LALR State Table |
Index | Configuration/Action | Lookahead |
0 | <S'> ::= · <program> (EOF) | |
| <program> ::= · <stmt seq> | EOF |
| <stmt seq> ::= · <stmt seq> ';' <stmt> | EOF ; |
| <stmt seq> ::= · <stmt> | EOF ; |
| <stmt> ::= · <if stmt> | EOF ; |
| <stmt> ::= · <repeat stmt> | EOF ; |
| <stmt> ::= · <assign stmt> | EOF ; |
| <stmt> ::= · <read stmt> | EOF ; |
| <stmt> ::= · <write stmt> | EOF ; |
| <if stmt> ::= · IF <exp> THEN <stmt seq> END | EOF ; |
| <if stmt> ::= · IF <exp> THEN <stmt seq> ELSE <stmt seq> END | EOF ; |
| <repeat stmt> ::= · REPEAT <stmt seq> UNTIL <exp> | EOF ; |
| <assign stmt> ::= · ID ':=' <exp> | EOF ; |
| <read stmt> ::= · READ ID | EOF ; |
| <write stmt> ::= · WRITE <exp> | EOF ; |
| ID Shift 1 | |
| IF Shift 24 | |
| READ Shift 27 | |
| REPEAT Shift 29 | |
| WRITE Shift 30 | |
| <assign stmt> Goto 32 | |
| <if stmt> Goto 33 | |
| <program> Goto 48 | |
| <read stmt> Goto 34 | |
| <repeat stmt> Goto 35 | |
| <stmt> Goto 36 | |
| <stmt seq> Goto 49 | |
| <write stmt> Goto 40 | |
| | |
1 | <assign stmt> ::= ID · ':=' <exp> | EOF ; ELSE END UNTIL |
| ':=' Shift 2 | |
| | |
2 | <assign stmt> ::= ID ':=' · <exp> | EOF ; ELSE END UNTIL |
| <exp> ::= · <simple exp> '<' <simple exp> | EOF ; ELSE END UNTIL |
| <exp> ::= · <simple exp> '=' <simple exp> | EOF ; ELSE END UNTIL |
| <exp> ::= · <simple exp> | EOF ; ELSE END UNTIL |
| <simple exp> ::= · <simple exp> '+' <term> | EOF - ; + < = ELSE END UNTIL |
| <simple exp> ::= · <simple exp> '-' <term> | EOF - ; + < = ELSE END UNTIL |
| <simple exp> ::= · <term> | EOF - ; + < = ELSE END UNTIL |
| <term> ::= · <term> '*' <factor> | EOF - * / ; + < = ELSE END UNTIL |
| <term> ::= · <term> '/' <factor> | EOF - * / ; + < = ELSE END UNTIL |
| <term> ::= · <factor> | EOF - * / ; + < = ELSE END UNTIL |
| <factor> ::= · '(' <exp> ')' | EOF - * / ; + < = ELSE END UNTIL |
| <factor> ::= · Number | EOF - * / ; + < = ELSE END UNTIL |
| <factor> ::= · ID | EOF - * / ; + < = ELSE END UNTIL |
| '(' Shift 3 | |
| ID Shift 4 | |
| Number Shift 5 | |
| <exp> Goto 23 | |
| <factor> Goto 8 | |
| <simple exp> Goto 9 | |
| <term> Goto 20 | |
| | |
3 | <factor> ::= '(' · <exp> ')' | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| <exp> ::= · <simple exp> '<' <simple exp> | ) |
| <exp> ::= · <simple exp> '=' <simple exp> | ) |
| <exp> ::= · <simple exp> | ) |
| <simple exp> ::= · <simple exp> '+' <term> | - ) + < = |
| <simple exp> ::= · <simple exp> '-' <term> | - ) + < = |
| <simple exp> ::= · <term> | - ) + < = |
| <term> ::= · <term> '*' <factor> | - ) * / + < = |
| <term> ::= · <term> '/' <factor> | - ) * / + < = |
| <term> ::= · <factor> | - ) * / + < = |
| <factor> ::= · '(' <exp> ')' | - ) * / + < = |
| <factor> ::= · Number | - ) * / + < = |
| <factor> ::= · ID | - ) * / + < = |
| '(' Shift 3 | |
| ID Shift 4 | |
| Number Shift 5 | |
| <exp> Goto 6 | |
| <factor> Goto 8 | |
| <simple exp> Goto 9 | |
| <term> Goto 20 | |
| | |
4 | <factor> ::= ID · | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| (EOF) Reduce Rule 25 | |
| '-' Reduce Rule 25 | |
| ')' Reduce Rule 25 | |
| '*' Reduce Rule 25 | |
| '/' Reduce Rule 25 | |
| ';' Reduce Rule 25 | |
| '+' Reduce Rule 25 | |
| '<' Reduce Rule 25 | |
| '=' Reduce Rule 25 | |
| ELSE Reduce Rule 25 | |
| END Reduce Rule 25 | |
| THEN Reduce Rule 25 | |
| UNTIL Reduce Rule 25 | |
| | |
5 | <factor> ::= Number · | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| (EOF) Reduce Rule 24 | |
| '-' Reduce Rule 24 | |
| ')' Reduce Rule 24 | |
| '*' Reduce Rule 24 | |
| '/' Reduce Rule 24 | |
| ';' Reduce Rule 24 | |
| '+' Reduce Rule 24 | |
| '<' Reduce Rule 24 | |
| '=' Reduce Rule 24 | |
| ELSE Reduce Rule 24 | |
| END Reduce Rule 24 | |
| THEN Reduce Rule 24 | |
| UNTIL Reduce Rule 24 | |
| | |
6 | <factor> ::= '(' <exp> · ')' | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| ')' Shift 7 | |
| | |
7 | <factor> ::= '(' <exp> ')' · | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| (EOF) Reduce Rule 23 | |
| '-' Reduce Rule 23 | |
| ')' Reduce Rule 23 | |
| '*' Reduce Rule 23 | |
| '/' Reduce Rule 23 | |
| ';' Reduce Rule 23 | |
| '+' Reduce Rule 23 | |
| '<' Reduce Rule 23 | |
| '=' Reduce Rule 23 | |
| ELSE Reduce Rule 23 | |
| END Reduce Rule 23 | |
| THEN Reduce Rule 23 | |
| UNTIL Reduce Rule 23 | |
| | |
8 | <term> ::= <factor> · | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| (EOF) Reduce Rule 22 | |
| '-' Reduce Rule 22 | |
| ')' Reduce Rule 22 | |
| '*' Reduce Rule 22 | |
| '/' Reduce Rule 22 | |
| ';' Reduce Rule 22 | |
| '+' Reduce Rule 22 | |
| '<' Reduce Rule 22 | |
| '=' Reduce Rule 22 | |
| ELSE Reduce Rule 22 | |
| END Reduce Rule 22 | |
| THEN Reduce Rule 22 | |
| UNTIL Reduce Rule 22 | |
| | |
9 | <exp> ::= <simple exp> · '<' <simple exp> | EOF ) ; ELSE END THEN UNTIL |
| <exp> ::= <simple exp> · '=' <simple exp> | EOF ) ; ELSE END THEN UNTIL |
| <exp> ::= <simple exp> · | EOF ) ; ELSE END THEN UNTIL |
| <simple exp> ::= <simple exp> · '+' <term> | EOF - ) ; + < = ELSE END THEN UNTIL |
| <simple exp> ::= <simple exp> · '-' <term> | EOF - ) ; + < = ELSE END THEN UNTIL |
| '-' Shift 10 | |
| '+' Shift 16 | |
| '<' Shift 18 | |
| '=' Shift 21 | |
| (EOF) Reduce Rule 16 | |
| ')' Reduce Rule 16 | |
| ';' Reduce Rule 16 | |
| ELSE Reduce Rule 16 | |
| END Reduce Rule 16 | |
| THEN Reduce Rule 16 | |
| UNTIL Reduce Rule 16 | |
| | |
10 | <simple exp> ::= <simple exp> '-' · <term> | EOF - ) ; + < = ELSE END THEN UNTIL |
| <term> ::= · <term> '*' <factor> | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| <term> ::= · <term> '/' <factor> | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| <term> ::= · <factor> | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| <factor> ::= · '(' <exp> ')' | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| <factor> ::= · Number | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| <factor> ::= · ID | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| '(' Shift 3 | |
| ID Shift 4 | |
| Number Shift 5 | |
| <factor> Goto 8 | |
| <term> Goto 11 | |
| | |
11 | <simple exp> ::= <simple exp> '-' <term> · | EOF - ) ; + < = ELSE END THEN UNTIL |
| <term> ::= <term> · '*' <factor> | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| <term> ::= <term> · '/' <factor> | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| '*' Shift 12 | |
| '/' Shift 14 | |
| (EOF) Reduce Rule 18 | |
| '-' Reduce Rule 18 | |
| ')' Reduce Rule 18 | |
| ';' Reduce Rule 18 | |
| '+' Reduce Rule 18 | |
| '<' Reduce Rule 18 | |
| '=' Reduce Rule 18 | |
| ELSE Reduce Rule 18 | |
| END Reduce Rule 18 | |
| THEN Reduce Rule 18 | |
| UNTIL Reduce Rule 18 | |
| | |
12 | <term> ::= <term> '*' · <factor> | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| <factor> ::= · '(' <exp> ')' | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| <factor> ::= · Number | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| <factor> ::= · ID | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| '(' Shift 3 | |
| ID Shift 4 | |
| Number Shift 5 | |
| <factor> Goto 13 | |
| | |
13 | <term> ::= <term> '*' <factor> · | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| (EOF) Reduce Rule 20 | |
| '-' Reduce Rule 20 | |
| ')' Reduce Rule 20 | |
| '*' Reduce Rule 20 | |
| '/' Reduce Rule 20 | |
| ';' Reduce Rule 20 | |
| '+' Reduce Rule 20 | |
| '<' Reduce Rule 20 | |
| '=' Reduce Rule 20 | |
| ELSE Reduce Rule 20 | |
| END Reduce Rule 20 | |
| THEN Reduce Rule 20 | |
| UNTIL Reduce Rule 20 | |
| | |
14 | <term> ::= <term> '/' · <factor> | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| <factor> ::= · '(' <exp> ')' | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| <factor> ::= · Number | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| <factor> ::= · ID | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| '(' Shift 3 | |
| ID Shift 4 | |
| Number Shift 5 | |
| <factor> Goto 15 | |
| | |
15 | <term> ::= <term> '/' <factor> · | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| (EOF) Reduce Rule 21 | |
| '-' Reduce Rule 21 | |
| ')' Reduce Rule 21 | |
| '*' Reduce Rule 21 | |
| '/' Reduce Rule 21 | |
| ';' Reduce Rule 21 | |
| '+' Reduce Rule 21 | |
| '<' Reduce Rule 21 | |
| '=' Reduce Rule 21 | |
| ELSE Reduce Rule 21 | |
| END Reduce Rule 21 | |
| THEN Reduce Rule 21 | |
| UNTIL Reduce Rule 21 | |
| | |
16 | <simple exp> ::= <simple exp> '+' · <term> | EOF - ) ; + < = ELSE END THEN UNTIL |
| <term> ::= · <term> '*' <factor> | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| <term> ::= · <term> '/' <factor> | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| <term> ::= · <factor> | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| <factor> ::= · '(' <exp> ')' | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| <factor> ::= · Number | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| <factor> ::= · ID | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| '(' Shift 3 | |
| ID Shift 4 | |
| Number Shift 5 | |
| <factor> Goto 8 | |
| <term> Goto 17 | |
| | |
17 | <simple exp> ::= <simple exp> '+' <term> · | EOF - ) ; + < = ELSE END THEN UNTIL |
| <term> ::= <term> · '*' <factor> | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| <term> ::= <term> · '/' <factor> | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| '*' Shift 12 | |
| '/' Shift 14 | |
| (EOF) Reduce Rule 17 | |
| '-' Reduce Rule 17 | |
| ')' Reduce Rule 17 | |
| ';' Reduce Rule 17 | |
| '+' Reduce Rule 17 | |
| '<' Reduce Rule 17 | |
| '=' Reduce Rule 17 | |
| ELSE Reduce Rule 17 | |
| END Reduce Rule 17 | |
| THEN Reduce Rule 17 | |
| UNTIL Reduce Rule 17 | |
| | |
18 | <exp> ::= <simple exp> '<' · <simple exp> | EOF ) ; ELSE END THEN UNTIL |
| <simple exp> ::= · <simple exp> '+' <term> | EOF - ) ; + ELSE END THEN UNTIL |
| <simple exp> ::= · <simple exp> '-' <term> | EOF - ) ; + ELSE END THEN UNTIL |
| <simple exp> ::= · <term> | EOF - ) ; + ELSE END THEN UNTIL |
| <term> ::= · <term> '*' <factor> | EOF - ) * / ; + ELSE END THEN UNTIL |
| <term> ::= · <term> '/' <factor> | EOF - ) * / ; + ELSE END THEN UNTIL |
| <term> ::= · <factor> | EOF - ) * / ; + ELSE END THEN UNTIL |
| <factor> ::= · '(' <exp> ')' | EOF - ) * / ; + ELSE END THEN UNTIL |
| <factor> ::= · Number | EOF - ) * / ; + ELSE END THEN UNTIL |
| <factor> ::= · ID | EOF - ) * / ; + ELSE END THEN UNTIL |
| '(' Shift 3 | |
| ID Shift 4 | |
| Number Shift 5 | |
| <factor> Goto 8 | |
| <simple exp> Goto 19 | |
| <term> Goto 20 | |
| | |
19 | <exp> ::= <simple exp> '<' <simple exp> · | EOF ) ; ELSE END THEN UNTIL |
| <simple exp> ::= <simple exp> · '+' <term> | EOF - ) ; + ELSE END THEN UNTIL |
| <simple exp> ::= <simple exp> · '-' <term> | EOF - ) ; + ELSE END THEN UNTIL |
| '-' Shift 10 | |
| '+' Shift 16 | |
| (EOF) Reduce Rule 14 | |
| ')' Reduce Rule 14 | |
| ';' Reduce Rule 14 | |
| ELSE Reduce Rule 14 | |
| END Reduce Rule 14 | |
| THEN Reduce Rule 14 | |
| UNTIL Reduce Rule 14 | |
| | |
20 | <simple exp> ::= <term> · | EOF - ) ; + < = ELSE END THEN UNTIL |
| <term> ::= <term> · '*' <factor> | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| <term> ::= <term> · '/' <factor> | EOF - ) * / ; + < = ELSE END THEN UNTIL |
| '*' Shift 12 | |
| '/' Shift 14 | |
| (EOF) Reduce Rule 19 | |
| '-' Reduce Rule 19 | |
| ')' Reduce Rule 19 | |
| ';' Reduce Rule 19 | |
| '+' Reduce Rule 19 | |
| '<' Reduce Rule 19 | |
| '=' Reduce Rule 19 | |
| ELSE Reduce Rule 19 | |
| END Reduce Rule 19 | |
| THEN Reduce Rule 19 | |
| UNTIL Reduce Rule 19 | |
| | |
21 | <exp> ::= <simple exp> '=' · <simple exp> | EOF ) ; ELSE END THEN UNTIL |
| <simple exp> ::= · <simple exp> '+' <term> | EOF - ) ; + ELSE END THEN UNTIL |
| <simple exp> ::= · <simple exp> '-' <term> | EOF - ) ; + ELSE END THEN UNTIL |
| <simple exp> ::= · <term> | EOF - ) ; + ELSE END THEN UNTIL |
| <term> ::= · <term> '*' <factor> | EOF - ) * / ; + ELSE END THEN UNTIL |
| <term> ::= · <term> '/' <factor> | EOF - ) * / ; + ELSE END THEN UNTIL |
| <term> ::= · <factor> | EOF - ) * / ; + ELSE END THEN UNTIL |
| <factor> ::= · '(' <exp> ')' | EOF - ) * / ; + ELSE END THEN UNTIL |
| <factor> ::= · Number | EOF - ) * / ; + ELSE END THEN UNTIL |
| <factor> ::= · ID | EOF - ) * / ; + ELSE END THEN UNTIL |
| '(' Shift 3 | |
| ID Shift 4 | |
| Number Shift 5 | |
| <factor> Goto 8 | |
| <simple exp> Goto 22 | |
| <term> Goto 20 | |
| | |
22 | <exp> ::= <simple exp> '=' <simple exp> · | EOF ) ; ELSE END THEN UNTIL |
| <simple exp> ::= <simple exp> · '+' <term> | EOF - ) ; + ELSE END THEN UNTIL |
| <simple exp> ::= <simple exp> · '-' <term> | EOF - ) ; + ELSE END THEN UNTIL |
| '-' Shift 10 | |
| '+' Shift 16 | |
| (EOF) Reduce Rule 15 | |
| ')' Reduce Rule 15 | |
| ';' Reduce Rule 15 | |
| ELSE Reduce Rule 15 | |
| END Reduce Rule 15 | |
| THEN Reduce Rule 15 | |
| UNTIL Reduce Rule 15 | |
| | |
23 | <assign stmt> ::= ID ':=' <exp> · | EOF ; ELSE END UNTIL |
| (EOF) Reduce Rule 11 | |
| ';' Reduce Rule 11 | |
| ELSE Reduce Rule 11 | |
| END Reduce Rule 11 | |
| UNTIL Reduce Rule 11 | |
| | |
24 | <if stmt> ::= IF · <exp> THEN <stmt seq> END | EOF ; ELSE END UNTIL |
| <if stmt> ::= IF · <exp> THEN <stmt seq> ELSE <stmt seq> END | EOF ; ELSE END UNTIL |
| <exp> ::= · <simple exp> '<' <simple exp> | THEN |
| <exp> ::= · <simple exp> '=' <simple exp> | THEN |
| <exp> ::= · <simple exp> | THEN |
| <simple exp> ::= · <simple exp> '+' <term> | - + < = THEN |
| <simple exp> ::= · <simple exp> '-' <term> | - + < = THEN |
| <simple exp> ::= · <term> | - + < = THEN |
| <term> ::= · <term> '*' <factor> | - * / + < = THEN |
| <term> ::= · <term> '/' <factor> | - * / + < = THEN |
| <term> ::= · <factor> | - * / + < = THEN |
| <factor> ::= · '(' <exp> ')' | - * / + < = THEN |
| <factor> ::= · Number | - * / + < = THEN |
| <factor> ::= · ID | - * / + < = THEN |
| '(' Shift 3 | |
| ID Shift 4 | |
| Number Shift 5 | |
| <exp> Goto 25 | |
| <factor> Goto 8 | |
| <simple exp> Goto 9 | |
| <term> Goto 20 | |
| | |
25 | <if stmt> ::= IF <exp> · THEN <stmt seq> END | EOF ; ELSE END UNTIL |
| <if stmt> ::= IF <exp> · THEN <stmt seq> ELSE <stmt seq> END | EOF ; ELSE END UNTIL |
| THEN Shift 26 | |
| | |
26 | <if stmt> ::= IF <exp> THEN · <stmt seq> END | EOF ; ELSE END UNTIL |
| <if stmt> ::= IF <exp> THEN · <stmt seq> ELSE <stmt seq> END | EOF ; ELSE END UNTIL |
| <stmt seq> ::= · <stmt seq> ';' <stmt> | ; ELSE END |
| <stmt seq> ::= · <stmt> | ; ELSE END |
| <stmt> ::= · <if stmt> | ; ELSE END |
| <stmt> ::= · <repeat stmt> | ; ELSE END |
| <stmt> ::= · <assign stmt> | ; ELSE END |
| <stmt> ::= · <read stmt> | ; ELSE END |
| <stmt> ::= · <write stmt> | ; ELSE END |
| <if stmt> ::= · IF <exp> THEN <stmt seq> END | ; ELSE END |
| <if stmt> ::= · IF <exp> THEN <stmt seq> ELSE <stmt seq> END | ; ELSE END |
| <repeat stmt> ::= · REPEAT <stmt seq> UNTIL <exp> | ; ELSE END |
| <assign stmt> ::= · ID ':=' <exp> | ; ELSE END |
| <read stmt> ::= · READ ID | ; ELSE END |
| <write stmt> ::= · WRITE <exp> | ; ELSE END |
| ID Shift 1 | |
| IF Shift 24 | |
| READ Shift 27 | |
| REPEAT Shift 29 | |
| WRITE Shift 30 | |
| <assign stmt> Goto 32 | |
| <if stmt> Goto 33 | |
| <read stmt> Goto 34 | |
| <repeat stmt> Goto 35 | |
| <stmt> Goto 36 | |
| <stmt seq> Goto 43 | |
| <write stmt> Goto 40 | |
| | |
27 | <read stmt> ::= READ · ID | EOF ; ELSE END UNTIL |
| ID Shift 28 | |
| | |
28 | <read stmt> ::= READ ID · | EOF ; ELSE END UNTIL |
| (EOF) Reduce Rule 12 | |
| ';' Reduce Rule 12 | |
| ELSE Reduce Rule 12 | |
| END Reduce Rule 12 | |
| UNTIL Reduce Rule 12 | |
| | |
29 | <repeat stmt> ::= REPEAT · <stmt seq> UNTIL <exp> | EOF ; ELSE END UNTIL |
| <stmt seq> ::= · <stmt seq> ';' <stmt> | ; UNTIL |
| <stmt seq> ::= · <stmt> | ; UNTIL |
| <stmt> ::= · <if stmt> | ; UNTIL |
| <stmt> ::= · <repeat stmt> | ; UNTIL |
| <stmt> ::= · <assign stmt> | ; UNTIL |
| <stmt> ::= · <read stmt> | ; UNTIL |
| <stmt> ::= · <write stmt> | ; UNTIL |
| <if stmt> ::= · IF <exp> THEN <stmt seq> END | ; UNTIL |
| <if stmt> ::= · IF <exp> THEN <stmt seq> ELSE <stmt seq> END | ; UNTIL |
| <repeat stmt> ::= · REPEAT <stmt seq> UNTIL <exp> | ; UNTIL |
| <assign stmt> ::= · ID ':=' <exp> | ; UNTIL |
| <read stmt> ::= · READ ID | ; UNTIL |
| <write stmt> ::= · WRITE <exp> | ; UNTIL |
| ID Shift 1 | |
| IF Shift 24 | |
| READ Shift 27 | |
| REPEAT Shift 29 | |
| WRITE Shift 30 | |
| <assign stmt> Goto 32 | |
| <if stmt> Goto 33 | |
| <read stmt> Goto 34 | |
| <repeat stmt> Goto 35 | |
| <stmt> Goto 36 | |
| <stmt seq> Goto 37 | |
| <write stmt> Goto 40 | |
| | |
30 | <write stmt> ::= WRITE · <exp> | EOF ; ELSE END UNTIL |
| <exp> ::= · <simple exp> '<' <simple exp> | EOF ; ELSE END UNTIL |
| <exp> ::= · <simple exp> '=' <simple exp> | EOF ; ELSE END UNTIL |
| <exp> ::= · <simple exp> | EOF ; ELSE END UNTIL |
| <simple exp> ::= · <simple exp> '+' <term> | EOF - ; + < = ELSE END UNTIL |
| <simple exp> ::= · <simple exp> '-' <term> | EOF - ; + < = ELSE END UNTIL |
| <simple exp> ::= · <term> | EOF - ; + < = ELSE END UNTIL |
| <term> ::= · <term> '*' <factor> | EOF - * / ; + < = ELSE END UNTIL |
| <term> ::= · <term> '/' <factor> | EOF - * / ; + < = ELSE END UNTIL |
| <term> ::= · <factor> | EOF - * / ; + < = ELSE END UNTIL |
| <factor> ::= · '(' <exp> ')' | EOF - * / ; + < = ELSE END UNTIL |
| <factor> ::= · Number | EOF - * / ; + < = ELSE END UNTIL |
| <factor> ::= · ID | EOF - * / ; + < = ELSE END UNTIL |
| '(' Shift 3 | |
| ID Shift 4 | |
| Number Shift 5 | |
| <exp> Goto 31 | |
| <factor> Goto 8 | |
| <simple exp> Goto 9 | |
| <term> Goto 20 | |
| | |
31 | <write stmt> ::= WRITE <exp> · | EOF ; ELSE END UNTIL |
| (EOF) Reduce Rule 13 | |
| ';' Reduce Rule 13 | |
| ELSE Reduce Rule 13 | |
| END Reduce Rule 13 | |
| UNTIL Reduce Rule 13 | |
| | |
32 | <stmt> ::= <assign stmt> · | EOF ; ELSE END UNTIL |
| (EOF) Reduce Rule 5 | |
| ';' Reduce Rule 5 | |
| ELSE Reduce Rule 5 | |
| END Reduce Rule 5 | |
| UNTIL Reduce Rule 5 | |
| | |
33 | <stmt> ::= <if stmt> · | EOF ; ELSE END UNTIL |
| (EOF) Reduce Rule 3 | |
| ';' Reduce Rule 3 | |
| ELSE Reduce Rule 3 | |
| END Reduce Rule 3 | |
| UNTIL Reduce Rule 3 | |
| | |
34 | <stmt> ::= <read stmt> · | EOF ; ELSE END UNTIL |
| (EOF) Reduce Rule 6 | |
| ';' Reduce Rule 6 | |
| ELSE Reduce Rule 6 | |
| END Reduce Rule 6 | |
| UNTIL Reduce Rule 6 | |
| | |
35 | <stmt> ::= <repeat stmt> · | EOF ; ELSE END UNTIL |
| (EOF) Reduce Rule 4 | |
| ';' Reduce Rule 4 | |
| ELSE Reduce Rule 4 | |
| END Reduce Rule 4 | |
| UNTIL Reduce Rule 4 | |
| | |
36 | <stmt seq> ::= <stmt> · | EOF ; ELSE END UNTIL |
| (EOF) Reduce Rule 2 | |
| ';' Reduce Rule 2 | |
| ELSE Reduce Rule 2 | |
| END Reduce Rule 2 | |
| UNTIL Reduce Rule 2 | |
| | |
37 | <repeat stmt> ::= REPEAT <stmt seq> · UNTIL <exp> | EOF ; ELSE END UNTIL |
| <stmt seq> ::= <stmt seq> · ';' <stmt> | ; UNTIL |
| ';' Shift 38 | |
| UNTIL Shift 41 | |
| | |
38 | <stmt seq> ::= <stmt seq> ';' · <stmt> | EOF ; ELSE END UNTIL |
| <stmt> ::= · <if stmt> | EOF ; ELSE END UNTIL |
| <stmt> ::= · <repeat stmt> | EOF ; ELSE END UNTIL |
| <stmt> ::= · <assign stmt> | EOF ; ELSE END UNTIL |
| <stmt> ::= · <read stmt> | EOF ; ELSE END UNTIL |
| <stmt> ::= · <write stmt> | EOF ; ELSE END UNTIL |
| <if stmt> ::= · IF <exp> THEN <stmt seq> END | EOF ; ELSE END UNTIL |
| <if stmt> ::= · IF <exp> THEN <stmt seq> ELSE <stmt seq> END | EOF ; ELSE END UNTIL |
| <repeat stmt> ::= · REPEAT <stmt seq> UNTIL <exp> | EOF ; ELSE END UNTIL |
| <assign stmt> ::= · ID ':=' <exp> | EOF ; ELSE END UNTIL |
| <read stmt> ::= · READ ID | EOF ; ELSE END UNTIL |
| <write stmt> ::= · WRITE <exp> | EOF ; ELSE END UNTIL |
| ID Shift 1 | |
| IF Shift 24 | |
| READ Shift 27 | |
| REPEAT Shift 29 | |
| WRITE Shift 30 | |
| <assign stmt> Goto 32 | |
| <if stmt> Goto 33 | |
| <read stmt> Goto 34 | |
| <repeat stmt> Goto 35 | |
| <stmt> Goto 39 | |
| <write stmt> Goto 40 | |
| | |
39 | <stmt seq> ::= <stmt seq> ';' <stmt> · | EOF ; ELSE END UNTIL |
| (EOF) Reduce Rule 1 | |
| ';' Reduce Rule 1 | |
| ELSE Reduce Rule 1 | |
| END Reduce Rule 1 | |
| UNTIL Reduce Rule 1 | |
| | |
40 | <stmt> ::= <write stmt> · | EOF ; ELSE END UNTIL |
| (EOF) Reduce Rule 7 | |
| ';' Reduce Rule 7 | |
| ELSE Reduce Rule 7 | |
| END Reduce Rule 7 | |
| UNTIL Reduce Rule 7 | |
| | |
41 | <repeat stmt> ::= REPEAT <stmt seq> UNTIL · <exp> | EOF ; ELSE END UNTIL |
| <exp> ::= · <simple exp> '<' <simple exp> | EOF ; ELSE END UNTIL |
| <exp> ::= · <simple exp> '=' <simple exp> | EOF ; ELSE END UNTIL |
| <exp> ::= · <simple exp> | EOF ; ELSE END UNTIL |
| <simple exp> ::= · <simple exp> '+' <term> | EOF - ; + < = ELSE END UNTIL |
| <simple exp> ::= · <simple exp> '-' <term> | EOF - ; + < = ELSE END UNTIL |
| <simple exp> ::= · <term> | EOF - ; + < = ELSE END UNTIL |
| <term> ::= · <term> '*' <factor> | EOF - * / ; + < = ELSE END UNTIL |
| <term> ::= · <term> '/' <factor> | EOF - * / ; + < = ELSE END UNTIL |
| <term> ::= · <factor> | EOF - * / ; + < = ELSE END UNTIL |
| <factor> ::= · '(' <exp> ')' | EOF - * / ; + < = ELSE END UNTIL |
| <factor> ::= · Number | EOF - * / ; + < = ELSE END UNTIL |
| <factor> ::= · ID | EOF - * / ; + < = ELSE END UNTIL |
| '(' Shift 3 | |
| ID Shift 4 | |
| Number Shift 5 | |
| <exp> Goto 42 | |
| <factor> Goto 8 | |
| <simple exp> Goto 9 | |
| <term> Goto 20 | |
| | |
42 | <repeat stmt> ::= REPEAT <stmt seq> UNTIL <exp> · | EOF ; ELSE END UNTIL |
| (EOF) Reduce Rule 10 | |
| ';' Reduce Rule 10 | |
| ELSE Reduce Rule 10 | |
| END Reduce Rule 10 | |
| UNTIL Reduce Rule 10 | |
| | |
43 | <if stmt> ::= IF <exp> THEN <stmt seq> · END | EOF ; ELSE END UNTIL |
| <if stmt> ::= IF <exp> THEN <stmt seq> · ELSE <stmt seq> END | EOF ; ELSE END UNTIL |
| <stmt seq> ::= <stmt seq> · ';' <stmt> | ; ELSE END |
| ';' Shift 38 | |
| ELSE Shift 44 | |
| END Shift 47 | |
| | |
44 | <if stmt> ::= IF <exp> THEN <stmt seq> ELSE · <stmt seq> END | EOF ; ELSE END UNTIL |
| <stmt seq> ::= · <stmt seq> ';' <stmt> | ; END |
| <stmt seq> ::= · <stmt> | ; END |
| <stmt> ::= · <if stmt> | ; END |
| <stmt> ::= · <repeat stmt> | ; END |
| <stmt> ::= · <assign stmt> | ; END |
| <stmt> ::= · <read stmt> | ; END |
| <stmt> ::= · <write stmt> | ; END |
| <if stmt> ::= · IF <exp> THEN <stmt seq> END | ; END |
| <if stmt> ::= · IF <exp> THEN <stmt seq> ELSE <stmt seq> END | ; END |
| <repeat stmt> ::= · REPEAT <stmt seq> UNTIL <exp> | ; END |
| <assign stmt> ::= · ID ':=' <exp> | ; END |
| <read stmt> ::= · READ ID | ; END |
| <write stmt> ::= · WRITE <exp> | ; END |
| ID Shift 1 | |
| IF Shift 24 | |
| READ Shift 27 | |
| REPEAT Shift 29 | |
| WRITE Shift 30 | |
| <assign stmt> Goto 32 | |
| <if stmt> Goto 33 | |
| <read stmt> Goto 34 | |
| <repeat stmt> Goto 35 | |
| <stmt> Goto 36 | |
| <stmt seq> Goto 45 | |
| <write stmt> Goto 40 | |
| | |
45 | <if stmt> ::= IF <exp> THEN <stmt seq> ELSE <stmt seq> · END | EOF ; ELSE END UNTIL |
| <stmt seq> ::= <stmt seq> · ';' <stmt> | ; END |
| ';' Shift 38 | |
| END Shift 46 | |
| | |
46 | <if stmt> ::= IF <exp> THEN <stmt seq> ELSE <stmt seq> END · | EOF ; ELSE END UNTIL |
| (EOF) Reduce Rule 9 | |
| ';' Reduce Rule 9 | |
| ELSE Reduce Rule 9 | |
| END Reduce Rule 9 | |
| UNTIL Reduce Rule 9 | |
| | |
47 | <if stmt> ::= IF <exp> THEN <stmt seq> END · | EOF ; ELSE END UNTIL |
| (EOF) Reduce Rule 8 | |
| ';' Reduce Rule 8 | |
| ELSE Reduce Rule 8 | |
| END Reduce Rule 8 | |
| UNTIL Reduce Rule 8 | |
| | |
48 | <S'> ::= <program> · (EOF) | |
| (EOF) Accept | |
| | |
49 | <program> ::= <stmt seq> · | EOF |
| <stmt seq> ::= <stmt seq> · ';' <stmt> | EOF ; |
| ';' Shift 38 | |
| (EOF) Reduce Rule 0 | |