Assignment 5: LALR(1) Parsing
Due: 12/2/03
< E >
( < E > , < L > ) | ident
< L >
< E > | < E > , < L >
1 .
2 ] 
LR(0) (
0,
)
1 .
2 ] is valid for
1 .
2, a ] 
LR(1) (
0,
)
1 .
2, a ] is valid for
The LALR(1) machine is formed by replacing the
LR(0) items in each state
of the LR(0) machine with
the union of all the LR(1) items found in the states of the
LR(1) machine that correspond to
. That is, the set:
{ [ N
1 .
2 , x ] | for some
' in the LR(1) machine, [ N
1 .
2 , x ] 
' &
= core(
' ) }
Using the definition of validity for LR(1) items, do the items in the states of the LALR(1) machine satisfy the same property as the items in the states of the LR(1) machine. In particular, for the LALR(1) machine is it the case that:
1 .
2 ; a ] 
LALR(1) (
0,
) if [ N
1 .
2 ; a] is valid for
.
1 .
2 ; a ] 
LALR(1) (
0,
) only if [ N
1 .
2 ; a ] is valid for
.