0% found this document useful (0 votes)
40 views1 page

Unit 2 Questions

The document contains a compiler design exam question paper with two parts. Part A consists of short answer questions about compiler theory topics like the differences between CALR and LALR parsing, types of intermediate representations, error recovery strategies, examples of top-down parsing, eliminating left recursion, shift-reduce conflicts, and the FIRST and FOLLOW algorithms. Part B asks to solve problems related to determining if a grammar is LALR(1), explaining error handling strategies, constructing an SLR parsing table, and implementing a shift-reduce parser for a given grammar and input string.

Uploaded by

Ganesh Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views1 page

Unit 2 Questions

The document contains a compiler design exam question paper with two parts. Part A consists of short answer questions about compiler theory topics like the differences between CALR and LALR parsing, types of intermediate representations, error recovery strategies, examples of top-down parsing, eliminating left recursion, shift-reduce conflicts, and the FIRST and FOLLOW algorithms. Part B asks to solve problems related to determining if a grammar is LALR(1), explaining error handling strategies, constructing an SLR parsing table, and implementing a shift-reduce parser for a given grammar and input string.

Uploaded by

Ganesh Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

CS8602 -Compiler Design

Unit 2 QP

PART - A
1. State the difference between CALR & LALR?
2. List three kinds of intermediate representation.
3. State any two error recovery strategies
4. Give example for Top-down parsing
5. Eliminate left recursive for the following grammar.
A -> AC | Aad | bd
6. What are the various conflicts that occurs during shift reduce parser?
7. Write the algorithm for FIRST and FOLLOW
8. What is a CFG?
9. Difference between SLR (1) and LALR (1).

PART B ( any 3)
1. Show that the following grammar
SAa | bAc | dc | bda
Aa
is LALR (1) but not SLR(1)

2. Explain different error handling and recovery in syntax analyzer.

3. Construct SLR parsing table for the following grammar


E -> E + T | T
T -> TF | F
F -> F* | a | b

4. Construct stack implementation of shift reduce parser for the following grammar.
E -> E + E
E -> E * E
E -> ( E )
E -> id

And the input string is id1 + ( id2 * id3 )

You might also like