]> git.saurik.com Git - bison.git/blob - tests/calc.at
Credit Satya for the graphviz change.
[bison.git] / tests / calc.at
1 # Simple calculator. -*- Autotest -*-
2
3 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
4 # Foundation, Inc.
5
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
9 # any later version.
10
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.
15
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 # 02110-1301, USA.
20
21 ## ---------------------------------------------------- ##
22 ## Compile the grammar described in the documentation. ##
23 ## ---------------------------------------------------- ##
24
25
26 # ------------------------- #
27 # Helping Autotest macros. #
28 # ------------------------- #
29
30
31 # _AT_DATA_CALC_Y($1, $2, $3, [BISON-DIRECTIVES])
32 # -----------------------------------------------
33 # Produce `calc.y'. Don't call this macro directly, because it contains
34 # some occurrences of `$1' etc. which will be interpreted by m4. So
35 # you should call it with $1, $2, and $3 as arguments, which is what
36 # AT_DATA_CALC_Y does.
37 m4_define([_AT_DATA_CALC_Y],
38 [m4_if([$1$2$3], $[1]$[2]$[3], [],
39 [m4_fatal([$0: Invalid arguments: $@])])dnl
40 AT_DATA_GRAMMAR([calc.y],
41 [[/* Infix notation calculator--calc */
42 ]$4
43 AT_SKEL_CC_IF(
44 [%define "global_tokens_and_yystype"])[
45 %{
46 #include <stdio.h>
47
48 #include <stdlib.h>
49 #include <string.h>
50 #if HAVE_UNISTD_H
51 # include <unistd.h>
52 #else
53 # undef alarm
54 # define alarm(seconds) /* empty */
55 #endif
56 #include <ctype.h>
57 #define USE(Var)
58
59 /* Exercise pre-prologue dependency to %union. */
60 typedef int semantic_value;
61
62 static semantic_value global_result = 0;
63 static int global_count = 0;
64 %}
65
66 /* Exercise %union. */
67 %union
68 {
69 semantic_value ival;
70 };
71
72 %{
73 static int power (int base, int exponent);
74 ]AT_SKEL_CC_IF(
75 [#ifndef YYLTYPE
76 [#] define YYLTYPE AT_NAME_PREFIX::location
77 #endif
78 #define first_line begin.line
79 #define first_column begin.column
80 #define last_line end.line
81 #define last_column end.column
82 ],
83 [/* yyerror receives the location if:
84 - %location & %pure & %glr
85 - %location & %pure & %yacc & %parse-param. */
86 static void yyerror (AT_YYERROR_ARG_LOC_IF([YYLTYPE *llocp, ])
87 AT_PARAM_IF([semantic_value *result, int *count, ])
88 const char *s
89 );])[
90 static int yylex (]AT_LEX_FORMALS[);
91 static int get_char (]AT_LEX_FORMALS[);
92 static void unget_char (]AT_LEX_PRE_FORMALS[ int c);
93 %}
94
95 ]AT_SKEL_CC_IF(
96 [/* The lalr1.cc skeleton, for backward compatibility, defines
97 a constructor for position that initializes the filename. The
98 glr.cc skeleton does not (and in fact cannot: location/position
99 are stored in a union, from which objects with constructors are
100 excluded in C++. */
101 %initial-action {
102 @$.initialize (0);
103 }
104 ])[
105
106 /* Bison Declarations */
107 %token CALC_EOF 0 "end of input"
108 %token <ival> NUM "number"
109 %type <ival> exp
110
111 %nonassoc '=' /* comparison */
112 %left '-' '+'
113 %left '*' '/'
114 %left NEG /* negation--unary minus */
115 %right '^' /* exponentiation */
116
117 /* Grammar follows */
118 %%
119 input:
120 line
121 | input line { ]AT_PARAM_IF([++*count; ++global_count;])[ }
122 ;
123
124 line:
125 '\n'
126 | exp '\n' { ]AT_PARAM_IF([*result = global_result = $1], [USE ($1)])[; }
127 ;
128
129 exp:
130 NUM { $$ = $1; }
131 | exp '=' exp
132 {
133 if ($1 != $3)
134 fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
135 $$ = $1;
136 }
137 | exp '+' exp { $$ = $1 + $3; }
138 | exp '-' exp { $$ = $1 - $3; }
139 | exp '*' exp { $$ = $1 * $3; }
140 | exp '/' exp { $$ = $1 / $3; }
141 | '-' exp %prec NEG { $$ = -$2; }
142 | exp '^' exp { $$ = power ($1, $3); }
143 | '(' exp ')' { $$ = $2; }
144 | '(' error ')' { $$ = 1111; }
145 | '!' { $$ = 0; YYERROR; }
146 | '-' error { $$ = 0; YYERROR; }
147 ;
148 %%
149 /* The input. */
150 static FILE *input;
151
152 ]AT_SKEL_CC_IF(
153 [/* A C++ error reporting function. */
154 void
155 AT_NAME_PREFIX::parser::error (const location& l, const std::string& m)
156 {
157 (void) l;
158 std::cerr << AT_LOCATION_IF([l << ": " << ])m << std::endl;
159 }
160
161 int
162 yyparse (AT_PARAM_IF([semantic_value *result, int *count]))
163 {
164 AT_NAME_PREFIX::parser parser[]AT_PARAM_IF([ (result, count)]);
165 #if YYDEBUG
166 parser.set_debug_level (1);
167 #endif
168 return parser.parse ();
169 }
170 ],
171 [static void
172 yyerror (AT_YYERROR_ARG_LOC_IF([YYLTYPE *llocp, ])
173 AT_PARAM_IF([semantic_value *result, int *count, ])
174 const char *s)
175 {
176 AT_PARAM_IF([(void) result; (void) count;])
177 AT_YYERROR_SEES_LOC_IF([
178 fprintf (stderr, "%d.%d",
179 AT_LOC.first_line, AT_LOC.first_column);
180 if (AT_LOC.first_line != AT_LOC.last_line)
181 fprintf (stderr, "-%d.%d",
182 AT_LOC.last_line, AT_LOC.last_column - 1);
183 else if (AT_LOC.first_column != AT_LOC.last_column - 1)
184 fprintf (stderr, "-%d",
185 AT_LOC.last_column - 1);
186 fprintf (stderr, ": ");])
187 fprintf (stderr, "%s\n", s);
188 }])[
189
190
191 ]AT_LOCATION_IF([
192 static YYLTYPE last_yylloc;
193 ])[
194 static int
195 get_char (]AT_LEX_FORMALS[)
196 {
197 int res = getc (input);
198 ]AT_USE_LEX_ARGS[;
199 ]AT_LOCATION_IF([
200 last_yylloc = AT_LOC;
201 if (res == '\n')
202 {
203 AT_LOC.last_line++;
204 AT_LOC.last_column = 1;
205 }
206 else
207 AT_LOC.last_column++;
208 ])[
209 return res;
210 }
211
212
213 static void
214 unget_char (]AT_LEX_PRE_FORMALS[ int c)
215 {
216 ]AT_USE_LEX_ARGS[;
217 ]AT_LOCATION_IF([
218 /* Wrong when C == `\n'. */
219 AT_LOC = last_yylloc;
220 ])[
221 ungetc (c, input);
222 }
223
224 static int
225 read_signed_integer (]AT_LEX_FORMALS[)
226 {
227 int c = get_char (]AT_LEX_ARGS[);
228 int sign = 1;
229 int n = 0;
230
231 ]AT_USE_LEX_ARGS[;
232 if (c == '-')
233 {
234 c = get_char (]AT_LEX_ARGS[);
235 sign = -1;
236 }
237
238 while (isdigit (c))
239 {
240 n = 10 * n + (c - '0');
241 c = get_char (]AT_LEX_ARGS[);
242 }
243
244 unget_char (]AT_LEX_PRE_ARGS[ c);
245
246 return sign * n;
247 }
248
249
250
251 /*---------------------------------------------------------------.
252 | Lexical analyzer returns an integer on the stack and the token |
253 | NUM, or the ASCII character read if not a number. Skips all |
254 | blanks and tabs, returns 0 for EOF. |
255 `---------------------------------------------------------------*/
256
257 static int
258 yylex (]AT_LEX_FORMALS[)
259 {
260 static int init = 1;
261 int c;
262
263 if (init)
264 {
265 init = 0;
266 ]AT_LOCATION_IF([
267 AT_LOC.last_column = 1;
268 AT_LOC.last_line = 1;
269 ])[
270 }
271
272 ]AT_LOCATION_IF([
273 AT_LOC.first_column = AT_LOC.last_column;
274 AT_LOC.first_line = AT_LOC.last_line;
275 ])[
276
277 /* Skip white space. */
278 while ((c = get_char (]AT_LEX_ARGS[)) == ' ' || c == '\t')
279 {
280 ]AT_LOCATION_IF(
281 [ AT_LOC.first_column = AT_LOC.last_column;
282 AT_LOC.first_line = AT_LOC.last_line;
283 ])[
284 }
285
286 /* process numbers */
287 if (c == '.' || isdigit (c))
288 {
289 unget_char (]AT_LEX_PRE_ARGS[ c);
290 ]AT_VAL[.ival = read_signed_integer (]AT_LEX_ARGS[);
291 return NUM;
292 }
293
294 /* Return end-of-file. */
295 if (c == EOF)
296 return CALC_EOF;
297
298 /* Return single chars. */
299 return c;
300 }
301
302 static int
303 power (int base, int exponent)
304 {
305 int res = 1;
306 if (exponent < 0)
307 exit (3);
308 for (/* Niente */; exponent; --exponent)
309 res *= base;
310 return res;
311 }
312
313
314 int
315 main (int argc, const char **argv)
316 {
317 semantic_value result = 0;
318 int count = 0;
319 int status;
320
321 /* This used to be alarm (10), but that isn't enough time for
322 a July 1995 vintage DEC Alphastation 200 4/100 system,
323 according to Nelson H. F. Beebe. 100 seconds is enough. */
324 alarm (100);
325
326 if (argc == 2)
327 input = fopen (argv[1], "r");
328 else
329 input = stdin;
330
331 if (!input)
332 {
333 perror (argv[1]);
334 return 3;
335 }
336
337 ]AT_SKEL_CC_IF([], [m4_bmatch([$4], [%debug],
338 [ yydebug = 1;])])[
339 status = yyparse (]AT_PARAM_IF([&result, &count])[);
340 if (global_result != result)
341 abort ();
342 if (global_count != count)
343 abort ();
344 return status;
345 }
346 ]])
347 ])# _AT_DATA_CALC_Y
348
349
350 # AT_DATA_CALC_Y([BISON-OPTIONS])
351 # -------------------------------
352 # Produce `calc.y'.
353 m4_define([AT_DATA_CALC_Y],
354 [_AT_DATA_CALC_Y($[1], $[2], $[3], [$1])
355 ])
356
357
358
359 # _AT_CHECK_CALC(BISON-OPTIONS, INPUT, [NUM-STDERR-LINES])
360 # --------------------------------------------------------
361 # Run `calc' on INPUT and expect no STDOUT nor STDERR.
362 #
363 # If BISON-OPTIONS contains `%debug' but not `%glr-parser', then
364 #
365 # NUM-STDERR-LINES is the number of expected lines on stderr.
366 # Currently this is ignored, though, since the output format is fluctuating.
367 #
368 # We don't count GLR's traces yet, since its traces are somewhat
369 # different from LALR's.
370 m4_define([_AT_CHECK_CALC],
371 [AT_DATA([[input]],
372 [[$2
373 ]])
374 AT_PARSER_CHECK([./calc input], 0, [], [stderr])
375 ])
376
377
378 # _AT_CHECK_CALC_ERROR(BISON-OPTIONS, EXIT-STATUS, INPUT,
379 # [NUM-STDERR-LINES],
380 # [VERBOSE-AND-LOCATED-ERROR-MESSAGE])
381 # ---------------------------------------------------------
382 # Run `calc' on INPUT, and expect a `syntax error' message.
383 #
384 # If INPUT starts with a slash, it is used as absolute input file name,
385 # otherwise as contents.
386 #
387 # NUM-STDERR-LINES is the number of expected lines on stderr.
388 # Currently this is ignored, though, since the output format is fluctuating.
389 #
390 # If BISON-OPTIONS contains `%location', then make sure the ERROR-LOCATION
391 # is correctly output on stderr.
392 #
393 # If BISON-OPTIONS contains `%error-verbose', then make sure the
394 # IF-YYERROR-VERBOSE message is properly output after `syntax error, '
395 # on STDERR.
396 #
397 # If BISON-OPTIONS contains `%debug' but not `%glr', then NUM-STDERR-LINES
398 # is the number of expected lines on stderr.
399 m4_define([_AT_CHECK_CALC_ERROR],
400 [m4_bmatch([$3], [^/],
401 [AT_PARSER_CHECK([./calc $3], $2, [], [stderr])],
402 [AT_DATA([[input]],
403 [[$3
404 ]])
405 AT_PARSER_CHECK([./calc input], $2, [], [stderr])])
406
407 # Normalize the observed and expected error messages, depending upon the
408 # options.
409 # 1. Remove the traces from observed.
410 sed '/^Starting/d
411 /^Entering/d
412 /^Stack/d
413 /^Reading/d
414 /^Reducing/d
415 /^Return/d
416 /^Shifting/d
417 /^state/d
418 /^Cleanup:/d
419 /^Error:/d
420 /^Next/d
421 /^Now/d
422 /^Discarding/d
423 / \$[[0-9$]]* = /d
424 /^yydestructor:/d' stderr >at-stderr
425 mv at-stderr stderr
426 # 2. Create the reference error message.
427 AT_DATA([[expout]],
428 [$5
429 ])
430 # 3. If locations are not used, remove them.
431 AT_YYERROR_SEES_LOC_IF([],
432 [[sed 's/^[-0-9.]*: //' expout >at-expout
433 mv at-expout expout]])
434 # 4. If error-verbose is not used, strip the`, unexpected....' part.
435 m4_bmatch([$1], [%error-verbose], [],
436 [[sed 's/syntax error, .*$/syntax error/' expout >at-expout
437 mv at-expout expout]])
438 # 5. Check
439 AT_CHECK([cat stderr], 0, [expout])
440 ])
441
442
443 # AT_CHECK_CALC([BISON-OPTIONS, [EXPECTED-TO-FAIL]])
444 # --------------------------------------------------
445 # Start a testing chunk which compiles `calc' grammar with
446 # BISON-OPTIONS, and performs several tests over the parser.
447 # However, if EXPECTED-TO-FAIL is nonempty, this test is expected to fail.
448 m4_define([AT_CHECK_CALC],
449 [# We use integers to avoid dependencies upon the precision of doubles.
450 AT_SETUP([Calculator $1])
451
452 m4_ifval([$2], [AT_CHECK([exit 77])])
453
454 AT_BISON_OPTION_PUSHDEFS([$1])
455
456 AT_DATA_CALC_Y([$1])
457
458 AT_SKEL_CC_IF(
459 [AT_CHECK([bison -o calc.cc calc.y])
460 AT_COMPILE_CXX([calc])],
461 [AT_CHECK([bison -o calc.c calc.y])
462 AT_COMPILE([calc])])
463
464 # Test the priorities.
465 _AT_CHECK_CALC([$1],
466 [1 + 2 * 3 = 7
467 1 + 2 * -3 = -5
468
469 -1^2 = -1
470 (-1)^2 = 1
471
472 ---1 = -1
473
474 1 - 2 - 3 = -4
475 1 - (2 - 3) = 2
476
477 2^2^3 = 256
478 (2^2)^3 = 64],
479 [842])
480
481 # Some syntax errors.
482 _AT_CHECK_CALC_ERROR([$1], [1], [0 0], [15],
483 [1.3: syntax error, unexpected number])
484 _AT_CHECK_CALC_ERROR([$1], [1], [1//2], [20],
485 [1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'])
486 _AT_CHECK_CALC_ERROR([$1], [1], [error], [5],
487 [1.1: syntax error, unexpected $undefined])
488 _AT_CHECK_CALC_ERROR([$1], [1], [1 = 2 = 3], [30],
489 [1.7: syntax error, unexpected '='])
490 _AT_CHECK_CALC_ERROR([$1], [1],
491 [
492 +1],
493 [20],
494 [2.1: syntax error, unexpected '+'])
495 # Exercise error messages with EOF: work on an empty file.
496 _AT_CHECK_CALC_ERROR([$1], [1], [/dev/null], [4],
497 [1.1: syntax error, unexpected end of input])
498
499 # Exercise the error token: without it, we die at the first error,
500 # hence be sure to
501 #
502 # - have several errors which exercise different shift/discardings
503 # - (): nothing to pop, nothing to discard
504 # - (1 + 1 + 1 +): a lot to pop, nothing to discard
505 # - (* * *): nothing to pop, a lot to discard
506 # - (1 + 2 * *): some to pop and discard
507 #
508 # - test the action associated to `error'
509 #
510 # - check the lookahead that triggers an error is not discarded
511 # when we enter error recovery. Below, the lookahead causing the
512 # first error is ")", which is needed to recover from the error and
513 # produce the "0" that triggers the "0 != 1" error.
514 #
515 _AT_CHECK_CALC_ERROR([$1], [0],
516 [() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1],
517 [250],
518 [1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
519 1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
520 1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
521 1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
522 calc: error: 4444 != 1])
523
524 # The same, but this time exercising explicitly triggered syntax errors.
525 # POSIX says the lookahead causing the error should not be discarded.
526 _AT_CHECK_CALC_ERROR([$1], [0], [(!) + (0 0) = 1], [102],
527 [1.10: syntax error, unexpected number
528 calc: error: 2222 != 1])
529 _AT_CHECK_CALC_ERROR([$1], [0], [(- *) + (0 0) = 1], [113],
530 [1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
531 1.12: syntax error, unexpected number
532 calc: error: 2222 != 1])
533 AT_BISON_OPTION_POPDEFS
534
535 AT_CLEANUP
536 ])# AT_CHECK_CALC
537
538
539
540
541 # ------------------------ #
542 # Simple LALR Calculator. #
543 # ------------------------ #
544
545 AT_BANNER([[Simple LALR(1) Calculator.]])
546
547 # AT_CHECK_CALC_LALR([BISON-OPTIONS])
548 # -----------------------------------
549 # Start a testing chunk which compiles `calc' grammar with
550 # BISON-OPTIONS, and performs several tests over the parser.
551 m4_define([AT_CHECK_CALC_LALR],
552 [AT_CHECK_CALC($@)])
553
554 AT_CHECK_CALC_LALR()
555
556 AT_CHECK_CALC_LALR([%defines])
557 AT_CHECK_CALC_LALR([%locations])
558 AT_CHECK_CALC_LALR([%name-prefix="calc"])
559 AT_CHECK_CALC_LALR([%verbose])
560 AT_CHECK_CALC_LALR([%yacc])
561 AT_CHECK_CALC_LALR([%error-verbose])
562
563 AT_CHECK_CALC_LALR([%pure-parser %locations])
564 AT_CHECK_CALC_LALR([%push-parser %locations])
565 AT_CHECK_CALC_LALR([%error-verbose %locations])
566
567 AT_CHECK_CALC_LALR([%error-verbose %locations %defines %name-prefix="calc" %verbose %yacc])
568
569 AT_CHECK_CALC_LALR([%debug])
570 AT_CHECK_CALC_LALR([%error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc])
571
572 AT_CHECK_CALC_LALR([%pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc])
573 AT_CHECK_CALC_LALR([%push-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc])
574
575 AT_CHECK_CALC_LALR([%pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])
576
577
578 # ----------------------- #
579 # Simple GLR Calculator. #
580 # ----------------------- #
581
582 AT_BANNER([[Simple GLR Calculator.]])
583
584 # AT_CHECK_CALC_GLR([BISON-OPTIONS])
585 # ----------------------------------
586 # Start a testing chunk which compiles `calc' grammar with
587 # BISON-OPTIONS and %glr-parser, and performs several tests over the parser.
588 m4_define([AT_CHECK_CALC_GLR],
589 [AT_CHECK_CALC([%glr-parser] $@)])
590
591
592 AT_CHECK_CALC_GLR()
593
594 AT_CHECK_CALC_GLR([%defines])
595 AT_CHECK_CALC_GLR([%locations])
596 AT_CHECK_CALC_GLR([%name-prefix="calc"])
597 AT_CHECK_CALC_GLR([%verbose])
598 AT_CHECK_CALC_GLR([%yacc])
599 AT_CHECK_CALC_GLR([%error-verbose])
600
601 AT_CHECK_CALC_GLR([%pure-parser %locations])
602 AT_CHECK_CALC_GLR([%error-verbose %locations])
603
604 AT_CHECK_CALC_GLR([%error-verbose %locations %defines %name-prefix="calc" %verbose %yacc])
605
606 AT_CHECK_CALC_GLR([%debug])
607 AT_CHECK_CALC_GLR([%error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc])
608
609 AT_CHECK_CALC_GLR([%pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc])
610
611 AT_CHECK_CALC_GLR([%pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])
612
613
614 # ----------------------------- #
615 # Simple LALR1 C++ Calculator. #
616 # ----------------------------- #
617
618 AT_BANNER([[Simple LALR(1) C++ Calculator.]])
619
620 # AT_CHECK_CALC_LALR1_CC([BISON-OPTIONS])
621 # ---------------------------------------
622 # Start a testing chunk which compiles `calc' grammar with
623 # the C++ skeleton, and performs several tests over the parser.
624 m4_define([AT_CHECK_CALC_LALR1_CC],
625 [AT_CHECK_CALC([%skeleton "lalr1.cc" %defines %locations] $@)])
626
627 AT_CHECK_CALC_LALR1_CC([])
628 AT_CHECK_CALC_LALR1_CC([%error-verbose %name-prefix="calc" %verbose %yacc])
629
630 AT_CHECK_CALC_LALR1_CC([%error-verbose %debug %name-prefix="calc" %verbose %yacc])
631
632 AT_CHECK_CALC_LALR1_CC([%pure-parser %error-verbose %debug %name-prefix="calc" %verbose %yacc])
633
634 AT_CHECK_CALC_LALR1_CC([%pure-parser %error-verbose %debug %name-prefix="calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])
635
636
637
638 # --------------------------- #
639 # Simple GLR C++ Calculator. #
640 # --------------------------- #
641
642 AT_BANNER([[Simple GLR C++ Calculator.]])
643
644 # AT_CHECK_CALC_GLR_CC([BISON-OPTIONS])
645 # -------------------------------------
646 # Start a testing chunk which compiles `calc' grammar with
647 # the GLR C++ skeleton, and performs several tests over the parser.
648 m4_define([AT_CHECK_CALC_GLR_CC],
649 [AT_CHECK_CALC([%skeleton "glr.cc" %defines %locations] $@)])
650
651 AT_CHECK_CALC_GLR_CC([])
652 AT_CHECK_CALC_GLR_CC([%error-verbose %name-prefix="calc" %verbose %yacc])
653
654 AT_CHECK_CALC_GLR_CC([%debug])
655 AT_CHECK_CALC_GLR_CC([%error-verbose %debug %name-prefix="calc" %verbose %yacc])
656
657 AT_CHECK_CALC_GLR_CC([%pure-parser %error-verbose %debug %name-prefix="calc" %verbose %yacc])
658
659 AT_CHECK_CALC_GLR_CC([%pure-parser %error-verbose %debug %name-prefix="calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])