0% found this document useful (0 votes)
24 views

Assignment 1

This document contains 4 assignments related to parsing grammars: 1) Write pseudo code to parse a grammar using recursive descent, 2) Construct First and Follow sets for a grammar, 3) Remove left recursion from a grammar and construct First and Follow sets, and 4) Left factor a grammar and construct First and Follow sets. Students are asked to complete these 4 assignments and submit them by January 21, 2014.

Uploaded by

Saraah Ghori
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Assignment 1

This document contains 4 assignments related to parsing grammars: 1) Write pseudo code to parse a grammar using recursive descent, 2) Construct First and Follow sets for a grammar, 3) Remove left recursion from a grammar and construct First and Follow sets, and 4) Left factor a grammar and construct First and Follow sets. Students are asked to complete these 4 assignments and submit them by January 21, 2014.

Uploaded by

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

Assignment -1

1. Given the grammar


ET+E T
TV*TV
V id
Write pseudo code to parse this grammar by recursive descent.
2. Given the grammar
A( A ) A|
Construct First and Follow sets for the nonterminal A.
3. Consider the grammar
lexpatom | list
atomnumber | identifier
list ( lexp-seq )
lexp-seqlexp-seq lexp | lexp
a) Remove the left recursion.
b) Construct First and Follow sets for the nonterminals of the resulting grammar.
4.

Consider the grammar


lexpatom | list
atomnumber | identifier
list ( lexp-seq )
lexp-seqlexp , lexp-seq | lexp
a) Left factor this grammar.
b) Construct First and Follow sets for the nonterminals of the resulting grammar.

NOTE: Here symbol is an epsilon.

Note: Last date of submission is 21-01-2014

You might also like