Question Bank – II

advertisement

Question Bank – II

UNIT- III and IV (Bottom up parsing)

1. What is handle pruning? Explain the same with the grammar, E-> E+E| E*E|(E)|id and the input string is id1+id2*id3$

2. Write short notes on Error recovery in LR parsers

3. Compare the relative merits and demerits of LL(1), SLR(1), LALR(1) and Canonical LR(1) parsing methods

4. For the given grammar indicate the handle in each of the following right-sentential forms

5. Why are LR Parsers preferred?

6. With a schematic explain the working of a LR parser.

7. Give the algorithm to

CLOSURE(I)

Canonical set of LR(0) Items

LR Parsing

Construct a SLR parsing table

LR(1) Closure

LR(1) Goto

Canonical set of LR(1) Items

Canonical LR parsing table

Discovering propagated and spontaneous lookaheads

Efficient computation of the kernels of the LALR(1) collection of sets of items.

8. Write a note on Yacc-Parser generators.

9. Given the grammar a. Construct sets of LR(0)/LR(1) items b. Construct SLR(1)/canonical LR(1)/ LALR(1) parsing table. (LALR any method can be asked.) c. Is the grammar SLR(1)/CLR(1)/LALR(1)? Justify your answer

10. What are the methods to compact the LR parsing Tables?

11. With an example illustrate how conflicts are resolved by a LR parser for an ambiguous grammar.

UNIT-VII (Runtime Environments)

1. Explain different storage allocation strategies

2. Briefly explain the runtime storage scheme for C-language. Give the structure of the activation record. Briefly explain the actions required during function call…etc.

3. Explain the different parameter passing methods

4. Explain Stack and Heap allocation strategies with the help of necessary diagrams. Also highlight their differences.

5. Explain different dynamic storage allocation techniques

6. Give the difference between static scope and dynamic scope

Download