]>
Commit | Line | Data |
---|---|---|
82c035a8 | 1 | # Executing Actions. -*- Autotest -*- |
1f916a78 | 2 | # Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. |
82c035a8 AD |
3 | |
4 | # This program is free software; you can redistribute it and/or modify | |
5 | # it under the terms of the GNU General Public License as published by | |
6 | # the Free Software Foundation; either version 2, or (at your option) | |
7 | # any later version. | |
8 | ||
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. | |
13 | ||
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with this program; if not, write to the Free Software | |
16 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
17 | # 02111-1307, USA. | |
18 | ||
19 | AT_BANNER([[User Actions.]]) | |
20 | ||
21 | ## ------------------ ## | |
22 | ## Mid-rule actions. ## | |
23 | ## ------------------ ## | |
24 | ||
25 | AT_SETUP([Mid-rule actions]) | |
26 | ||
27 | # Bison once forgot the mid-rule actions. It was because the action | |
28 | # was attached to the host rule (the one with the mid-rule action), | |
29 | # instead of being attached to the empty rule dedicated to this | |
30 | # action. | |
31 | ||
9501dc6e | 32 | AT_DATA_GRAMMAR([[input.y]], |
82c035a8 | 33 | [[%{ |
d99361e6 AD |
34 | # include <stdio.h> |
35 | # include <stdlib.h> | |
36 | static void yyerror (const char *msg); | |
37 | static int yylex (void); | |
38 | # define YYDEBUG 1 | |
39 | # define YYERROR_VERBOSE 1 | |
82c035a8 AD |
40 | %} |
41 | %% | |
931394cb AD |
42 | exp: { putchar ('0'); } |
43 | '1' { putchar ('1'); } | |
44 | '2' { putchar ('2'); } | |
45 | '3' { putchar ('3'); } | |
46 | '4' { putchar ('4'); } | |
47 | '5' { putchar ('5'); } | |
48 | '6' { putchar ('6'); } | |
49 | '7' { putchar ('7'); } | |
50 | '8' { putchar ('8'); } | |
51 | '9' { putchar ('9'); } | |
52 | { putchar ('\n'); } | |
82c035a8 AD |
53 | ; |
54 | %% | |
55 | static int | |
56 | yylex (void) | |
57 | { | |
58 | static const char *input = "123456789"; | |
59 | return *input++; | |
60 | } | |
61 | ||
62 | static void | |
63 | yyerror (const char *msg) | |
64 | { | |
65 | fprintf (stderr, "%s\n", msg); | |
66 | } | |
67 | ||
68 | int | |
69 | main (void) | |
70 | { | |
71 | return yyparse (); | |
72 | } | |
73 | ]]) | |
74 | ||
b56471a6 | 75 | AT_CHECK([bison -d -v -o input.c input.y]) |
1154cced AD |
76 | AT_COMPILE([input]) |
77 | AT_PARSER_CHECK([./input], 0, | |
931394cb | 78 | [[0123456789 |
82c035a8 AD |
79 | ]]) |
80 | ||
81 | AT_CLEANUP | |
75d1fe16 AD |
82 | |
83 | ||
84 | ||
5dac0025 PE |
85 | ## ---------------------- ## |
86 | ## Actions after errors. ## | |
87 | ## ---------------------- ## | |
88 | ||
89 | AT_SETUP([Actions after errors]) | |
90 | ||
91 | ||
92 | ||
93 | AT_DATA_GRAMMAR([[input.y]], | |
94 | [[%{ | |
95 | #include <stdio.h> | |
96 | #include <stdlib.h> | |
97 | ||
98 | static int yylex (void); | |
99 | static void yyerror (char const *); | |
100 | ||
101 | #define YYDEBUG 1 | |
102 | %} | |
103 | %union { int ival; } | |
104 | %type <ival> 'x' ';' thing line input | |
105 | ||
106 | %% | |
107 | input: | |
108 | /* Nothing. */ | |
109 | { | |
110 | $$ = 0; | |
16f37b35 | 111 | printf ("input (%d): /* Nothing */\n", $$); |
5dac0025 PE |
112 | } |
113 | | line input /* Right recursive to load the stack so that popping at | |
114 | EOF can be exercised. */ | |
115 | { | |
116 | $$ = 2; | |
16f37b35 | 117 | printf ("input (%d): line (%d) input (%d)\n", $$, $1, $2); |
5dac0025 PE |
118 | } |
119 | ; | |
120 | ||
121 | line: | |
122 | thing thing thing ';' | |
123 | { | |
124 | $$ = $1; | |
16f37b35 | 125 | printf ("line (%d): thing (%d) thing (%d) thing (%d) ';' (%d)\n", |
5dac0025 PE |
126 | $$, $1, $2, $3, $4); |
127 | } | |
128 | | thing thing ';' | |
129 | { | |
130 | $$ = $1; | |
16f37b35 | 131 | printf ("line (%d): thing (%d) thing (%d) ';' (%d)\n", $$, $1, $2, $3); |
5dac0025 PE |
132 | } |
133 | | thing ';' | |
134 | { | |
135 | $$ = $1; | |
16f37b35 | 136 | printf ("line (%d): thing (%d) ';' (%d)\n", $$, $1, $2); |
5dac0025 PE |
137 | } |
138 | | error ';' | |
139 | { | |
140 | $$ = -1; | |
16f37b35 | 141 | printf ("line (%d): error ';' (%d)\n", $$, $2); |
5dac0025 PE |
142 | } |
143 | ; | |
144 | ||
145 | thing: | |
146 | 'x' | |
147 | { | |
148 | $$ = $1; | |
16f37b35 | 149 | printf ("thing (%d): 'x' (%d)\n", $$, $1); |
5dac0025 PE |
150 | } |
151 | ; | |
152 | %% | |
153 | static size_t counter; | |
154 | ||
155 | static int | |
156 | yylex (void) | |
157 | { | |
158 | static char const input[] = | |
159 | { | |
120f129d | 160 | /* Exercise the discarding of stack top and input until `error' |
5dac0025 PE |
161 | can be reduced. */ |
162 | 'x', 'x', 'x', 'x', 'x', 'x', ';', | |
163 | ||
164 | /* Load the stack and provoke an error that cannot be caught by | |
165 | the grammar, to check that the stack is cleared. */ | |
166 | 'x', 'x', ';', | |
167 | 'x', ';', | |
168 | 'y' | |
169 | }; | |
170 | ||
171 | if (counter < sizeof input) | |
172 | { | |
173 | yylval.ival = counter; | |
16f37b35 | 174 | printf ("sending: '%c' (%d)\n", input[counter], yylval.ival); |
5dac0025 PE |
175 | return input[counter++]; |
176 | } | |
177 | else | |
178 | { | |
179 | printf ("sending: EOF\n"); | |
180 | return EOF; | |
181 | } | |
182 | } | |
183 | ||
184 | static void | |
185 | yyerror (char const *msg) | |
186 | { | |
187 | printf ("%lu: %s\n", (unsigned long int) counter, msg); | |
188 | } | |
189 | ||
190 | int | |
191 | main (void) | |
192 | { | |
193 | yydebug = !!getenv ("YYDEBUG"); | |
194 | return yyparse (); | |
195 | } | |
196 | ]]) | |
197 | ||
198 | AT_CHECK([bison -o input.c input.y]) | |
199 | AT_COMPILE([input]) | |
200 | AT_PARSER_CHECK([./input], 1, | |
16f37b35 PE |
201 | [[sending: 'x' (0) |
202 | thing (0): 'x' (0) | |
203 | sending: 'x' (1) | |
204 | thing (1): 'x' (1) | |
205 | sending: 'x' (2) | |
206 | thing (2): 'x' (2) | |
207 | sending: 'x' (3) | |
5dac0025 | 208 | 4: syntax error |
16f37b35 PE |
209 | sending: 'x' (4) |
210 | sending: 'x' (5) | |
211 | sending: ';' (6) | |
212 | line (-1): error ';' (6) | |
213 | sending: 'x' (7) | |
214 | thing (7): 'x' (7) | |
215 | sending: 'x' (8) | |
216 | thing (8): 'x' (8) | |
217 | sending: ';' (9) | |
218 | line (7): thing (7) thing (8) ';' (9) | |
219 | sending: 'x' (10) | |
220 | thing (10): 'x' (10) | |
221 | sending: ';' (11) | |
222 | line (10): thing (10) ';' (11) | |
223 | sending: 'y' (12) | |
5dac0025 PE |
224 | 13: syntax error |
225 | sending: EOF | |
226 | ]]) | |
227 | ||
228 | AT_CLEANUP | |
229 | ||
230 | ||
231 | ||
75d1fe16 AD |
232 | ## ---------------- ## |
233 | ## Exotic Dollars. ## | |
234 | ## ---------------- ## | |
235 | ||
236 | AT_SETUP([Exotic Dollars]) | |
237 | ||
9501dc6e | 238 | AT_DATA_GRAMMAR([[input.y]], |
75d1fe16 AD |
239 | [[%{ |
240 | # include <stdio.h> | |
241 | # include <stdlib.h> | |
242 | static void yyerror (const char *msg); | |
243 | static int yylex (void); | |
244 | # define YYDEBUG 1 | |
245 | # define YYERROR_VERBOSE 1 | |
246 | %} | |
247 | ||
248 | %union | |
249 | { | |
250 | int val; | |
251 | }; | |
252 | ||
0ff67d71 | 253 | %type <val> a_1 a_2 a_5 |
75d1fe16 AD |
254 | sum_of_the_five_previous_values |
255 | ||
256 | %% | |
0ff67d71 PE |
257 | exp: a_1 a_2 { $<val>$ = 3; } { $<val>$ = $<val>3 + 1; } a_5 |
258 | sum_of_the_five_previous_values | |
75d1fe16 AD |
259 | { |
260 | printf ("%d\n", $6); | |
261 | } | |
262 | ; | |
263 | a_1: { $$ = 1; }; | |
264 | a_2: { $$ = 2; }; | |
75d1fe16 AD |
265 | a_5: { $$ = 5; }; |
266 | ||
267 | sum_of_the_five_previous_values: | |
268 | { | |
269 | $$ = $<val>0 + $<val>-1 + $<val>-2 + $<val>-3 + $<val>-4; | |
270 | } | |
271 | ; | |
272 | ||
273 | %% | |
274 | static int | |
275 | yylex (void) | |
276 | { | |
277 | return EOF; | |
278 | } | |
279 | ||
280 | static void | |
281 | yyerror (const char *msg) | |
282 | { | |
283 | fprintf (stderr, "%s\n", msg); | |
284 | } | |
285 | ||
286 | int | |
287 | main (void) | |
288 | { | |
289 | return yyparse (); | |
290 | } | |
291 | ]]) | |
292 | ||
b56471a6 | 293 | AT_CHECK([bison -d -v -o input.c input.y]) |
1154cced AD |
294 | AT_COMPILE([input]) |
295 | AT_PARSER_CHECK([./input], 0, | |
75d1fe16 AD |
296 | [[15 |
297 | ]]) | |
298 | ||
299 | AT_CLEANUP | |
9280d3ef AD |
300 | |
301 | ||
302 | ||
e776192e AD |
303 | ## -------------------------- ## |
304 | ## Printers and Destructors. ## | |
305 | ## -------------------------- ## | |
9280d3ef | 306 | |
ac700aa6 PE |
307 | # _AT_CHECK_PRINTER_AND_DESTRUCTOR($1, $2, $3, $4, BISON-DIRECTIVE, UNION-FLAG) |
308 | # ----------------------------------------------------------------------------- | |
3df37415 AD |
309 | m4_define([_AT_CHECK_PRINTER_AND_DESTRUCTOR], |
310 | [m4_if([$1$2$3], $[1]$[2]$[3], [], | |
311 | [m4_fatal([$0: Invalid arguments: $@])])dnl | |
312 | ||
ac700aa6 | 313 | AT_SETUP([Printers and Destructors $6: $5]) |
9280d3ef AD |
314 | |
315 | # Make sure complex $n work. | |
316 | ||
c2729758 | 317 | AT_BISON_OPTION_PUSHDEFS([$5]) |
9501dc6e | 318 | AT_DATA_GRAMMAR([[input.y]], |
16f37b35 | 319 | [[$5 |
3df37415 | 320 | %{ |
9280d3ef AD |
321 | #include <stdio.h> |
322 | #include <stdlib.h> | |
c2729758 ADL |
323 | ]AT_LALR1_CC_IF( |
324 | [#define RANGE(Location) (Location).begin.line, (Location).end.line], | |
325 | [#define RANGE(Location) (Location).first_line, (Location).last_line]) | |
326 | [%} | |
7bd6c77e AD |
327 | %error-verbose |
328 | %debug | |
5719c109 | 329 | %verbose |
7bd6c77e | 330 | %locations |
ac700aa6 | 331 | ]m4_ifval([$6], [%union |
9280d3ef AD |
332 | { |
333 | int ival; | |
ac700aa6 PE |
334 | }]) |
335 | [ | |
c2729758 | 336 | %{ |
ac700aa6 PE |
337 | ]AT_LALR1_CC_IF([typedef yy::Location YYLTYPE; |
338 | m4_ifval([$6], , [#define YYSTYPE int])]) | |
c2729758 | 339 | [static int yylex (]AT_LEX_FORMALS[); |
ca6f187f PE |
340 | ]AT_LALR1_CC_IF([], [static void yyerror (const char *msg);]) |
341 | [%} | |
c2729758 | 342 | |
ac700aa6 | 343 | ]m4_ifval([$6], [%type <ival> 'x' ';' thing line input])[ |
e3170060 | 344 | |
136d6530 | 345 | %printer { fprintf (yyoutput, "%d@%d-%d", $$, RANGE (@$)); } |
e3170060 AD |
346 | input line thing 'x' |
347 | ||
348 | %destructor | |
4c6cc1db | 349 | { printf ("Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); } |
7bd6c77e | 350 | input |
5719c109 | 351 | |
7bd6c77e | 352 | %destructor |
4c6cc1db | 353 | { printf ("Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); } |
7bd6c77e AD |
354 | line |
355 | ||
356 | %destructor | |
4c6cc1db | 357 | { printf ("Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); } |
7bd6c77e AD |
358 | thing |
359 | ||
360 | %destructor | |
4c6cc1db | 361 | { printf ("Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); } |
7bd6c77e | 362 | 'x' |
5719c109 | 363 | |
9280d3ef AD |
364 | %% |
365 | input: | |
366 | /* Nothing. */ | |
5719c109 AD |
367 | { |
368 | $$ = 0; | |
16f37b35 | 369 | printf ("input (%d@%d-%d): /* Nothing */\n", $$, RANGE (@$)); |
5719c109 AD |
370 | } |
371 | | line input /* Right recursive to load the stack so that popping at | |
372 | EOF can be exercised. */ | |
373 | { | |
374 | $$ = 2; | |
16f37b35 | 375 | printf ("input (%d@%d-%d): line (%d@%d-%d) input (%d@%d-%d)\n", |
4c6cc1db | 376 | $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2)); |
5719c109 | 377 | } |
9280d3ef AD |
378 | ; |
379 | ||
380 | line: | |
381 | thing thing thing ';' | |
5719c109 AD |
382 | { |
383 | $$ = $1; | |
16f37b35 | 384 | printf ("line (%d@%d-%d): thing (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ';' (%d@%d-%d)\n", |
4c6cc1db | 385 | $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2), |
16f37b35 | 386 | $3, RANGE (@3), $4, RANGE (@4)); |
5719c109 | 387 | } |
9280d3ef | 388 | | thing thing ';' |
5719c109 AD |
389 | { |
390 | $$ = $1; | |
16f37b35 PE |
391 | printf ("line (%d@%d-%d): thing (%d@%d-%d) thing (%d@%d-%d) ';' (%d@%d-%d)\n", |
392 | $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2), $3, RANGE (@3)); | |
5719c109 | 393 | } |
9280d3ef | 394 | | thing ';' |
5719c109 AD |
395 | { |
396 | $$ = $1; | |
16f37b35 PE |
397 | printf ("line (%d@%d-%d): thing (%d@%d-%d) ';' (%d@%d-%d)\n", |
398 | $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2)); | |
5719c109 | 399 | } |
9280d3ef | 400 | | error ';' |
5719c109 AD |
401 | { |
402 | $$ = -1; | |
16f37b35 PE |
403 | printf ("line (%d@%d-%d): error (@%d-%d) ';' (%d@%d-%d)\n", |
404 | $$, RANGE (@$), RANGE (@1), $2, RANGE (@2)); | |
5719c109 | 405 | } |
9280d3ef AD |
406 | ; |
407 | ||
408 | thing: | |
5719c109 AD |
409 | 'x' |
410 | { | |
411 | $$ = $1; | |
4c6cc1db AD |
412 | printf ("thing (%d@%d-%d): 'x' (%d@%d-%d)\n", |
413 | $$, RANGE (@$), $1, RANGE (@1)); | |
5719c109 | 414 | } |
9280d3ef AD |
415 | ; |
416 | %% | |
417 | static int | |
c2729758 | 418 | yylex (]AT_LEX_FORMALS[) |
9280d3ef | 419 | { |
ac700aa6 | 420 | static const char input[] = |
9280d3ef | 421 | { |
4c6cc1db | 422 | /* Exercise the discarding of stack top and input until `error' |
5719c109 | 423 | can be reduced. */ |
9280d3ef | 424 | 'x', 'x', 'x', 'x', 'x', 'x', ';', |
5719c109 | 425 | |
5a08f1ce AD |
426 | /* Load the stack and provoke an error that cannot be caught by |
427 | the grammar, to check that the stack is cleared. */ | |
9280d3ef AD |
428 | 'x', 'x', ';', |
429 | 'x', ';', | |
5719c109 | 430 | 'y' |
9280d3ef | 431 | }; |
5a08f1ce | 432 | static unsigned int counter = 0; |
9280d3ef AD |
433 | |
434 | if (counter < (sizeof(input) / sizeof (input[0]))) | |
435 | { | |
c2729758 | 436 | ]AT_LALR1_CC_IF( |
ac700aa6 | 437 | [ int c = m4_ifval([$6], [yylval->ival], [*yylval]) = counter++; |
c2729758 | 438 | /* As in BASIC, line numbers go from 10 to 10. */ |
ac700aa6 | 439 | yylloc->begin.line = yylloc->begin.column = 10 * c; |
c2729758 ADL |
440 | yylloc->end.line = yylloc->end.column = yylloc->begin.line + 9; |
441 | printf ("sending: '%c' (%d@%d-%d)\n", | |
ac700aa6 PE |
442 | input[[c]], c, RANGE (*yylloc)); |
443 | return input[[c]]; | |
c2729758 | 444 | ], |
ac700aa6 | 445 | [ int c = m4_ifval([$6], [yylval.ival], [yylval]) = counter++; |
93b68a0e | 446 | /* As in BASIC, line numbers go from 10 to 10. */ |
ac700aa6 | 447 | yylloc.first_line = yylloc.first_column = 10 * c; |
4c6cc1db AD |
448 | yylloc.last_line = yylloc.last_column = yylloc.first_line + 9; |
449 | printf ("sending: '%c' (%d@%d-%d)\n", | |
ac700aa6 PE |
450 | input[[c]], c, RANGE (yylloc)); |
451 | return input[[c]]; | |
c2729758 | 452 | ])[ |
9280d3ef AD |
453 | } |
454 | else | |
5719c109 AD |
455 | { |
456 | printf ("sending: EOF\n"); | |
457 | return EOF; | |
458 | } | |
9280d3ef AD |
459 | } |
460 | ||
c2729758 ADL |
461 | ]AT_LALR1_CC_IF( |
462 | [/* Currently, print_ is required in C++. */ | |
463 | void | |
464 | yy::Parser::print_ () | |
465 | { | |
466 | std::cerr << location; | |
467 | } | |
468 | ||
469 | /* A C++ error reporting function. */ | |
470 | void | |
471 | yy::Parser::error_ () | |
472 | { | |
473 | printf ("%d-%d: %s\n", RANGE (location), message.c_str()); | |
474 | } | |
475 | ||
476 | static bool yydebug; | |
477 | int | |
478 | yyparse () | |
479 | { | |
29058652 | 480 | yy::Parser parser (yydebug, yy::Location ()); |
c2729758 ADL |
481 | return parser.parse (); |
482 | } | |
483 | ], | |
484 | [static void | |
9280d3ef AD |
485 | yyerror (const char *msg) |
486 | { | |
4c6cc1db | 487 | printf ("%d-%d: %s\n", RANGE (yylloc), msg); |
c2729758 | 488 | }])[ |
9280d3ef | 489 | |
9280d3ef AD |
490 | int |
491 | main (void) | |
492 | { | |
493 | yydebug = !!getenv ("YYDEBUG"); | |
494 | if (yyparse ()) | |
495 | { | |
4c6cc1db | 496 | printf ("Parsing FAILED.\n"); |
9280d3ef AD |
497 | exit (1); |
498 | } | |
4c6cc1db | 499 | printf ("Successful parse.\n"); |
9280d3ef AD |
500 | return 0; |
501 | } | |
502 | ]]) | |
503 | ||
07971983 PE |
504 | AT_LALR1_CC_IF( |
505 | [AT_CHECK([bison -o input.cc input.y]) | |
506 | AT_COMPILE_CXX([input])], | |
507 | [AT_CHECK([bison -o input.c input.y]) | |
508 | AT_COMPILE([input])]) | |
1154cced | 509 | AT_PARSER_CHECK([./input], 1, |
4c6cc1db AD |
510 | [[sending: 'x' (0@0-9) |
511 | thing (0@0-9): 'x' (0@0-9) | |
512 | sending: 'x' (1@10-19) | |
513 | thing (1@10-19): 'x' (1@10-19) | |
514 | sending: 'x' (2@20-29) | |
515 | thing (2@20-29): 'x' (2@20-29) | |
516 | sending: 'x' (3@30-39) | |
517 | 30-39: syntax error, unexpected 'x', expecting ';' | |
518 | Freeing nterm thing (2@20-29) | |
519 | Freeing nterm thing (1@10-19) | |
520 | Freeing nterm thing (0@0-9) | |
521 | Freeing token 'x' (3@30-39) | |
522 | sending: 'x' (4@40-49) | |
523 | Freeing token 'x' (4@40-49) | |
524 | sending: 'x' (5@50-59) | |
525 | Freeing token 'x' (5@50-59) | |
526 | sending: ';' (6@60-69) | |
120f129d | 527 | line (-1@0-69): error (@0-59) ';' (6@60-69) |
4c6cc1db AD |
528 | sending: 'x' (7@70-79) |
529 | thing (7@70-79): 'x' (7@70-79) | |
530 | sending: 'x' (8@80-89) | |
531 | thing (8@80-89): 'x' (8@80-89) | |
532 | sending: ';' (9@90-99) | |
16f37b35 | 533 | line (7@70-99): thing (7@70-79) thing (8@80-89) ';' (9@90-99) |
4c6cc1db AD |
534 | sending: 'x' (10@100-109) |
535 | thing (10@100-109): 'x' (10@100-109) | |
536 | sending: ';' (11@110-119) | |
16f37b35 | 537 | line (10@100-119): thing (10@100-109) ';' (11@110-119) |
4c6cc1db AD |
538 | sending: 'y' (12@120-129) |
539 | 120-129: syntax error, unexpected $undefined, expecting $end or 'x' | |
5719c109 | 540 | sending: EOF |
4c6cc1db AD |
541 | Freeing nterm line (10@100-119) |
542 | Freeing nterm line (7@70-99) | |
120f129d | 543 | Freeing nterm line (-1@0-69) |
5719c109 | 544 | Parsing FAILED. |
9280d3ef AD |
545 | ]]) |
546 | ||
547 | AT_CLEANUP | |
3df37415 AD |
548 | ]) |
549 | ||
550 | ||
ac700aa6 PE |
551 | # AT_CHECK_PRINTER_AND_DESTRUCTOR([BISON-OPTIONS], [UNION-FLAG]) |
552 | # -------------------------------------------------------------- | |
3df37415 AD |
553 | # Produce `calc.y'. |
554 | m4_define([AT_CHECK_PRINTER_AND_DESTRUCTOR], | |
ac700aa6 | 555 | [_AT_CHECK_PRINTER_AND_DESTRUCTOR($[1], $[2], $[3], $[4], [$1], [$2]) |
3df37415 AD |
556 | ]) |
557 | ||
558 | ||
ac700aa6 PE |
559 | AT_CHECK_PRINTER_AND_DESTRUCTOR([]) |
560 | AT_CHECK_PRINTER_AND_DESTRUCTOR([], [with union]) | |
c2729758 | 561 | AT_CHECK_PRINTER_AND_DESTRUCTOR([%locations %defines %skeleton "lalr1.cc"]) |
ac700aa6 PE |
562 | AT_CHECK_PRINTER_AND_DESTRUCTOR([%locations %defines %skeleton "lalr1.cc"], |
563 | [with union]) | |
16f37b35 | 564 | |
ac700aa6 | 565 | # FIXME. These test cases fail. |
16f37b35 | 566 | #AT_CHECK_PRINTER_AND_DESTRUCTOR([%glr-parser]) |
ac700aa6 | 567 | #AT_CHECK_PRINTER_AND_DESTRUCTOR([%glr-parser], [with union]) |