Java Reference
In-Depth Information
goto(s
4
,
(
) = s
11
= f[F ::=
(
E
)
,
+/*/
)],
[E ::= E
+
T,
+/
)],
[E ::= T,
+/
)],
[T ::= T
*
F,
+/*/
)],
[T ::= F,
+/*/
)],
[F ::=
(
E
)
,
+/*/
)],
[F ::=
id
,
+/*/
)]g
Notice that s
11
differs from s
4
in only the lookaheads for the first item.
goto(s
4
,
id
) = s
12
= f[F ::=
id
,
+/*/
)]g
There are no moves from s
5
, so consider s
6
:
goto(s
6
, T) = s
13
= f[E ::= E
+
T ,
+/#
],
[T ::= T
*
F,
+/*/#
]g
Now, goto(s
6
, F) = f[T ::= F,
+/*/#
]g but that is s
3
. goto(s
6
,
(
) is closure(f[F ::=
(
E),
+/*/#
]g), but that is s
4
. And goto(s
6
,
id
) is s
5
.
goto(s
6
, F) = s
3
goto(s
6
,
(
) = s
4
goto(s
6
,
id
) = s
5
Consider s
7
, s
8
, and s
9
.
goto(s
7
, F)= s
14
= f[T ::= T
*
F ,
+/*/#
]g
goto(s
7
,
(
) = s
4
goto(s
7
,
id
) = s
5
goto(s
8
,
)
) = s
15
= f[F ::=
(
E
)
,
+/*/#
]g
goto(s
8
,
+
) = s
16
= f[E ::= E
+
T,
+/)
],
[T ::= T
*
F,
+/*/)
],
[T ::= F,
+/*/)
],
[F ::=
(
E
)
,
+/*/)
],
[F ::=
id
,
+/*/)
]g
goto(s
9
,
*
) = s
17
= f[T ::= T
*
F,
+/*/)
],
[F ::=
(
E
)
,
+/*/)
],
[F ::=
id
,
+/*/)
]g
There are no moves from s
10
, but several from s
11
:
Search WWH ::
Custom Search