0% found this document useful (0 votes)
11 views2 pages

CD Assignment 1

The document is an assignment for a Computer Science course focusing on Compiler Design, covering topics such as parsing techniques, conflicts in shift-reduce parsers, and the workings of LR parsers. It includes questions on differentiating parsing methods, constructing parsing tables, and eliminating left recursion in grammars. Additionally, it requires practical exercises like finding FIRST and FOLLOW sets and performing shift-reduce parsing on given strings.

Uploaded by

skandasaxena9
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)
11 views2 pages

CD Assignment 1

The document is an assignment for a Computer Science course focusing on Compiler Design, covering topics such as parsing techniques, conflicts in shift-reduce parsers, and the workings of LR parsers. It includes questions on differentiating parsing methods, constructing parsing tables, and eliminating left recursion in grammars. Additionally, it requires practical exercises like finding FIRST and FOLLOW sets and performing shift-reduce parsing on given strings.

Uploaded by

skandasaxena9
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/ 2

BSACET,Mathura

Assignment-1
Branch:CS 3rd Year Subject:CD(BCS602)

1. What is Parser? Write the Role of Parser. What are the most popular parsing techniques?

2. What are the common conflicts that can be encountered in Shift-Reduce Parser?

3. Discuss working of LR parser with its block diagram

4. Differentiate between Recursive Descent Parsing and Predictive Parsing.

5. Differentiate between Top-Down and Bottom-Up Parsing Techniques.

6. Write Short Note on the following a) LR(0) items b) Augmented Grammar c)Kernel and Non-Kernel
items

7. What are the problems with Top-Down Parsing?

8. Find the FIRST and FOLLOW of the following Grammar


ETE’
E’+TE’|∈
T’*FT’|∈
Fid|(E)

8. Consider the following grammar


EE+E | E*E | (E) | id
Construct the SLR parsing table.

9. Perform Shift Reduce parsing for the given input strings using the grammar
S(L)|a
LL,S|S
i. (a,(a,a)) ii. (a,a)

10.Eliminate Left Recursion from the following grammar


SAB
ABS|b
BSA|a

11. Construct LR(0) parsing table for the following grammar


ScB|ccA
AcA|a
BccB|b
12. Construct the LALR parsing table for following grammar
SAA
AaA
Ab
Show that this grammar is LR(1) or LALR(1), or both.

13. Construct the LALR parsing table for following grammar


SA)
SA,P|(P,P
P{ num , num }

You might also like