LP 2005
LP 2005
www.andhracolleges.com
⋆⋆⋆⋆⋆
2. (a) Distinguish between simple precedence and operator precedemce parsing tech-
niques. [6]
(b) Construct simple precedence parse table for the following grammar.
E ← E + T|T
T → T∗ F|F
F → (F)|id [10]
www.andhracolleges.com
4. Write type expression for the following types
5. (a) What is an activation record? Explain how it is related with run time storage
organization. [8]
(b) Write a short notes on heap strategy and run-time storage allocation. [8]
6. (a) What are the various machine dependent code optimization techniques. [8]
(b) Convert the following arithmetic expression into syntax tree and three address
code
b* 3 (a+b) [8]
Seminar Topics - Scholarships - Admission/Entrance Exam Notifications
1 ofUSA-UK-Australia-Germany-France-NewZealand
2 Universities List
www.andhracolleges.com
Assuming two machine registers to be available. [8]
8. (a) Write the design specification for a parameter in macro statement. [6]
(b) What is meant by Expansion time Variable ( EV). Write the syntax of two
forms of Expansion time variable. [5]
(c) How the value of EV can be manipulated through the preprocessor statement
SET. Explain with an example. [5]
⋆⋆⋆⋆⋆
www.andhracolleges.com
Seminar Topics - Scholarships - Admission/Entrance Exam Notifications
2 ofUSA-UK-Australia-Germany-France-NewZealand
2 Universities List
www.andhracolleges.com
⋆⋆⋆⋆⋆
1. Explain with one example how LEX program perform lexical analysis for the follow-
ing patterns in C : identifier, comments, numerical constants, arithmetic operators.
[16]
2. (a) Distinguish between simple precedence and operator precedemce parsing tech-
niques. [6]
(b) Construct simple precedence parse table for the following grammar.
E ← E + T|T
T → T∗ F|F
F → (F)|id [10]
www.andhracolleges.com
E→E-T
E→T
T→T*F
T→T/F
T→F
F→P↑ F
F→P
P→(E)
P→id. [6+10]
4. (a) List out some typical semantic errors . Explain how they can be rectified? [8]
(b) What is static checking ? Give some examples of static checks. [8]
5. (a) Write a notes on the static storage allocation strategy with examples and
discuss its limitations. [8]
(b) Discuss about the static allocation strategy of run-time environment with
examples. [8]
6. (a) Explain with an example how abstract machine code can be generated for a
given if-then-else statement. [8]
Seminar Topics - Scholarships - Admission/Entrance Exam Notifications
1 ofUSA-UK-Australia-Germany-France-NewZealand
2 Universities List
8. (a) List out the data structure to perform Macro Expansion. [8]
www.andhracolleges.com
(b) Write an algorithm for Macro processing. [8]
⋆⋆⋆⋆⋆
www.andhracolleges.com
Seminar Topics - Scholarships - Admission/Entrance Exam Notifications
2 ofUSA-UK-Australia-Germany-France-NewZealand
2 Universities List
www.andhracolleges.com
⋆⋆⋆⋆⋆
2. (a) Explain the reasons for separating lexial analysis phase from syntax analysis.
[6]
(b) Eliminate ambiguities from the following grammar
S → iEtSeS|iEtS|a
E → b|c|d [10]
www.andhracolleges.com
T→T*F
T→T/F
T→F
F→P↑ F
F→P
P→(E)
P→id. [6+10]
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) Give a translator grammar for converting boolean expression into three address
code. [8]
(b) Apply the translation scheme on the following expression a< b or c< d and
e< f. [8]
Seminar Topics - Scholarships - Admission/Entrance Exam Notifications
1 ofUSA-UK-Australia-Germany-France-NewZealand
2 Universities List
8. (a) Explain the memory requirement for variant I and variant II of intermediate
code of an assembler design. [8]
(b) How Declarative state and Assembler directives are processed by an assembler.
[8]
www.andhracolleges.com ⋆⋆⋆⋆⋆
www.andhracolleges.com
Seminar Topics - Scholarships - Admission/Entrance Exam Notifications
2 ofUSA-UK-Australia-Germany-France-NewZealand
2 Universities List
www.andhracolleges.com
⋆⋆⋆⋆⋆
(a) Informally describe the set of strings denoted by the pattern (as a function of
n) [6]
(b) If we substitute out all auxiliary definitions in the pattern, how long is the
regular expression [5]
(c) Show that 2n + 1 states are necessary for any NFA recognize An . [5]
2. (a) The grammar S → aSa|aa generates all even length string of a’s except for the
empty string. If a brute force method of top down parsor is used, it succeeds
of 2a’s, 4a’s, 8a’s but fails on 6a’s. Find out all even strings for which the
www.andhracolleges.com
parser succeeds. [8]
(b) List out the rules for constructing the simple precedence table for a CFG. [8]
4. (a) List out some typical semantic errors . Explain how they can be rectified? [8]
(b) What is static checking ? Give some examples of static checks. [8]
5. (a) What is an activation record? Explain how it is related with run time storage
organization. [8]
(b) Write a short notes on heap strategy and run-time storage allocation. [8]
6. (a) What are loop invariant components. Explain how they effect the efficiency
of a program. [8]
(b) Compare various forms of three address code. [8]
Seminar Topics - Scholarships - Admission/Entrance Exam Notifications
1 ofUSA-UK-Australia-Germany-France-NewZealand
2 Universities List
8. (a) List out the data structure to perform Macro Expansion. [8]
(b) Write an algorithm for Macro processing. [8]
www.andhracolleges.com
⋆⋆⋆⋆⋆
www.andhracolleges.com
Seminar Topics - Scholarships - Admission/Entrance Exam Notifications
2 ofUSA-UK-Australia-Germany-France-NewZealand
2 Universities List