Contents    Page-10    Prev    Next    Page+10    Index   

The LR Parsing Algorithm[slide by John Werth]

A configuration of an LR parser is a pair whose first component is the stack contents and whose second component is the unexpended input:

(S0 X1 S1 X2 S2 ... Xm Sm , aj aj+1 ... an $)

This configuration represents the right-sentential form:

(X1 X2 ... Xm aj aj+1 ... an)

The next move of the parser is determined by reading aj, the current input symbol, and Sm, the state on top of the stack, and then consulting the parsing action table entry, action[ Sm , aj ].