]>
Commit | Line | Data |
---|---|---|
817e9f41 | 1 | # Exercising Bison on actual grammars. -*- Autotest -*- |
2740f169 | 2 | |
db34f798 JD |
3 | # Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004, |
4 | # 2005, 2007, 2009 Free Software Foundation, Inc. | |
817e9f41 | 5 | |
f16b0819 | 6 | # This program is free software: you can redistribute it and/or modify |
817e9f41 | 7 | # it under the terms of the GNU General Public License as published by |
f16b0819 PE |
8 | # the Free Software Foundation, either version 3 of the License, or |
9 | # (at your option) any later version. | |
10 | # | |
817e9f41 AD |
11 | # This program is distributed in the hope that it will be useful, |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | # GNU General Public License for more details. | |
f16b0819 | 15 | # |
817e9f41 | 16 | # You should have received a copy of the GNU General Public License |
f16b0819 | 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
817e9f41 AD |
18 | |
19 | AT_BANNER([[Existing Grammars.]]) | |
817e9f41 | 20 | |
db34f798 JD |
21 | # AT_TEST_EXISTING_GRAMMAR(DESCRIPTION, |
22 | # DECLS, GRAMMAR, INPUT, | |
23 | # BISON-STDERR, LAST-STATE, LALR1-DIFF, | |
24 | # [OTHER-CHECKS], | |
25 | # [PARSER-EXIT-VALUE], | |
26 | # [PARSER-STDOUT], [PARSER-STDERR]) | |
27 | # -------------------------------------------------------------- | |
28 | m4_define([AT_TEST_EXISTING_GRAMMAR], [_AT_TEST_EXISTING_GRAMMAR([$][1], $@)]) | |
29 | ||
30 | m4_define([_AT_TEST_EXISTING_GRAMMAR], | |
31 | [ | |
32 | dnl See how the parser tables have changed. As the .output format evolves, the | |
33 | dnl diff comments with line numbers might be a pain to maintain. When that | |
34 | dnl time comes, just use sed to drop the line numbers. For now, as LR(1) | |
35 | dnl support is rapidly evolving, let's keep that information to be careful. | |
36 | dnl However, we don't do diffs for canonical LR(1) because the diff is huge. | |
37 | m4_pushdef([AT_LALR1_DIFF_CHECK], | |
38 | [AT_CHECK([[sed 's/^%define lr.type .*$//' input.y > input-lalr.y]]) | |
39 | AT_BISON_CHECK([[--report=all input-lalr.y]], [[0]], [ignore], [ignore]) | |
40 | AT_CHECK([[diff -u input-lalr.output input.output \ | |
41 | | sed -n '/^@@/,$p' | sed 's/^ $//']], | |
42 | [[0]], [$1])]) | |
43 | ||
44 | AT_TEST_TABLES_AND_PARSE([$2[: LALR(1)]], [[LALR]], [[last-state]], | |
45 | [[%define lr.type "LALR" | |
46 | ]$3], | |
47 | [$4], [$5], [$6], [$7], | |
48 | [AT_LALR1_DIFF_CHECK([$8])$9]m4_if($#, 8, [], | |
49 | $#, 9, [], | |
50 | [, m4_shiftn(9, | |
51 | $@)])) | |
52 | AT_TEST_TABLES_AND_PARSE([$2[: IELR(1)]], [[IELR]], [[last-state]], | |
53 | [[%define lr.type "IELR" | |
54 | ]$3], | |
55 | [$4], [$5], [$6], [$7], | |
56 | [AT_LALR1_DIFF_CHECK([$8])$9]m4_if($#, 8, [], | |
57 | $#, 9, [], | |
58 | [, m4_shiftn(9, | |
59 | $@)])) | |
60 | AT_TEST_TABLES_AND_PARSE([$2[: Canonical LR(1)]], [[canonical LR]], | |
61 | [[last-state,no-xml]], | |
62 | [[%define lr.type "canonical LR" | |
63 | ]$3], | |
64 | [$4], [$5], [$6], [$7], | |
65 | [$9]m4_if($#, 8, [], $#, 9, [], [, m4_shiftn(9, $@)])) | |
66 | ||
67 | m4_popdef([AT_LALR1_DIFF_CHECK]) | |
68 | ]) | |
69 | ||
70 | ||
71 | ||
72 | ## ----------------------- ## | |
73 | ## GNU AWK 3.1.0 Grammar. ## | |
74 | ## ----------------------- ## | |
817e9f41 AD |
75 | |
76 | # We have been careful to strip all the actions excepts the | |
db34f798 | 77 | # mid-rule actions. |
817e9f41 | 78 | # |
db34f798 JD |
79 | # There are 65 SR conflicts. Bison was once wrong, due to an incorrect |
80 | # computation of nullable. It reported 485 SR conflicts! | |
817e9f41 | 81 | |
db34f798 JD |
82 | AT_TEST_EXISTING_GRAMMAR([[GNU AWK 3.1.0 Grammar]], |
83 | [[%error-verbose | |
817e9f41 AD |
84 | |
85 | %token FUNC_CALL NAME REGEXP | |
86 | %token ERROR | |
87 | %token YNUMBER YSTRING | |
88 | %token RELOP APPEND_OP | |
89 | %token ASSIGNOP MATCHOP NEWLINE CONCAT_OP | |
90 | %token LEX_BEGIN LEX_END LEX_IF LEX_ELSE LEX_RETURN LEX_DELETE | |
91 | %token LEX_WHILE LEX_DO LEX_FOR LEX_BREAK LEX_CONTINUE | |
92 | %token LEX_PRINT LEX_PRINTF LEX_NEXT LEX_EXIT LEX_FUNCTION | |
93 | %token LEX_GETLINE LEX_NEXTFILE | |
94 | %token LEX_IN | |
95 | %token LEX_AND LEX_OR INCREMENT DECREMENT | |
96 | %token LEX_BUILTIN LEX_LENGTH | |
97 | ||
98 | /* Lowest to highest */ | |
99 | %right ASSIGNOP | |
100 | %right '?' ':' | |
101 | %left LEX_OR | |
102 | %left LEX_AND | |
103 | %left LEX_GETLINE | |
104 | %nonassoc LEX_IN | |
105 | %left FUNC_CALL LEX_BUILTIN LEX_LENGTH | |
106 | %nonassoc ',' | |
107 | %nonassoc MATCHOP | |
108 | %nonassoc RELOP '<' '>' '|' APPEND_OP TWOWAYIO | |
109 | %left CONCAT_OP | |
110 | %left YSTRING YNUMBER | |
111 | %left '+' '-' | |
112 | %left '*' '/' '%' | |
113 | %right '!' UNARY | |
114 | %right '^' | |
115 | %left INCREMENT DECREMENT | |
116 | %left '$' | |
117 | %left '(' ')' | |
db34f798 JD |
118 | ]], |
119 | [[ | |
817e9f41 AD |
120 | start |
121 | : opt_nls program opt_nls | |
122 | ; | |
123 | ||
124 | program | |
125 | : rule | |
126 | | program rule | |
127 | | error | |
128 | | program error | |
129 | | /* empty */ | |
130 | ; | |
131 | ||
132 | rule | |
133 | : LEX_BEGIN {} action | |
134 | | LEX_END {} action | |
135 | | LEX_BEGIN statement_term | |
136 | | LEX_END statement_term | |
137 | | pattern action | |
138 | | action | |
139 | | pattern statement_term | |
140 | | function_prologue function_body | |
141 | ; | |
142 | ||
143 | func_name | |
144 | : NAME | |
145 | | FUNC_CALL | |
146 | | lex_builtin | |
147 | ; | |
148 | ||
149 | lex_builtin | |
150 | : LEX_BUILTIN | |
151 | | LEX_LENGTH | |
152 | ; | |
153 | ||
154 | function_prologue | |
155 | : LEX_FUNCTION {} func_name '(' opt_param_list r_paren opt_nls | |
156 | ; | |
157 | ||
158 | function_body | |
159 | : l_brace statements r_brace opt_semi opt_nls | |
160 | | l_brace r_brace opt_semi opt_nls | |
161 | ; | |
162 | ||
817e9f41 AD |
163 | pattern |
164 | : exp | |
165 | | exp ',' exp | |
166 | ; | |
167 | ||
168 | regexp | |
169 | /* | |
170 | * In this rule, want_regexp tells yylex that the next thing | |
171 | * is a regexp so it should read up to the closing slash. | |
172 | */ | |
173 | : '/' {} REGEXP '/' | |
174 | ; | |
175 | ||
176 | action | |
177 | : l_brace statements r_brace opt_semi opt_nls | |
178 | | l_brace r_brace opt_semi opt_nls | |
179 | ; | |
180 | ||
181 | statements | |
182 | : statement | |
183 | | statements statement | |
184 | | error | |
185 | | statements error | |
186 | ; | |
187 | ||
188 | statement_term | |
189 | : nls | |
190 | | semi opt_nls | |
191 | ; | |
192 | ||
193 | statement | |
194 | : semi opt_nls | |
195 | | l_brace r_brace | |
196 | | l_brace statements r_brace | |
197 | | if_statement | |
198 | | LEX_WHILE '(' exp r_paren opt_nls statement | |
199 | | LEX_DO opt_nls statement LEX_WHILE '(' exp r_paren opt_nls | |
200 | | LEX_FOR '(' NAME LEX_IN NAME r_paren opt_nls statement | |
201 | | LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement | |
202 | | LEX_FOR '(' opt_exp semi opt_nls semi opt_nls opt_exp r_paren opt_nls statement | |
203 | | LEX_BREAK statement_term | |
204 | | LEX_CONTINUE statement_term | |
205 | | print '(' expression_list r_paren output_redir statement_term | |
206 | | print opt_rexpression_list output_redir statement_term | |
207 | | LEX_NEXT statement_term | |
208 | | LEX_NEXTFILE statement_term | |
209 | | LEX_EXIT opt_exp statement_term | |
210 | | LEX_RETURN {} opt_exp statement_term | |
211 | | LEX_DELETE NAME '[' expression_list ']' statement_term | |
212 | | LEX_DELETE NAME statement_term | |
213 | | exp statement_term | |
214 | ; | |
215 | ||
216 | ||
217 | : LEX_PRINT | |
218 | | LEX_PRINTF | |
219 | ; | |
220 | ||
221 | if_statement | |
222 | : LEX_IF '(' exp r_paren opt_nls statement | |
223 | | LEX_IF '(' exp r_paren opt_nls statement | |
224 | LEX_ELSE opt_nls statement | |
225 | ; | |
226 | ||
227 | nls | |
228 | : NEWLINE | |
229 | | nls NEWLINE | |
230 | ; | |
231 | ||
232 | opt_nls | |
233 | : /* empty */ | |
234 | | nls | |
235 | ; | |
236 | ||
237 | input_redir | |
238 | : /* empty */ | |
239 | | '<' simp_exp | |
240 | ; | |
241 | ||
242 | output_redir | |
243 | : /* empty */ | |
244 | | '>' exp | |
245 | | APPEND_OP exp | |
246 | | '|' exp | |
247 | | TWOWAYIO exp | |
248 | ; | |
249 | ||
250 | opt_param_list | |
251 | : /* empty */ | |
252 | | param_list | |
253 | ; | |
254 | ||
255 | param_list | |
256 | : NAME | |
257 | | param_list comma NAME | |
258 | | error | |
259 | | param_list error | |
260 | | param_list comma error | |
261 | ; | |
262 | ||
263 | /* optional expression, as in for loop */ | |
264 | opt_exp | |
265 | : /* empty */ | |
266 | | exp | |
267 | ; | |
268 | ||
269 | opt_rexpression_list | |
270 | : /* empty */ | |
271 | | rexpression_list | |
272 | ; | |
273 | ||
274 | rexpression_list | |
275 | : rexp | |
276 | | rexpression_list comma rexp | |
277 | | error | |
278 | | rexpression_list error | |
279 | | rexpression_list error rexp | |
280 | | rexpression_list comma error | |
281 | ; | |
282 | ||
283 | opt_expression_list | |
284 | : /* empty */ | |
285 | | expression_list | |
286 | ; | |
287 | ||
288 | expression_list | |
289 | : exp | |
290 | | expression_list comma exp | |
291 | | error | |
292 | | expression_list error | |
293 | | expression_list error exp | |
294 | | expression_list comma error | |
295 | ; | |
296 | ||
297 | /* Expressions, not including the comma operator. */ | |
298 | exp : variable ASSIGNOP {} exp | |
299 | | '(' expression_list r_paren LEX_IN NAME | |
300 | | exp '|' LEX_GETLINE opt_variable | |
301 | | exp TWOWAYIO LEX_GETLINE opt_variable | |
302 | | LEX_GETLINE opt_variable input_redir | |
303 | | exp LEX_AND exp | |
304 | | exp LEX_OR exp | |
305 | | exp MATCHOP exp | |
306 | | regexp | |
307 | | '!' regexp %prec UNARY | |
308 | | exp LEX_IN NAME | |
309 | | exp RELOP exp | |
310 | | exp '<' exp | |
311 | | exp '>' exp | |
312 | | exp '?' exp ':' exp | |
313 | | simp_exp | |
314 | | exp simp_exp %prec CONCAT_OP | |
315 | ; | |
316 | ||
317 | rexp | |
318 | : variable ASSIGNOP {} rexp | |
319 | | rexp LEX_AND rexp | |
320 | | rexp LEX_OR rexp | |
321 | | LEX_GETLINE opt_variable input_redir | |
322 | | regexp | |
323 | | '!' regexp %prec UNARY | |
324 | | rexp MATCHOP rexp | |
325 | | rexp LEX_IN NAME | |
326 | | rexp RELOP rexp | |
327 | | rexp '?' rexp ':' rexp | |
328 | | simp_exp | |
329 | | rexp simp_exp %prec CONCAT_OP | |
330 | ; | |
331 | ||
332 | simp_exp | |
333 | : non_post_simp_exp | |
334 | /* Binary operators in order of decreasing precedence. */ | |
335 | | simp_exp '^' simp_exp | |
336 | | simp_exp '*' simp_exp | |
337 | | simp_exp '/' simp_exp | |
338 | | simp_exp '%' simp_exp | |
339 | | simp_exp '+' simp_exp | |
340 | | simp_exp '-' simp_exp | |
341 | | variable INCREMENT | |
342 | | variable DECREMENT | |
343 | ; | |
344 | ||
345 | non_post_simp_exp | |
346 | : '!' simp_exp %prec UNARY | |
347 | | '(' exp r_paren | |
348 | | LEX_BUILTIN | |
349 | '(' opt_expression_list r_paren | |
350 | | LEX_LENGTH '(' opt_expression_list r_paren | |
351 | | LEX_LENGTH | |
352 | | FUNC_CALL '(' opt_expression_list r_paren | |
353 | | variable | |
354 | | INCREMENT variable | |
355 | | DECREMENT variable | |
356 | | YNUMBER | |
357 | | YSTRING | |
358 | | '-' simp_exp %prec UNARY | |
359 | | '+' simp_exp %prec UNARY | |
360 | ; | |
361 | ||
362 | opt_variable | |
363 | : /* empty */ | |
364 | | variable | |
365 | ; | |
366 | ||
367 | variable | |
368 | : NAME | |
369 | | NAME '[' expression_list ']' | |
370 | | '$' non_post_simp_exp | |
371 | ; | |
372 | ||
373 | l_brace | |
f0064700 PE |
374 | : '{' opt_nls |
375 | ; | |
817e9f41 AD |
376 | |
377 | r_brace | |
f0064700 | 378 | : '}' opt_nls |
817e9f41 AD |
379 | ; |
380 | ||
381 | r_paren | |
382 | : ')' | |
383 | ; | |
384 | ||
385 | opt_semi | |
386 | : /* empty */ | |
387 | | semi | |
388 | ; | |
389 | ||
390 | semi | |
391 | : ';' | |
392 | ; | |
393 | ||
394 | comma : ',' opt_nls | |
395 | ; | |
db34f798 JD |
396 | ]], |
397 | ||
398 | dnl INPUT | |
399 | dnl | |
400 | dnl For example, in AWK: | |
401 | dnl | |
402 | dnl getline $!4*0; | |
403 | dnl | |
404 | dnl The grammar below (from GNU AWK 3.1.0) using canonical LR(1) or IELR(1) | |
405 | dnl parses it as: | |
406 | dnl | |
407 | dnl getline $!(4*0); | |
408 | dnl | |
409 | dnl That is, they shift `*' immediately and make it part of the getline | |
410 | dnl argument. | |
411 | dnl | |
412 | dnl The grammar below using LALR(1) parses it as a syntax error. So does | |
413 | dnl GNU AWK 3.0.6, 3.1.0, and 3.1.1. They reduce the full getline expression | |
414 | dnl before shifting `*' even though `*' is not a valid lookahead. | |
415 | dnl | |
416 | dnl GNU AWK 3.1.2, 3.1.3, 3.1.4, and 3.1.5 parse it as: | |
417 | dnl | |
418 | dnl (getline $!4)*0; | |
419 | dnl | |
420 | dnl That is, like the other versions of GNU AWK, they reduce the full getline | |
421 | dnl expression before shifting `*'. However, because of a different LHS on the | |
422 | dnl getline rule, `*' actually is a valid lookahead. Solaris /usr/xpg4/bin/awk | |
423 | dnl and the Open Group awk specification seem to agree: | |
424 | dnl | |
425 | dnl http://www.opengroup.org/pubs/online/7908799/xcu/awk.html | |
426 | dnl | |
427 | dnl /bin/nawk and /bin/awk on Solaris 10 report it as a syntax error, but they | |
428 | dnl don't like even `print $!4;'. | |
429 | [[LEX_GETLINE, '$', '!', YNUMBER, '*', YNUMBER, ';']], | |
430 | ||
431 | dnl BISON-STDERR | |
432 | [AT_COND_CASE([[canonical LR]], | |
433 | [[input.y: conflicts: 265 shift/reduce]], | |
434 | [[input.y: conflicts: 65 shift/reduce]])[ | |
435 | ]], | |
436 | ||
437 | dnl LAST-STATE | |
438 | [AT_COND_CASE([[LALR]], [[319]], [[canonical LR]], [[2358]], [[328]])], | |
439 | ||
440 | dnl LALR1-DIFF not used for canonical LR(1) because the diff is huge. | |
441 | dnl Isocore map from LALR(1) state number to new state number plus descriptions | |
442 | dnl of any change in the actions resulting in a change in accepted language: | |
443 | dnl - 24 -> 320 | |
444 | dnl - 16 -> 321 | |
445 | dnl - 17 -> 322 | |
446 | dnl - 20 -> 323 | |
447 | dnl - 21 -> 324 | |
448 | dnl - 54 -> 325 | |
449 | dnl - 56 -> 326: reduce -> shift on '*', '/', and '%' | |
450 | dnl - 58 -> 327: reduce -> shift on '*', '/', and '%' | |
451 | dnl - 61 -> 328: reduce -> shift on '*', '/', and '%' | |
452 | [AT_COND_CASE([[LALR]], [], | |
453 | [[@@ -712,7 +712,7 @@ | |
454 | 156 | . '$' non_post_simp_exp | |
455 | ||
456 | NAME shift, and go to state 9 | |
457 | - '$' shift, and go to state 24 | |
458 | + '$' shift, and go to state 320 | |
459 | ||
460 | NAME [reduce using rule 152 (opt_variable)] | |
461 | '$' [reduce using rule 152 (opt_variable)] | |
462 | @@ -5379,7 +5379,7 @@ | |
463 | 156 | . '$' non_post_simp_exp | |
464 | ||
465 | NAME shift, and go to state 9 | |
466 | - '$' shift, and go to state 24 | |
467 | + '$' shift, and go to state 320 | |
468 | ||
469 | NAME [reduce using rule 152 (opt_variable)] | |
470 | '$' [reduce using rule 152 (opt_variable)] | |
471 | @@ -5399,7 +5399,7 @@ | |
472 | 156 | . '$' non_post_simp_exp | |
473 | ||
474 | NAME shift, and go to state 9 | |
475 | - '$' shift, and go to state 24 | |
476 | + '$' shift, and go to state 320 | |
477 | ||
478 | NAME [reduce using rule 152 (opt_variable)] | |
479 | '$' [reduce using rule 152 (opt_variable)] | |
480 | @@ -6214,7 +6214,7 @@ | |
481 | 156 | . '$' non_post_simp_exp | |
482 | ||
483 | NAME shift, and go to state 9 | |
484 | - '$' shift, and go to state 24 | |
485 | + '$' shift, and go to state 320 | |
486 | ||
487 | NAME [reduce using rule 152 (opt_variable)] | |
488 | '$' [reduce using rule 152 (opt_variable)] | |
489 | @@ -11099,3 +11099,274 @@ | |
490 | 45 statement: LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement . | |
491 | ||
492 | $default reduce using rule 45 (statement) | |
493 | + | |
494 | + | |
495 | +state 320 | |
496 | + | |
497 | + 139 non_post_simp_exp: . '!' simp_exp | |
498 | + 140 | . '(' exp r_paren | |
499 | + 141 | . LEX_BUILTIN '(' opt_expression_list r_paren | |
500 | + 142 | . LEX_LENGTH '(' opt_expression_list r_paren | |
501 | + 143 | . LEX_LENGTH | |
502 | + 144 | . FUNC_CALL '(' opt_expression_list r_paren | |
503 | + 145 | . variable | |
504 | + 146 | . INCREMENT variable | |
505 | + 147 | . DECREMENT variable | |
506 | + 148 | . YNUMBER | |
507 | + 149 | . YSTRING | |
508 | + 150 | . '-' simp_exp | |
509 | + 151 | . '+' simp_exp | |
510 | + 154 variable: . NAME | |
511 | + 155 | . NAME '[' expression_list ']' | |
512 | + 156 | . '$' non_post_simp_exp | |
513 | + 156 | '$' . non_post_simp_exp | |
514 | + | |
515 | + FUNC_CALL shift, and go to state 8 | |
516 | + NAME shift, and go to state 9 | |
517 | + YNUMBER shift, and go to state 10 | |
518 | + YSTRING shift, and go to state 11 | |
519 | + INCREMENT shift, and go to state 321 | |
520 | + DECREMENT shift, and go to state 322 | |
521 | + LEX_BUILTIN shift, and go to state 18 | |
522 | + LEX_LENGTH shift, and go to state 19 | |
523 | + '+' shift, and go to state 323 | |
524 | + '-' shift, and go to state 324 | |
525 | + '!' shift, and go to state 325 | |
526 | + '$' shift, and go to state 320 | |
527 | + '(' shift, and go to state 55 | |
528 | + | |
529 | + non_post_simp_exp go to state 62 | |
530 | + variable go to state 63 | |
531 | + | |
532 | + | |
533 | +state 321 | |
534 | + | |
535 | + 146 non_post_simp_exp: INCREMENT . variable | |
536 | + 154 variable: . NAME | |
537 | + 155 | . NAME '[' expression_list ']' | |
538 | + 156 | . '$' non_post_simp_exp | |
539 | + | |
540 | + NAME shift, and go to state 9 | |
541 | + '$' shift, and go to state 320 | |
542 | + | |
543 | + variable go to state 50 | |
544 | + | |
545 | + | |
546 | +state 322 | |
547 | + | |
548 | + 147 non_post_simp_exp: DECREMENT . variable | |
549 | + 154 variable: . NAME | |
550 | + 155 | . NAME '[' expression_list ']' | |
551 | + 156 | . '$' non_post_simp_exp | |
552 | + | |
553 | + NAME shift, and go to state 9 | |
554 | + '$' shift, and go to state 320 | |
555 | + | |
556 | + variable go to state 51 | |
557 | + | |
558 | + | |
559 | +state 323 | |
560 | + | |
561 | + 130 simp_exp: . non_post_simp_exp | |
562 | + 131 | . simp_exp '^' simp_exp | |
563 | + 132 | . simp_exp '*' simp_exp | |
564 | + 133 | . simp_exp '/' simp_exp | |
565 | + 134 | . simp_exp '%' simp_exp | |
566 | + 135 | . simp_exp '+' simp_exp | |
567 | + 136 | . simp_exp '-' simp_exp | |
568 | + 137 | . variable INCREMENT | |
569 | + 138 | . variable DECREMENT | |
570 | + 139 non_post_simp_exp: . '!' simp_exp | |
571 | + 140 | . '(' exp r_paren | |
572 | + 141 | . LEX_BUILTIN '(' opt_expression_list r_paren | |
573 | + 142 | . LEX_LENGTH '(' opt_expression_list r_paren | |
574 | + 143 | . LEX_LENGTH | |
575 | + 144 | . FUNC_CALL '(' opt_expression_list r_paren | |
576 | + 145 | . variable | |
577 | + 146 | . INCREMENT variable | |
578 | + 147 | . DECREMENT variable | |
579 | + 148 | . YNUMBER | |
580 | + 149 | . YSTRING | |
581 | + 150 | . '-' simp_exp | |
582 | + 151 | . '+' simp_exp | |
583 | + 151 | '+' . simp_exp | |
584 | + 154 variable: . NAME | |
585 | + 155 | . NAME '[' expression_list ']' | |
586 | + 156 | . '$' non_post_simp_exp | |
587 | + | |
588 | + FUNC_CALL shift, and go to state 8 | |
589 | + NAME shift, and go to state 9 | |
590 | + YNUMBER shift, and go to state 10 | |
591 | + YSTRING shift, and go to state 11 | |
592 | + INCREMENT shift, and go to state 16 | |
593 | + DECREMENT shift, and go to state 17 | |
594 | + LEX_BUILTIN shift, and go to state 18 | |
595 | + LEX_LENGTH shift, and go to state 19 | |
596 | + '+' shift, and go to state 20 | |
597 | + '-' shift, and go to state 21 | |
598 | + '!' shift, and go to state 54 | |
599 | + '$' shift, and go to state 24 | |
600 | + '(' shift, and go to state 55 | |
601 | + | |
602 | + simp_exp go to state 326 | |
603 | + non_post_simp_exp go to state 35 | |
604 | + variable go to state 57 | |
605 | + | |
606 | + | |
607 | +state 324 | |
608 | + | |
609 | + 130 simp_exp: . non_post_simp_exp | |
610 | + 131 | . simp_exp '^' simp_exp | |
611 | + 132 | . simp_exp '*' simp_exp | |
612 | + 133 | . simp_exp '/' simp_exp | |
613 | + 134 | . simp_exp '%' simp_exp | |
614 | + 135 | . simp_exp '+' simp_exp | |
615 | + 136 | . simp_exp '-' simp_exp | |
616 | + 137 | . variable INCREMENT | |
617 | + 138 | . variable DECREMENT | |
618 | + 139 non_post_simp_exp: . '!' simp_exp | |
619 | + 140 | . '(' exp r_paren | |
620 | + 141 | . LEX_BUILTIN '(' opt_expression_list r_paren | |
621 | + 142 | . LEX_LENGTH '(' opt_expression_list r_paren | |
622 | + 143 | . LEX_LENGTH | |
623 | + 144 | . FUNC_CALL '(' opt_expression_list r_paren | |
624 | + 145 | . variable | |
625 | + 146 | . INCREMENT variable | |
626 | + 147 | . DECREMENT variable | |
627 | + 148 | . YNUMBER | |
628 | + 149 | . YSTRING | |
629 | + 150 | . '-' simp_exp | |
630 | + 150 | '-' . simp_exp | |
631 | + 151 | . '+' simp_exp | |
632 | + 154 variable: . NAME | |
633 | + 155 | . NAME '[' expression_list ']' | |
634 | + 156 | . '$' non_post_simp_exp | |
635 | + | |
636 | + FUNC_CALL shift, and go to state 8 | |
637 | + NAME shift, and go to state 9 | |
638 | + YNUMBER shift, and go to state 10 | |
639 | + YSTRING shift, and go to state 11 | |
640 | + INCREMENT shift, and go to state 16 | |
641 | + DECREMENT shift, and go to state 17 | |
642 | + LEX_BUILTIN shift, and go to state 18 | |
643 | + LEX_LENGTH shift, and go to state 19 | |
644 | + '+' shift, and go to state 20 | |
645 | + '-' shift, and go to state 21 | |
646 | + '!' shift, and go to state 54 | |
647 | + '$' shift, and go to state 24 | |
648 | + '(' shift, and go to state 55 | |
649 | + | |
650 | + simp_exp go to state 327 | |
651 | + non_post_simp_exp go to state 35 | |
652 | + variable go to state 57 | |
653 | + | |
654 | + | |
655 | +state 325 | |
656 | + | |
657 | + 130 simp_exp: . non_post_simp_exp | |
658 | + 131 | . simp_exp '^' simp_exp | |
659 | + 132 | . simp_exp '*' simp_exp | |
660 | + 133 | . simp_exp '/' simp_exp | |
661 | + 134 | . simp_exp '%' simp_exp | |
662 | + 135 | . simp_exp '+' simp_exp | |
663 | + 136 | . simp_exp '-' simp_exp | |
664 | + 137 | . variable INCREMENT | |
665 | + 138 | . variable DECREMENT | |
666 | + 139 non_post_simp_exp: . '!' simp_exp | |
667 | + 139 | '!' . simp_exp | |
668 | + 140 | . '(' exp r_paren | |
669 | + 141 | . LEX_BUILTIN '(' opt_expression_list r_paren | |
670 | + 142 | . LEX_LENGTH '(' opt_expression_list r_paren | |
671 | + 143 | . LEX_LENGTH | |
672 | + 144 | . FUNC_CALL '(' opt_expression_list r_paren | |
673 | + 145 | . variable | |
674 | + 146 | . INCREMENT variable | |
675 | + 147 | . DECREMENT variable | |
676 | + 148 | . YNUMBER | |
677 | + 149 | . YSTRING | |
678 | + 150 | . '-' simp_exp | |
679 | + 151 | . '+' simp_exp | |
680 | + 154 variable: . NAME | |
681 | + 155 | . NAME '[' expression_list ']' | |
682 | + 156 | . '$' non_post_simp_exp | |
683 | + | |
684 | + FUNC_CALL shift, and go to state 8 | |
685 | + NAME shift, and go to state 9 | |
686 | + YNUMBER shift, and go to state 10 | |
687 | + YSTRING shift, and go to state 11 | |
688 | + INCREMENT shift, and go to state 16 | |
689 | + DECREMENT shift, and go to state 17 | |
690 | + LEX_BUILTIN shift, and go to state 18 | |
691 | + LEX_LENGTH shift, and go to state 19 | |
692 | + '+' shift, and go to state 20 | |
693 | + '-' shift, and go to state 21 | |
694 | + '!' shift, and go to state 54 | |
695 | + '$' shift, and go to state 24 | |
696 | + '(' shift, and go to state 55 | |
697 | + | |
698 | + simp_exp go to state 328 | |
699 | + non_post_simp_exp go to state 35 | |
700 | + variable go to state 57 | |
701 | + | |
702 | + | |
703 | +state 326 | |
704 | + | |
705 | + 131 simp_exp: simp_exp . '^' simp_exp | |
706 | + 132 | simp_exp . '*' simp_exp | |
707 | + 133 | simp_exp . '/' simp_exp | |
708 | + 134 | simp_exp . '%' simp_exp | |
709 | + 135 | simp_exp . '+' simp_exp | |
710 | + 136 | simp_exp . '-' simp_exp | |
711 | + 151 non_post_simp_exp: '+' simp_exp . [error, FUNC_CALL, NAME, YNUMBER, YSTRING, RELOP, APPEND_OP, MATCHOP, NEWLINE, LEX_IN, LEX_AND, LEX_OR, INCREMENT, DECREMENT, LEX_BUILTIN, LEX_LENGTH, '?', ':', ',', '<', '>', '|', TWOWAYIO, '+', '-', '!', '$', '(', ')', '@:>@', '{', ';'] | |
712 | + | |
713 | + '*' shift, and go to state 89 | |
714 | + '/' shift, and go to state 90 | |
715 | + '%' shift, and go to state 91 | |
716 | + '^' shift, and go to state 92 | |
717 | + | |
718 | + $default reduce using rule 151 (non_post_simp_exp) | |
719 | + | |
720 | + Conflict between rule 151 and token '+' resolved as reduce ('+' < UNARY). | |
721 | + Conflict between rule 151 and token '-' resolved as reduce ('-' < UNARY). | |
722 | + | |
723 | + | |
724 | +state 327 | |
725 | + | |
726 | + 131 simp_exp: simp_exp . '^' simp_exp | |
727 | + 132 | simp_exp . '*' simp_exp | |
728 | + 133 | simp_exp . '/' simp_exp | |
729 | + 134 | simp_exp . '%' simp_exp | |
730 | + 135 | simp_exp . '+' simp_exp | |
731 | + 136 | simp_exp . '-' simp_exp | |
732 | + 150 non_post_simp_exp: '-' simp_exp . [error, FUNC_CALL, NAME, YNUMBER, YSTRING, RELOP, APPEND_OP, MATCHOP, NEWLINE, LEX_IN, LEX_AND, LEX_OR, INCREMENT, DECREMENT, LEX_BUILTIN, LEX_LENGTH, '?', ':', ',', '<', '>', '|', TWOWAYIO, '+', '-', '!', '$', '(', ')', '@:>@', '{', ';'] | |
733 | + | |
734 | + '*' shift, and go to state 89 | |
735 | + '/' shift, and go to state 90 | |
736 | + '%' shift, and go to state 91 | |
737 | + '^' shift, and go to state 92 | |
738 | + | |
739 | + $default reduce using rule 150 (non_post_simp_exp) | |
740 | + | |
741 | + Conflict between rule 150 and token '+' resolved as reduce ('+' < UNARY). | |
742 | + Conflict between rule 150 and token '-' resolved as reduce ('-' < UNARY). | |
743 | + | |
744 | + | |
745 | +state 328 | |
746 | + | |
747 | + 131 simp_exp: simp_exp . '^' simp_exp | |
748 | + 132 | simp_exp . '*' simp_exp | |
749 | + 133 | simp_exp . '/' simp_exp | |
750 | + 134 | simp_exp . '%' simp_exp | |
751 | + 135 | simp_exp . '+' simp_exp | |
752 | + 136 | simp_exp . '-' simp_exp | |
753 | + 139 non_post_simp_exp: '!' simp_exp . [error, FUNC_CALL, NAME, YNUMBER, YSTRING, RELOP, APPEND_OP, MATCHOP, NEWLINE, LEX_IN, LEX_AND, LEX_OR, INCREMENT, DECREMENT, LEX_BUILTIN, LEX_LENGTH, '?', ':', ',', '<', '>', '|', TWOWAYIO, '+', '-', '!', '$', '(', ')', '@:>@', '{', ';'] | |
754 | + | |
755 | + '*' shift, and go to state 89 | |
756 | + '/' shift, and go to state 90 | |
757 | + '%' shift, and go to state 91 | |
758 | + '^' shift, and go to state 92 | |
759 | + | |
760 | + $default reduce using rule 139 (non_post_simp_exp) | |
761 | + | |
762 | + Conflict between rule 139 and token '+' resolved as reduce ('+' < UNARY). | |
763 | + Conflict between rule 139 and token '-' resolved as reduce ('-' < UNARY). | |
764 | ]])], | |
765 | ||
766 | dnl OTHER-CHECKS | |
767 | [], | |
768 | ||
769 | dnl PARSER-EXIT-VALUE, PARSER-STDOUT, PARSER-STDERR | |
770 | dnl In the case of the syntax error, the parser recovers, so it returns 0. | |
771 | [[0]], | |
772 | [], | |
773 | [AT_COND_CASE([[LALR]], | |
774 | [[syntax error, unexpected '*', expecting NEWLINE or '{' or ';' | |
775 | ]])]) | |
817e9f41 | 776 | |
817e9f41 AD |
777 | ## ----------------- ## |
778 | ## GNU Cim Grammar. ## | |
779 | ## ----------------- ## | |
780 | ||
817e9f41 AD |
781 | # GNU Cim, the GNU Simula 87 Compiler. |
782 | ||
783 | # Bison was once wrong, due to an incorrect computation of the RR conflicts. | |
784 | # It reported 80 SR && 99 RR conflicts instead of 78/10!!! | |
785 | ||
db34f798 | 786 | AT_TEST_EXISTING_GRAMMAR([[GNU Cim Grammar]], |
affac613 | 787 | [[%union {} |
817e9f41 AD |
788 | |
789 | %token | |
f0064700 PE |
790 | HACTIVATE HAFTER /*HAND*/ HARRAY HAT |
791 | HBEFORE HBEGIN HBOOLEAN | |
792 | HCHARACTER HCLASS /*HCOMMENT*/ HCONC | |
793 | HDELAY HDO | |
794 | HELSE HEND HEQ /*HEQV*/ HEXTERNAL | |
795 | HFOR | |
796 | HGE HGO HGOTO HGT | |
797 | HHIDDEN | |
798 | HIF /*HIMP*/ HIN HINNER HINSPECT HINTEGER HIS | |
799 | HLABEL HLE HLONG HLT | |
800 | HNAME HNE HNEW HNONE /*HNOT*/ HNOTEXT | |
801 | /*HOR*/ HOTHERWISE | |
802 | HPRIOR HPROCEDURE HPROTECTED | |
803 | HQUA | |
804 | HREACTIVATE HREAL HREF | |
805 | HSHORT HSTEP HSWITCH | |
806 | HTEXT HTHEN HTHIS HTO | |
807 | HUNTIL | |
808 | HVALUE HVAR HVIRTUAL | |
809 | HWHEN HWHILE | |
810 | ||
811 | HASSIGNVALUE HASSIGNREF | |
812 | /*HDOT*/ HPAREXPSEPARATOR HLABELSEPARATOR HSTATEMENTSEPARATOR | |
813 | HBEGPAR HENDPAR | |
814 | HEQR HNER | |
815 | HADD HSUB HMUL HDIV HINTDIV HEXP | |
04098407 | 816 | HDOTDOTDOT |
817e9f41 | 817 | |
affac613 AD |
818 | %token HIDENTIFIER |
819 | %token HBOOLEANKONST HINTEGERKONST HCHARACTERKONST | |
820 | %token HREALKONST | |
821 | %token HTEXTKONST | |
817e9f41 | 822 | |
817e9f41 | 823 | |
affac613 | 824 | %right HASSIGN |
817e9f41 AD |
825 | %left HORELSE |
826 | %left HANDTHEN | |
827 | %left HEQV | |
828 | %left HIMP | |
829 | %left HOR | |
830 | %left HAND | |
831 | ||
832 | %left HNOT | |
833 | ||
affac613 | 834 | %left HVALRELOPERATOR HREFRELOPERATOR HOBJRELOPERATOR |
817e9f41 AD |
835 | |
836 | %left HCONC | |
837 | ||
affac613 AD |
838 | %left HTERMOPERATOR |
839 | %left UNEAR | |
840 | %left HFACTOROPERATOR | |
817e9f41 AD |
841 | %left HPRIMARYOPERATOR |
842 | ||
843 | %left HQUA | |
844 | ||
845 | %left HDOT | |
846 | ||
847 | %start MAIN_MODULE | |
db34f798 JD |
848 | ]], |
849 | [[ | |
817e9f41 | 850 | /* GRAMATIKK FOR PROGRAM MODULES */ |
affac613 AD |
851 | MAIN_MODULE : {} |
852 | MODULS | |
04098407 | 853 | | error HSTATEMENTSEPARATOR MBEE_DECLSTMS |
817e9f41 AD |
854 | ; |
855 | EXT_DECLARATION : HEXTERNAL | |
856 | MBEE_TYPE | |
857 | HPROCEDURE | |
affac613 | 858 | {} |
817e9f41 AD |
859 | EXT_LIST |
860 | | | |
861 | HEXTERNAL | |
862 | HIDENTIFIER | |
863 | HPROCEDURE | |
affac613 AD |
864 | {} |
865 | HIDENTIFIER {} | |
817e9f41 | 866 | EXTERNAL_KIND_ITEM |
817e9f41 AD |
867 | | HEXTERNAL |
868 | HCLASS | |
affac613 | 869 | {} |
817e9f41 AD |
870 | EXT_LIST |
871 | ||
872 | ; | |
873 | EXTERNAL_KIND_ITEM: EXT_IDENT | |
874 | HOBJRELOPERATOR | |
affac613 | 875 | {} |
f0064700 | 876 | MBEE_TYPE HPROCEDURE |
817e9f41 | 877 | HIDENTIFIER |
affac613 | 878 | {} |
f0064700 | 879 | HEADING EMPTY_BLOCK |
affac613 | 880 | {} |
817e9f41 AD |
881 | /* | |
882 | EXT_IDENT | |
affac613 | 883 | {} |
817e9f41 | 884 | MBEE_REST_EXT_LIST |
817e9f41 AD |
885 | ; |
886 | MBEE_REST_EXT_LIST: /* EMPTY | |
887 | | HPAREXPSEPARATOR EXT_KIND_LIST | |
888 | ; | |
889 | EXT_KIND_LIST : EXT_KIND_ITEM | |
890 | | EXT_KIND_LIST HPAREXPSEPARATOR EXT_KIND_ITEM | |
891 | ; | |
892 | EXT_KIND_ITEM : HIDENTIFIER | |
893 | EXT_IDENT | |
affac613 | 894 | {}*/ |
817e9f41 AD |
895 | ; |
896 | EMPTY_BLOCK : /*EMPT*/ | |
897 | | HBEGIN HEND | |
898 | ; | |
899 | EXT_LIST : EXT_ITEM | |
900 | | EXT_LIST HPAREXPSEPARATOR EXT_ITEM | |
901 | ; | |
902 | EXT_ITEM : HIDENTIFIER | |
903 | EXT_IDENT | |
817e9f41 | 904 | ; |
affac613 AD |
905 | EXT_IDENT : /* EMPTY */ |
906 | | HVALRELOPERATOR {} | |
907 | HTEXTKONST | |
817e9f41 AD |
908 | ; |
909 | /* GRAMATIKK FOR TYPER */ | |
affac613 | 910 | NO_TYPE : /*EMPT*/ |
f0064700 | 911 | ; |
817e9f41 | 912 | MBEE_TYPE : NO_TYPE |
f0064700 PE |
913 | | TYPE |
914 | ; | |
817e9f41 | 915 | TYPE : HREF HBEGPAR |
f0064700 PE |
916 | HIDENTIFIER |
917 | {} | |
918 | HENDPAR | |
919 | | HTEXT | |
920 | | HBOOLEAN | |
921 | | HCHARACTER | |
922 | | HSHORT HINTEGER | |
923 | | HINTEGER | |
924 | | HREAL | |
925 | | HLONG HREAL | |
926 | ; | |
817e9f41 AD |
927 | |
928 | /* GRAMATIKK FOR DEL AV SETNINGER */ | |
929 | MBEE_ELSE_PART : /*EMPT*/ | |
930 | /* | HELSE | |
931 | HIF | |
f0064700 PE |
932 | EXPRESSION |
933 | HTHEN {} | |
934 | BLOCK {} | |
935 | MBEE_ELSE_PART {}*/ | |
936 | | HELSE {} | |
937 | BLOCK | |
938 | ; | |
affac613 | 939 | FOR_LIST : FOR_LIST_ELEMENT |
f0064700 PE |
940 | | FOR_LIST_ELEMENT |
941 | HPAREXPSEPARATOR | |
942 | FOR_LIST | |
943 | ; | |
817e9f41 | 944 | FOR_LIST_ELEMENT: EXPRESSION |
f0064700 PE |
945 | MBEE_F_L_EL_R_PT |
946 | ; | |
817e9f41 | 947 | MBEE_F_L_EL_R_PT: /*EMPT*/ |
f0064700 PE |
948 | | HWHILE |
949 | EXPRESSION | |
950 | | HSTEP | |
951 | EXPRESSION | |
952 | HUNTIL | |
953 | EXPRESSION | |
954 | ; | |
817e9f41 | 955 | GOTO : HGO |
f0064700 PE |
956 | HTO |
957 | | HGOTO | |
958 | ; | |
817e9f41 | 959 | CONN_STATE_R_PT : WHEN_CLAUSE_LIST |
f0064700 PE |
960 | | HDO {} |
961 | BLOCK | |
962 | ; | |
817e9f41 | 963 | WHEN_CLAUSE_LIST: HWHEN |
f0064700 PE |
964 | HIDENTIFIER |
965 | HDO {} | |
966 | BLOCK | |
967 | | WHEN_CLAUSE_LIST | |
968 | HWHEN | |
969 | HIDENTIFIER | |
970 | HDO {} | |
971 | BLOCK | |
972 | ; | |
817e9f41 | 973 | MBEE_OTWI_CLAUS : /*EMPT*/ |
f0064700 | 974 | | HOTHERWISE {} |
817e9f41 | 975 | |
f0064700 PE |
976 | BLOCK |
977 | ; | |
affac613 AD |
978 | ACTIVATOR : HACTIVATE |
979 | | HREACTIVATE | |
817e9f41 | 980 | ; |
affac613 AD |
981 | SCHEDULE : /*EMPT*/ |
982 | | ATDELAY EXPRESSION {} | |
817e9f41 | 983 | PRIOR |
affac613 AD |
984 | | BEFOREAFTER {} |
985 | EXPRESSION | |
817e9f41 | 986 | ; |
affac613 AD |
987 | ATDELAY : HAT |
988 | | HDELAY | |
817e9f41 | 989 | ; |
affac613 AD |
990 | BEFOREAFTER : HBEFORE |
991 | | HAFTER | |
817e9f41 | 992 | ; |
affac613 AD |
993 | PRIOR : /*EMPT*/ |
994 | | HPRIOR | |
817e9f41 AD |
995 | ; |
996 | /* GRAMATIKK FOR SETNINGER OG DEKLARASJONER */ | |
997 | MODULSTATEMENT : HWHILE | |
f0064700 PE |
998 | EXPRESSION |
999 | HDO {} | |
1000 | BLOCK | |
04098407 | 1001 | | HIF |
f0064700 PE |
1002 | EXPRESSION |
1003 | HTHEN {} | |
1004 | BLOCK {} | |
1005 | MBEE_ELSE_PART | |
817e9f41 | 1006 | | HFOR |
f0064700 PE |
1007 | HIDENTIFIER |
1008 | HASSIGN {} | |
1009 | FOR_LIST | |
1010 | HDO {} | |
1011 | BLOCK | |
817e9f41 | 1012 | | GOTO |
f0064700 | 1013 | EXPRESSION |
817e9f41 | 1014 | | HINSPECT |
f0064700 PE |
1015 | EXPRESSION {} |
1016 | CONN_STATE_R_PT | |
1017 | {} | |
1018 | MBEE_OTWI_CLAUS | |
affac613 | 1019 | | HINNER |
f0064700 PE |
1020 | | HIDENTIFIER |
1021 | HLABELSEPARATOR | |
1022 | {} | |
1023 | DECLSTATEMENT | |
1024 | | EXPRESSION_SIMP | |
1025 | HBEGIN | |
1026 | {} | |
817e9f41 | 1027 | IMPORT_SPEC_MODULE |
affac613 | 1028 | {} |
f0064700 PE |
1029 | MBEE_DECLSTMS |
1030 | HEND | |
817e9f41 | 1031 | | EXPRESSION_SIMP HBEGIN error HSTATEMENTSEPARATOR |
f0064700 | 1032 | MBEE_DECLSTMS HEND |
817e9f41 | 1033 | | EXPRESSION_SIMP HBEGIN error HEND |
f0064700 | 1034 | | EXPRESSION_SIMP |
817e9f41 | 1035 | | ACTIVATOR EXPRESSION SCHEDULE |
f0064700 PE |
1036 | | HBEGIN |
1037 | {} | |
1038 | MBEE_DECLSTMS | |
1039 | HEND | |
817e9f41 | 1040 | | MBEE_TYPE HPROCEDURE |
f0064700 PE |
1041 | HIDENTIFIER |
1042 | {} | |
1043 | HEADING BLOCK | |
817e9f41 AD |
1044 | | HIDENTIFIER |
1045 | HCLASS | |
f0064700 | 1046 | NO_TYPE |
affac613 | 1047 | {} |
817e9f41 | 1048 | IMPORT_SPEC_MODULE |
f0064700 | 1049 | HIDENTIFIER |
affac613 | 1050 | {} |
f0064700 PE |
1051 | HEADING |
1052 | BLOCK | |
1053 | | HCLASS | |
1054 | NO_TYPE | |
1055 | HIDENTIFIER | |
1056 | {} | |
1057 | HEADING | |
1058 | BLOCK | |
1059 | | EXT_DECLARATION | |
affac613 | 1060 | | /*EMPT*/ |
f0064700 | 1061 | ; |
affac613 | 1062 | IMPORT_SPEC_MODULE: |
817e9f41 AD |
1063 | ; |
1064 | DECLSTATEMENT : MODULSTATEMENT | |
1065 | | TYPE | |
f0064700 | 1066 | HIDENTIFIER |
817e9f41 | 1067 | MBEE_CONSTANT |
f0064700 PE |
1068 | HPAREXPSEPARATOR |
1069 | {} | |
1070 | IDENTIFIER_LISTC | |
1071 | | TYPE | |
1072 | HIDENTIFIER | |
817e9f41 | 1073 | MBEE_CONSTANT |
f0064700 PE |
1074 | | MBEE_TYPE |
1075 | HARRAY {} | |
1076 | ARR_SEGMENT_LIST | |
1077 | | HSWITCH | |
1078 | HIDENTIFIER | |
1079 | HASSIGN {} | |
1080 | SWITCH_LIST | |
1081 | ; | |
affac613 | 1082 | BLOCK : DECLSTATEMENT |
f0064700 | 1083 | | HBEGIN MBEE_DECLSTMS HEND |
817e9f41 AD |
1084 | | HBEGIN error HSTATEMENTSEPARATOR MBEE_DECLSTMS HEND |
1085 | | HBEGIN error HEND | |
1086 | ; | |
affac613 | 1087 | MBEE_DECLSTMS : MBEE_DECLSTMSU |
f0064700 | 1088 | ; |
affac613 | 1089 | MBEE_DECLSTMSU : DECLSTATEMENT |
f0064700 PE |
1090 | | MBEE_DECLSTMSU |
1091 | HSTATEMENTSEPARATOR | |
1092 | DECLSTATEMENT | |
1093 | ; | |
affac613 | 1094 | MODULS : MODULSTATEMENT |
04098407 | 1095 | | MODULS HSTATEMENTSEPARATOR MODULSTATEMENT |
817e9f41 AD |
1096 | ; |
1097 | /* GRAMATIKK FOR DEL AV DEKLARASJONER */ | |
1098 | ARR_SEGMENT_LIST: ARR_SEGMENT | |
f0064700 PE |
1099 | | ARR_SEGMENT_LIST |
1100 | HPAREXPSEPARATOR | |
1101 | ARR_SEGMENT | |
1102 | ; | |
817e9f41 | 1103 | ARR_SEGMENT : ARRAY_SEGMENT |
f0064700 PE |
1104 | HBEGPAR |
1105 | BAUND_PAIR_LIST HENDPAR | |
1106 | ; | |
affac613 | 1107 | ARRAY_SEGMENT : ARRAY_SEGMENT_EL {} |
817e9f41 | 1108 | |
f0064700 PE |
1109 | | ARRAY_SEGMENT_EL |
1110 | HPAREXPSEPARATOR | |
1111 | ARRAY_SEGMENT | |
1112 | ; | |
affac613 | 1113 | ARRAY_SEGMENT_EL: HIDENTIFIER |
f0064700 | 1114 | ; |
affac613 | 1115 | BAUND_PAIR_LIST : BAUND_PAIR |
f0064700 PE |
1116 | | BAUND_PAIR |
1117 | HPAREXPSEPARATOR | |
1118 | BAUND_PAIR_LIST | |
1119 | ; | |
817e9f41 | 1120 | BAUND_PAIR : EXPRESSION |
f0064700 PE |
1121 | HLABELSEPARATOR |
1122 | EXPRESSION | |
1123 | ; | |
affac613 | 1124 | SWITCH_LIST : EXPRESSION |
f0064700 PE |
1125 | | EXPRESSION |
1126 | HPAREXPSEPARATOR | |
1127 | SWITCH_LIST | |
1128 | ; | |
affac613 | 1129 | HEADING : MBEE_FMAL_PAR_P HSTATEMENTSEPARATOR {} |
f0064700 PE |
1130 | MBEE_MODE_PART {} |
1131 | MBEE_SPEC_PART {} | |
1132 | MBEE_PROT_PART {} | |
1133 | MBEE_VIRT_PART | |
1134 | ; | |
817e9f41 | 1135 | MBEE_FMAL_PAR_P : /*EMPT*/ |
f0064700 PE |
1136 | | FMAL_PAR_PART |
1137 | ; | |
817e9f41 | 1138 | FMAL_PAR_PART : HBEGPAR NO_TYPE |
f0064700 PE |
1139 | MBEE_LISTV HENDPAR |
1140 | ; | |
817e9f41 | 1141 | MBEE_LISTV : /*EMPT*/ |
f0064700 PE |
1142 | | LISTV |
1143 | ; | |
affac613 | 1144 | LISTV : HIDENTIFIER |
f0064700 PE |
1145 | | FPP_CATEG HDOTDOTDOT |
1146 | | HIDENTIFIER {} | |
1147 | HPAREXPSEPARATOR LISTV | |
1148 | | FPP_SPEC | |
1149 | | FPP_SPEC | |
1150 | HPAREXPSEPARATOR LISTV | |
1151 | ; | |
817e9f41 | 1152 | FPP_HEADING : HBEGPAR NO_TYPE |
f0064700 PE |
1153 | FPP_MBEE_LISTV HENDPAR |
1154 | ; | |
817e9f41 | 1155 | FPP_MBEE_LISTV : /*EMPT*/ |
f0064700 PE |
1156 | | FPP_LISTV |
1157 | ; | |
affac613 | 1158 | FPP_LISTV : FPP_CATEG HDOTDOTDOT |
f0064700 PE |
1159 | | FPP_SPEC |
1160 | | FPP_SPEC | |
1161 | HPAREXPSEPARATOR LISTV | |
1162 | ; | |
817e9f41 | 1163 | FPP_SPEC : FPP_CATEG SPECIFIER HIDENTIFIER |
817e9f41 AD |
1164 | | FPP_CATEG FPP_PROC_DECL_IN_SPEC |
1165 | ; | |
1166 | FPP_CATEG : HNAME HLABELSEPARATOR | |
f0064700 PE |
1167 | | HVALUE HLABELSEPARATOR |
1168 | | HVAR HLABELSEPARATOR | |
1169 | | /*EMPT*/ | |
1170 | ; | |
817e9f41 | 1171 | FPP_PROC_DECL_IN_SPEC: MBEE_TYPE HPROCEDURE |
f0064700 | 1172 | HIDENTIFIER |
affac613 | 1173 | {} |
f0064700 | 1174 | FPP_HEADING {} { /* Yes, two "final" actions. */ } |
817e9f41 | 1175 | ; |
affac613 | 1176 | IDENTIFIER_LISTV: HIDENTIFIER |
f0064700 PE |
1177 | | HDOTDOTDOT |
1178 | | HIDENTIFIER {} | |
1179 | HPAREXPSEPARATOR IDENTIFIER_LISTV | |
1180 | ; | |
817e9f41 | 1181 | MBEE_MODE_PART : /*EMPT*/ |
f0064700 PE |
1182 | | MODE_PART |
1183 | ; | |
817e9f41 | 1184 | MODE_PART : NAME_PART |
f0064700 PE |
1185 | | VALUE_PART |
1186 | | VAR_PART | |
1187 | | NAME_PART VALUE_PART | |
1188 | | VALUE_PART NAME_PART | |
1189 | | NAME_PART VAR_PART | |
1190 | | VAR_PART NAME_PART | |
1191 | | VALUE_PART VAR_PART | |
1192 | | VAR_PART VALUE_PART | |
1193 | | VAR_PART NAME_PART VALUE_PART | |
1194 | | NAME_PART VAR_PART VALUE_PART | |
1195 | | NAME_PART VALUE_PART VAR_PART | |
1196 | | VAR_PART VALUE_PART NAME_PART | |
1197 | | VALUE_PART VAR_PART NAME_PART | |
1198 | | VALUE_PART NAME_PART VAR_PART | |
1199 | ; | |
affac613 | 1200 | NAME_PART : HNAME {} |
f0064700 PE |
1201 | IDENTIFIER_LISTV |
1202 | HSTATEMENTSEPARATOR | |
1203 | ; | |
affac613 | 1204 | VAR_PART : HVAR {} |
f0064700 PE |
1205 | IDENTIFIER_LISTV |
1206 | HSTATEMENTSEPARATOR | |
1207 | ; | |
affac613 | 1208 | VALUE_PART : HVALUE {} |
f0064700 PE |
1209 | IDENTIFIER_LISTV HSTATEMENTSEPARATOR |
1210 | ; | |
817e9f41 | 1211 | MBEE_SPEC_PART : /*EMPT*/ |
f0064700 PE |
1212 | | SPEC_PART |
1213 | ; | |
817e9f41 | 1214 | SPEC_PART : ONE_SPEC |
f0064700 PE |
1215 | | SPEC_PART ONE_SPEC |
1216 | ; | |
817e9f41 AD |
1217 | ONE_SPEC : SPECIFIER IDENTIFIER_LIST HSTATEMENTSEPARATOR |
1218 | | NO_TYPE HPROCEDURE HIDENTIFIER HOBJRELOPERATOR | |
affac613 | 1219 | {} |
817e9f41 | 1220 | PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR |
f0064700 PE |
1221 | | FPP_PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR |
1222 | | MBEE_TYPE HPROCEDURE HIDENTIFIER HSTATEMENTSEPARATOR | |
1223 | | MBEE_TYPE HPROCEDURE HIDENTIFIER HPAREXPSEPARATOR | |
1224 | IDENTIFIER_LIST HSTATEMENTSEPARATOR | |
817e9f41 | 1225 | ; |
affac613 | 1226 | SPECIFIER : TYPE |
f0064700 PE |
1227 | | MBEE_TYPE |
1228 | HARRAY | |
1229 | | HLABEL | |
1230 | | HSWITCH | |
1231 | ; | |
817e9f41 | 1232 | PROC_DECL_IN_SPEC: MBEE_TYPE HPROCEDURE |
f0064700 | 1233 | HIDENTIFIER |
affac613 | 1234 | {} |
f0064700 | 1235 | HEADING |
affac613 | 1236 | {} |
817e9f41 | 1237 | MBEE_BEGIN_END |
817e9f41 AD |
1238 | ; |
1239 | MBEE_BEGIN_END : /* EMPTY */ | |
1240 | | HBEGIN HEND | |
1241 | ; | |
1242 | MBEE_PROT_PART : /*EMPT*/ | |
f0064700 PE |
1243 | | PROTECTION_PART |
1244 | ; | |
817e9f41 | 1245 | PROTECTION_PART : PROT_SPECIFIER IDENTIFIER_LIST |
f0064700 PE |
1246 | HSTATEMENTSEPARATOR |
1247 | | PROTECTION_PART PROT_SPECIFIER | |
1248 | IDENTIFIER_LIST HSTATEMENTSEPARATOR | |
1249 | ; | |
affac613 | 1250 | PROT_SPECIFIER : HHIDDEN |
f0064700 PE |
1251 | | HPROTECTED |
1252 | | HHIDDEN | |
1253 | HPROTECTED | |
1254 | | HPROTECTED | |
1255 | HHIDDEN | |
1256 | ; | |
817e9f41 | 1257 | MBEE_VIRT_PART : /*EMPT*/ |
f0064700 PE |
1258 | | VIRTUAL_PART |
1259 | ; | |
817e9f41 | 1260 | VIRTUAL_PART : HVIRTUAL |
f0064700 PE |
1261 | HLABELSEPARATOR |
1262 | MBEE_SPEC_PART | |
1263 | ; | |
affac613 | 1264 | IDENTIFIER_LIST : HIDENTIFIER |
f0064700 PE |
1265 | | IDENTIFIER_LIST HPAREXPSEPARATOR |
1266 | HIDENTIFIER | |
1267 | ; | |
817e9f41 | 1268 | IDENTIFIER_LISTC: HIDENTIFIER |
affac613 | 1269 | MBEE_CONSTANT |
f0064700 PE |
1270 | | IDENTIFIER_LISTC HPAREXPSEPARATOR |
1271 | HIDENTIFIER | |
affac613 | 1272 | MBEE_CONSTANT |
f0064700 | 1273 | ; |
817e9f41 AD |
1274 | MBEE_CONSTANT : /* EMPTY */ |
1275 | | HVALRELOPERATOR | |
affac613 AD |
1276 | {} |
1277 | EXPRESSION | |
817e9f41 AD |
1278 | ; |
1279 | ||
1280 | /* GRAMATIKK FOR UTTRYKK */ | |
affac613 | 1281 | EXPRESSION : EXPRESSION_SIMP |
f0064700 PE |
1282 | | HIF |
1283 | EXPRESSION | |
1284 | HTHEN | |
1285 | EXPRESSION | |
1286 | HELSE | |
1287 | EXPRESSION | |
1288 | ; | |
817e9f41 AD |
1289 | EXPRESSION_SIMP : EXPRESSION_SIMP |
1290 | HASSIGN | |
affac613 | 1291 | EXPRESSION |
817e9f41 AD |
1292 | | |
1293 | ||
1294 | EXPRESSION_SIMP | |
f0064700 PE |
1295 | HCONC |
1296 | EXPRESSION_SIMP | |
1297 | | EXPRESSION_SIMP HOR | |
1298 | HELSE | |
1299 | EXPRESSION_SIMP | |
1300 | %prec HORELSE | |
1301 | | EXPRESSION_SIMP HAND | |
1302 | HTHEN | |
1303 | EXPRESSION_SIMP | |
1304 | %prec HANDTHEN | |
1305 | | EXPRESSION_SIMP | |
1306 | HEQV EXPRESSION_SIMP | |
1307 | | EXPRESSION_SIMP | |
1308 | HIMP EXPRESSION_SIMP | |
1309 | | EXPRESSION_SIMP | |
1310 | HOR EXPRESSION_SIMP | |
1311 | | EXPRESSION_SIMP | |
1312 | HAND EXPRESSION_SIMP | |
1313 | | HNOT EXPRESSION_SIMP | |
1314 | | EXPRESSION_SIMP | |
1315 | HVALRELOPERATOR | |
1316 | EXPRESSION_SIMP | |
1317 | | EXPRESSION_SIMP | |
1318 | HREFRELOPERATOR | |
1319 | EXPRESSION_SIMP | |
1320 | | EXPRESSION_SIMP | |
1321 | HOBJRELOPERATOR | |
1322 | EXPRESSION_SIMP | |
1323 | | HTERMOPERATOR | |
1324 | EXPRESSION_SIMP %prec UNEAR | |
1325 | | EXPRESSION_SIMP | |
1326 | HTERMOPERATOR | |
1327 | EXPRESSION_SIMP | |
1328 | | EXPRESSION_SIMP | |
1329 | HFACTOROPERATOR | |
1330 | EXPRESSION_SIMP | |
1331 | | EXPRESSION_SIMP | |
1332 | HPRIMARYOPERATOR | |
1333 | EXPRESSION_SIMP | |
1334 | | HBEGPAR | |
1335 | EXPRESSION HENDPAR | |
1336 | | HTEXTKONST | |
1337 | | HCHARACTERKONST | |
1338 | | HREALKONST | |
1339 | | HINTEGERKONST | |
1340 | | HBOOLEANKONST | |
1341 | | HNONE | |
1342 | | HIDENTIFIER | |
1343 | {} | |
1344 | MBEE_ARG_R_PT | |
1345 | | HTHIS HIDENTIFIER | |
1346 | | HNEW | |
1347 | HIDENTIFIER | |
1348 | ARG_R_PT | |
1349 | | EXPRESSION_SIMP | |
1350 | HDOT | |
1351 | EXPRESSION_SIMP | |
1352 | | EXPRESSION_SIMP | |
1353 | HQUA HIDENTIFIER | |
1354 | ; | |
affac613 | 1355 | ARG_R_PT : /*EMPTY*/ |
f0064700 PE |
1356 | | HBEGPAR |
1357 | ARGUMENT_LIST HENDPAR | |
1358 | ; | |
affac613 | 1359 | MBEE_ARG_R_PT : /*EMPTY*/ |
f0064700 PE |
1360 | | HBEGPAR |
1361 | ARGUMENT_LIST HENDPAR | |
1362 | ; | |
affac613 | 1363 | ARGUMENT_LIST : EXPRESSION |
f0064700 PE |
1364 | | EXPRESSION |
1365 | HPAREXPSEPARATOR | |
1366 | ARGUMENT_LIST | |
1367 | ; | |
db34f798 JD |
1368 | ]], |
1369 | ||
1370 | dnl INPUT | |
1371 | [[]], | |
1372 | ||
1373 | dnl BISON-STDERR | |
1374 | [AT_COND_CASE([[canonical LR]], | |
1375 | [[input.y: conflicts: 1876 shift/reduce, 144 reduce/reduce]], | |
1376 | [[input.y: conflicts: 78 shift/reduce, 10 reduce/reduce]])[ | |
1377 | ]], | |
1378 | ||
1379 | dnl LAST-STATE | |
1380 | [AT_COND_CASE([[canonical LR]], [[10425]], [[442]])], | |
817e9f41 | 1381 | |
db34f798 JD |
1382 | dnl LALR1-DIFF not used for canonical LR(1) because the diff is huge. |
1383 | [], | |
817e9f41 | 1384 | |
db34f798 JD |
1385 | dnl OTHER-CHECKS |
1386 | [AT_COND_CASE([[canonical LR]], [[]], | |
1387 | [AT_CHECK([[grep '^State.*conflicts:' input.output]], [[0]], | |
a4b746ea PE |
1388 | [[State 64 conflicts: 14 shift/reduce |
1389 | State 164 conflicts: 1 shift/reduce | |
1390 | State 201 conflicts: 33 shift/reduce, 4 reduce/reduce | |
1391 | State 206 conflicts: 1 shift/reduce | |
1392 | State 240 conflicts: 1 shift/reduce | |
1393 | State 335 conflicts: 9 shift/reduce, 2 reduce/reduce | |
1394 | State 356 conflicts: 1 shift/reduce | |
1395 | State 360 conflicts: 9 shift/reduce, 2 reduce/reduce | |
1396 | State 427 conflicts: 9 shift/reduce, 2 reduce/reduce | |
db34f798 | 1397 | ]])])]) |
817e9f41 | 1398 | |
db34f798 JD |
1399 | ## -------------------------------- ## |
1400 | ## GNU pic (Groff 1.18.1) Grammar. ## | |
1401 | ## -------------------------------- ## | |
2740f169 PE |
1402 | |
1403 | # GNU pic, part of groff. | |
1404 | ||
1405 | # Bison once reported shift/reduce conflicts that it shouldn't have. | |
1406 | ||
db34f798 JD |
1407 | AT_TEST_EXISTING_GRAMMAR([[GNU pic (Groff 1.18.1) Grammar]], |
1408 | [[%error-verbose | |
1409 | %union {} | |
affac613 AD |
1410 | |
1411 | %token LABEL | |
1412 | %token VARIABLE | |
1413 | %token NUMBER | |
1414 | %token TEXT | |
1415 | %token COMMAND_LINE | |
1416 | %token DELIMITED | |
1417 | %token ORDINAL | |
2740f169 PE |
1418 | %token TH |
1419 | %token LEFT_ARROW_HEAD | |
1420 | %token RIGHT_ARROW_HEAD | |
1421 | %token DOUBLE_ARROW_HEAD | |
1422 | %token LAST | |
1423 | %token UP | |
1424 | %token DOWN | |
1425 | %token LEFT | |
1426 | %token RIGHT | |
1427 | %token BOX | |
1428 | %token CIRCLE | |
1429 | %token ELLIPSE | |
1430 | %token ARC | |
1431 | %token LINE | |
1432 | %token ARROW | |
1433 | %token MOVE | |
1434 | %token SPLINE | |
1435 | %token HEIGHT | |
1436 | %token RADIUS | |
1437 | %token WIDTH | |
1438 | %token DIAMETER | |
1439 | %token FROM | |
1440 | %token TO | |
1441 | %token AT | |
1442 | %token WITH | |
1443 | %token BY | |
1444 | %token THEN | |
1445 | %token SOLID | |
1446 | %token DOTTED | |
1447 | %token DASHED | |
1448 | %token CHOP | |
1449 | %token SAME | |
1450 | %token INVISIBLE | |
1451 | %token LJUST | |
1452 | %token RJUST | |
1453 | %token ABOVE | |
1454 | %token BELOW | |
1455 | %token OF | |
1456 | %token THE | |
1457 | %token WAY | |
1458 | %token BETWEEN | |
1459 | %token AND | |
1460 | %token HERE | |
1461 | %token DOT_N | |
04098407 | 1462 | %token DOT_E |
2740f169 PE |
1463 | %token DOT_W |
1464 | %token DOT_S | |
1465 | %token DOT_NE | |
1466 | %token DOT_SE | |
1467 | %token DOT_NW | |
1468 | %token DOT_SW | |
1469 | %token DOT_C | |
1470 | %token DOT_START | |
1471 | %token DOT_END | |
1472 | %token DOT_X | |
1473 | %token DOT_Y | |
1474 | %token DOT_HT | |
1475 | %token DOT_WID | |
1476 | %token DOT_RAD | |
1477 | %token SIN | |
1478 | %token COS | |
1479 | %token ATAN2 | |
1480 | %token LOG | |
1481 | %token EXP | |
1482 | %token SQRT | |
1483 | %token K_MAX | |
1484 | %token K_MIN | |
1485 | %token INT | |
1486 | %token RAND | |
1487 | %token SRAND | |
1488 | %token COPY | |
1489 | %token THRU | |
1490 | %token TOP | |
1491 | %token BOTTOM | |
1492 | %token UPPER | |
1493 | %token LOWER | |
1494 | %token SH | |
1495 | %token PRINT | |
1496 | %token CW | |
1497 | %token CCW | |
1498 | %token FOR | |
1499 | %token DO | |
1500 | %token IF | |
1501 | %token ELSE | |
1502 | %token ANDAND | |
1503 | %token OROR | |
1504 | %token NOTEQUAL | |
1505 | %token EQUALEQUAL | |
1506 | %token LESSEQUAL | |
1507 | %token GREATEREQUAL | |
1508 | %token LEFT_CORNER | |
1509 | %token RIGHT_CORNER | |
1510 | %token NORTH | |
1511 | %token SOUTH | |
1512 | %token EAST | |
1513 | %token WEST | |
1514 | %token CENTER | |
1515 | %token END | |
1516 | %token START | |
1517 | %token RESET | |
1518 | %token UNTIL | |
1519 | %token PLOT | |
1520 | %token THICKNESS | |
1521 | %token FILL | |
1522 | %token COLORED | |
1523 | %token OUTLINED | |
1524 | %token SHADED | |
1525 | %token ALIGNED | |
1526 | %token SPRINTF | |
1527 | %token COMMAND | |
1528 | ||
1529 | %left '.' | |
1530 | ||
1531 | /* this ensures that plot 17 "%g" parses as (plot 17 "%g") */ | |
1532 | %left PLOT | |
1533 | %left TEXT SPRINTF | |
1534 | ||
1535 | /* give text adjustments higher precedence than TEXT, so that | |
1536 | box "foo" above ljust == box ("foo" above ljust) | |
1537 | */ | |
1538 | ||
1539 | %left LJUST RJUST ABOVE BELOW | |
1540 | ||
1541 | %left LEFT RIGHT | |
1542 | /* Give attributes that take an optional expression a higher | |
1543 | precedence than left and right, so that eg `line chop left' | |
1544 | parses properly. */ | |
1545 | %left CHOP SOLID DASHED DOTTED UP DOWN FILL COLORED OUTLINED | |
1546 | %left LABEL | |
1547 | ||
04098407 | 1548 | %left VARIABLE NUMBER '(' SIN COS ATAN2 LOG EXP SQRT K_MAX K_MIN INT RAND SRAND LAST |
2740f169 PE |
1549 | %left ORDINAL HERE '`' |
1550 | ||
1551 | %left BOX CIRCLE ELLIPSE ARC LINE ARROW SPLINE '[' /* ] */ | |
1552 | ||
1553 | /* these need to be lower than '-' */ | |
1554 | %left HEIGHT RADIUS WIDTH DIAMETER FROM TO AT THICKNESS | |
1555 | ||
1556 | /* these must have higher precedence than CHOP so that `label %prec CHOP' | |
1557 | works */ | |
1558 | %left DOT_N DOT_E DOT_W DOT_S DOT_NE DOT_SE DOT_NW DOT_SW DOT_C | |
1559 | %left DOT_START DOT_END TOP BOTTOM LEFT_CORNER RIGHT_CORNER | |
1560 | %left UPPER LOWER NORTH SOUTH EAST WEST CENTER START END | |
1561 | ||
1562 | %left ',' | |
1563 | %left OROR | |
1564 | %left ANDAND | |
1565 | %left EQUALEQUAL NOTEQUAL | |
1566 | %left '<' '>' LESSEQUAL GREATEREQUAL | |
1567 | ||
1568 | %left BETWEEN OF | |
1569 | %left AND | |
1570 | ||
1571 | %left '+' '-' | |
1572 | %left '*' '/' '%' | |
1573 | %right '!' | |
1574 | %right '^' | |
db34f798 JD |
1575 | ]], |
1576 | [[ | |
2740f169 PE |
1577 | top: |
1578 | optional_separator | |
1579 | | element_list | |
2740f169 PE |
1580 | ; |
1581 | ||
2740f169 PE |
1582 | element_list: |
1583 | optional_separator middle_element_list optional_separator | |
2740f169 PE |
1584 | ; |
1585 | ||
1586 | middle_element_list: | |
1587 | element | |
2740f169 | 1588 | | middle_element_list separator element |
2740f169 PE |
1589 | ; |
1590 | ||
1591 | optional_separator: | |
1592 | /* empty */ | |
1593 | | separator | |
1594 | ; | |
1595 | ||
1596 | separator: | |
1597 | ';' | |
1598 | | separator ';' | |
1599 | ; | |
1600 | ||
1601 | placeless_element: | |
1602 | VARIABLE '=' any_expr | |
2740f169 | 1603 | | VARIABLE ':' '=' any_expr |
2740f169 | 1604 | | UP |
2740f169 | 1605 | | DOWN |
2740f169 | 1606 | | LEFT |
2740f169 | 1607 | | RIGHT |
2740f169 | 1608 | | COMMAND_LINE |
2740f169 | 1609 | | COMMAND print_args |
2740f169 | 1610 | | PRINT print_args |
2740f169 | 1611 | | SH |
affac613 | 1612 | {} |
2740f169 | 1613 | DELIMITED |
2740f169 | 1614 | | COPY TEXT |
2740f169 | 1615 | | COPY TEXT THRU |
affac613 | 1616 | {} |
04098407 | 1617 | DELIMITED |
affac613 | 1618 | {} |
2740f169 | 1619 | until |
2740f169 | 1620 | | COPY THRU |
affac613 | 1621 | {} |
2740f169 | 1622 | DELIMITED |
affac613 | 1623 | {} |
2740f169 | 1624 | until |
2740f169 | 1625 | | FOR VARIABLE '=' expr TO expr optional_by DO |
affac613 | 1626 | {} |
2740f169 | 1627 | DELIMITED |
2740f169 | 1628 | | simple_if |
2740f169 | 1629 | | simple_if ELSE |
affac613 | 1630 | {} |
2740f169 | 1631 | DELIMITED |
2740f169 PE |
1632 | | reset_variables |
1633 | | RESET | |
2740f169 PE |
1634 | ; |
1635 | ||
1636 | reset_variables: | |
1637 | RESET VARIABLE | |
2740f169 | 1638 | | reset_variables VARIABLE |
2740f169 | 1639 | | reset_variables ',' VARIABLE |
2740f169 PE |
1640 | ; |
1641 | ||
1642 | print_args: | |
1643 | print_arg | |
2740f169 | 1644 | | print_args print_arg |
2740f169 PE |
1645 | ; |
1646 | ||
1647 | print_arg: | |
04098407 | 1648 | expr %prec ',' |
2740f169 | 1649 | | text |
2740f169 | 1650 | | position %prec ',' |
2740f169 PE |
1651 | ; |
1652 | ||
1653 | simple_if: | |
1654 | IF any_expr THEN | |
affac613 | 1655 | {} |
2740f169 | 1656 | DELIMITED |
2740f169 PE |
1657 | ; |
1658 | ||
1659 | until: | |
1660 | /* empty */ | |
2740f169 | 1661 | | UNTIL TEXT |
2740f169 | 1662 | ; |
04098407 | 1663 | |
2740f169 PE |
1664 | any_expr: |
1665 | expr | |
2740f169 | 1666 | | text_expr |
2740f169 | 1667 | ; |
04098407 | 1668 | |
2740f169 PE |
1669 | text_expr: |
1670 | text EQUALEQUAL text | |
2740f169 | 1671 | | text NOTEQUAL text |
2740f169 | 1672 | | text_expr ANDAND text_expr |
2740f169 | 1673 | | text_expr ANDAND expr |
2740f169 | 1674 | | expr ANDAND text_expr |
2740f169 | 1675 | | text_expr OROR text_expr |
2740f169 | 1676 | | text_expr OROR expr |
2740f169 | 1677 | | expr OROR text_expr |
2740f169 | 1678 | | '!' text_expr |
2740f169 PE |
1679 | ; |
1680 | ||
2740f169 PE |
1681 | optional_by: |
1682 | /* empty */ | |
2740f169 | 1683 | | BY expr |
2740f169 | 1684 | | BY '*' expr |
2740f169 PE |
1685 | ; |
1686 | ||
1687 | element: | |
1688 | object_spec | |
2740f169 | 1689 | | LABEL ':' optional_separator element |
2740f169 | 1690 | | LABEL ':' optional_separator position_not_place |
2740f169 | 1691 | | LABEL ':' optional_separator place |
408476bc | 1692 | | '{' {} element_list '}' |
affac613 | 1693 | {} |
2740f169 | 1694 | optional_element |
2740f169 | 1695 | | placeless_element |
2740f169 PE |
1696 | ; |
1697 | ||
1698 | optional_element: | |
1699 | /* empty */ | |
2740f169 | 1700 | | element |
2740f169 PE |
1701 | ; |
1702 | ||
1703 | object_spec: | |
1704 | BOX | |
2740f169 | 1705 | | CIRCLE |
2740f169 | 1706 | | ELLIPSE |
2740f169 | 1707 | | ARC |
2740f169 | 1708 | | LINE |
2740f169 | 1709 | | ARROW |
2740f169 | 1710 | | MOVE |
2740f169 | 1711 | | SPLINE |
2740f169 | 1712 | | text %prec TEXT |
2740f169 | 1713 | | PLOT expr |
2740f169 | 1714 | | PLOT expr text |
04098407 | 1715 | | '[' |
affac613 | 1716 | {} |
2740f169 | 1717 | element_list ']' |
2740f169 | 1718 | | object_spec HEIGHT expr |
2740f169 | 1719 | | object_spec RADIUS expr |
2740f169 | 1720 | | object_spec WIDTH expr |
2740f169 | 1721 | | object_spec DIAMETER expr |
2740f169 | 1722 | | object_spec expr %prec HEIGHT |
2740f169 | 1723 | | object_spec UP |
2740f169 | 1724 | | object_spec UP expr |
2740f169 | 1725 | | object_spec DOWN |
2740f169 | 1726 | | object_spec DOWN expr |
2740f169 | 1727 | | object_spec RIGHT |
2740f169 | 1728 | | object_spec RIGHT expr |
2740f169 | 1729 | | object_spec LEFT |
2740f169 | 1730 | | object_spec LEFT expr |
2740f169 | 1731 | | object_spec FROM position |
2740f169 | 1732 | | object_spec TO position |
2740f169 | 1733 | | object_spec AT position |
2740f169 | 1734 | | object_spec WITH path |
2740f169 | 1735 | | object_spec WITH position %prec ',' |
2740f169 | 1736 | | object_spec BY expr_pair |
2740f169 | 1737 | | object_spec THEN |
2740f169 | 1738 | | object_spec SOLID |
2740f169 | 1739 | | object_spec DOTTED |
2740f169 | 1740 | | object_spec DOTTED expr |
2740f169 | 1741 | | object_spec DASHED |
2740f169 | 1742 | | object_spec DASHED expr |
2740f169 | 1743 | | object_spec FILL |
2740f169 | 1744 | | object_spec FILL expr |
2740f169 | 1745 | | object_spec SHADED text |
2740f169 | 1746 | | object_spec COLORED text |
2740f169 | 1747 | | object_spec OUTLINED text |
2740f169 | 1748 | | object_spec CHOP |
2740f169 | 1749 | | object_spec CHOP expr |
2740f169 | 1750 | | object_spec SAME |
2740f169 | 1751 | | object_spec INVISIBLE |
2740f169 | 1752 | | object_spec LEFT_ARROW_HEAD |
2740f169 | 1753 | | object_spec RIGHT_ARROW_HEAD |
2740f169 | 1754 | | object_spec DOUBLE_ARROW_HEAD |
2740f169 | 1755 | | object_spec CW |
2740f169 | 1756 | | object_spec CCW |
2740f169 | 1757 | | object_spec text %prec TEXT |
2740f169 | 1758 | | object_spec LJUST |
2740f169 | 1759 | | object_spec RJUST |
2740f169 | 1760 | | object_spec ABOVE |
2740f169 | 1761 | | object_spec BELOW |
2740f169 | 1762 | | object_spec THICKNESS expr |
2740f169 | 1763 | | object_spec ALIGNED |
2740f169 PE |
1764 | ; |
1765 | ||
1766 | text: | |
1767 | TEXT | |
2740f169 | 1768 | | SPRINTF '(' TEXT sprintf_args ')' |
2740f169 PE |
1769 | ; |
1770 | ||
1771 | sprintf_args: | |
1772 | /* empty */ | |
2740f169 | 1773 | | sprintf_args ',' expr |
2740f169 PE |
1774 | ; |
1775 | ||
1776 | position: | |
04098407 | 1777 | position_not_place |
2740f169 | 1778 | | place |
2740f169 PE |
1779 | ; |
1780 | ||
1781 | position_not_place: | |
1782 | expr_pair | |
2740f169 | 1783 | | position '+' expr_pair |
2740f169 | 1784 | | position '-' expr_pair |
2740f169 | 1785 | | '(' position ',' position ')' |
2740f169 | 1786 | | expr between position AND position |
2740f169 | 1787 | | expr '<' position ',' position '>' |
2740f169 PE |
1788 | ; |
1789 | ||
1790 | between: | |
1791 | BETWEEN | |
1792 | | OF THE WAY BETWEEN | |
1793 | ; | |
1794 | ||
1795 | expr_pair: | |
1796 | expr ',' expr | |
2740f169 | 1797 | | '(' expr_pair ')' |
2740f169 PE |
1798 | ; |
1799 | ||
1800 | place: | |
1801 | /* line at A left == line (at A) left */ | |
1802 | label %prec CHOP | |
2740f169 | 1803 | | label corner |
2740f169 | 1804 | | corner label |
2740f169 | 1805 | | corner OF label |
2740f169 | 1806 | | HERE |
2740f169 PE |
1807 | ; |
1808 | ||
1809 | label: | |
1810 | LABEL | |
2740f169 | 1811 | | nth_primitive |
2740f169 | 1812 | | label '.' LABEL |
2740f169 PE |
1813 | ; |
1814 | ||
1815 | ordinal: | |
1816 | ORDINAL | |
2740f169 | 1817 | | '`' any_expr TH |
2740f169 PE |
1818 | ; |
1819 | ||
1820 | optional_ordinal_last: | |
1821 | LAST | |
04098407 | 1822 | | ordinal LAST |
2740f169 PE |
1823 | ; |
1824 | ||
1825 | nth_primitive: | |
1826 | ordinal object_type | |
2740f169 | 1827 | | optional_ordinal_last object_type |
2740f169 PE |
1828 | ; |
1829 | ||
1830 | object_type: | |
1831 | BOX | |
2740f169 | 1832 | | CIRCLE |
2740f169 | 1833 | | ELLIPSE |
2740f169 | 1834 | | ARC |
2740f169 | 1835 | | LINE |
2740f169 | 1836 | | ARROW |
2740f169 | 1837 | | SPLINE |
2740f169 | 1838 | | '[' ']' |
2740f169 | 1839 | | TEXT |
2740f169 PE |
1840 | ; |
1841 | ||
1842 | label_path: | |
04098407 | 1843 | '.' LABEL |
2740f169 | 1844 | | label_path '.' LABEL |
2740f169 PE |
1845 | ; |
1846 | ||
1847 | relative_path: | |
1848 | corner %prec CHOP | |
2740f169 PE |
1849 | /* give this a lower precedence than LEFT and RIGHT so that |
1850 | [A: box] with .A left == [A: box] with (.A left) */ | |
04098407 | 1851 | | label_path %prec TEXT |
2740f169 | 1852 | | label_path corner |
2740f169 PE |
1853 | ; |
1854 | ||
1855 | path: | |
1856 | relative_path | |
2740f169 | 1857 | | '(' relative_path ',' relative_path ')' |
affac613 | 1858 | {} |
2740f169 PE |
1859 | /* The rest of these rules are a compatibility sop. */ |
1860 | | ORDINAL LAST object_type relative_path | |
2740f169 | 1861 | | LAST object_type relative_path |
2740f169 | 1862 | | ORDINAL object_type relative_path |
2740f169 | 1863 | | LABEL relative_path |
2740f169 PE |
1864 | ; |
1865 | ||
1866 | corner: | |
1867 | DOT_N | |
04098407 | 1868 | | DOT_E |
2740f169 | 1869 | | DOT_W |
2740f169 | 1870 | | DOT_S |
2740f169 | 1871 | | DOT_NE |
2740f169 | 1872 | | DOT_SE |
2740f169 | 1873 | | DOT_NW |
2740f169 | 1874 | | DOT_SW |
2740f169 | 1875 | | DOT_C |
2740f169 | 1876 | | DOT_START |
2740f169 | 1877 | | DOT_END |
04098407 | 1878 | | TOP |
2740f169 | 1879 | | BOTTOM |
2740f169 | 1880 | | LEFT |
2740f169 | 1881 | | RIGHT |
2740f169 | 1882 | | UPPER LEFT |
2740f169 | 1883 | | LOWER LEFT |
2740f169 | 1884 | | UPPER RIGHT |
2740f169 | 1885 | | LOWER RIGHT |
2740f169 | 1886 | | LEFT_CORNER |
2740f169 | 1887 | | RIGHT_CORNER |
2740f169 | 1888 | | UPPER LEFT_CORNER |
2740f169 | 1889 | | LOWER LEFT_CORNER |
2740f169 | 1890 | | UPPER RIGHT_CORNER |
2740f169 | 1891 | | LOWER RIGHT_CORNER |
2740f169 | 1892 | | NORTH |
2740f169 | 1893 | | SOUTH |
2740f169 | 1894 | | EAST |
2740f169 | 1895 | | WEST |
2740f169 | 1896 | | CENTER |
2740f169 | 1897 | | START |
2740f169 | 1898 | | END |
2740f169 PE |
1899 | ; |
1900 | ||
1901 | expr: | |
1902 | VARIABLE | |
2740f169 | 1903 | | NUMBER |
2740f169 | 1904 | | place DOT_X |
2740f169 | 1905 | | place DOT_Y |
2740f169 | 1906 | | place DOT_HT |
2740f169 | 1907 | | place DOT_WID |
2740f169 | 1908 | | place DOT_RAD |
2740f169 | 1909 | | expr '+' expr |
2740f169 | 1910 | | expr '-' expr |
2740f169 | 1911 | | expr '*' expr |
2740f169 | 1912 | | expr '/' expr |
2740f169 | 1913 | | expr '%' expr |
2740f169 | 1914 | | expr '^' expr |
2740f169 | 1915 | | '-' expr %prec '!' |
2740f169 | 1916 | | '(' any_expr ')' |
2740f169 | 1917 | | SIN '(' any_expr ')' |
2740f169 | 1918 | | COS '(' any_expr ')' |
2740f169 | 1919 | | ATAN2 '(' any_expr ',' any_expr ')' |
2740f169 | 1920 | | LOG '(' any_expr ')' |
2740f169 | 1921 | | EXP '(' any_expr ')' |
2740f169 | 1922 | | SQRT '(' any_expr ')' |
2740f169 | 1923 | | K_MAX '(' any_expr ',' any_expr ')' |
2740f169 | 1924 | | K_MIN '(' any_expr ',' any_expr ')' |
2740f169 | 1925 | | INT '(' any_expr ')' |
2740f169 | 1926 | | RAND '(' any_expr ')' |
2740f169 | 1927 | | RAND '(' ')' |
2740f169 | 1928 | | SRAND '(' any_expr ')' |
2740f169 | 1929 | | expr '<' expr |
2740f169 | 1930 | | expr LESSEQUAL expr |
2740f169 | 1931 | | expr '>' expr |
2740f169 | 1932 | | expr GREATEREQUAL expr |
2740f169 | 1933 | | expr EQUALEQUAL expr |
2740f169 | 1934 | | expr NOTEQUAL expr |
2740f169 | 1935 | | expr ANDAND expr |
2740f169 | 1936 | | expr OROR expr |
2740f169 | 1937 | | '!' expr |
2740f169 | 1938 | ; |
db34f798 JD |
1939 | ]], |
1940 | ||
1941 | dnl INPUT | |
1942 | dnl | |
1943 | dnl For example, in pic: | |
1944 | dnl | |
1945 | dnl .PS | |
1946 | dnl A: circle "A" | |
1947 | dnl B: A left | |
1948 | dnl circle "B" at B | |
1949 | dnl .PE | |
1950 | dnl | |
1951 | dnl Even using groff 1.19.2, the 3rd line above is a syntax error. Change | |
1952 | dnl "left" to "right", and it still is. However, add "upper" or "lower" before | |
1953 | dnl "left or "right" and it's accepted to mean ".nw", ".ne", ".sw", or ".se". | |
1954 | dnl (There seem to be no aliases for "north" and "south" that can stand alone | |
1955 | dnl without being followed by "of".) | |
1956 | [[VARIABLE, '=', LABEL, LEFT, DOT_X]], | |
1957 | ||
1958 | dnl BISON-STDERR | |
1959 | [[input.y:471.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path | |
1960 | ]], | |
1961 | ||
1962 | dnl LAST-STATE | |
1963 | [AT_COND_CASE([[LALR]], [[422]], [[canonical LR]], [[4833]], [[427]])], | |
1964 | ||
1965 | dnl LALR1-DIFF not used for canonical LR(1) because the diff is huge. | |
1966 | dnl Isocore map from LALR(1) state number to new state number plus descriptions | |
1967 | dnl of any change in the actions resulting in a change in accepted language: | |
1968 | dnl - 102 -> 423: reduce -> shift on LEFT and RIGHT | |
1969 | dnl - 237 -> 425 | |
1970 | dnl - 266 -> 424 | |
1971 | dnl - 339 -> 426 | |
1972 | dnl - 383 -> 427 | |
1973 | [AT_COND_CASE([[LALR]], [], | |
1974 | [[@@ -1223,7 +1223,7 @@ | |
1975 | text_expr go to state 112 | |
1976 | text go to state 113 | |
1977 | place go to state 114 | |
1978 | - label go to state 102 | |
1979 | + label go to state 423 | |
1980 | ordinal go to state 103 | |
1981 | optional_ordinal_last go to state 104 | |
1982 | nth_primitive go to state 105 | |
1983 | @@ -1377,7 +1377,7 @@ | |
1984 | '!' shift, and go to state 94 | |
1985 | ||
1986 | place go to state 114 | |
1987 | - label go to state 102 | |
1988 | + label go to state 423 | |
1989 | ordinal go to state 103 | |
1990 | optional_ordinal_last go to state 104 | |
1991 | nth_primitive go to state 105 | |
1992 | @@ -1854,7 +1854,7 @@ | |
1993 | ||
1994 | text go to state 162 | |
1995 | place go to state 114 | |
1996 | - label go to state 102 | |
1997 | + label go to state 423 | |
1998 | ordinal go to state 103 | |
1999 | optional_ordinal_last go to state 104 | |
2000 | nth_primitive go to state 105 | |
2001 | @@ -2047,7 +2047,7 @@ | |
2002 | text_expr go to state 112 | |
2003 | text go to state 113 | |
2004 | place go to state 114 | |
2005 | - label go to state 102 | |
2006 | + label go to state 423 | |
2007 | ordinal go to state 103 | |
2008 | optional_ordinal_last go to state 104 | |
2009 | nth_primitive go to state 105 | |
2010 | @@ -2571,7 +2571,7 @@ | |
2011 | position_not_place go to state 99 | |
2012 | expr_pair go to state 191 | |
2013 | place go to state 101 | |
2014 | - label go to state 102 | |
2015 | + label go to state 423 | |
2016 | ordinal go to state 103 | |
2017 | optional_ordinal_last go to state 104 | |
2018 | nth_primitive go to state 105 | |
2019 | @@ -2732,7 +2732,7 @@ | |
2020 | text_expr go to state 112 | |
2021 | text go to state 113 | |
2022 | place go to state 114 | |
2023 | - label go to state 102 | |
2024 | + label go to state 423 | |
2025 | ordinal go to state 103 | |
2026 | optional_ordinal_last go to state 104 | |
2027 | nth_primitive go to state 105 | |
2028 | @@ -2875,7 +2875,7 @@ | |
2029 | '!' shift, and go to state 94 | |
2030 | ||
2031 | place go to state 114 | |
2032 | - label go to state 102 | |
2033 | + label go to state 423 | |
2034 | ordinal go to state 103 | |
2035 | optional_ordinal_last go to state 104 | |
2036 | nth_primitive go to state 105 | |
2037 | @@ -3018,7 +3018,7 @@ | |
2038 | '!' shift, and go to state 94 | |
2039 | ||
2040 | place go to state 114 | |
2041 | - label go to state 102 | |
2042 | + label go to state 423 | |
2043 | ordinal go to state 103 | |
2044 | optional_ordinal_last go to state 104 | |
2045 | nth_primitive go to state 105 | |
2046 | @@ -3256,7 +3256,7 @@ | |
2047 | ||
2048 | state 102 | |
2049 | ||
2050 | - 146 place: label . [$end, LABEL, VARIABLE, NUMBER, TEXT, ORDINAL, LEFT_ARROW_HEAD, RIGHT_ARROW_HEAD, DOUBLE_ARROW_HEAD, LAST, UP, DOWN, LEFT, RIGHT, HEIGHT, RADIUS, WIDTH, DIAMETER, FROM, TO, AT, WITH, BY, THEN, SOLID, DOTTED, DASHED, CHOP, SAME, INVISIBLE, LJUST, RJUST, ABOVE, BELOW, AND, HERE, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, SIN, COS, ATAN2, LOG, EXP, SQRT, K_MAX, K_MIN, INT, RAND, SRAND, CW, CCW, THICKNESS, FILL, COLORED, OUTLINED, SHADED, ALIGNED, SPRINTF, '(', '`', ',', '>', '+', '-', '!', ';', '}', '@:>@', ')'] | |
2051 | + 146 place: label . [$end, LABEL, VARIABLE, NUMBER, TEXT, ORDINAL, LEFT_ARROW_HEAD, RIGHT_ARROW_HEAD, DOUBLE_ARROW_HEAD, LAST, UP, DOWN, LEFT, RIGHT, HEIGHT, RADIUS, WIDTH, DIAMETER, FROM, TO, AT, WITH, BY, THEN, SOLID, DOTTED, DASHED, CHOP, SAME, INVISIBLE, LJUST, RJUST, ABOVE, BELOW, HERE, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, SIN, COS, ATAN2, LOG, EXP, SQRT, K_MAX, K_MIN, INT, RAND, SRAND, CW, CCW, THICKNESS, FILL, COLORED, OUTLINED, SHADED, ALIGNED, SPRINTF, '(', '`', '+', '-', '!', ';', '}', '@:>@'] | |
2052 | 147 | label . corner | |
2053 | 153 label: label . '.' LABEL | |
2054 | 180 corner: . DOT_N | |
2055 | @@ -3645,7 +3645,7 @@ | |
2056 | text_expr go to state 112 | |
2057 | text go to state 113 | |
2058 | place go to state 114 | |
2059 | - label go to state 102 | |
2060 | + label go to state 423 | |
2061 | ordinal go to state 103 | |
2062 | optional_ordinal_last go to state 104 | |
2063 | nth_primitive go to state 105 | |
2064 | @@ -3804,7 +3804,7 @@ | |
2065 | text_expr go to state 239 | |
2066 | text go to state 113 | |
2067 | place go to state 114 | |
2068 | - label go to state 102 | |
2069 | + label go to state 423 | |
2070 | ordinal go to state 103 | |
2071 | optional_ordinal_last go to state 104 | |
2072 | nth_primitive go to state 105 | |
2073 | @@ -4481,7 +4481,7 @@ | |
2074 | $default reduce using rule 89 (object_spec) | |
2075 | ||
2076 | place go to state 114 | |
2077 | - label go to state 102 | |
2078 | + label go to state 423 | |
2079 | ordinal go to state 103 | |
2080 | optional_ordinal_last go to state 104 | |
2081 | nth_primitive go to state 105 | |
2082 | @@ -4673,7 +4673,7 @@ | |
2083 | $default reduce using rule 91 (object_spec) | |
2084 | ||
2085 | place go to state 114 | |
2086 | - label go to state 102 | |
2087 | + label go to state 423 | |
2088 | ordinal go to state 103 | |
2089 | optional_ordinal_last go to state 104 | |
2090 | nth_primitive go to state 105 | |
2091 | @@ -4867,7 +4867,7 @@ | |
2092 | $default reduce using rule 95 (object_spec) | |
2093 | ||
2094 | place go to state 114 | |
2095 | - label go to state 102 | |
2096 | + label go to state 423 | |
2097 | ordinal go to state 103 | |
2098 | optional_ordinal_last go to state 104 | |
2099 | nth_primitive go to state 105 | |
2100 | @@ -5065,7 +5065,7 @@ | |
2101 | $default reduce using rule 93 (object_spec) | |
2102 | ||
2103 | place go to state 114 | |
2104 | - label go to state 102 | |
2105 | + label go to state 423 | |
2106 | ordinal go to state 103 | |
2107 | optional_ordinal_last go to state 104 | |
2108 | nth_primitive go to state 105 | |
2109 | @@ -5260,7 +5260,7 @@ | |
2110 | '!' shift, and go to state 94 | |
2111 | ||
2112 | place go to state 114 | |
2113 | - label go to state 102 | |
2114 | + label go to state 423 | |
2115 | ordinal go to state 103 | |
2116 | optional_ordinal_last go to state 104 | |
2117 | nth_primitive go to state 105 | |
2118 | @@ -5403,7 +5403,7 @@ | |
2119 | '!' shift, and go to state 94 | |
2120 | ||
2121 | place go to state 114 | |
2122 | - label go to state 102 | |
2123 | + label go to state 423 | |
2124 | ordinal go to state 103 | |
2125 | optional_ordinal_last go to state 104 | |
2126 | nth_primitive go to state 105 | |
2127 | @@ -5546,7 +5546,7 @@ | |
2128 | '!' shift, and go to state 94 | |
2129 | ||
2130 | place go to state 114 | |
2131 | - label go to state 102 | |
2132 | + label go to state 423 | |
2133 | ordinal go to state 103 | |
2134 | optional_ordinal_last go to state 104 | |
2135 | nth_primitive go to state 105 | |
2136 | @@ -5689,7 +5689,7 @@ | |
2137 | '!' shift, and go to state 94 | |
2138 | ||
2139 | place go to state 114 | |
2140 | - label go to state 102 | |
2141 | + label go to state 423 | |
2142 | ordinal go to state 103 | |
2143 | optional_ordinal_last go to state 104 | |
2144 | nth_primitive go to state 105 | |
2145 | @@ -6475,7 +6475,7 @@ | |
2146 | ||
2147 | expr_pair go to state 280 | |
2148 | place go to state 114 | |
2149 | - label go to state 102 | |
2150 | + label go to state 423 | |
2151 | ordinal go to state 103 | |
2152 | optional_ordinal_last go to state 104 | |
2153 | nth_primitive go to state 105 | |
2154 | @@ -6633,7 +6633,7 @@ | |
2155 | $default reduce using rule 105 (object_spec) | |
2156 | ||
2157 | place go to state 114 | |
2158 | - label go to state 102 | |
2159 | + label go to state 423 | |
2160 | ordinal go to state 103 | |
2161 | optional_ordinal_last go to state 104 | |
2162 | nth_primitive go to state 105 | |
2163 | @@ -6825,7 +6825,7 @@ | |
2164 | $default reduce using rule 107 (object_spec) | |
2165 | ||
2166 | place go to state 114 | |
2167 | - label go to state 102 | |
2168 | + label go to state 423 | |
2169 | ordinal go to state 103 | |
2170 | optional_ordinal_last go to state 104 | |
2171 | nth_primitive go to state 105 | |
2172 | @@ -7017,7 +7017,7 @@ | |
2173 | $default reduce using rule 114 (object_spec) | |
2174 | ||
2175 | place go to state 114 | |
2176 | - label go to state 102 | |
2177 | + label go to state 423 | |
2178 | ordinal go to state 103 | |
2179 | optional_ordinal_last go to state 104 | |
2180 | nth_primitive go to state 105 | |
2181 | @@ -7264,7 +7264,7 @@ | |
2182 | '!' shift, and go to state 94 | |
2183 | ||
2184 | place go to state 114 | |
2185 | - label go to state 102 | |
2186 | + label go to state 423 | |
2187 | ordinal go to state 103 | |
2188 | optional_ordinal_last go to state 104 | |
2189 | nth_primitive go to state 105 | |
2190 | @@ -7408,7 +7408,7 @@ | |
2191 | $default reduce using rule 109 (object_spec) | |
2192 | ||
2193 | place go to state 114 | |
2194 | - label go to state 102 | |
2195 | + label go to state 423 | |
2196 | ordinal go to state 103 | |
2197 | optional_ordinal_last go to state 104 | |
2198 | nth_primitive go to state 105 | |
2199 | @@ -7819,12 +7819,12 @@ | |
2200 | position_not_place go to state 296 | |
2201 | expr_pair go to state 100 | |
2202 | place go to state 297 | |
2203 | - label go to state 102 | |
2204 | + label go to state 423 | |
2205 | ordinal go to state 103 | |
2206 | optional_ordinal_last go to state 104 | |
2207 | nth_primitive go to state 105 | |
2208 | corner go to state 106 | |
2209 | - expr go to state 266 | |
2210 | + expr go to state 424 | |
2211 | ||
2212 | ||
2213 | state 165 | |
2214 | @@ -7987,7 +7987,7 @@ | |
2215 | text_expr go to state 112 | |
2216 | text go to state 113 | |
2217 | place go to state 114 | |
2218 | - label go to state 102 | |
2219 | + label go to state 423 | |
2220 | ordinal go to state 103 | |
2221 | optional_ordinal_last go to state 104 | |
2222 | nth_primitive go to state 105 | |
2223 | @@ -8172,7 +8172,7 @@ | |
2224 | text_expr go to state 112 | |
2225 | text go to state 113 | |
2226 | place go to state 114 | |
2227 | - label go to state 102 | |
2228 | + label go to state 423 | |
2229 | ordinal go to state 103 | |
2230 | optional_ordinal_last go to state 104 | |
2231 | nth_primitive go to state 105 | |
2232 | @@ -8333,7 +8333,7 @@ | |
2233 | text_expr go to state 112 | |
2234 | text go to state 113 | |
2235 | place go to state 114 | |
2236 | - label go to state 102 | |
2237 | + label go to state 423 | |
2238 | ordinal go to state 103 | |
2239 | optional_ordinal_last go to state 104 | |
2240 | nth_primitive go to state 105 | |
2241 | @@ -8494,7 +8494,7 @@ | |
2242 | text_expr go to state 112 | |
2243 | text go to state 113 | |
2244 | place go to state 114 | |
2245 | - label go to state 102 | |
2246 | + label go to state 423 | |
2247 | ordinal go to state 103 | |
2248 | optional_ordinal_last go to state 104 | |
2249 | nth_primitive go to state 105 | |
2250 | @@ -8655,7 +8655,7 @@ | |
2251 | text_expr go to state 112 | |
2252 | text go to state 113 | |
2253 | place go to state 114 | |
2254 | - label go to state 102 | |
2255 | + label go to state 423 | |
2256 | ordinal go to state 103 | |
2257 | optional_ordinal_last go to state 104 | |
2258 | nth_primitive go to state 105 | |
2259 | @@ -8816,7 +8816,7 @@ | |
2260 | text_expr go to state 112 | |
2261 | text go to state 113 | |
2262 | place go to state 114 | |
2263 | - label go to state 102 | |
2264 | + label go to state 423 | |
2265 | ordinal go to state 103 | |
2266 | optional_ordinal_last go to state 104 | |
2267 | nth_primitive go to state 105 | |
2268 | @@ -8977,7 +8977,7 @@ | |
2269 | text_expr go to state 112 | |
2270 | text go to state 113 | |
2271 | place go to state 114 | |
2272 | - label go to state 102 | |
2273 | + label go to state 423 | |
2274 | ordinal go to state 103 | |
2275 | optional_ordinal_last go to state 104 | |
2276 | nth_primitive go to state 105 | |
2277 | @@ -9138,7 +9138,7 @@ | |
2278 | text_expr go to state 112 | |
2279 | text go to state 113 | |
2280 | place go to state 114 | |
2281 | - label go to state 102 | |
2282 | + label go to state 423 | |
2283 | ordinal go to state 103 | |
2284 | optional_ordinal_last go to state 104 | |
2285 | nth_primitive go to state 105 | |
2286 | @@ -9299,7 +9299,7 @@ | |
2287 | text_expr go to state 112 | |
2288 | text go to state 113 | |
2289 | place go to state 114 | |
2290 | - label go to state 102 | |
2291 | + label go to state 423 | |
2292 | ordinal go to state 103 | |
2293 | optional_ordinal_last go to state 104 | |
2294 | nth_primitive go to state 105 | |
2295 | @@ -9460,7 +9460,7 @@ | |
2296 | text_expr go to state 112 | |
2297 | text go to state 113 | |
2298 | place go to state 114 | |
2299 | - label go to state 102 | |
2300 | + label go to state 423 | |
2301 | ordinal go to state 103 | |
2302 | optional_ordinal_last go to state 104 | |
2303 | nth_primitive go to state 105 | |
2304 | @@ -9623,7 +9623,7 @@ | |
2305 | text_expr go to state 112 | |
2306 | text go to state 113 | |
2307 | place go to state 114 | |
2308 | - label go to state 102 | |
2309 | + label go to state 423 | |
2310 | ordinal go to state 103 | |
2311 | optional_ordinal_last go to state 104 | |
2312 | nth_primitive go to state 105 | |
2313 | @@ -9784,7 +9784,7 @@ | |
2314 | text_expr go to state 112 | |
2315 | text go to state 113 | |
2316 | place go to state 114 | |
2317 | - label go to state 102 | |
2318 | + label go to state 423 | |
2319 | ordinal go to state 103 | |
2320 | optional_ordinal_last go to state 104 | |
2321 | nth_primitive go to state 105 | |
2322 | @@ -9921,7 +9921,7 @@ | |
2323 | ||
2324 | $default reduce using rule 47 (any_expr) | |
2325 | ||
2326 | - between go to state 237 | |
2327 | + between go to state 425 | |
2328 | ||
2329 | ||
2330 | state 193 | |
2331 | @@ -10152,7 +10152,7 @@ | |
2332 | ||
2333 | expr_pair go to state 317 | |
2334 | place go to state 114 | |
2335 | - label go to state 102 | |
2336 | + label go to state 423 | |
2337 | ordinal go to state 103 | |
2338 | optional_ordinal_last go to state 104 | |
2339 | nth_primitive go to state 105 | |
2340 | @@ -10298,7 +10298,7 @@ | |
2341 | ||
2342 | expr_pair go to state 318 | |
2343 | place go to state 114 | |
2344 | - label go to state 102 | |
2345 | + label go to state 423 | |
2346 | ordinal go to state 103 | |
2347 | optional_ordinal_last go to state 104 | |
2348 | nth_primitive go to state 105 | |
2349 | @@ -10622,7 +10622,7 @@ | |
2350 | '!' shift, and go to state 94 | |
2351 | ||
2352 | place go to state 114 | |
2353 | - label go to state 102 | |
2354 | + label go to state 423 | |
2355 | ordinal go to state 103 | |
2356 | optional_ordinal_last go to state 104 | |
2357 | nth_primitive go to state 105 | |
2358 | @@ -10765,7 +10765,7 @@ | |
2359 | '!' shift, and go to state 94 | |
2360 | ||
2361 | place go to state 114 | |
2362 | - label go to state 102 | |
2363 | + label go to state 423 | |
2364 | ordinal go to state 103 | |
2365 | optional_ordinal_last go to state 104 | |
2366 | nth_primitive go to state 105 | |
2367 | @@ -10908,7 +10908,7 @@ | |
2368 | '!' shift, and go to state 94 | |
2369 | ||
2370 | place go to state 114 | |
2371 | - label go to state 102 | |
2372 | + label go to state 423 | |
2373 | ordinal go to state 103 | |
2374 | optional_ordinal_last go to state 104 | |
2375 | nth_primitive go to state 105 | |
2376 | @@ -11051,7 +11051,7 @@ | |
2377 | '!' shift, and go to state 94 | |
2378 | ||
2379 | place go to state 114 | |
2380 | - label go to state 102 | |
2381 | + label go to state 423 | |
2382 | ordinal go to state 103 | |
2383 | optional_ordinal_last go to state 104 | |
2384 | nth_primitive go to state 105 | |
2385 | @@ -11194,7 +11194,7 @@ | |
2386 | '!' shift, and go to state 94 | |
2387 | ||
2388 | place go to state 114 | |
2389 | - label go to state 102 | |
2390 | + label go to state 423 | |
2391 | ordinal go to state 103 | |
2392 | optional_ordinal_last go to state 104 | |
2393 | nth_primitive go to state 105 | |
2394 | @@ -11337,7 +11337,7 @@ | |
2395 | '!' shift, and go to state 94 | |
2396 | ||
2397 | place go to state 114 | |
2398 | - label go to state 102 | |
2399 | + label go to state 423 | |
2400 | ordinal go to state 103 | |
2401 | optional_ordinal_last go to state 104 | |
2402 | nth_primitive go to state 105 | |
2403 | @@ -11480,7 +11480,7 @@ | |
2404 | '!' shift, and go to state 94 | |
2405 | ||
2406 | place go to state 114 | |
2407 | - label go to state 102 | |
2408 | + label go to state 423 | |
2409 | ordinal go to state 103 | |
2410 | optional_ordinal_last go to state 104 | |
2411 | nth_primitive go to state 105 | |
2412 | @@ -11637,7 +11637,7 @@ | |
2413 | position_not_place go to state 99 | |
2414 | expr_pair go to state 100 | |
2415 | place go to state 101 | |
2416 | - label go to state 102 | |
2417 | + label go to state 423 | |
2418 | ordinal go to state 103 | |
2419 | optional_ordinal_last go to state 104 | |
2420 | nth_primitive go to state 105 | |
2421 | @@ -11780,7 +11780,7 @@ | |
2422 | '!' shift, and go to state 94 | |
2423 | ||
2424 | place go to state 114 | |
2425 | - label go to state 102 | |
2426 | + label go to state 423 | |
2427 | ordinal go to state 103 | |
2428 | optional_ordinal_last go to state 104 | |
2429 | nth_primitive go to state 105 | |
2430 | @@ -11923,7 +11923,7 @@ | |
2431 | '!' shift, and go to state 94 | |
2432 | ||
2433 | place go to state 114 | |
2434 | - label go to state 102 | |
2435 | + label go to state 423 | |
2436 | ordinal go to state 103 | |
2437 | optional_ordinal_last go to state 104 | |
2438 | nth_primitive go to state 105 | |
2439 | @@ -12066,7 +12066,7 @@ | |
2440 | '!' shift, and go to state 94 | |
2441 | ||
2442 | place go to state 114 | |
2443 | - label go to state 102 | |
2444 | + label go to state 423 | |
2445 | ordinal go to state 103 | |
2446 | optional_ordinal_last go to state 104 | |
2447 | nth_primitive go to state 105 | |
2448 | @@ -12209,7 +12209,7 @@ | |
2449 | '!' shift, and go to state 94 | |
2450 | ||
2451 | place go to state 114 | |
2452 | - label go to state 102 | |
2453 | + label go to state 423 | |
2454 | ordinal go to state 103 | |
2455 | optional_ordinal_last go to state 104 | |
2456 | nth_primitive go to state 105 | |
2457 | @@ -12352,7 +12352,7 @@ | |
2458 | '!' shift, and go to state 94 | |
2459 | ||
2460 | place go to state 114 | |
2461 | - label go to state 102 | |
2462 | + label go to state 423 | |
2463 | ordinal go to state 103 | |
2464 | optional_ordinal_last go to state 104 | |
2465 | nth_primitive go to state 105 | |
2466 | @@ -12495,7 +12495,7 @@ | |
2467 | '!' shift, and go to state 94 | |
2468 | ||
2469 | place go to state 114 | |
2470 | - label go to state 102 | |
2471 | + label go to state 423 | |
2472 | ordinal go to state 103 | |
2473 | optional_ordinal_last go to state 104 | |
2474 | nth_primitive go to state 105 | |
2475 | @@ -12638,7 +12638,7 @@ | |
2476 | '!' shift, and go to state 94 | |
2477 | ||
2478 | place go to state 114 | |
2479 | - label go to state 102 | |
2480 | + label go to state 423 | |
2481 | ordinal go to state 103 | |
2482 | optional_ordinal_last go to state 104 | |
2483 | nth_primitive go to state 105 | |
2484 | @@ -12794,12 +12794,12 @@ | |
2485 | position_not_place go to state 99 | |
2486 | expr_pair go to state 100 | |
2487 | place go to state 101 | |
2488 | - label go to state 102 | |
2489 | + label go to state 423 | |
2490 | ordinal go to state 103 | |
2491 | optional_ordinal_last go to state 104 | |
2492 | nth_primitive go to state 105 | |
2493 | corner go to state 106 | |
2494 | - expr go to state 266 | |
2495 | + expr go to state 424 | |
2496 | ||
2497 | ||
2498 | state 238 | |
2499 | @@ -12937,7 +12937,7 @@ | |
2500 | '!' shift, and go to state 94 | |
2501 | ||
2502 | place go to state 114 | |
2503 | - label go to state 102 | |
2504 | + label go to state 423 | |
2505 | ordinal go to state 103 | |
2506 | optional_ordinal_last go to state 104 | |
2507 | nth_primitive go to state 105 | |
2508 | @@ -13160,7 +13160,7 @@ | |
2509 | text_expr go to state 342 | |
2510 | text go to state 113 | |
2511 | place go to state 114 | |
2512 | - label go to state 102 | |
2513 | + label go to state 423 | |
2514 | ordinal go to state 103 | |
2515 | optional_ordinal_last go to state 104 | |
2516 | nth_primitive go to state 105 | |
2517 | @@ -13319,7 +13319,7 @@ | |
2518 | text_expr go to state 344 | |
2519 | text go to state 113 | |
2520 | place go to state 114 | |
2521 | - label go to state 102 | |
2522 | + label go to state 423 | |
2523 | ordinal go to state 103 | |
2524 | optional_ordinal_last go to state 104 | |
2525 | nth_primitive go to state 105 | |
2526 | @@ -13502,7 +13502,7 @@ | |
2527 | text_expr go to state 348 | |
2528 | text go to state 113 | |
2529 | place go to state 114 | |
2530 | - label go to state 102 | |
2531 | + label go to state 423 | |
2532 | ordinal go to state 103 | |
2533 | optional_ordinal_last go to state 104 | |
2534 | nth_primitive go to state 105 | |
2535 | @@ -13661,7 +13661,7 @@ | |
2536 | text_expr go to state 350 | |
2537 | text go to state 113 | |
2538 | place go to state 114 | |
2539 | - label go to state 102 | |
2540 | + label go to state 423 | |
2541 | ordinal go to state 103 | |
2542 | optional_ordinal_last go to state 104 | |
2543 | nth_primitive go to state 105 | |
2544 | @@ -13804,7 +13804,7 @@ | |
2545 | '!' shift, and go to state 94 | |
2546 | ||
2547 | place go to state 114 | |
2548 | - label go to state 102 | |
2549 | + label go to state 423 | |
2550 | ordinal go to state 103 | |
2551 | optional_ordinal_last go to state 104 | |
2552 | nth_primitive go to state 105 | |
2553 | @@ -14747,7 +14747,7 @@ | |
2554 | position_not_place go to state 99 | |
2555 | expr_pair go to state 191 | |
2556 | place go to state 101 | |
2557 | - label go to state 102 | |
2558 | + label go to state 423 | |
2559 | ordinal go to state 103 | |
2560 | optional_ordinal_last go to state 104 | |
2561 | nth_primitive go to state 105 | |
2562 | @@ -15074,7 +15074,7 @@ | |
2563 | text go to state 113 | |
2564 | expr_pair go to state 365 | |
2565 | place go to state 114 | |
2566 | - label go to state 102 | |
2567 | + label go to state 423 | |
2568 | ordinal go to state 103 | |
2569 | optional_ordinal_last go to state 104 | |
2570 | nth_primitive go to state 105 | |
2571 | @@ -15693,12 +15693,12 @@ | |
2572 | position_not_place go to state 99 | |
2573 | expr_pair go to state 100 | |
2574 | place go to state 101 | |
2575 | - label go to state 102 | |
2576 | + label go to state 423 | |
2577 | ordinal go to state 103 | |
2578 | optional_ordinal_last go to state 104 | |
2579 | nth_primitive go to state 105 | |
2580 | corner go to state 106 | |
2581 | - expr go to state 266 | |
2582 | + expr go to state 424 | |
2583 | ||
2584 | ||
2585 | state 315 | |
2586 | @@ -16124,7 +16124,7 @@ | |
2587 | ||
2588 | $default reduce using rule 239 (expr) | |
2589 | ||
2590 | - between go to state 237 | |
2591 | + between go to state 425 | |
2592 | ||
2593 | Conflict between rule 239 and token OF resolved as shift ('<' < OF). | |
2594 | Conflict between rule 239 and token BETWEEN resolved as shift ('<' < BETWEEN). | |
2595 | @@ -17234,7 +17234,7 @@ | |
2596 | text_expr go to state 112 | |
2597 | text go to state 113 | |
2598 | place go to state 114 | |
2599 | - label go to state 102 | |
2600 | + label go to state 423 | |
2601 | ordinal go to state 103 | |
2602 | optional_ordinal_last go to state 104 | |
2603 | nth_primitive go to state 105 | |
2604 | @@ -17416,7 +17416,7 @@ | |
2605 | text_expr go to state 112 | |
2606 | text go to state 113 | |
2607 | place go to state 114 | |
2608 | - label go to state 102 | |
2609 | + label go to state 423 | |
2610 | ordinal go to state 103 | |
2611 | optional_ordinal_last go to state 104 | |
2612 | nth_primitive go to state 105 | |
2613 | @@ -17577,7 +17577,7 @@ | |
2614 | text_expr go to state 112 | |
2615 | text go to state 113 | |
2616 | place go to state 114 | |
2617 | - label go to state 102 | |
2618 | + label go to state 423 | |
2619 | ordinal go to state 103 | |
2620 | optional_ordinal_last go to state 104 | |
2621 | nth_primitive go to state 105 | |
2622 | @@ -17772,12 +17772,12 @@ | |
2623 | position_not_place go to state 99 | |
2624 | expr_pair go to state 100 | |
2625 | place go to state 101 | |
2626 | - label go to state 102 | |
2627 | + label go to state 423 | |
2628 | ordinal go to state 103 | |
2629 | optional_ordinal_last go to state 104 | |
2630 | nth_primitive go to state 105 | |
2631 | corner go to state 106 | |
2632 | - expr go to state 266 | |
2633 | + expr go to state 424 | |
2634 | ||
2635 | ||
2636 | state 383 | |
2637 | @@ -18071,7 +18071,7 @@ | |
2638 | '!' shift, and go to state 94 | |
2639 | ||
2640 | place go to state 114 | |
2641 | - label go to state 102 | |
2642 | + label go to state 423 | |
2643 | ordinal go to state 103 | |
2644 | optional_ordinal_last go to state 104 | |
2645 | nth_primitive go to state 105 | |
2646 | @@ -18221,7 +18221,7 @@ | |
2647 | '!' shift, and go to state 94 | |
2648 | ||
2649 | place go to state 114 | |
2650 | - label go to state 102 | |
2651 | + label go to state 423 | |
2652 | ordinal go to state 103 | |
2653 | optional_ordinal_last go to state 104 | |
2654 | nth_primitive go to state 105 | |
2655 | @@ -18830,7 +18830,7 @@ | |
2656 | '!' shift, and go to state 94 | |
2657 | ||
2658 | place go to state 114 | |
2659 | - label go to state 102 | |
2660 | + label go to state 423 | |
2661 | ordinal go to state 103 | |
2662 | optional_ordinal_last go to state 104 | |
2663 | nth_primitive go to state 105 | |
2664 | @@ -18987,7 +18987,7 @@ | |
2665 | '!' shift, and go to state 94 | |
2666 | ||
2667 | place go to state 114 | |
2668 | - label go to state 102 | |
2669 | + label go to state 423 | |
2670 | ordinal go to state 103 | |
2671 | optional_ordinal_last go to state 104 | |
2672 | nth_primitive go to state 105 | |
2673 | @@ -19089,3 +19089,440 @@ | |
2674 | 29 placeless_element: FOR VARIABLE '=' expr TO expr optional_by DO $@6 DELIMITED . | |
2675 | ||
2676 | $default reduce using rule 29 (placeless_element) | |
2677 | + | |
2678 | + | |
2679 | +state 423 | |
2680 | + | |
2681 | + 146 place: label . [$end, AND, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, ',', '>', '+', '-', ';', '}', '@:>@', ')'] | |
2682 | + 147 | label . corner | |
2683 | + 153 label: label . '.' LABEL | |
2684 | + 180 corner: . DOT_N | |
2685 | + 181 | . DOT_E | |
2686 | + 182 | . DOT_W | |
2687 | + 183 | . DOT_S | |
2688 | + 184 | . DOT_NE | |
2689 | + 185 | . DOT_SE | |
2690 | + 186 | . DOT_NW | |
2691 | + 187 | . DOT_SW | |
2692 | + 188 | . DOT_C | |
2693 | + 189 | . DOT_START | |
2694 | + 190 | . DOT_END | |
2695 | + 191 | . TOP | |
2696 | + 192 | . BOTTOM | |
2697 | + 193 | . LEFT | |
2698 | + 194 | . RIGHT | |
2699 | + 195 | . UPPER LEFT | |
2700 | + 196 | . LOWER LEFT | |
2701 | + 197 | . UPPER RIGHT | |
2702 | + 198 | . LOWER RIGHT | |
2703 | + 199 | . LEFT_CORNER | |
2704 | + 200 | . RIGHT_CORNER | |
2705 | + 201 | . UPPER LEFT_CORNER | |
2706 | + 202 | . LOWER LEFT_CORNER | |
2707 | + 203 | . UPPER RIGHT_CORNER | |
2708 | + 204 | . LOWER RIGHT_CORNER | |
2709 | + 205 | . NORTH | |
2710 | + 206 | . SOUTH | |
2711 | + 207 | . EAST | |
2712 | + 208 | . WEST | |
2713 | + 209 | . CENTER | |
2714 | + 210 | . START | |
2715 | + 211 | . END | |
2716 | + | |
2717 | + LEFT shift, and go to state 53 | |
2718 | + RIGHT shift, and go to state 54 | |
2719 | + DOT_N shift, and go to state 56 | |
2720 | + DOT_E shift, and go to state 57 | |
2721 | + DOT_W shift, and go to state 58 | |
2722 | + DOT_S shift, and go to state 59 | |
2723 | + DOT_NE shift, and go to state 60 | |
2724 | + DOT_SE shift, and go to state 61 | |
2725 | + DOT_NW shift, and go to state 62 | |
2726 | + DOT_SW shift, and go to state 63 | |
2727 | + DOT_C shift, and go to state 64 | |
2728 | + DOT_START shift, and go to state 65 | |
2729 | + DOT_END shift, and go to state 66 | |
2730 | + TOP shift, and go to state 78 | |
2731 | + BOTTOM shift, and go to state 79 | |
2732 | + UPPER shift, and go to state 80 | |
2733 | + LOWER shift, and go to state 81 | |
2734 | + LEFT_CORNER shift, and go to state 82 | |
2735 | + RIGHT_CORNER shift, and go to state 83 | |
2736 | + NORTH shift, and go to state 84 | |
2737 | + SOUTH shift, and go to state 85 | |
2738 | + EAST shift, and go to state 86 | |
2739 | + WEST shift, and go to state 87 | |
2740 | + CENTER shift, and go to state 88 | |
2741 | + END shift, and go to state 89 | |
2742 | + START shift, and go to state 90 | |
2743 | + '.' shift, and go to state 204 | |
2744 | + | |
2745 | + $default reduce using rule 146 (place) | |
2746 | + | |
2747 | + corner go to state 205 | |
2748 | + | |
2749 | + | |
2750 | +state 424 | |
2751 | + | |
2752 | + 140 position_not_place: expr . between position AND position | |
2753 | + 141 | expr . '<' position ',' position '>' | |
2754 | + 142 between: . BETWEEN | |
2755 | + 143 | . OF THE WAY BETWEEN | |
2756 | + 144 expr_pair: expr . ',' expr | |
2757 | + 219 expr: expr . '+' expr | |
2758 | + 220 | expr . '-' expr | |
2759 | + 221 | expr . '*' expr | |
2760 | + 222 | expr . '/' expr | |
2761 | + 223 | expr . '%' expr | |
2762 | + 224 | expr . '^' expr | |
2763 | + 239 | expr . '<' expr | |
2764 | + 240 | expr . LESSEQUAL expr | |
2765 | + 241 | expr . '>' expr | |
2766 | + 242 | expr . GREATEREQUAL expr | |
2767 | + 243 | expr . EQUALEQUAL expr | |
2768 | + 244 | expr . NOTEQUAL expr | |
2769 | + 245 | expr . ANDAND expr | |
2770 | + 246 | expr . OROR expr | |
2771 | + | |
2772 | + OF shift, and go to state 220 | |
2773 | + BETWEEN shift, and go to state 221 | |
2774 | + ANDAND shift, and go to state 222 | |
2775 | + OROR shift, and go to state 223 | |
2776 | + NOTEQUAL shift, and go to state 224 | |
2777 | + EQUALEQUAL shift, and go to state 225 | |
2778 | + LESSEQUAL shift, and go to state 226 | |
2779 | + GREATEREQUAL shift, and go to state 227 | |
2780 | + ',' shift, and go to state 228 | |
2781 | + '<' shift, and go to state 229 | |
2782 | + '>' shift, and go to state 230 | |
2783 | + '+' shift, and go to state 231 | |
2784 | + '-' shift, and go to state 232 | |
2785 | + '*' shift, and go to state 233 | |
2786 | + '/' shift, and go to state 234 | |
2787 | + '%' shift, and go to state 235 | |
2788 | + '^' shift, and go to state 236 | |
2789 | + | |
2790 | + between go to state 425 | |
2791 | + | |
2792 | + | |
2793 | +state 425 | |
2794 | + | |
2795 | + 134 position: . position_not_place | |
2796 | + 135 | . place | |
2797 | + 136 position_not_place: . expr_pair | |
2798 | + 137 | . position '+' expr_pair | |
2799 | + 138 | . position '-' expr_pair | |
2800 | + 139 | . '(' position ',' position ')' | |
2801 | + 140 | . expr between position AND position | |
2802 | + 140 | expr between . position AND position | |
2803 | + 141 | . expr '<' position ',' position '>' | |
2804 | + 144 expr_pair: . expr ',' expr | |
2805 | + 145 | . '(' expr_pair ')' | |
2806 | + 146 place: . label | |
2807 | + 147 | . label corner | |
2808 | + 148 | . corner label | |
2809 | + 149 | . corner OF label | |
2810 | + 150 | . HERE | |
2811 | + 151 label: . LABEL | |
2812 | + 152 | . nth_primitive | |
2813 | + 153 | . label '.' LABEL | |
2814 | + 154 ordinal: . ORDINAL | |
2815 | + 155 | . '`' any_expr TH | |
2816 | + 156 optional_ordinal_last: . LAST | |
2817 | + 157 | . ordinal LAST | |
2818 | + 158 nth_primitive: . ordinal object_type | |
2819 | + 159 | . optional_ordinal_last object_type | |
2820 | + 180 corner: . DOT_N | |
2821 | + 181 | . DOT_E | |
2822 | + 182 | . DOT_W | |
2823 | + 183 | . DOT_S | |
2824 | + 184 | . DOT_NE | |
2825 | + 185 | . DOT_SE | |
2826 | + 186 | . DOT_NW | |
2827 | + 187 | . DOT_SW | |
2828 | + 188 | . DOT_C | |
2829 | + 189 | . DOT_START | |
2830 | + 190 | . DOT_END | |
2831 | + 191 | . TOP | |
2832 | + 192 | . BOTTOM | |
2833 | + 193 | . LEFT | |
2834 | + 194 | . RIGHT | |
2835 | + 195 | . UPPER LEFT | |
2836 | + 196 | . LOWER LEFT | |
2837 | + 197 | . UPPER RIGHT | |
2838 | + 198 | . LOWER RIGHT | |
2839 | + 199 | . LEFT_CORNER | |
2840 | + 200 | . RIGHT_CORNER | |
2841 | + 201 | . UPPER LEFT_CORNER | |
2842 | + 202 | . LOWER LEFT_CORNER | |
2843 | + 203 | . UPPER RIGHT_CORNER | |
2844 | + 204 | . LOWER RIGHT_CORNER | |
2845 | + 205 | . NORTH | |
2846 | + 206 | . SOUTH | |
2847 | + 207 | . EAST | |
2848 | + 208 | . WEST | |
2849 | + 209 | . CENTER | |
2850 | + 210 | . START | |
2851 | + 211 | . END | |
2852 | + 212 expr: . VARIABLE | |
2853 | + 213 | . NUMBER | |
2854 | + 214 | . place DOT_X | |
2855 | + 215 | . place DOT_Y | |
2856 | + 216 | . place DOT_HT | |
2857 | + 217 | . place DOT_WID | |
2858 | + 218 | . place DOT_RAD | |
2859 | + 219 | . expr '+' expr | |
2860 | + 220 | . expr '-' expr | |
2861 | + 221 | . expr '*' expr | |
2862 | + 222 | . expr '/' expr | |
2863 | + 223 | . expr '%' expr | |
2864 | + 224 | . expr '^' expr | |
2865 | + 225 | . '-' expr | |
2866 | + 226 | . '(' any_expr ')' | |
2867 | + 227 | . SIN '(' any_expr ')' | |
2868 | + 228 | . COS '(' any_expr ')' | |
2869 | + 229 | . ATAN2 '(' any_expr ',' any_expr ')' | |
2870 | + 230 | . LOG '(' any_expr ')' | |
2871 | + 231 | . EXP '(' any_expr ')' | |
2872 | + 232 | . SQRT '(' any_expr ')' | |
2873 | + 233 | . K_MAX '(' any_expr ',' any_expr ')' | |
2874 | + 234 | . K_MIN '(' any_expr ',' any_expr ')' | |
2875 | + 235 | . INT '(' any_expr ')' | |
2876 | + 236 | . RAND '(' any_expr ')' | |
2877 | + 237 | . RAND '(' ')' | |
2878 | + 238 | . SRAND '(' any_expr ')' | |
2879 | + 239 | . expr '<' expr | |
2880 | + 240 | . expr LESSEQUAL expr | |
2881 | + 241 | . expr '>' expr | |
2882 | + 242 | . expr GREATEREQUAL expr | |
2883 | + 243 | . expr EQUALEQUAL expr | |
2884 | + 244 | . expr NOTEQUAL expr | |
2885 | + 245 | . expr ANDAND expr | |
2886 | + 246 | . expr OROR expr | |
2887 | + 247 | . '!' expr | |
2888 | + | |
2889 | + LABEL shift, and go to state 48 | |
2890 | + VARIABLE shift, and go to state 49 | |
2891 | + NUMBER shift, and go to state 50 | |
2892 | + ORDINAL shift, and go to state 51 | |
2893 | + LAST shift, and go to state 52 | |
2894 | + LEFT shift, and go to state 53 | |
2895 | + RIGHT shift, and go to state 54 | |
2896 | + HERE shift, and go to state 55 | |
2897 | + DOT_N shift, and go to state 56 | |
2898 | + DOT_E shift, and go to state 57 | |
2899 | + DOT_W shift, and go to state 58 | |
2900 | + DOT_S shift, and go to state 59 | |
2901 | + DOT_NE shift, and go to state 60 | |
2902 | + DOT_SE shift, and go to state 61 | |
2903 | + DOT_NW shift, and go to state 62 | |
2904 | + DOT_SW shift, and go to state 63 | |
2905 | + DOT_C shift, and go to state 64 | |
2906 | + DOT_START shift, and go to state 65 | |
2907 | + DOT_END shift, and go to state 66 | |
2908 | + SIN shift, and go to state 67 | |
2909 | + COS shift, and go to state 68 | |
2910 | + ATAN2 shift, and go to state 69 | |
2911 | + LOG shift, and go to state 70 | |
2912 | + EXP shift, and go to state 71 | |
2913 | + SQRT shift, and go to state 72 | |
2914 | + K_MAX shift, and go to state 73 | |
2915 | + K_MIN shift, and go to state 74 | |
2916 | + INT shift, and go to state 75 | |
2917 | + RAND shift, and go to state 76 | |
2918 | + SRAND shift, and go to state 77 | |
2919 | + TOP shift, and go to state 78 | |
2920 | + BOTTOM shift, and go to state 79 | |
2921 | + UPPER shift, and go to state 80 | |
2922 | + LOWER shift, and go to state 81 | |
2923 | + LEFT_CORNER shift, and go to state 82 | |
2924 | + RIGHT_CORNER shift, and go to state 83 | |
2925 | + NORTH shift, and go to state 84 | |
2926 | + SOUTH shift, and go to state 85 | |
2927 | + EAST shift, and go to state 86 | |
2928 | + WEST shift, and go to state 87 | |
2929 | + CENTER shift, and go to state 88 | |
2930 | + END shift, and go to state 89 | |
2931 | + START shift, and go to state 90 | |
2932 | + '(' shift, and go to state 91 | |
2933 | + '`' shift, and go to state 92 | |
2934 | + '-' shift, and go to state 93 | |
2935 | + '!' shift, and go to state 94 | |
2936 | + | |
2937 | + position go to state 426 | |
2938 | + position_not_place go to state 99 | |
2939 | + expr_pair go to state 100 | |
2940 | + place go to state 101 | |
2941 | + label go to state 423 | |
2942 | + ordinal go to state 103 | |
2943 | + optional_ordinal_last go to state 104 | |
2944 | + nth_primitive go to state 105 | |
2945 | + corner go to state 106 | |
2946 | + expr go to state 424 | |
2947 | + | |
2948 | + | |
2949 | +state 426 | |
2950 | + | |
2951 | + 137 position_not_place: position . '+' expr_pair | |
2952 | + 138 | position . '-' expr_pair | |
2953 | + 140 | expr between position . AND position | |
2954 | + | |
2955 | + AND shift, and go to state 427 | |
2956 | + '+' shift, and go to state 197 | |
2957 | + '-' shift, and go to state 198 | |
2958 | + | |
2959 | + | |
2960 | +state 427 | |
2961 | + | |
2962 | + 134 position: . position_not_place | |
2963 | + 135 | . place | |
2964 | + 136 position_not_place: . expr_pair | |
2965 | + 137 | . position '+' expr_pair | |
2966 | + 138 | . position '-' expr_pair | |
2967 | + 139 | . '(' position ',' position ')' | |
2968 | + 140 | . expr between position AND position | |
2969 | + 140 | expr between position AND . position | |
2970 | + 141 | . expr '<' position ',' position '>' | |
2971 | + 144 expr_pair: . expr ',' expr | |
2972 | + 145 | . '(' expr_pair ')' | |
2973 | + 146 place: . label | |
2974 | + 147 | . label corner | |
2975 | + 148 | . corner label | |
2976 | + 149 | . corner OF label | |
2977 | + 150 | . HERE | |
2978 | + 151 label: . LABEL | |
2979 | + 152 | . nth_primitive | |
2980 | + 153 | . label '.' LABEL | |
2981 | + 154 ordinal: . ORDINAL | |
2982 | + 155 | . '`' any_expr TH | |
2983 | + 156 optional_ordinal_last: . LAST | |
2984 | + 157 | . ordinal LAST | |
2985 | + 158 nth_primitive: . ordinal object_type | |
2986 | + 159 | . optional_ordinal_last object_type | |
2987 | + 180 corner: . DOT_N | |
2988 | + 181 | . DOT_E | |
2989 | + 182 | . DOT_W | |
2990 | + 183 | . DOT_S | |
2991 | + 184 | . DOT_NE | |
2992 | + 185 | . DOT_SE | |
2993 | + 186 | . DOT_NW | |
2994 | + 187 | . DOT_SW | |
2995 | + 188 | . DOT_C | |
2996 | + 189 | . DOT_START | |
2997 | + 190 | . DOT_END | |
2998 | + 191 | . TOP | |
2999 | + 192 | . BOTTOM | |
3000 | + 193 | . LEFT | |
3001 | + 194 | . RIGHT | |
3002 | + 195 | . UPPER LEFT | |
3003 | + 196 | . LOWER LEFT | |
3004 | + 197 | . UPPER RIGHT | |
3005 | + 198 | . LOWER RIGHT | |
3006 | + 199 | . LEFT_CORNER | |
3007 | + 200 | . RIGHT_CORNER | |
3008 | + 201 | . UPPER LEFT_CORNER | |
3009 | + 202 | . LOWER LEFT_CORNER | |
3010 | + 203 | . UPPER RIGHT_CORNER | |
3011 | + 204 | . LOWER RIGHT_CORNER | |
3012 | + 205 | . NORTH | |
3013 | + 206 | . SOUTH | |
3014 | + 207 | . EAST | |
3015 | + 208 | . WEST | |
3016 | + 209 | . CENTER | |
3017 | + 210 | . START | |
3018 | + 211 | . END | |
3019 | + 212 expr: . VARIABLE | |
3020 | + 213 | . NUMBER | |
3021 | + 214 | . place DOT_X | |
3022 | + 215 | . place DOT_Y | |
3023 | + 216 | . place DOT_HT | |
3024 | + 217 | . place DOT_WID | |
3025 | + 218 | . place DOT_RAD | |
3026 | + 219 | . expr '+' expr | |
3027 | + 220 | . expr '-' expr | |
3028 | + 221 | . expr '*' expr | |
3029 | + 222 | . expr '/' expr | |
3030 | + 223 | . expr '%' expr | |
3031 | + 224 | . expr '^' expr | |
3032 | + 225 | . '-' expr | |
3033 | + 226 | . '(' any_expr ')' | |
3034 | + 227 | . SIN '(' any_expr ')' | |
3035 | + 228 | . COS '(' any_expr ')' | |
3036 | + 229 | . ATAN2 '(' any_expr ',' any_expr ')' | |
3037 | + 230 | . LOG '(' any_expr ')' | |
3038 | + 231 | . EXP '(' any_expr ')' | |
3039 | + 232 | . SQRT '(' any_expr ')' | |
3040 | + 233 | . K_MAX '(' any_expr ',' any_expr ')' | |
3041 | + 234 | . K_MIN '(' any_expr ',' any_expr ')' | |
3042 | + 235 | . INT '(' any_expr ')' | |
3043 | + 236 | . RAND '(' any_expr ')' | |
3044 | + 237 | . RAND '(' ')' | |
3045 | + 238 | . SRAND '(' any_expr ')' | |
3046 | + 239 | . expr '<' expr | |
3047 | + 240 | . expr LESSEQUAL expr | |
3048 | + 241 | . expr '>' expr | |
3049 | + 242 | . expr GREATEREQUAL expr | |
3050 | + 243 | . expr EQUALEQUAL expr | |
3051 | + 244 | . expr NOTEQUAL expr | |
3052 | + 245 | . expr ANDAND expr | |
3053 | + 246 | . expr OROR expr | |
3054 | + 247 | . '!' expr | |
3055 | + | |
3056 | + LABEL shift, and go to state 48 | |
3057 | + VARIABLE shift, and go to state 49 | |
3058 | + NUMBER shift, and go to state 50 | |
3059 | + ORDINAL shift, and go to state 51 | |
3060 | + LAST shift, and go to state 52 | |
3061 | + LEFT shift, and go to state 53 | |
3062 | + RIGHT shift, and go to state 54 | |
3063 | + HERE shift, and go to state 55 | |
3064 | + DOT_N shift, and go to state 56 | |
3065 | + DOT_E shift, and go to state 57 | |
3066 | + DOT_W shift, and go to state 58 | |
3067 | + DOT_S shift, and go to state 59 | |
3068 | + DOT_NE shift, and go to state 60 | |
3069 | + DOT_SE shift, and go to state 61 | |
3070 | + DOT_NW shift, and go to state 62 | |
3071 | + DOT_SW shift, and go to state 63 | |
3072 | + DOT_C shift, and go to state 64 | |
3073 | + DOT_START shift, and go to state 65 | |
3074 | + DOT_END shift, and go to state 66 | |
3075 | + SIN shift, and go to state 67 | |
3076 | + COS shift, and go to state 68 | |
3077 | + ATAN2 shift, and go to state 69 | |
3078 | + LOG shift, and go to state 70 | |
3079 | + EXP shift, and go to state 71 | |
3080 | + SQRT shift, and go to state 72 | |
3081 | + K_MAX shift, and go to state 73 | |
3082 | + K_MIN shift, and go to state 74 | |
3083 | + INT shift, and go to state 75 | |
3084 | + RAND shift, and go to state 76 | |
3085 | + SRAND shift, and go to state 77 | |
3086 | + TOP shift, and go to state 78 | |
3087 | + BOTTOM shift, and go to state 79 | |
3088 | + UPPER shift, and go to state 80 | |
3089 | + LOWER shift, and go to state 81 | |
3090 | + LEFT_CORNER shift, and go to state 82 | |
3091 | + RIGHT_CORNER shift, and go to state 83 | |
3092 | + NORTH shift, and go to state 84 | |
3093 | + SOUTH shift, and go to state 85 | |
3094 | + EAST shift, and go to state 86 | |
3095 | + WEST shift, and go to state 87 | |
3096 | + CENTER shift, and go to state 88 | |
3097 | + END shift, and go to state 89 | |
3098 | + START shift, and go to state 90 | |
3099 | + '(' shift, and go to state 91 | |
3100 | + '`' shift, and go to state 92 | |
3101 | + '-' shift, and go to state 93 | |
3102 | + '!' shift, and go to state 94 | |
3103 | + | |
3104 | + position go to state 402 | |
3105 | + position_not_place go to state 99 | |
3106 | + expr_pair go to state 100 | |
3107 | + place go to state 101 | |
3108 | + label go to state 423 | |
3109 | + ordinal go to state 103 | |
3110 | + optional_ordinal_last go to state 104 | |
3111 | + nth_primitive go to state 105 | |
3112 | + corner go to state 106 | |
3113 | + expr go to state 424 | |
3114 | ]])], | |
3115 | ||
3116 | dnl OTHER-CHECKS | |
3117 | [], | |
3118 | ||
3119 | dnl PARSER-EXIT-VALUE, PARSER-STDOUT, PARSER-STDERR | |
3120 | [AT_COND_CASE([[LALR]], [[1]], [[0]])], | |
3121 | [], | |
3122 | [AT_COND_CASE([[LALR]], | |
3123 | [[syntax error, unexpected LEFT | |
3124 | ]])]) |