-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrammer_after_cut.txt
106 lines (106 loc) · 2.15 KB
/
grammer_after_cut.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
PROGRAM→program IDENTIFIER ; PARTOFPROGRAM
PARTOFPROGRAM→VARIABLESTATEMENTS begin SENTENCEFORM end.
VARIABLESTATEMENTS→var VARIABLESTATEMENTSFORM ;
VARIABLESTATEMENTSFORM→VARIABLEFORM : TYPE VARIABLESTATEMENTSFORM'
VARIABLESTATEMENTSFORM'→, VARIABLESTATEMENTSFORM
VARIABLESTATEMENTSFORM'→ε
TYPE→integer
TYPE→real
VARIABLEFORM→VARIABLE VARIABLEFORM'
VARIABLEFORM'→, VARIABLEFORM
VARIABLEFORM'→ε
SENTENCEFORM→SENTENCE SENTENCEFORM'
SENTENCEFORM'→; SENTENCEFORM
SENTENCEFORM'→ε
SENTENCE→ASSIGNMENTSENTENCE
SENTENCE→CONDITIONSENTENCE
SENTENCE→WHILESENTENCE
SENTENCE→COMPLEXSENTENCE
ASSIGNMENTSENTENCE→VARIABLE := OPERATIONEXPRESSION
CONDITIONSENTENCE→if REATIONSHIPEXPRESSION then SENTENCE else SENTENCE
WHILESENTENCE→while REATIONSHIPEXPRESSION do SENTENCE
COMPLEXSENTENCE→begin SENTENCEFORM end
OPERATIONEXPRESSION→TERM
OPERATIONEXPRESSION→+ TERM , OPERATIONEXPRESSION
OPERATIONEXPRESSION→- TERM , OPERATIONEXPRESSION
TERM→FACTOR
TERM→* FACTOR , TERM
TERM→/ FACTOR , TERM
FACTOR→VARIABLE
FACTOR→CONSTANT
REATIONSHIPEXPRESSION→OPERATIONEXPRESSION REATIONSHIPOPERATOR OPERATIONEXPRESSION
VARIABLE→IDENTIFIER
IDENTIFIER→ALPHABET
IDENTIFIER'→IDENTIFIER NUM
IDENTIFIER'→IDENTIFIER
IDENTIFIER'→ε
CONSTANT→WHOLENUM
WHOLENUM→NUM WHOLENUM'
WHOLENUM'→WHOLENUM
WHOLENUM'→ε
REATIONSHIPOPERATOR→<
REATIONSHIPOPERATOR→<=
REATIONSHIPOPERATOR→=
REATIONSHIPOPERATOR→>=
ALPHABET→A
ALPHABET→B
ALPHABET→C
ALPHABET→D
ALPHABET→E
ALPHABET→F
ALPHABET→G
ALPHABET→H
ALPHABET→I
ALPHABET→J
ALPHABET→K
ALPHABET→L
ALPHABET→M
ALPHABET→N
ALPHABET→O
ALPHABET→P
ALPHABET→Q
ALPHABET→R
ALPHABET→S
ALPHABET→T
ALPHABET→U
ALPHABET→V
ALPHABET→W
ALPHABET→X
ALPHABET→Y
ALPHABET→Z
ALPHABET→a
ALPHABET→b
ALPHABET→c
ALPHABET→d
ALPHABET→e
ALPHABET→f
ALPHABET→g
ALPHABET→h
ALPHABET→i
ALPHABET→j
ALPHABET→k
ALPHABET→l
ALPHABET→m
ALPHABET→n
ALPHABET→o
ALPHABET→p
ALPHABET→q
ALPHABET→r
ALPHABET→s
ALPHABET→t
ALPHABET→u
ALPHABET→v
ALPHABET→w
ALPHABET→x
ALPHABET→y
ALPHABET→z
NUM→0
NUM→1
NUM→2
NUM→3
NUM→4
NUM→5
NUM→6
NUM→7
NUM→8
NUM→9