Tiny

by Kenneth C. Louden




Parameters
NameValue
NameTiny
VersionBased on Kenneth C. Loudens YACC grammar
AuthorKenneth C. Louden
AboutThis grammar is used in Compiler Construction: Principles and Practice
Start Symbolprogram
Auto WhitespaceTrue
Character MappingANSI
Case SensitiveFalse


Terminals
IndexName
0(EOF)
1(Error)
2(Whitespace)
3(Comment End)
4(Comment Start)
5'-'
6'('
7')'
8'*'
9'/'
10':='
11';'
12'+'
13'<'
14'='
15ELSE
16END
17ID
18IF
19Number
20READ
21REPEAT
22THEN
23UNTIL
24WRITE


Nonterminals
IndexName
25<assign stmt>
26<exp>
27<factor>
28<if stmt>
29<program>
30<read stmt>
31<repeat stmt>
32<simple exp>
33<stmt>
34<stmt seq>
35<term>
36<write stmt>


Rules
IndexName::=Definition
0<program>::=<stmt seq>
1<stmt seq>::=<stmt seq> ';' <stmt>
2<stmt seq>::=<stmt>
3<stmt>::=<if stmt>
4<stmt>::=<repeat stmt>
5<stmt>::=<assign stmt>
6<stmt>::=<read stmt>
7<stmt>::=<write stmt>
8<if stmt>::=IF <exp> THEN <stmt seq> END
9<if stmt>::=IF <exp> THEN <stmt seq> ELSE <stmt seq> END
10<repeat stmt>::=REPEAT <stmt seq> UNTIL <exp>
11<assign stmt>::=ID ':=' <exp>
12<read stmt>::=READ ID
13<write stmt>::=WRITE <exp>
14<exp>::=<simple exp> '<' <simple exp>
15<exp>::=<simple exp> '=' <simple exp>
16<exp>::=<simple exp>
17<simple exp>::=<simple exp> '+' <term>
18<simple exp>::=<simple exp> '-' <term>
19<simple exp>::=<term>
20<term>::=<term> '*' <factor>
21<term>::=<term> '/' <factor>
22<term>::=<factor>
23<factor>::='(' <exp> ')'
24<factor>::=Number
25<factor>::=ID


Determistic Finite Automata
IndexDescriptionCharacters
0Goto 1{HT}{LF}{VT}{FF}{CR}{Space}{NBSP}
 Goto 2(
 Goto 3)
 Goto 4*
 Goto 5+
 Goto 6-
 Goto 7/
 Goto 80123456789
 Goto 9:
 Goto 11;
 Goto 12<
 Goto 13=
 Goto 14ABCDFGHJKLMNOPQSVXYZabcdfghjklmnopqsvxyz
 Goto 15Ee
 Goto 21Ii
 Goto 23Rr
 Goto 31Tt
 Goto 35Uu
 Goto 40Ww
 Goto 45{
 Goto 46}
   
1Goto 1{HT}{LF}{VT}{FF}{CR}{Space}{NBSP}
 Accept (Whitespace) 
   
2Accept '(' 
   
3Accept ')' 
   
4Accept '*' 
   
5Accept '+' 
   
6Accept '-' 
   
7Accept '/' 
   
8Goto 80123456789
 Accept Number 
   
9Goto 10=
   
10Accept ':=' 
   
11Accept ';' 
   
12Accept '<' 
   
13Accept '=' 
   
14Goto 14ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
 Accept ID 
   
15Goto 14ABCDEFGHIJKMOPQRSTUVWXYZabcdefghijkmopqrstuvwxyz
 Goto 16Ll
 Goto 19Nn
 Accept ID 
   
16Goto 14ABCDEFGHIJKLMNOPQRTUVWXYZabcdefghijklmnopqrtuvwxyz
 Goto 17Ss
 Accept ID 
   
17Goto 14ABCDFGHIJKLMNOPQRSTUVWXYZabcdfghijklmnopqrstuvwxyz
 Goto 18Ee
 Accept ID 
   
18Goto 14ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
 Accept ELSE 
   
19Goto 14ABCEFGHIJKLMNOPQRSTUVWXYZabcefghijklmnopqrstuvwxyz
 Goto 20Dd
 Accept ID 
   
20Goto 14ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
 Accept END 
   
21Goto 14ABCDEGHIJKLMNOPQRSTUVWXYZabcdeghijklmnopqrstuvwxyz
 Goto 22Ff
 Accept ID 
   
22Goto 14ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
 Accept IF 
   
23Goto 14ABCDFGHIJKLMNOPQRSTUVWXYZabcdfghijklmnopqrstuvwxyz
 Goto 24Ee
 Accept ID 
   
24Goto 25Aa
 Goto 14BCDEFGHIJKLMNOQRSTUVWXYZbcdefghijklmnoqrstuvwxyz
 Goto 27Pp
 Accept ID 
   
25Goto 14ABCEFGHIJKLMNOPQRSTUVWXYZabcefghijklmnopqrstuvwxyz
 Goto 26Dd
 Accept ID 
   
26Goto 14ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
 Accept READ 
   
27Goto 14ABCDFGHIJKLMNOPQRSTUVWXYZabcdfghijklmnopqrstuvwxyz
 Goto 28Ee
 Accept ID 
   
28Goto 29Aa
 Goto 14BCDEFGHIJKLMNOPQRSTUVWXYZbcdefghijklmnopqrstuvwxyz
 Accept ID 
   
29Goto 14ABCDEFGHIJKLMNOPQRSUVWXYZabcdefghijklmnopqrsuvwxyz
 Goto 30Tt
 Accept ID 
   
30Goto 14ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
 Accept REPEAT 
   
31Goto 14ABCDEFGIJKLMNOPQRSTUVWXYZabcdefgijklmnopqrstuvwxyz
 Goto 32Hh
 Accept ID 
   
32Goto 14ABCDFGHIJKLMNOPQRSTUVWXYZabcdfghijklmnopqrstuvwxyz
 Goto 33Ee
 Accept ID 
   
33Goto 14ABCDEFGHIJKLMOPQRSTUVWXYZabcdefghijklmopqrstuvwxyz
 Goto 34Nn
 Accept ID 
   
34Goto 14ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
 Accept THEN 
   
35Goto 14ABCDEFGHIJKLMOPQRSTUVWXYZabcdefghijklmopqrstuvwxyz
 Goto 36Nn
 Accept ID 
   
36Goto 14ABCDEFGHIJKLMNOPQRSUVWXYZabcdefghijklmnopqrsuvwxyz
 Goto 37Tt
 Accept ID 
   
37Goto 14ABCDEFGHJKLMNOPQRSTUVWXYZabcdefghjklmnopqrstuvwxyz
 Goto 38Ii
 Accept ID 
   
38Goto 14ABCDEFGHIJKMNOPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz
 Goto 39Ll
 Accept ID 
   
39Goto 14ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
 Accept UNTIL 
   
40Goto 14ABCDEFGHIJKLMNOPQSTUVWXYZabcdefghijklmnopqstuvwxyz
 Goto 41Rr
 Accept ID 
   
41Goto 14ABCDEFGHJKLMNOPQRSTUVWXYZabcdefghjklmnopqrstuvwxyz
 Goto 42Ii
 Accept ID 
   
42Goto 14ABCDEFGHIJKLMNOPQRSUVWXYZabcdefghijklmnopqrsuvwxyz
 Goto 43Tt
 Accept ID 
   
43Goto 14ABCDFGHIJKLMNOPQRSTUVWXYZabcdfghijklmnopqrstuvwxyz
 Goto 44Ee
 Accept ID 
   
44Goto 14ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
 Accept WRITE 
   
45Accept (Comment Start) 
   
46Accept (Comment End) 


LALR State Table
IndexConfiguration/ActionLookahead
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> ENDEOF ;
 <if stmt> ::= · IF <exp> THEN <stmt seq> ELSE <stmt seq> ENDEOF ;
 <repeat stmt> ::= · REPEAT <stmt seq> UNTIL <exp>EOF ;
 <assign stmt> ::= · ID ':=' <exp>EOF ;
 <read stmt> ::= · READ IDEOF ;
 <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> ::= · NumberEOF - * / ; + < = ELSE END UNTIL
 <factor> ::= · IDEOF - * / ; + < = 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> ::= · NumberEOF - ) * / ; + < = ELSE END THEN UNTIL
 <factor> ::= · IDEOF - ) * / ; + < = 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> ::= · NumberEOF - ) * / ; + < = ELSE END THEN UNTIL
 <factor> ::= · IDEOF - ) * / ; + < = 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> ::= · NumberEOF - ) * / ; + < = ELSE END THEN UNTIL
 <factor> ::= · IDEOF - ) * / ; + < = 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> ::= · NumberEOF - ) * / ; + < = ELSE END THEN UNTIL
 <factor> ::= · IDEOF - ) * / ; + < = 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> ::= · NumberEOF - ) * / ; + ELSE END THEN UNTIL
 <factor> ::= · IDEOF - ) * / ; + 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> ::= · NumberEOF - ) * / ; + ELSE END THEN UNTIL
 <factor> ::= · IDEOF - ) * / ; + 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> ENDEOF ; ELSE END UNTIL
 <if stmt> ::= IF · <exp> THEN <stmt seq> ELSE <stmt seq> ENDEOF ; 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> ENDEOF ; ELSE END UNTIL
 <if stmt> ::= IF <exp> · THEN <stmt seq> ELSE <stmt seq> ENDEOF ; ELSE END UNTIL
 THEN Shift 26 
   
26<if stmt> ::= IF <exp> THEN · <stmt seq> ENDEOF ; ELSE END UNTIL
 <if stmt> ::= IF <exp> THEN · <stmt seq> ELSE <stmt seq> ENDEOF ; 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 · IDEOF ; 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> ::= · NumberEOF - * / ; + < = ELSE END UNTIL
 <factor> ::= · IDEOF - * / ; + < = 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> ENDEOF ; ELSE END UNTIL
 <if stmt> ::= · IF <exp> THEN <stmt seq> ELSE <stmt seq> ENDEOF ; 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 IDEOF ; 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> ::= · NumberEOF - * / ; + < = ELSE END UNTIL
 <factor> ::= · IDEOF - * / ; + < = 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> · ENDEOF ; ELSE END UNTIL
 <if stmt> ::= IF <exp> THEN <stmt seq> · ELSE <stmt seq> ENDEOF ; 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> ENDEOF ; 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> · ENDEOF ; 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