Chapter 4:Syntax Analysis

Construct LALR parse table

. Construct C={I0 , .. ,In } set of LR(1) items

. For each core present in LR(1) items find all sets having the same core and replace these sets by their union

. Let C' = {J0 , .. .,Jm } be the resulting set of items

. Construct action table as was done earlier

. Let J = I1 U I2 .. .U Ik

since I 1 , I2 .. ., Ik have same core, goto(J,X) will have he same core

Let K=goto(I1 ,X) U goto(I2 ,X) .. goto(Ik ,X) the goto(J,X)=K

The construction rules for LALR parse table are similar to construction of LR(1) parse table.