Lalr parser notes by prince Gupta, Lecture notes of Compiler Design

Compiler notes by Prince Gupta

Typology: Lecture notes

2018/2019

Uploaded on 08/28/2019

prince-gupta-3
prince-gupta-3 🇮🇳

7 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Scanned by CamScanner
pf3
pf4
pf5

Partial preview of the text

Download Lalr parser notes by prince Gupta and more Lecture notes Compiler Design in PDF only on Docsity!

490 Comprehensive Compiler Design The productions for the grammar are numbered as shown below; S— aSbS () 5S .bSaS SOE EXAMPLE 5.6: Construct an LALR(1) parsing table for the following grammar: S— Aa | bAc | de | bda Avd The augmented grammar is: s|jo Ss S— Aa S— bAc S— de S— bda Anvd The canonical collection of sets of LR(1) items is: I= {S| > .S,$ S—> Aa, $ S— .bAc, $ S > .de,$ S— .bda, $ A> d,a yo , BIO S)= {S] > 5.,$} = Boto(Ty, A) = {$ tes) =} goto(I,, b) = {So b.Ac, $ - S b.da, $ Axr.dec aL D= (S++ de§ cae =I] ¢ goto], a) = {5 ee ; goto(l, A) = t5_, 0 9) = 4s Ss bac$)=7, goto({,, Scanned by CamScanner