Module 2-F CLR Parsing
Module 2-F CLR Parsing
Compiler Design
MODULE - 2
Dr.D.Jeya Mala
Professor
School of Computer Science and Engineering (SCOPE)
VIT Chennai
[email protected]
Augmented grammar
• If G is a grammar with start symbol S, then G’, the augmented
grammar for G, is G with a new start symbol S’ and production S’ S.
If G = (N, T, P, S), then G’ = (N U {S’} , T, PU {S’ S} , S’)
goto(I0 , S) = I1 goto(I0 , c) = I3
I1 : S’ S. , $ I3 : C → c.C , c/d
C →.cC , c/d
goto(I0 , d) = I4 goto(I2 , d) = I7 goto(I3 , d) = I4
I4: C →d. , c/d I7: C →d. , $
C C
d
c C
c C