Professional Documents
Culture Documents
UNIT 2
1. Explain input buffering methods. 03
2. Draw the DFA for the regular expression (a|b)*abb using set construction method only. 07
3. Draw NFA from regular expression using Thomson’s construction and convert it into DFA.
(a | b)* a b* a 07
4. What is Input Buffering? Why it is used? 04
5. Describe the role of lexical analyzer. 03
6. Write the regular expression R over {0,1} or {a,b}:
1) The set of all strings with even number of a’s followed by an odd number of b’s.
2) The set of all strings that consist of alternating 0’s and 1’s . 04
7. Write a brief note on input buffering techniques. 04
8. Define token, lexeme and pattern. Identify the lexemes that makes up the tokens for the
following code
const p = 10;
if( a < p)
{ a++ ;
If(a== 5)
continue ;
} . 07
9. Construct deterministic finite automata without constructing NFA for following regular
expression. (a/b)*abb*. 07
10. What is lexical analysis? Which are the tasks performed by lexical analyzer. 03
11. Write a regular definition for:
1.The language of all strings containing at least one 0 and at least one 1.
2.The language of all strings that do not end with 01.
3.The language of all strings containing 0’s and 1’s both are even.
4.The language of all strings which are starting with 1 and ending with 0. 04
UNIT 3
20. What is left factoring in CFG? Perform the Left factoring of following Grammar. 04
S → iEtS / iEtSaS / a
E→b
21. Construct SLR parsing table for the following grammar :
S → (L) | a
L→ L,S | S .07
22. Give syntax directed definition for simple desk calculator. Also show annotated parse tree for
6*5+7n, .07
23. Define : 1) synthesized attribute 2) inherited attribute. 03
24. Differentiate ambiguous and unambiguous grammar. 03
25. Give the translation scheme that convert infix to postfix notation. 03
26. Define: Left Recursive Grammar. Check Following grammar is left recursive or not, if yes,
remove left recursive from it.
A → ABd / Aa / a
B → Be / b .04
27. Construct an SLR Parsing table for the following grammar.
S → Aa | bAc | bBa
A→ d
B → d .07
28. Explain shift reduce parsing technique in brief. 03
29. Differentiate top down parsing and bottom up parsing. 04
30. Show that the following grammar
S → AaAb | BbBa
A→ ϵ
B→ϵ
is LL(1) but not SLR(1). 07
31. Translate the arithmetic expression (a + b) * (c + d) into 1. Syntax tree 2. Postfix notation. 03
32. Show the following grammar is LR(1) but not LALR(1). 07
S->Aa │bAc │Bc│bBa
A->d
B->d
UNIT 4
UNIT 5
UNIT 7
UNIT 8
1. Explain Basic-Block Scheduling. 04
2. Explain Pass structure of assembler. 07
_____________________________________________________________________________
1. Explain activation tree? 04
2. Define a following: i. Basic block ii. Constant folding iii. Handle. 03
3. Differentiate between parse tree and syntax tree 03
4. What do you mean by dangling references? 03