You are on page 1of 2

Silicon Institute of Technology

Class Test III (7 Sem. B. Tech- CS & IT), 2010 Sub : Compiler Design Time 60 mins. Max. Marks 10 Date : 12.11.10 (Answer any four) Q.1. Answer the following questions. a) Give the conditions for a given grammar G to be LL(1).[1.0] b) Give the configurations of an LR parser at any instant of time and also with shift and reduce actions. [1.0] c) What is viable prefix? [0.5] Q.2. Generate an SLR parsing table for the given grammar. E E + T, E T, T T * F, T F, F (E) and F id. Q.3. Q.4. Q.5. [2.5] Q.3. Q.4. Q.5. Construct the DFA of the canonical collection of LR(0) items for the grammar given in Q.2. [2.5] Give the algorithm for construction of an SLR parsing table. [2.5] Show that the following grammar is not LL(1). [2.5] S iCtSS' | a S' eS | C b. Q.6. Construct the collection of LR(1) items for the given grammar. S CC, C cC | d. Good Luck [2.5] Q.6. Q.1.
th

Silicon Institute of Technology


Class Test III (7th Sem. B. Tech- CS & IT), 2010 Sub : Compiler Design Time 60 mins. Max. Marks 10 Date : 12.11.10 (Answer any four) Answer the following questions. a) Give the conditions for a given grammar G to be LL(1).[1.0] b) Give the configurations of an LR parser at any instant of time and also with shift and reduce actions. [1.0] c) What is viable prefix? [0.5] Q.2. Generate an SLR parsing table for the given grammar. E E + T, E T, T T * F, T F, F (E) and F id. [2.5] Construct the DFA of the canonical collection of LR(0) items for the grammar given in Q.2. [2.5] Give the algorithm for construction of an SLR parsing table. [2.5] Show that the following grammar is not LL(1). [2.5] S iCtSS' | a S' eS | C b. Construct the collection of LR(1) items for the given grammar. S CC, C cC | d. Good Luck [2.5]

You might also like