-
Notifications
You must be signed in to change notification settings - Fork 2
/
massaged.txt
151 lines (101 loc) · 2.12 KB
/
massaged.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
TOKENS - + not mulop assignop addop relop , call end begin . ; ) ( program id var : array [ ] num of integer real procedure
program ->
program id ( identifier_list ) ; declarations subprogram_declarations compound_statement .
identifier_list ->
id
identifier_list ->
identifier_list , id
declarations ->
declarations var id : type ;
declarations ->
e
type ->
standard_type
type ->
array [ num .. num ] of standard_type
standard_type ->
integer
standard_type ->
real
subprogram_declarations ->
subprogram_declarations subprogram_declaration ;
subprogram_declarations ->
e
subprogram_declaration ->
subprogram_head declarations subprogram_declarations compound_statement
subprogram_head ->
procedure id arugments ;
arugments ->
( parameter_list )
arugments ->
e
parameter_list ->
id : type
parameter_list ->
parameter_list ; id : type
compound_statement ->
begin optional_statements end
optional_statements ->
statement_list
optional_statements ->
e
statement_list ->
statement
statement_list ->
statement_list ; statement
statement ->
matched_statement
statement ->
unmatched_statement
matched_statement ->
if expression then matched_statement else matched_statement
matched_statement ->
variable assignop expression
matched_statement ->
procedure_statement
matched_statement ->
compound_statement
matched_statement ->
while expression do statement
unmatched_statement ->
if expression then statement
unmatched_statement ->
if expression then matched_statement else unmatched_statement
variable ->
id
variable ->
id [ expression ]
procedure_statement ->
call id
procedure_statement ->
call id ( expression_list )
expression_list ->
expression
expression_list ->
expression_list , expression
expression ->
simple_expression
expression ->
simple_expression relop simple_expression
simple_expression ->
term
simple_expression ->
sign_term
simple_expression ->
simple_expression addop term
term ->
factor
term ->
term mulop factor
factor ->
id
factor ->
num
factor ->
( expression )
factor ->
not factor
sign ->
+
sign ->
-