Академический Документы
Профессиональный Документы
Культура Документы
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
⋆⋆⋆⋆⋆
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 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]
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]
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