You are on page 1of 1

Reg. No.

: ___________________

UNIVERSITY
Karunya Institute of Technology & Sciences
School of (Declared under section-3 of the UGC Act, 1956) Computer
Science and Technology
III B.Tech. (Information Technology) A Sec.
Internal Assessment Test I

Code: 09CS214 Date: 08.10.13


Subject Name: Principles of Compiler Design Duration: 2 Hours
Max.Marks:50

Answer all the questions


PART – A (5 x 1 = 5 MARKS)

1. Write the item for A->.


2. List the disadvantages of Shift Reduce Parsing.
3. X is a terminal. First(X) = ________.
4. Define handle.
5. The rightmost derivation is also termed as _______________.
PART – B (5x 3 = 15 MARKS)

6. E-> E+E | E*E | id | -E | (E)


Construct leftmost and rightmost derivations for the string – (id+id)*id.
7. Write the algorithm for finding closure of the production.
8. Write notes on left factoring with an example.
9. Differentiate top down and bottom up parsing techniques.
10. Write the rules for finding FIRST and FOLLOW of non terminals.
PART – C (3 x 10 = 30 MARKS)

11. Construct predictive parsing table for the following grammar


bexpr -> bexpr or bterm | bterm
bterm -> bterm and bfactor | bfactor
bfactor -> not bfactor | (bexpr) | true | false
Parse the string not (true or false)
12. Construct SLR parsing table for the following grammar
E -> E+T | T
T ->TF|F
F -> F* | a | b
13. Check whether the following grammar is LL(1) grammar.
S-> aBDh
B-> cC
C->bC | 
D- >EF
E->g|
F->f|

You might also like