Java Reference
In-Depth Information
goto(s 11 , E) = s 18
= f[F ::= ( E ) , +/*/) ],
[E ::= E + T, +/) ]g
goto(s 11 , T) = s 9
goto(s 11 , F) = s 10
goto(s 11 , ( ) = s 11
goto(s 11 , id ) = s 12
There are no moves from s 12 , but there is a move from s 13 :
goto(s 13 , * ) = s 7
There are no moves from s 14 or s 15 , but there are moves from s 16 , s 17 , s 18 , and s 19 :
goto(s 16 , T) = s 19
= f[E ::= E + T , +/) ],
[T ::= T * F, +/*/) ]g
goto(s 16 , F) = s 10
goto(s 16 , ( ) = s 11
goto(s 16 , id ) = s 12
goto(s 17 , F) = s 20
= f[T ::= T * F , +/*/) ]g
goto(s 17 , ( ) = s 11
goto(s 17 , id ) = s 12
goto(s 18 , ) ) = s 21
= f[F ::= ( E ) , +/*/) ]g
goto(s 18 , + ) = s 16
goto(s 19 , * ) = s 17
There are no moves from s 20 or s 21 , so we are done. The LR(1) canonical collection
consists of twenty-two states s 0 :::s 21 . The entire collection is summarized in the table
below.
s 0 = f[E 0 ::= E, # ],
[E::= E + T, +/# ],
[E::= T, +/# ],
[T ::= T * F, +/*/# ],
[T ::= F, +/*/# ],
[F ::= ( E ) , +/*/# ],
[F ::= id , +/*/# ]g
goto(s 0 ,E) =s 1
goto(s 0 ,T) =s 2
goto(s 0 ,F) =s 3
goto(s 0 , ( ) =s 4
goto(s 0 , id ) =s 5
s 11 = f[F ::= ( E ) , +/*/ )],
[E::= E + T, +/ )],
[E::= T, +/ )],
[T ::= T * F, +/*/ )],
[T ::= F, +/*/ )],
[F ::= ( E ) , +/*/ )],
[F ::= id , +/*/ )]g
goto(s 11 ,E) =s 18
goto(s 11 ,T) =s 9
goto(s 11 ,F) =s 10
goto(s 11 , ( ) =s 11
goto(s 11 , id ) =s 12
s 1 = f[E 0 ::=E, # ],
[E::=E + T, +/# ]g
goto(s 1 , + ) =s 6 s 12 = f[F ::= id , +/*/ )]g
 
Search WWH ::




Custom Search