6 CSE Cs2352 - PCD
6 CSE Cs2352 - PCD
6 CSE Cs2352 - PCD
Date
Branch
Max.Marks
: 01.02.2013
: CSE
: 50
PART-A (5x2=10)
1. Define compiler.
2. What is the role of lexical analysis phase?
3. Construct a parse tree (a+b)*c for the grammar E->E+E/E*E/ (E)/id.
4. Eliminate left recursion for the following grammar
E->E+T | T
T->T*F | F
5. Define ambiguous grammar with example
PART-B (16*2 + 8*1 = 40 marks)
6. a) Explain the various phases of a compiler in detail with neat diagram.(16)
(Or)
b) Explain Role of Lexical Analyzer and Input Buffering with example. (16)
7. a) Construct predictive parsing table for the following grammar and hence check whether the
String (a,a) is accepted or not.
(16)
S -> ( L ) | a
L -> L, S | S
(Or)
b) With suitable examples, Explain Tokens with its attributes. (16)