Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Subject Name: CD (170701) Faculty Name: RP

Date of Given: 13/08/2013 Last date of submission: 17/08/2013

Assignment-3
1) (i) Consider the grammar S -> SS+ | SS* | a Show that the string aa+a* can be generated by the grammar. Construct the parse tree for it. Is the grammar ambiguous? Justify. (ii) Write production rules for producing following language. 2) Eliminate left recursion from the following grammar and rewrite the Grammar. S -> Aa | b A -> Ac | Sd | ^ 3) (i)Perform the Left factoring of following Grammar A ad | a | ab | abc | b (ii) Find out FIRST & FOLLOW set for all the Nonterminals S AcB | cbB | Ba A da | BC B g | ^ C h | ^ 4) Is the following grammar suitable for LL(1) parsing? If not make it suitable for LL(1) parsing. Compute FIRST and FOLLOW sets. Generate the parsing table. SAB ACa | BBaAC | c Cb |

Prepared By:Prof. Renish Padariya

Approved By:Prof. Yatin Shukla

| B. H. Gardi College of Engineering & Technology

You might also like