-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathParserMessages.messages
416 lines (333 loc) · 18.6 KB
/
ParserMessages.messages
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
program: T_while
## The known suffix of the stack is as follows:
##
Expected 'fun' keyword.
A program must start with the 'fun' keyword.
program: T_fun T_while
## The known suffix of the stack is as follows:
## T_fun
program: T_fun T_identifier T_left_par T_ref T_while
## The known suffix of the stack is as follows:
## T_ref
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_var T_while
## The known suffix of the stack is as follows:
## T_var
program: T_fun T_identifier T_left_par T_identifier T_comma T_while
## The known suffix of the stack is as follows:
## T_comma
# Identifier is missing after keywords fun, ref and var.
Expected identifier.
After 'fun', 'ref', 'var' keywords and comma ',' an identifier is expected.
program: T_fun T_identifier T_while
## The known suffix of the stack is as follows:
## T_fun T_identifier
# Parameter definitions enclosed in parentheses after the identifier of a function header.
Expected opening parenthesis '(' after identifier in function header.
program: T_fun T_identifier T_left_par T_while
## The known suffix of the stack is as follows:
## T_fun T_identifier T_left_par
# Parameter definitions are expected after opening parenthesis in function header.
Expected 'ref' keyword or identifier after opening parenthesis '(' in function header.
program: T_fun T_identifier T_left_par T_right_par T_while
## The known suffix of the stack is as follows:
## T_fun T_identifier T_left_par T_right_par1
program: T_fun T_identifier T_left_par T_identifier T_colon T_char T_right_par T_while
## The known suffix of the stack is as follows:
## T_fun T_identifier T_left_par fpar_def_list T_right_par
program: T_fun T_identifier T_left_par T_identifier T_while
## The known suffix of the stack is as follows:
## T_identifier
program: T_fun T_identifier T_left_par T_ref T_identifier T_while
## The known suffix of the stack is as follows:
## T_ref T_identifier
program: T_fun T_identifier T_left_par T_identifier T_comma T_identifier T_while
## The known suffix of the stack is as follows:
## T_comma T_identifier
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_var T_identifier T_while
## The known suffix of the stack is as follows:
## T_var T_identifier
# A colon ':' is missing.
Expected colon ':'.
After parameter definitions in function header, after parameter identifier list
and after variable identifier list a colon ':' is expected.
program: T_fun T_identifier T_left_par T_right_par T_colon T_while
## The known suffix of the stack is as follows:
## T_fun T_identifier T_left_par T_right_par T_colon
program: T_fun T_identifier T_left_par T_ref T_identifier T_colon T_while
## The known suffix of the stack is as follows:
## T_ref T_identifier id_list T_colon
program: T_fun T_identifier T_left_par T_identifier T_colon T_while
## The known suffix of the stack is as follows:
## T_identifier id_list T_colon
program: T_fun T_identifier T_left_par T_identifier T_colon T_char T_right_par T_colon T_while
## The known suffix of the stack is as follows:
## T_fun T_identifier T_left_par fpar_def_list T_right_par T_colon
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_var T_identifier T_colon T_while
## The known suffix of the stack is as follows:
## T_var T_identifier id_list T_colon
# The data type is missing after a colon ':'.
Expected data type after colon ':'.
A data type must be provided after a colon ':' in a function header, a parameter definition
or a variable definition.
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_var T_identifier T_colon T_char T_while
## The known suffix of the stack is as follows:
## data_type
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_var T_identifier T_colon T_char T_left_sqr T_integer T_right_sqr T_right_par
## The known suffix of the stack is as follows:
## T_var T_identifier id_list T_colon var_type
# The semicolon ';' is missing at the end of a variable definition.
Expected semicolon ';' after variable definition.
After variable definitions a semicolon ';' is expected.
program: T_fun T_identifier T_left_par T_identifier T_colon T_char T_semicolon T_while
## The known suffix of the stack is as follows:
## fpar_def T_semicolon
# A parameter definition is missing or a stray semicolon was added.
Expected parameter definition after semicolon ';'.
(Maybe you mistakenly entered a semicolon ';'?)
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_while
## The known suffix of the stack is as follows:
## T_if
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_while T_while
## The known suffix of the stack is as follows:
## T_while
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_left_par T_while
## The known suffix of the stack is as follows:
## T_left_par
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_left_par T_identifier T_then
## The known suffix of the stack is as follows:
## T_left_par expr
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_left_par T_identifier T_equal T_identifier T_then
## The known suffix of the stack is as follows:
## T_left_par cond
# A condition is missing from an if or a while statement.
Expected condition after 'if' and 'while' keywords.
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_plus T_while
## The known suffix of the stack is as follows:
## T_plus
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_minus T_while
## The known suffix of the stack is as follows:
## T_minus
# An integer expression is expected after a unary operator.
Expected integer expression.
After the unary operator '$0' an integer expression is expected.
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_plus T_while
## The known suffix of the stack is as follows:
## expr T_plus
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_mul T_while
## The known suffix of the stack is as follows:
## expr T_mul
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_mod T_while
## The known suffix of the stack is as follows:
## expr T_mod
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_div T_while
## The known suffix of the stack is as follows:
## expr T_div
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_minus T_while
## The known suffix of the stack is as follows:
## expr T_minus
# An integer expression is expected after an arithmetic operator.
Expected integer expression.
After the arithmetic operator '$0' an integer expression is expected.
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_not_equal T_while
## The known suffix of the stack is as follows:
## expr T_not_equal
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_less_eq T_while
## The known suffix of the stack is as follows:
## expr T_less_eq
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_less T_while
## The known suffix of the stack is as follows:
## expr T_less
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_greater_eq T_while
## The known suffix of the stack is as follows:
## expr T_greater_eq
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_greater T_while
## The known suffix of the stack is as follows:
## expr T_greater
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_equal T_while
## The known suffix of the stack is as follows:
## expr T_equal
# An expression is expected after a logical operator.
Expected expression.
After the comparison operator '$0' an expression is expected.
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_not T_while
## The known suffix of the stack is as follows:
## T_not
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_equal T_identifier T_or T_while
## The known suffix of the stack is as follows:
## cond T_or
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_equal T_identifier T_and T_while
## The known suffix of the stack is as follows:
## cond T_and
# A condition is expected after a logical operator.
Expected condition.
After the logical operator '$0' a condition is expected.
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_then
## The known suffix of the stack is as follows:
## expr
# An expression is used as a condition.
Expected condition, but found expression.
The expression '$0' cannot replace a condition.
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_plus T_identifier T_assignment
## The known suffix of the stack is as follows:
## expr T_plus expr
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_minus T_identifier T_assignment
## The known suffix of the stack is as follows:
## expr T_minus expr
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_minus T_identifier T_assignment
## The known suffix of the stack is as follows:
## T_minus expr
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_plus T_identifier T_assignment
## The known suffix of the stack is as follows:
## T_plus expr
# A comparison operator is expected.
Expected comparison operator after expression.
The expression '$0' cannot replace a condition.
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_not_equal T_identifier T_semicolon
## The known suffix of the stack is as follows:
## expr T_not_equal expr
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_less_eq T_identifier T_semicolon
## The known suffix of the stack is as follows:
## expr T_less_eq expr
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_less T_identifier T_semicolon
## The known suffix of the stack is as follows:
## expr T_less expr
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_greater_eq T_identifier T_semicolon
## The known suffix of the stack is as follows:
## expr T_greater_eq expr
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_greater T_identifier T_semicolon
## The known suffix of the stack is as follows:
## expr T_greater expr
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_equal T_identifier T_semicolon
## The known suffix of the stack is as follows:
## expr T_equal expr
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_equal T_identifier T_or T_left_par T_identifier T_equal T_identifier T_right_par T_while
## The known suffix of the stack is as follows:
## cond T_or cond
# The then keyword is expected.
Expected 'then' or 'do' keyword after the condition '$2 $1 $0'.
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_equal T_identifier T_right_par
## The known suffix of the stack is as follows:
## T_if cond
# The then keyword is expected.
Expected 'then' or 'do' keyword after the condition '$0'.
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_var
## The known suffix of the stack is as follows:
## T_left_br
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_equal T_identifier T_then T_var
## The known suffix of the stack is as follows:
## T_if cond T_then
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_equal T_identifier T_then T_semicolon T_else T_var
## The known suffix of the stack is as follows:
## T_if cond T_then stmt T_else
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_semicolon T_var
## The known suffix of the stack is as follows:
## stmt
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_while T_identifier T_equal T_identifier T_do T_var
## The known suffix of the stack is as follows:
## T_while cond T_do
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_if T_identifier T_equal T_identifier T_then T_semicolon T_var
## The known suffix of the stack is as follows:
## T_if cond T_then stmt
# A local definition is inside a block.
Expected statement.
Note: Local definitions must happen outside of a function's block.
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_string T_while
## The known suffix of the stack is as follows:
## T_string
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_identifier T_while
## The known suffix of the stack is as follows:
## T_identifier
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_identifier T_left_sqr T_identifier T_right_sqr T_while
## The known suffix of the stack is as follows:
## l_value_comp T_left_sqr expr T_right_sqr
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_identifier T_then
## The known suffix of the stack is as follows:
## l_value
# An assignment statement is left incomplete.
Expected assignment operator '<-'.
The assignment statement is left incomplete.
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_identifier T_assignment T_while
## The known suffix of the stack is as follows:
## l_value T_assignment
# The expression is missing from the assignment statement.
Expected expression after assignment operator '<-'.
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_return T_while
## The known suffix of the stack is as follows:
## T_return
# After the return keyword an expression or a semicolon ';' is expected.
Expected semicolon ';' or expression after the 'return' keyword.
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_return T_identifier T_then
## The known suffix of the stack is as follows:
## T_return expr
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_identifier T_assignment T_identifier T_then
## The known suffix of the stack is as follows:
## l_value T_assignment expr
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_identifier T_left_par T_right_par T_while
## The known suffix of the stack is as follows:
## func_call
# A semicolon ';' is missing from the end of a statement.
Expected semicolon ';' at the end of statement.
(Maybe you forgot a semicolon ';'?)
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_while
## The known suffix of the stack is as follows:
## header
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_fun T_identifier T_left_par T_right_par T_colon T_char T_while
## The known suffix of the stack is as follows:
## header
Expected semicolon ';', local definitions or block after the function header '$0'.
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_var T_identifier T_colon T_char T_semicolon T_while
## The known suffix of the stack is as follows:
## local_def
Expected local definitions or block after local definition '$0'.
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_right_br T_while
## The known suffix of the stack is as follows:
## func_def
Expected End-of-file (EOF) character at the end of the block of the base function.
program: T_fun T_identifier T_left_par T_identifier T_colon T_char T_while
## The known suffix of the stack is as follows:
## data_type
program: T_fun T_identifier T_left_par T_identifier T_colon T_char T_left_sqr T_right_sqr T_while
## The known suffix of the stack is as follows:
## data_type T_left_sqr T_right_sqr
program: T_fun T_identifier T_left_par T_identifier T_colon T_char T_left_sqr T_integer T_right_sqr T_while
## The known suffix of the stack is as follows:
## T_left_sqr T_integer T_right_sqr
Expected semicolon ';', opening square bracket '[' or closing parenthesis ')' after a parameter type.
program: T_fun T_identifier T_left_par T_identifier T_colon T_char T_left_sqr T_while
## The known suffix of the stack is as follows:
## data_type T_left_sqr
program: T_fun T_identifier T_left_par T_identifier T_colon T_char T_left_sqr T_right_sqr T_left_sqr T_while
## The known suffix of the stack is as follows:
## T_left_sqr
# An integer is expected inside the square brackets of a parameter type or a variable type.
Expected integer expression (or closing square bracket ']' for parameter type) inside the square
brackets of a parameter/variable type.
program: T_fun T_identifier T_left_par T_identifier T_colon T_char T_left_sqr T_integer T_while
## The known suffix of the stack is as follows:
## T_left_sqr T_integer
# Unclosed parenthesis/bracket/square bracket.
Expected a closing square bracket ']'. The corresponding opening square bracket '[' is unclosed.
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_return T_left_par T_while
## The known suffix of the stack is as follows:
## T_left_par
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_identifier T_left_sqr T_while
## The known suffix of the stack is as follows:
## l_value_comp T_left_sqr
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_return T_left_par T_identifier T_then
## The known suffix of the stack is as follows:
## T_left_par expr
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_identifier T_left_sqr T_identifier T_then
## The known suffix of the stack is as follows:
## l_value_comp T_left_sqr expr
# An expression is expected inside parentheses.
Expected expression inside enclosing symbols (parentheses, brackets, square brackets).
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_identifier T_left_par T_while
## The known suffix of the stack is as follows:
## T_identifier T_left_par
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_identifier T_left_par T_identifier T_then
## The known suffix of the stack is as follows:
## expr
program: T_fun T_identifier T_left_par T_right_par T_colon T_char T_left_br T_identifier T_left_par T_identifier T_comma T_while
## The known suffix of the stack is as follows:
## expr T_comma
Expected a closing parenthesis ')' or expression list inside the parentheses of a function call.