[back]
0    start -> stmt
1    stmt -> if-stmt
2    stmt -> expr-stmt
3    if-stmt -> IF expr THEN stmt ELSE >! stmt
4    if-stmt -> IF expr THEN stmt
5    expr-stmt -> expr
6    expr -> NUMBER

0
-----
start ->.stmt

IF - SHIFT 1
NUMBER - SHIFT 2

stmt - GOTO 3
if-stmt - GOTO 4
expr-stmt - GOTO 5
expr - GOTO 6

1
-----
if-stmt -> IF.expr THEN stmt ELSE >! stmt
if-stmt -> IF.expr THEN stmt

NUMBER - SHIFT 2

expr - GOTO 7

2
-----
expr -> NUMBER. (6)

* - REDUCE 6 expr

3
-----
start -> stmt. (0)

EOT - DONE 0

4
-----
stmt -> if-stmt. (1)

* - REDUCE 1 stmt

5
-----
stmt -> expr-stmt. (2)

* - REDUCE 2 stmt

6
-----
expr-stmt -> expr. (5)

* - REDUCE 5 expr-stmt

7
-----
if-stmt -> IF expr.THEN stmt ELSE >! stmt
if-stmt -> IF expr.THEN stmt

THEN - SHIFT 8

8
-----
if-stmt -> IF expr THEN.stmt ELSE >! stmt
if-stmt -> IF expr THEN.stmt

IF - SHIFT 1
NUMBER - SHIFT 2

stmt - GOTO 9
if-stmt - GOTO 4
expr-stmt - GOTO 5
expr - GOTO 6

9
-----
if-stmt -> IF expr THEN stmt.ELSE >! stmt
if-stmt -> IF expr THEN stmt. (4)

ELSE - SHIFT 10
* - REDUCE 4 if-stmt

10
-----
if-stmt -> IF expr THEN stmt ELSE >!.stmt

IF - SHIFT 1
NUMBER - SHIFT 2

stmt - GOTO 11
if-stmt - GOTO 4
expr-stmt - GOTO 5
expr - GOTO 6

11
-----
if-stmt -> IF expr THEN stmt ELSE >! stmt. (3)

* - REDUCE 3 if-stmt

[back]