CD
CD
chapter 1:
1. Explain the phases of compiler with an example (7 marks )
2. What is compiler? What is front-end and back-end of compiler? (3 marks )
3. Explain input, output and action performed by each phases of compiler with
example. ( 7 marks )
4. complier vs interpreter ( 4 marks )
chapter 2:
0. what is inputbuffer. ( 3 marks )
1. Write a brief note on input buffering techniques. ( 4 marks )
2 . Define token, lexeme and pattern. Identify the lexemes that makes up the
tokens for the following code ( 7 marks )
const p = 10;
if( a < p)
{ a++ ;
If(a== 5)
continue ;
}
3. Define lexeme, token and pattern. Identify the tokens from the following
program segment ( 4 marks )
void change (int c, int d)
{ int m; m = c; c= d; d = m; }
8 . Find out FIRST & FOLLOW set for all the Nonterminals ( 4 marks )
S-> 1AB | ϵ
A-> 1AC | 0C
B-> 0S
C-> 1
10. Draw the DFA for the regular expression (a|b)*abb using set
construction method only. ( 7 marks )
11. Draw NFA from regular expression using Thomson’s construction and convert
it into DFA. (a | b)* a b* a ( 7marks )
chapter 3:
4. What is Left Recursion? Give an example for eliminating the same ( 4 marks )
6 . Draw the parse tree and derive the left most derivation using the following ( 3
marks )
grammar for the input string: (a + a) * (a * a).
E → E + T | T
T → T * F | F
F → ( E ) | a
8 . Define the following terms and give suitable example for it.
i. Augmented Grammar
ii. LR(0) Item
iii.LR(1) Item