1. Give the general structure of a complier. Show the working of different phases of
a complier taking an example. [june/jul 12] (10 Marks)
2. List and explain reasons for separating analysis portion of a complier into lexical
analysis and syntax analysis phases. [june/jul 12] (06 Marks)
3. Why two-buffer scheme is used in lexical analysis? Write an algorithm for “look
ahead code with sentinels”. [june/jul 12] (04 Marks)
4. Explain with a neat diagram, the phases of a compiler.[may/june 2010](10 Marks)
5. Construct a transition diagram for recognizing unsigned numbers. Sketch the
program segments to implement it, showing the first two states and one final state.
[may/june 2010] (10 Marks)
6. What is meant by input buffering ? Explain the use of sentinels in recognizing
tokens [june/jul 09] ( 08 Marks)
7. With the help of a diagram, explain the various phases of a compiler [june/jul 09](12 Marks)

Unit 2:

1. Show how left recursion and left factoring help top down parsing? [june/jul 12]
(06 Marks)
2. Give algorithm for FIRST and FOLLOW sets construction. Give the same for the
grammar. E  TE, E  TE/, T  FT, T  * FT/, F  (E)/id.
[june/jul 12] (08 Marks)
3. Explain the “panic-mode recovery” and “global correction” error recovery
strategies. [june/jul 12] (06 Marks)
4. Explain the left recursion and show how it is eliminated. Describe the algorithm
used for eliminating the left recursion. [may/june 2010] (6 Marks)
5. Eliminate left recursion from the grammar. [may/june 2010] (2 Marks)
6. Given the grammar S(L) |a L L, S| S [may/june 2010] (12 Marks)
a. Make necessary changes to make it suitable for LL (1) parsing.
b. Construction FIRST and FOLLOW sets
c. Construct the predictive parsing table
d. Show the moves made by the predictive parser on input(a, (a,a))
7. Briefly explain the problems associated with top-down parser
[june/jul 09] (04 marks)
8. Show that the grammar below is ambiguous. E → E + E | E * E | id Give an
unambiguous grammar for the above grammar such that + has higher priority, *
has less priority and both are right associative [june/jul 09] (08 marks)
9. Given the grammar
S → a | (L)
L → L, S | S
Do the necessary changes to make it suitable for LL (1) parser. Check the
resultant grammar is LL (1) or not. [june/jul 09] (08 marks)