home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programmer 7500
/
MAX_PROGRAMMERS.iso
/
PASCAL
/
CMLN1285.ZIP
/
QPARSER.LST
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
UTF-8
Wrap
File List
|
1986-02-27
|
29.1 KB
|
1,056 lines
C:\QPARSER>lr1
QPARSER LALR(1) Parser Generator, version 2.5 *restricted use*
COPYRIGHT (C) 1985, QCAD Systems, Inc. All rights reserved.
Usage:
LR1 grammarfile[.GRM] [ -l reportfile[.TXT] ]
[ -t tablefile[.TBL] ]
Other options (* means default):
-l# set report level to # (* = 0; max = 6)
-nt no table output
-g# set LALR stack to # (default = 50)
The generator report levels are as follows:
0: Grammar and conflict report
1: Tokens and token numbers
2: Final state machine
3: Grammar statistics, initial item sets
4: More item sets in more detail
Each report level encompasses all lower level numbers.
C:\QPARSER>lr1 prolog6 -l2
QPARSER LALR(1) Parser Generator, version 2.5 *restricted use*
COPYRIGHT (C) 1985, QCAD Systems, Inc. All rights reserved.
LALR(1) Parser Generator, version 2.5 &&&&&&&&&&&&&&&&
COPYRIGHT (C) 1985, QCAD Systems, Inc. All rights reserved.
Grammar file = prolog6.GRM
Report file = CON:
Report level = 2
LALR stack size = 50
Table file = prolog6.TBL
Memory available 28661
----------------------
Productions
1 Start -> Prolog
2
2 Prolog -> Prolog Clause
3 -> Clause
4
4 Clause -> Goals '.'
5 -> Goals ':-' Goals '.'
6
6 Goals -> Goals ',' Goal
7 -> Goal
8
8 Goal -> Predicate '(' Components ')'
9
9 Components -> Components ',' Component
10 -> Component
11
11 Component -> Functor '(' Components ')'
12 -> '<VARIABLE>'
13 -> Constant
14 -> List
15
15 Constant -> '<NUMBER>'
16 -> '<ATOM>'
17
17 Functor -> '<ATOM>'
18
18 Predicate -> '<ATOM>'
19
19 List -> '[' ']'
20 -> '[' Head ']'
21 -> '[' Head '|' Tail ']'
22
22 Head -> Components
23
23 Tail -> List
24
Memory available 27117
Terminal tokens
1: (
2: )
3: ,
4: .
5: :-
6: <ATOM>
7: <NUMBER>
8: <VARIABLE>
9: <empty>
10: <eol>
11: <identifier>
12: <integer>
13: <real>
14: <stop>
15: <string>
16: [
17: ]
18: |
Nonterminal tokens
19: Clause
20: Component
21: Components
22: Constant
23: Functor
24: Goal
25: Goals
26: Head
27: List
28: Predicate
29: Prolog
30: Start
31: Tail
State building complete
Memory available 26755
Memory available 26730
Mixed read-reduce states split
36 LALR items required
Memory available 26525
Memory available 26499
READS completed
INCLUDES completed: max stack= 4
36 LALR list items
Memory available 26525
0 conflicts found.
Resolution complete
Untagged single productions removed
Inaccessible state: 5
Inaccessible state: 6
Inaccessible state: 16
Inaccessible state: 19
Inaccessible state: 22
Inaccessible state: 35
Inaccessible states removed
Read tables compressed
Reduce tables compressed
Parser table reduction complete
States renumbered
State Machine
Start state: 18, initial stack state: 18
0: HALT
1: REDUCE
18 [Predicate -> <ATOM> |]
- On stack state 34 => 20
- On stack state 22 => 20
- On stack state 21 => 20
- On stack state 18 => 20
2: REDUCE
4 [Clause -> Goals . |]
- On stack state 18 => 37
On stack state 34 => 3
3: REDUCE
2 [Prolog -> Prolog Clause |]
- On stack state 18 => 37
4: REDUCE
6 [Goals -> Goals , Goal |]
- On stack state 34 => 19
- On stack state 18 => 19
On stack state 21 => 24
5: REDUCE
15 [Constant -> <NUMBER> |]
- On stack state 23 => 27
On stack state 25 => 39
On stack state 29 => 32
On stack state 30 => 11
6: REDUCE
12 [Component -> <VARIABLE> |]
- On stack state 23 => 27
On stack state 25 => 39
On stack state 29 => 32
On stack state 30 => 11
7: REDUCE (= 2)
5 [Clause -> Goals :- Goals . |]
- On stack state 18 => 37
On stack state 34 => 3
8: REDUCE
19 [List -> [ ] |]
- On stack state 23 => 27
On stack state 25 => 39
On stack state 29 => 32
On stack state 30 => 11
On stack state 31 => 33
9: REDUCE
8 [Goal -> Predicate ( Components ) |]
- On stack state 34 => 19
- On stack state 18 => 19
On stack state 21 => 24
On stack state 22 => 4
10: REDUCE (= 8)
20 [List -> [ Head ] |]
- On stack state 23 => 27
On stack state 25 => 39
On stack state 29 => 32
On stack state 30 => 11
On stack state 31 => 33
11: REDUCE
9 [Components -> Components , Component |]
- On stack state 23 => 27
On stack state 25 => 39
On stack state 29 => 32
12: REDUCE (= 6)
11 [Component -> Functor ( Components ) |]
- On stack state 23 => 27
On stack state 25 => 39
On stack state 29 => 32
On stack state 30 => 11
13: REDUCE (= 8)
21 [List -> [ Head | Tail ] |]
- On stack state 23 => 27
On stack state 25 => 39
On stack state 29 => 32
On stack state 30 => 11
On stack state 31 => 33
14: REDUCE
1 [Start -> Prolog |]
- On stack state 18 => 0
15: REDUCE (= 5)
16 [Constant -> <ATOM> |]
- On stack state 23 => 27
On stack state 25 => 39
On stack state 29 => 32
On stack state 30 => 11
16: REDUCE
17 [Functor -> <ATOM> |]
- On stack state 30 => 26
- On stack state 29 => 26
- On stack state 25 => 26
- On stack state 23 => 26
17: REDUCE
22 [Head -> Components |]
- On stack state 25 => 28
18: READ
On <ATOM> => 1
19: READ
On , => 22
On . => 2
On :- => 21
20: READ
On ( => 23
21: READ (= 18)
On <ATOM> => 1
22: READ (= 18)
On <ATOM> => 1
23: READ
On <ATOM> => 38
On <NUMBER> => 5
On <VARIABLE> => 6
On [ => 25
24: READ
On , => 22
On . => 7
25: READ
On <ATOM> => 38
On <NUMBER> => 5
On <VARIABLE> => 6
On [ => 25
On ] => 8
26: READ
On ( => 29
27: READ
On ) => 9
On , => 30
28: READ
On ] => 10
On | => 31
29: READ (= 23)
On <ATOM> => 38
On <NUMBER> => 5
On <VARIABLE> => 6
On [ => 25
30: READ (= 23)
On <ATOM> => 38
On <NUMBER> => 5
On <VARIABLE> => 6
On [ => 25
31: READ
On [ => 25
32: READ
On ) => 12
On , => 30
33: READ
On ] => 13
34: READ (= 18)
On <ATOM> => 1
35: READ
36: READ
On , => 30
37: LOOK
- On { <ATOM> } => 34
On { <stop> } => 14
38: LOOK
On { } => 35
- On { ) , ] | } => 15
On { ( } => 16
39: LOOK
On { , } => 36
- On { ] | } => 17
No errors or warnings.
C:\QPARSER>
C:\QPARSER>gramchk
QPARSER Grammar Checker, version 2.4
COPYRIGHT (C) 1985, QCAD Systems, Inc. All rights reserved.
Usage:
GRAMCHK grammarfile[.GRM] [ -l reportfile[.TXT] ]
Option:
-l# report level:=# (default = 0)
The report levels are as follows:
0: Grammar and inspection report
1: Grammar cross-reference table
2: First/follow/predecessor sets
3: Grammar statistics
A large report level implies printing everything at a lower level
C:\QPARSER>gramchk prolog6 -l1
QPARSER Grammar Checker, version 2.4
COPYRIGHT (C) 1985, QCAD Systems, Inc. All rights reserved.
GRAMCHK grammar report and checking utility, version 2.4
COPYRIGHT (C) 1985, QCAD Systems, Inc. All rights reserved.
Grammar file = prolog6.GRM
Report file = CON:
Report level = 1
LALR stack size = 50
Table file = prolog6.TBL
----------------------
Productions
1 Start -> Prolog
2
2 Prolog -> Prolog Clause
3 -> Clause
4
4 Clause -> Goals '.'
5 -> Goals ':-' Goals '.'
6
6 Goals -> Goals ',' Goal
7 -> Goal
8
8 Goal -> Predicate '(' Components ')'
9
9 Components -> Components ',' Component
10 -> Component
11
11 Component -> Functor '(' Components ')'
12 -> '<VARIABLE>'
13 -> Constant
14 -> List
15
15 Constant -> '<NUMBER>'
16 -> '<ATOM>'
17
17 Functor -> '<ATOM>'
18
18 Predicate -> '<ATOM>'
19
19 List -> '[' ']'
20 -> '[' Head ']'
21 -> '[' Head '|' Tail ']'
22
22 Head -> Components
23
23 Tail -> List
24
------------------
Alphabetized productions
4: Clause -> Goals .
5: Clause -> Goals :- Goals .
11: Component -> Functor ( Components )
12: Component -> <VARIABLE>
13: Component -> Constant
14: Component -> List
9: Components -> Components , Component
10: Components -> Component
15: Constant -> <NUMBER>
16: Constant -> <ATOM>
17: Functor -> <ATOM>
8: Goal -> Predicate ( Components )
6: Goals -> Goals , Goal
7: Goals -> Goal
22: Head -> Components
19: List -> [ ]
20: List -> [ Head ]
21: List -> [ Head | Tail ]
18: Predicate -> <ATOM>
2: Prolog -> Prolog Clause
3: Prolog -> Clause
1: *Start -> Prolog
23: Tail -> List
------------------
Token cross-reference table
TERMINAL tokens
1. ( 8 11
2. ) 8 11
3. , 6 9
4. . 4 5
5. :- 5
6. <ATOM> 16 17 18
7. <NUMBER> 15
8. <VARIABLE> 12
9. <empty>
10. <eol>
11. <identifier>
12. <integer>
13. <real>
14. <stop>
15. <string>
16. [ 19 20 21
17. ] 19 20 21
18. | 21
NONTERMINAL tokens
19. Clause 2 3 4* 5*
20. Component 9 10 11* 12* 13* 14*
21. Components 8 9* 9 10* 11 22
22. Constant 13 15* 16*
23. Functor 11 17*
24. Goal 6 7 8*
25. Goals 4 5 5 6* 6 7*
26. Head 20 21 22*
27. List 14 19* 20* 21* 23
28. Predicate 8 18*
29. Prolog 1 2* 2 3*
30. Start 1*
31. Tail 21 23*
------------------------
The following special terminals have appeared
in the grammar:
------------------------
Checking for useless productions and the possibility that
the goal symbol fails to derive any terminal string
A complaint means that the grammar should be reduced
or repaired.
... no useless productions
... goal symbol derives at least one terminal string
------------------------
Checking for any tokens, terminal or nonterminal,
that cannot be derived from the goal.
If any such are found, the grammar is not strongly
connected and should be repaired.
... no problems detected
------------------------
Nullable nonterminals: none found
------------------------
Checking for any single production cycles, e.g.
A ->+ A
If one exists, the grammar is ambiguous.
(A cycle may be reported more than once)
... no cycles detected
------------------------
Checking for any nonterminals that fail to derive a single
terminal token. A complaint is NOT an error. You may choose
to add an error production for each such nonterminal in order
to improve error recovery. Just create a unique error terminal
token, e.g. ERROR_01, then add the production X -> ERROR_01
NOTE: No production of the form Clause -> x, where x is terminal
NOTE: No production of the form Components -> x, where x is terminal
NOTE: No production of the form Goal -> x, where x is terminal
NOTE: No production of the form Goals -> x, where x is terminal
NOTE: No production of the form Head -> x, where x is terminal
NOTE: No production of the form List -> x, where x is terminal
NOTE: No production of the form Prolog -> x, where x is terminal
NOTE: No production of the form Start -> x, where x is terminal
NOTE: No production of the form Tail -> x, where x is terminal
No errors or warnings.
C:\QPARSER>lr1 psg3
QPARSER LALR(1) Parser Generator, version 2.5 *restricted use*
COPYRIGHT (C) 1985, QCAD Systems, Inc. All rights reserved.
LALR(1) Parser Generator, version 2.5 &&&&&&&&&&&&&&&&
COPYRIGHT (C) 1985, QCAD Systems, Inc. All rights reserved.
----------------------
Productions
1
1 PSG -> Program
2 Program -> ProgHead ProgParms ';' Pblk Pblock '.'
3
3 ProgHead -> 'PROGRAM' '<IDENTIFIER>'
4 ProgParms ->
5
5 Pblock -> LBList TYPList VRList PList Pbegin StmtList 'END'
6 Pbegin -> 'BEGIN'
7
7 Block -> 'BEGIN' StmtList 'END'
8
8 LBList -> 'LABEL' LabList ';'
9 ->
10 LabList -> LabList ',' '<INTEGER>'
11 -> '<INTEGER>'
12
12 VRList -> Var VList ';'
13 ->
14 Var -> 'VAR'
15 VList -> VList ';' VarItem
16 -> VarItem
17 VarItem -> IdentList ':' Type
18 IdentList -> IdentList ',' '<IDENTIFIER>'
19 -> '<IDENTIFIER>'
20
20 TYPList -> 'TYPE' TList ';'
21 ->
22 TList -> TList ';' TypItem
23 -> TypItem
24 TypItem -> '<IDENTIFIER>' '=' Type
25
25 Type -> SimpType
26 -> 'ARRAY' '[' Sint '..' Sint ']' 'OF' Type
27 -> 'RECORD' FieldList 'END'
28
28 SimpType -> '<IDENTIFIER>'
29
29
29 FieldList -> IdentList ':' Type
30 -> IdentList ':' Type ';' FieldList
31 -> 'CASE' SimpType 'OF' CaseList
32
32
32 CaseList -> CaseItem ';' CaseList
33 -> CaseItem
34 CaseItem -> ConstList ':' '(' FieldList ')'
35
35 PList -> PList PFDecl
36 ->
37 PFDecl -> ProcDecl
38 -> FuncDecl
39 ProcDecl -> ProcHead Parms ';' 'FORWARD' ';'
40 -> ProcHead Parms ';' Pblk Pblock ';'
41 ProcHead -> 'PROCEDURE' '<IDENTIFIER>'
42 FuncDecl -> FuncHead Parms ':' '<IDENTIFIER>' ';' 'FORWARD' ';'
43 -> FuncHead Parms ':' '<IDENTIFIER>' ';' Fblk Pblock ';'
44 FuncHead -> 'FUNCTION' '<IDENTIFIER>'
45 Parms ->
46 -> '(' ParmList ')'
47 ParmList -> ParmList ';' Parm
48 -> Parm
49 Parm -> 'VAR' IdentList ':' SimpType
50 -> IdentList ':' SimpType
51 Pblk ->
52 Fblk ->
53
53 StmtList -> StmtList ';' Stmt
54 -> Stmt
55 Stmt -> 'IF' Boolean Then Stmt
56 -> 'IF' Boolean Then Stmt Else Stmt
57 -> 'WHILE' Boolean Do Stmt
58 -> Repeat StmtList 'UNTIL' Boolean
59 -> 'FOR' VarHead ':=' Boolean 'TO' Boolean Fup Stmt
60 -> 'FOR' VarHead ':=' Boolean 'DOWNTO' Boolean Fdown Stmt
61 -> Variable ':=' Boolean
62 -> ProcCall
63 -> '<IDENTIFIER>'
64 -> 'GOTO' '<INTEGER>'
65 -> Label ':' Stmt
66 -> Block
67 -> ReadWrite '(' IOList ')'
68 ->
69 Then -> 'THEN'
70 Else -> 'ELSE'
71 Fup -> 'DO'
72 Fdown -> 'DO'
73 Do -> 'DO'
74 Repeat -> 'REPEAT'
75 Label -> '<INTEGER>'
76 ReadWrite -> 'READ'
77 -> 'WRITE'
78
78 IOList -> IOList ',' IOItem
79 -> IOItem
80 IOItem -> Boolean
81 -> '<string>'
82
82 ProcCall -> '<IDENTIFIER>' '(' BoolList ')'
83 BoolList -> BoolList ',' Boolean
84 -> Boolean
85
85 Boolean -> BoolTerm
86 -> Boolean 'OR' BoolTerm
87 BoolTerm -> BoolUnary
88 -> BoolTerm 'AND' BoolUnary
89 BoolUnary -> BoolPri
90 -> 'NOT' BoolPri
91 BoolPri -> Expr
92 -> Expr Relop Expr
93
93 Relop -> '<'
94 -> '>'
95 -> '<='
96 -> '>='
97 -> '='
98 -> '<>'
99
99 Expr -> Expr '+' Term
100 -> Expr '-' Term
101 -> Term
102 Term -> Term '*' Unary
103 -> Term '/' Unary
104 -> Term 'MOD' Unary
105 -> Term 'DIV' Unary
106 -> Unary
107 Unary -> Primary
108 -> '-' Primary
109 Primary -> '(' Boolean ')'
110 -> ProcCall
111 -> Variable
112 -> Constant
113
113 Variable -> VarHead VarExtension
114 VarHead -> '<IDENTIFIER>'
115 VarExtension -> VarExtension VarExt
116 ->
117 VarExt -> '[' BoolList ']'
118 -> '.' '<IDENTIFIER>'
119
119 Constant -> '<REAL>'
120 -> '<INTEGER>'
121 -> 'TRUE'
122 -> 'FALSE'
123 ConstList -> ConstList ',' Constant
124 -> Constant
125 Sint -> '<INTEGER>'
126 -> '-' '<INTEGER>'
State building complete
Mixed read-reduce states split
401 LALR items required
READS completed
INCLUDES completed: max stack= 13
401 LALR list items
------------------------
LOOKAHEAD conflict on tokens ELSE
205: LOOK , insymbol Stmt
On { ELSE } => 309
On { ; ELSE END UNTIL } => 310
309: READ , insymbol Stmt
70 [Else -> | ELSE] => 220
*56 [Stmt -> IF Boolean Then Stmt | Else Stmt] => 221
310: REDUCE , insymbol Stmt
55 [Stmt -> IF Boolean Then Stmt |]
... fully resolved in favor of READ
Lookahead state AFTER resolution:
205: LOOK , insymbol Stmt
On { ELSE } => 309
On { ; END UNTIL } => 310
1 conflict found and resolved.
PLEASE EXAMINE THE CONFLICT REPORT
... parser may not do what you expect
Resolution complete
Untagged single productions removed
Inaccessible states removed
Read tables compressed
Reduce tables compressed
Parser table reduction complete
States renumbered
1 ERROR
C:\QPARSER>gramchk psg3
QPARSER Grammar Checker, version 2.4
COPYRIGHT (C) 1985, QCAD Systems, Inc. All rights reserved.
GRAMCHK grammar report and checking utility, version 2.4
COPYRIGHT (C) 1985, QCAD Systems, Inc. All rights reserved.
----------------------
Productions
1
1 PSG -> Program
2 Program -> ProgHead ProgParms ';' Pblk Pblock '.'
3
3 ProgHead -> 'PROGRAM' '<IDENTIFIER>'
4 ProgParms ->
5
5 Pblock -> LBList TYPList VRList PList Pbegin StmtList 'END'
6 Pbegin -> 'BEGIN'
7
7 Block -> 'BEGIN' StmtList 'END'
8
8 LBList -> 'LABEL' LabList ';'
9 ->
10 LabList -> LabList ',' '<INTEGER>'
11 -> '<INTEGER>'
12
12 VRList -> Var VList ';'
13 ->
14 Var -> 'VAR'
15 VList -> VList ';' VarItem
16 -> VarItem
17 VarItem -> IdentList ':' Type
18 IdentList -> IdentList ',' '<IDENTIFIER>'
19 -> '<IDENTIFIER>'
20
20 TYPList -> 'TYPE' TList ';'
21 ->
22 TList -> TList ';' TypItem
23 -> TypItem
24 TypItem -> '<IDENTIFIER>' '=' Type
25
25 Type -> SimpType
26 -> 'ARRAY' '[' Sint '..' Sint ']' 'OF' Type
27 -> 'RECORD' FieldList 'END'
28
28 SimpType -> '<IDENTIFIER>'
29
29
29 FieldList -> IdentList ':' Type
30 -> IdentList ':' Type ';' FieldList
31 -> 'CASE' SimpType 'OF' CaseList
32
32
32 CaseList -> CaseItem ';' CaseList
33 -> CaseItem
34 CaseItem -> ConstList ':' '(' FieldList ')'
35
35 PList -> PList PFDecl
36 ->
37 PFDecl -> ProcDecl
38 -> FuncDecl
39 ProcDecl -> ProcHead Parms ';' 'FORWARD' ';'
40 -> ProcHead Parms ';' Pblk Pblock ';'
41 ProcHead -> 'PROCEDURE' '<IDENTIFIER>'
42 FuncDecl -> FuncHead Parms ':' '<IDENTIFIER>' ';' 'FORWARD' ';'
43 -> FuncHead Parms ':' '<IDENTIFIER>' ';' Fblk Pblock ';'
44 FuncHead -> 'FUNCTION' '<IDENTIFIER>'
45 Parms ->
46 -> '(' ParmList ')'
47 ParmList -> ParmList ';' Parm
48 -> Parm
49 Parm -> 'VAR' IdentList ':' SimpType
50 -> IdentList ':' SimpType
51 Pblk ->
52 Fblk ->
53
53 StmtList -> StmtList ';' Stmt
54 -> Stmt
55 Stmt -> 'IF' Boolean Then Stmt
56 -> 'IF' Boolean Then Stmt Else Stmt
57 -> 'WHILE' Boolean Do Stmt
58 -> Repeat StmtList 'UNTIL' Boolean
59 -> 'FOR' VarHead ':=' Boolean 'TO' Boolean Fup Stmt
60 -> 'FOR' VarHead ':=' Boolean 'DOWNTO' Boolean Fdown Stmt
61 -> Variable ':=' Boolean
62 -> ProcCall
63 -> '<IDENTIFIER>'
64 -> 'GOTO' '<INTEGER>'
65 -> Label ':' Stmt
66 -> Block
67 -> ReadWrite '(' IOList ')'
68 ->
69 Then -> 'THEN'
70 Else -> 'ELSE'
71 Fup -> 'DO'
72 Fdown -> 'DO'
73 Do -> 'DO'
74 Repeat -> 'REPEAT'
75 Label -> '<INTEGER>'
76 ReadWrite -> 'READ'
77 -> 'WRITE'
78
78 IOList -> IOList ',' IOItem
79 -> IOItem
80 IOItem -> Boolean
81 -> '<string>'
82
82 ProcCall -> '<IDENTIFIER>' '(' BoolList ')'
83 BoolList -> BoolList ',' Boolean
84 -> Boolean
85
85 Boolean -> BoolTerm
86 -> Boolean 'OR' BoolTerm
87 BoolTerm -> BoolUnary
88 -> BoolTerm 'AND' BoolUnary
89 BoolUnary -> BoolPri
90 -> 'NOT' BoolPri
91 BoolPri -> Expr
92 -> Expr Relop Expr
93
93 Relop -> '<'
94 -> '>'
95 -> '<='
96 -> '>='
97 -> '='
98 -> '<>'
99
99 Expr -> Expr '+' Term
100 -> Expr '-' Term
101 -> Term
102 Term -> Term '*' Unary
103 -> Term '/' Unary
104 -> Term 'MOD' Unary
105 -> Term 'DIV' Unary
106 -> Unary
107 Unary -> Primary
108 -> '-' Primary
109 Primary -> '(' Boolean ')'
110 -> ProcCall
111 -> Variable
112 -> Constant
113
113 Variable -> VarHead VarExtension
114 VarHead -> '<IDENTIFIER>'
115 VarExtension -> VarExtension VarExt
116 ->
117 VarExt -> '[' BoolList ']'
118 -> '.' '<IDENTIFIER>'
119
119 Constant -> '<REAL>'
120 -> '<INTEGER>'
121 -> 'TRUE'
122 -> 'FALSE'
123 ConstList -> ConstList ',' Constant
124 -> Constant
125 Sint -> '<INTEGER>'
126 -> '-' '<INTEGER>'
------------------
Alphabetized productions
7: Block -> BEGIN StmtList END
83: BoolList -> BoolList , Boolean
84: BoolList -> Boolean
91: BoolPri -> Expr
92: BoolPri -> Expr Relop Expr
87: BoolTerm -> BoolUnary
88: BoolTerm -> BoolTerm AND BoolUnary
89: BoolUnary -> BoolPri
90: BoolUnary -> NOT BoolPri
85: Boolean -> BoolTerm
86: Boolean -> Boolean OR BoolTerm
34: CaseItem -> ConstList : ( FieldList )
32: CaseList -> CaseItem ; CaseList
33: CaseList -> CaseItem
123: ConstList -> ConstList , Constant
124: ConstList -> Constant
119: Constant -> <REAL>
120: Constant -> <INTEGER>
121: Constant -> TRUE
122: Constant -> FALSE
73: Do -> DO
70: Else -> ELSE
99: Expr -> Expr + Term
100: Expr -> Expr - Term
101: Expr -> Term
52: Fblk -> <empty>
72: Fdown -> DO
29: FieldList -> IdentList : Type
30: FieldList -> IdentList : Type ; FieldList
31: FieldList -> CASE SimpType OF CaseList
42: FuncDecl -> FuncHead Parms : <IDENTIFIER> ; FORWARD ;
43: FuncDecl -> FuncHead Parms : <IDENTIFIER> ; Fblk Pblock ;
44: FuncHead -> FUNCTION <IDENTIFIER>
71: Fup -> DO
80: IOItem -> Boolean
81: IOItem -> <string>
78: IOList -> IOList , IOItem
79: IOList -> IOItem
18: IdentList -> IdentList , <IDENTIFIER>
19: IdentList -> <IDENTIFIER>
8: LBList -> LABEL LabList ;
9: LBList -> <empty>
10: LabList -> LabList , <INTEGER>
11: LabList -> <INTEGER>
75: Label -> <INTEGER>
37: PFDecl -> ProcDecl
38: PFDecl -> FuncDecl
35: PList -> PList PFDecl
36: PList -> <empty>
1: *PSG -> Program
49: Parm -> VAR IdentList : SimpType
50: Parm -> IdentList : SimpType
47: ParmList -> ParmList ; Parm
48: ParmList -> Parm
45: Parms -> <empty>
46: Parms -> ( ParmList )
6: Pbegin -> BEGIN
51: Pblk -> <empty>
5: Pblock -> LBList TYPList VRList PList Pbegin StmtList END
109: Primary -> ( Boolean )
110: Primary -> ProcCall
111: Primary -> Variable
112: Primary -> Constant
82: ProcCall -> <IDENTIFIER> ( BoolList )
39: ProcDecl -> ProcHead Parms ; FORWARD ;
40: ProcDecl -> ProcHead Parms ; Pblk Pblock ;
41: ProcHead -> PROCEDURE <IDENTIFIER>
3: ProgHead -> PROGRAM <IDENTIFIER>
4: ProgParms -> <empty>
2: Program -> ProgHead ProgParms ; Pblk Pblock .
76: ReadWrite -> READ
77: ReadWrite -> WRITE
93: Relop -> <
94: Relop -> >
95: Relop -> <=
96: Relop -> >=
97: Relop -> =
98: Relop -> <>
74: Repeat -> REPEAT
28: SimpType -> <IDENTIFIER>
125: Sint -> <INTEGER>
126: Sint -> - <INTEGER>
55: Stmt -> IF Boolean Then Stmt
56: Stmt -> IF Boolean Then Stmt Else Stmt
57: Stmt -> WHILE Boolean Do Stmt
58: Stmt -> Repeat StmtList UNTIL Boolean
59: Stmt -> FOR VarHead := Boolean TO Boolean Fup Stmt
60: Stmt -> FOR VarHead := Boolean DOWNTO Boolean Fdown Stmt
61: Stmt -> Variable := Boolean
62: Stmt -> ProcCall
63: Stmt -> <IDENTIFIER>
64: Stmt -> GOTO <INTEGER>
65: Stmt -> Label : Stmt
66: Stmt -> Block
67: Stmt -> ReadWrite ( IOList )
68: Stmt -> <empty>
53: StmtList -> StmtList ; Stmt
54: StmtList -> Stmt
22: TList -> TList ; TypItem
23: TList -> TypItem
20: TYPList -> TYPE TList ;
21: TYPList -> <empty>
102: Term -> Term * Unary
103: Term -> Term / Unary
104: Term -> Term MOD Unary
105: Term -> Term DIV Unary
106: Term -> Unary
69: Then -> THEN
24: TypItem -> <IDENTIFIER> = Type
25: Type -> SimpType
26: Type -> ARRAY [ Sint .. Sint ] OF Type
27: Type -> RECORD FieldList END
107: Unary -> Primary
108: Unary -> - Primary
15: VList -> VList ; VarItem
16: VList -> VarItem
12: VRList -> Var VList ;
13: VRList -> <empty>
14: Var -> VAR
117: VarExt -> [ BoolList ]
118: VarExt -> . <IDENTIFIER>
115: VarExtension -> VarExtension VarExt
116: VarExtension -> <empty>
114: VarHead -> <IDENTIFIER>
17: VarItem -> IdentList : Type
113: Variable -> VarHead VarExtension
------------------------
The following special terminals have appeared
in the grammar:
<string>
------------------------
Checking for useless productions and the possibility that
the goal symbol fails to derive any terminal string
A complaint means that the grammar should be reduced
or repaired.
... no useless productions
... goal symbol derives at least one terminal string
------------------------
Checking for any tokens, terminal or nonterminal,
that cannot be derived from the goal.
If any such are found, the grammar is not strongly
connected and should be repaired.
... no problems detected
------------------------
Nullable nonterminals: Fblk LBList PList Parms Pblk ProgParms Stmt StmtList
TYPList VRList VarExtension
------------------------
Checking for any single production cycles, e.g.
A ->+ A
If one exists, the grammar is ambiguous.
(A cycle may be reported more than once)
... no cycles detected
------------------------
Checking for any nonterminals that fail to derive a single
terminal token. A complaint is NOT an error. You may choose
to add an error production for each such nonterminal in order
to improve error recovery. Just create a unique error terminal
token, e.g. ERROR_01, then add the production X -> ERROR_01
NOTE: No production of the form Block -> x, where x is terminal
NOTE: No production of the form BoolList -> x, where x is terminal
NOTE: No production of the form BoolPri -> x, where x is terminal
NOTE: No production of the form BoolTerm -> x, where x is terminal
NOTE: No production of the form BoolUnary -> x, where x is terminal
NOTE: No production of the form Boolean -> x, where x is terminal
NOTE: No production of the form CaseItem -> x, where x is terminal
NOTE: No production of the form CaseList -> x, where x is terminal
NOTE: No production of the form ConstList -> x, where x is terminal
NOTE: No production of the form Expr -> x, where x is terminal
NOTE: No production of the form Fblk -> x, where x is terminal
NOTE: No production of the form FieldList -> x, where x is terminal
NOTE: No production of the form FuncDecl -> x, where x is terminal
NOTE: No production of the form FuncHead -> x, where x is terminal
NOTE: No production of the form IOList -> x, where x is terminal
NOTE: No production of the form LBList -> x, where x is terminal
NOTE: No production of the form PFDecl -> x, where x is terminal
NOTE: No production of the form PList -> x, where x is terminal
NOTE: No production of the form PSG -> x, where x is terminal
NOTE: No production of the form Parm -> x, where x is terminal
NOTE: No production of the form ParmList -> x, where x is terminal
NOTE: No production of the form Parms -> x, where x is terminal
NOTE: No production of the form Pblk -> x, where x is terminal
NOTE: No production of the form Pblock -> x, where x is terminal
NOTE: No production of the form Primary -> x, where x is terminal
NOTE: No production of the form ProcCall -> x, where x is terminal
NOTE: No production of the form ProcDecl -> x, where x is terminal
NOTE: No production of the form ProcHead -> x, where x is terminal
NOTE: No production of the form ProgHead -> x, where x is terminal
NOTE: No production of the form ProgParms -> x, where x is terminal
NOTE: No production of the form Program -> x, where x is terminal
NOTE: No production of the form StmtList -> x, where x is terminal
NOTE: No production of the form TList -> x, where x is terminal
NOTE: No production of the form TYPList -> x, where x is terminal
NOTE: No production of the form Term -> x, where x is terminal
NOTE: No production of the form TypItem -> x, where x is terminal
NOTE: No production of the form Type -> x, where x is terminal
NOTE: No production of the form Unary -> x, where x is terminal
NOTE: No production of the form VList -> x, where x is terminal
NOTE: No production of the form VRList -> x, where x is terminal
NOTE: No production of the form VarExt -> x, where x is terminal
NOTE: No production of the form VarExtension -> x, where x is terminal
NOTE: No production of the form VarItem -> x, where x is terminal
NOTE: No production of the form Variable -> x, where x is terminal
No errors or warnings.