Вы находитесь на странице: 1из 7

Code No: RR411201 Set No.

1
IV B.Tech I Semester Supplementary Examinations, February 2007
LANGUAGE PROCESSORS
(Information Technology)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆

1. (a) Write a procedure for constructing a deterministic finite automata from a


non-deterministic Automata, explain with one example. [10]
(b) Give the general format of a LEX program. [6]

2. (a) Distinguish operator precedence and simple precedence parses. [6]


(b) Generate operator precedence parse table for the following grammar.
E → E + T|T
T → TF|F
F → F∗ |a|b
[10]

3. (a) What is LR(1) passing.


(b) Construct canonical LR parse table for the following grammar
S → Aa|bAc|bBa
A→d
B→d. [4+12]

4. Write type expression for the following types

(a) An array of pointers to real, where the array


index ranges from 1 to 100. [5]
(b) A two dimensional array of integers ( i.e an array of arrays)
whose rows are indexed from 0 to 9 and whose columns
are indexed from 10 to 10. [5]
(c) Functions whose domains are functions from integers to pointers to integers
and whose ranges are records consisting of an integer and a character. [6]

5. (a) What are the contents of a symbol table? Explain in detail. [8]
(b) What is the data structure used to implement a symbol table in an efficient
way? Give reasons ? [8]

6. (a) Explain with an example the abstract machine code form of Intermediate code.
[8]
(b) Give a detailed account on loop optimisation techniques. [8]

7. (a) Explain how Redundant sub expression elimination can be done at global level
in a given program. [8]

1 of 2
Code No: RR411201 Set No. 1
(b) Explain how syntax trees can be constructed for the following expression
a*b-(c+d)
a*b+(a*b) [8]

8. Design the algorithm for the PASS II of an assembler. Explain the Data structure
used in PASS II [16]

⋆⋆⋆⋆⋆

2 of 2
Code No: RR411201 Set No. 2
IV B.Tech I Semester Supplementary Examinations, February 2007
LANGUAGE PROCESSORS
(Information Technology)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆

1. (a) Write a procedure that combines two NFAs in to a single NFA. The operations
to be performed are those of concatenation, union and closure. [10]
(b) Write a procedure that detects all extraneous states in a DFA. [6]
2. (a) Convert the following grammar into LL(1) grammar
R → R“|′ R|RR|R ∗ |(R)|a|b [10]
(b) What are the advantages and disadvantages of operator precedence parsing.
[6]
3. (a) What is an LR(0) grammer. [4]
(b) Construct SLR passing table for the following grammer [12]
R → R‘1′ R|RR|R ∗ |(R)|a|b
4. (a) Write a note on the specification of a Simple type checker. [8]
(b) Explain the equivalence of type expressions with appropriate examples. [8]
5. (a) What are self-organizing lists. How this can be used to organize a symbol
table. Explain with an example. [8]
(b) Explain the process of organizing a symbol table for a block structured lan-
guage. [8]
6. (a) Translate the expression -(a+b)*(c+d)+(a+b+c) into quadruple, triple and
indirect triple. [9]
(b) Explain in detail the optimization tecnique “Strength Reduction”. [7]
7. (a) Define Address Descriptor and Register Descriptor. [4]
(b) Why Next-use information is required for generating Object code? [6]
(c) What are the various object code forms. [6]
8. (a) Define the following
i. Macro [2]
ii. Macro expansion [2]
iii. Lexical Expansion [2]
iv. Semantic Expansion [2]
(b) What is meant by Macro definition? Explain the data structures used in a
Macro Processor. [8]

⋆⋆⋆⋆⋆

1 of 1
Code No: RR411201 Set No. 3
IV B.Tech I Semester Supplementary Examinations, February 2007
LANGUAGE PROCESSORS
(Information Technology)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆

1. (a) Write about lexical analyzer generator. [7]


(b) Construct minimumstate DFAs for the following regular expressions.
i. (a+b)* a (a+b) [3]

ii. (a+b)* a (a+b) (a+b) [3]

iii. (a/b)* a (a/b)(a/b)(a/b). [3]

2. (a) Convert the following grammar into LL(1) grammar


R → R“|′ R|RR|R ∗ |(R)|a|b [10]
(b) What are the advantages and disadvantages of operator precedence parsing.
[6]

3. (a) What is an LR(0) grammer. [4]


(b) Construct SLR passing table for the following grammer [12]
R → R‘1′ R|RR|R ∗ |(R)|a|b
4. (a) What is type expression? Write type expression for the following types. [2]
i. A two dimensional array of integers (i.e. an array of arrays) whose rows
are indexed from 0 to 9 and whose columns are indexed from -10 to 10.
[3]
ii. Functions whose domains are functions from integers to pointers to inte-
gers and whose ranges are records consisting of an integer and a character.
[3]
(b) What is type system. Discuss static and dynamic checking of types.
[8]
5. (a) What are the advantages and disadvantages of static storage allocation strat-
egy. [8]
(b) What are the advantages and disadvantages of heap storage allocation strat-
egy? [8]
6. (a) Translate the expression -(a+b)*(c+d)+(a+b+c) into quadruple, triple and
indirect triple. [9]
(b) Explain in detail the optimization tecnique “Strength Reduction”. [7]
7. (a) Consider the following code sequence.

1 of 2
Code No: RR411201 Set No. 3
i. MOV B, R0
ADD C, R0
MOV R0 A
ii. MOV B,A
ADD C, A
Calculate the cost of the above instructions in terms of access time and
memory usage. [10]
(b) Explain the simple Strategy to generate assembly code from Quadruples. [6]

8. (a) List out the data structure to perform Macro Expansion. [8]
(b) Write an algorithm for Macro processing. [8]

⋆⋆⋆⋆⋆

2 of 2
Code No: RR411201 Set No. 4
IV B.Tech I Semester Supplementary Examinations, February 2007
LANGUAGE PROCESSORS
(Information Technology)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆

1. (a) Write about transition diagrams and construct transition diagram for the re-
lational operators. [8]
(b) Write a specification for the tokens identifiers, constants and comments of
pascal From this specification, construct equivalent transition diagrams. Use
the transition diagram to implement a lexical analyzer for pascal in ‘C’. [8]

2. (a) Define LL(1) grammar. [4]


(b) Construct LL(1) parse table for the following grammer.
bexpr → bexpr or bterm/bterm
bterm → bterm and bfactor|bfactor
bfactor → not factor|(blxpr)|true|false
Where or, and, not, (, ), true, false are terminals in the grammar. [12]

3. Explain the algorithm for translator of S-attributed grammars along with bottom
up parsing with suitable examples. [16]

4. (a) How do you check the expressions in polymorphic functions? Explain through
an example. [8]
(b) Consider the following declarations
type link = ↑ cell;
var next : link;
last : link;
p : ↑ cell;
q,r : ↑ cell;
Which among the following expressions are Structurally equivalent? Which
are name equivalent? Justify your answer.
i. link
ii. pointer(cell)
iii. pointer(link)
iv. pointer(record((info X integer) X (next X pointer(cell))) [8]

5. (a) What are the advantages and disadvantages of static storage allocation strat-
egy. [8]
(b) What are the advantages and disadvantages of heap storage allocation strat-
egy? [8]

1 of 2
Code No: RR411201 Set No. 4
6. (a) Explain any two machine dependent code optimization techniques. [8]
(b) What is a DAG. Explain its application. [8]

7. (a) Discuss the various forms of object code. [8]


(b) Explain how the nature of the object code is highly dependent on the machine
and the operating system. [8]

8. Formulate an algorithm for the First pas of the assembler. Explain the Data struc-
ture used during the PASS I of an assembler. [16]

⋆⋆⋆⋆⋆

2 of 2

Вам также может понравиться