]> git.saurik.com Git - bison.git/blame - tests/calc.at
* src/parse-gram.y (declaration): Have %parse-param and %lex-param
[bison.git] / tests / calc.at
CommitLineData
342b8b6e 1# Checking the output filenames. -*- Autotest -*-
5504898e 2# Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
bfb07874 3
342b8b6e
AD
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.
bfb07874 8
342b8b6e
AD
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.
bfb07874 13
342b8b6e
AD
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.
bfb07874 18
bfb07874
AD
19## ---------------------------------------------------- ##
20## Compile the grammar described in the documentation. ##
21## ---------------------------------------------------- ##
22
23
24# ------------------------- #
25# Helping Autotest macros. #
26# ------------------------- #
27
28
2a8d363a
AD
29# _AT_DATA_CALC_Y($1, $2, $3, [BISON-DIRECTIVES])
30# -----------------------------------------------
bfb07874
AD
31# Produce `calc.y'. Don't call this macro directly, because it contains
32# some occurrences of `$1' etc. which will be interpreted by m4. So
33# you should call it with $1, $2, and $3 as arguments, which is what
34# AT_DATA_CALC_Y does.
342b8b6e
AD
35m4_define([_AT_DATA_CALC_Y],
36[m4_if([$1$2$3], $[1]$[2]$[3], [],
37 [m4_fatal([$0: Invalid arguments: $@])])dnl
9501dc6e 38AT_DATA_GRAMMAR([calc.y],
bfb07874 39[[/* Infix notation calculator--calc */
2a8d363a 40]$4[
bfb07874
AD
41%{
42#include <stdio.h>
2ce10144
AD
43
44#if STDC_HEADERS
45# include <stdlib.h>
46# include <string.h>
2ce10144 47#endif
bfb07874 48#include <ctype.h>
e7cb57c0 49#include <assert.h>
bfb07874 50
bfb07874 51extern void perror (const char *s);
0dd1580a
RA
52
53/* Exercise pre-prologue dependency to %union. */
54typedef int value_t;
55
e7cb57c0
AD
56value_t global_result = 0;
57int global_count = 0;
58
bfb07874
AD
59%}
60
5a08f1ce 61/* Exercise %union. */
213e640e
AD
62%union
63{
5a08f1ce 64 value_t ival;
213e640e
AD
65};
66
c19988b7
AD
67%{
68#if YYPURE
69# define LOC (*yylloc)
70# define VAL (*yylval)
71#else
72# define LOC (yylloc)
73# define VAL (yylval)
74#endif
75
2a8d363a
AD
76#define YYLLOC_FORMAL ]AT_LOCATION_IF([, YYLTYPE *yylloc])[
77#define YYLLOC_ARG ]AT_LOCATION_IF([, yylloc])[
78#define USE_YYLLOC ]AT_LOCATION_IF([(void) yylloc;])[
79
c19988b7 80#if YYPURE
2a8d363a
AD
81# define LEX_FORMALS YYSTYPE *yylval YYLLOC_FORMAL
82# define LEX_ARGS yylval YYLLOC_ARG
83# define USE_LEX_ARGS (void) yylval; USE_YYLLOC
c19988b7
AD
84# define LEX_PRE_FORMALS LEX_FORMALS,
85# define LEX_PRE_ARGS LEX_ARGS,
86#else
87# define LEX_FORMALS void
88# define LEX_PRE_FORMALS
89# define LEX_ARGS
90# define LEX_PRE_ARGS
91# define USE_LEX_ARGS
92#endif
93
94static int power (int base, int exponent);
2a8d363a
AD
95/* yyerror receives the location if:
96 - %location & %pure & %glr
97 - %location & %pure & %yacc & %parse-param. */
93724f13
AD
98static void yyerror (]AT_YYERROR_ARG_LOC_IF([YYLTYPE *yylloc, ])[
99 ]AT_PARAM_IF([value_t *result, int *count, ])[
100 const char *s
2a8d363a 101 );
c19988b7
AD
102static int yylex (LEX_FORMALS);
103static int yygetc (LEX_FORMALS);
104static void yyungetc (LEX_PRE_FORMALS int c);
105%}
106
6b7e85b9 107/* Bison Declarations */
c19988b7 108%token CALC_EOF 0 "end of input"
213e640e
AD
109%token <ival> NUM "number"
110%type <ival> exp
bfb07874
AD
111
112%nonassoc '=' /* comparison */
113%left '-' '+'
114%left '*' '/'
115%left NEG /* negation--unary minus */
116%right '^' /* exponentiation */
117
118/* Grammar follows */
119%%
120input:
b7c49edf 121 line
2a8d363a 122| input line { ]AT_PARAM_IF([++*count; ++global_count;])[ }
bfb07874
AD
123;
124
125line:
c19988b7 126 '\n'
2a8d363a 127| exp '\n' { ]AT_PARAM_IF([*result = global_result = $1;])[ }
bfb07874
AD
128;
129
130exp:
131 NUM { $$ = $1; }
132| exp '=' exp
133 {
2a8d363a
AD
134 if ($1 != $3)
135 fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
136 $$ = $1;
bfb07874
AD
137 }
138| exp '+' exp { $$ = $1 + $3; }
139| exp '-' exp { $$ = $1 - $3; }
140| exp '*' exp { $$ = $1 * $3; }
141| exp '/' exp { $$ = $1 / $3; }
142| '-' exp %prec NEG { $$ = -$2; }
143| exp '^' exp { $$ = power ($1, $3); }
144| '(' exp ')' { $$ = $2; }
51dec47b 145| '(' error ')' { $$ = 0; }
bfb07874
AD
146;
147%%
148/* The input. */
149FILE *yyin;
150
151static void
93724f13
AD
152yyerror (]AT_YYERROR_ARG_LOC_IF([YYLTYPE *yylloc, ])[
153 ]AT_PARAM_IF([value_t *result, int *count, ])[
154 const char *s
155 )
bfb07874 156{
793a58bb 157]AT_PARAM_IF([(void) result; (void) count; ])[
2a8d363a 158]AT_YYERROR_SEES_LOC_IF([
51dec47b 159 fprintf (stderr, "%d.%d-%d.%d: ",
c19988b7
AD
160 LOC.first_line, LOC.first_column,
161 LOC.last_line, LOC.last_column);
2a8d363a 162])[
bfb07874
AD
163 fprintf (stderr, "%s\n", s);
164}
165
b7c49edf 166
2a8d363a 167]AT_LOCATION_IF([
b7c49edf 168static YYLTYPE last_yylloc;
2a8d363a 169])[
bfb07874 170static int
c19988b7 171yygetc (LEX_FORMALS)
bfb07874
AD
172{
173 int res = getc (yyin);
c19988b7 174 USE_LEX_ARGS;
2a8d363a 175]AT_LOCATION_IF([
c19988b7 176 last_yylloc = LOC;
bfb07874
AD
177 if (res == '\n')
178 {
c19988b7
AD
179 LOC.last_line++;
180 LOC.last_column = 1;
bfb07874
AD
181 }
182 else
c19988b7 183 LOC.last_column++;
2a8d363a 184])[
bfb07874
AD
185 return res;
186}
187
188
189static void
c19988b7 190yyungetc (LEX_PRE_FORMALS int c)
bfb07874 191{
c19988b7 192 USE_LEX_ARGS;
2a8d363a 193]AT_LOCATION_IF([
bfb07874 194 /* Wrong when C == `\n'. */
c19988b7 195 LOC = last_yylloc;
2a8d363a 196])[
bfb07874
AD
197 ungetc (c, yyin);
198}
199
200static int
c19988b7 201read_signed_integer (LEX_FORMALS)
bfb07874 202{
c19988b7 203 int c = yygetc (LEX_ARGS);
bfb07874
AD
204 int sign = 1;
205 int n = 0;
206
c19988b7 207 USE_LEX_ARGS;
bfb07874
AD
208 if (c == '-')
209 {
c19988b7 210 c = yygetc (LEX_ARGS);
bfb07874
AD
211 sign = -1;
212 }
213
214 while (isdigit (c))
215 {
216 n = 10 * n + (c - '0');
c19988b7 217 c = yygetc (LEX_ARGS);
bfb07874
AD
218 }
219
c19988b7 220 yyungetc (LEX_PRE_ARGS c);
bfb07874
AD
221
222 return sign * n;
223}
224
225
226
227/*---------------------------------------------------------------.
228| Lexical analyzer returns an integer on the stack and the token |
229| NUM, or the ASCII character read if not a number. Skips all |
230| blanks and tabs, returns 0 for EOF. |
231`---------------------------------------------------------------*/
232
233static int
c19988b7 234yylex (LEX_FORMALS)
bfb07874 235{
c19988b7 236 static int init = 1;
bfb07874
AD
237 int c;
238
c19988b7
AD
239 if (init)
240 {
241 init = 0;
2a8d363a 242]AT_LOCATION_IF([
21964f43
AD
243 LOC.last_column = 1;
244 LOC.last_line = 1;
2a8d363a 245])[
c19988b7
AD
246 }
247
2a8d363a 248]AT_LOCATION_IF([
c19988b7
AD
249 LOC.first_column = LOC.last_column;
250 LOC.first_line = LOC.last_line;
2a8d363a 251])[
bfb07874
AD
252
253 /* Skip white space. */
c19988b7 254 while ((c = yygetc (LEX_ARGS)) == ' ' || c == '\t')
bfb07874 255 {
2a8d363a 256]AT_LOCATION_IF([
c19988b7
AD
257 LOC.first_column = LOC.last_column;
258 LOC.first_line = LOC.last_line;
2a8d363a 259])[
bfb07874
AD
260 }
261
262 /* process numbers */
263 if (c == '.' || isdigit (c))
264 {
c19988b7
AD
265 yyungetc (LEX_PRE_ARGS c);
266 VAL.ival = read_signed_integer (LEX_ARGS);
bfb07874
AD
267 return NUM;
268 }
269
270 /* Return end-of-file. */
271 if (c == EOF)
6b7e85b9 272 return CALC_EOF;
bfb07874
AD
273
274 /* Return single chars. */
275 return c;
276}
277
278static int
279power (int base, int exponent)
280{
281 int res = 1;
282 if (exponent < 0)
283 exit (1);
284 for (/* Niente */; exponent; --exponent)
285 res *= base;
286 return res;
287}
288
289int
342b8b6e 290main (int argc, const char **argv)
bfb07874 291{
e7cb57c0
AD
292 value_t result = 0;
293 int count = 0;
b0f98b10 294 int status = 0;
342b8b6e
AD
295 yyin = NULL;
296
297 if (argc == 2)
bfb07874
AD
298 yyin = fopen (argv[1], "r");
299 else
300 yyin = stdin;
301
342b8b6e 302 if (!yyin)
bfb07874
AD
303 {
304 perror (argv[1]);
305 exit (1);
306 }
307
308#if YYDEBUG
309 yydebug = 1;
bfb07874 310#endif
b0f98b10 311 status = yyparse (]AT_PARAM_IF([&result, &count])[);
e7cb57c0
AD
312 assert (global_result == result);
313 assert (global_count == count);
b0f98b10 314 return status;
bfb07874
AD
315}
316]])
317])# _AT_DATA_CALC_Y
318
319
320# AT_DATA_CALC_Y([BISON-OPTIONS])
321# -------------------------------
322# Produce `calc.y'.
342b8b6e 323m4_define([AT_DATA_CALC_Y],
9e32add8 324[_AT_DATA_CALC_Y($[1], $[2], $[3], [$1])
f50adbbd 325])
bfb07874
AD
326
327
328
342b8b6e
AD
329# _AT_CHECK_CALC(BISON-OPTIONS, INPUT, [NUM-STDERR-LINES = 0])
330# ------------------------------------------------------------
bfb07874 331# Run `calc' on INPUT and expect no STDOUT nor STDERR.
342b8b6e 332#
f50adbbd
AD
333# If BISON-OPTIONS contains `%debug' but not `%glr-parser', then
334# NUM-STDERR-LINES is the number of expected lines on stderr.
335#
336# We don't count GLR's traces yet, since its traces are somewhat
337# different from LALR's.
342b8b6e
AD
338m4_define([_AT_CHECK_CALC],
339[AT_DATA([[input]],
340[[$2
341]])
f50adbbd
AD
342AT_PARSER_CHECK([./calc input], 0, [], [stderr])
343m4_bmatch([$1],
344 [%debug.*%glr\|%glr.*%debug],
345 [],
346 [%debug],
347 [AT_CHECK([wc -l <stderr | sed 's/[[^0-9]]//g'], 0, [$3
348])])
342b8b6e
AD
349])
350
351
b0f98b10
AD
352# _AT_CHECK_CALC_ERROR(BISON-OPTIONS, EXIT-STATUS, INPUT,
353# [NUM-DEBUG-LINES],
2a8d363a 354# [VERBOSE-AND-LOCATED-ERROR-MESSAGE])
b0f98b10 355# ---------------------------------------------------------
342b8b6e
AD
356# Run `calc' on INPUT, and expect a `parse error' message.
357#
b7c49edf
AD
358# If INPUT starts with a slash, it is used as absolute input file name,
359# otherwise as contents.
360#
9e32add8 361# If BISON-OPTIONS contains `%location', then make sure the ERROR-LOCATION
342b8b6e
AD
362# is correctly output on stderr.
363#
f50adbbd 364# If BISON-OPTIONS contains `%error-verbose', then make sure the
342b8b6e
AD
365# IF-YYERROR-VERBOSE message is properly output after `parse error, '
366# on STDERR.
367#
f50adbbd
AD
368# If BISON-OPTIONS contains `%debug' but not `%glr', then NUM-STDERR-LINES
369# is the number of expected lines on stderr.
342b8b6e 370m4_define([_AT_CHECK_CALC_ERROR],
b0f98b10
AD
371[m4_bmatch([$3], [^/],
372 [AT_PARSER_CHECK([./calc $3], $2, [], [stderr])],
b7c49edf 373 [AT_DATA([[input]],
b0f98b10 374[[$3
342b8b6e 375]])
b0f98b10 376AT_PARSER_CHECK([./calc input], $2, [], [stderr])])
f50adbbd
AD
377m4_bmatch([$1],
378 [%debug.*%glr\|%glr.*%debug],
379 [],
380 [%debug],
b0f98b10 381 [AT_CHECK([wc -l <stderr | sed 's/[[^0-9]]//g'], 0, [$4
51dec47b 382])])
342b8b6e 383
51dec47b
AD
384# Normalize the observed and expected error messages, depending upon the
385# options.
386# 1. Remove the traces from observed.
9280d3ef
AD
387sed '/^Starting/d
388/^Entering/d
f50adbbd 389/^Stack/d
9280d3ef
AD
390/^Reading/d
391/^Reducing/d
392/^Shifting/d
393/^state/d
394/^Error:/d
395/^Next/d
396/^Discarding/d
397/^yydestructor:/d' stderr >at-stderr
342b8b6e 398mv at-stderr stderr
51dec47b
AD
399# 2. Create the reference error message.
400AT_DATA([[expout]],
b0f98b10 401[$5
342b8b6e 402])
51dec47b 403# 3. If locations are not used, remove them.
2a8d363a 404AT_YYERROR_SEES_LOC_IF([],
51dec47b
AD
405[[sed 's/^[-0-9.]*: //' expout >at-expout
406mv at-expout expout]])
407# 4. If error-verbose is not used, strip the`, unexpected....' part.
f50adbbd 408m4_bmatch([$1], [%error-verbose], [],
51dec47b
AD
409[[sed 's/parse error, .*$/parse error/' expout >at-expout
410mv at-expout expout]])
411# 5. Check
412AT_CHECK([cat stderr], 0, [expout])
342b8b6e 413])
bfb07874
AD
414
415
2a8d363a
AD
416# AT_CALC_PUSHDEFS($1, $2, [BISON-OPTIONS])
417# -----------------------------------------
418# This macro works around the impossibility to define macros
419# inside macros, because issuing `[$1]' is not possible in M4 :(.
420# This sucks hard, GNU M4 should really provide M5 like $$1.
421m4_define([AT_CHECK_PUSHDEFS],
422[m4_if([$1$2], $[1]$[2], [],
423 [m4_fatal([$0: Invalid arguments: $@])])dnl
424m4_pushdef([AT_PARAM_IF],
425[m4_bmatch([$3], [%parse-param], [$1], [$2])])
426m4_pushdef([AT_LOCATION_IF],
427[m4_bmatch([$3], [%locations], [$1], [$2])])
428m4_pushdef([AT_PURE_IF],
429[m4_bmatch([$3], [%pure-parser], [$1], [$2])])
430m4_pushdef([AT_GLR_IF],
431[m4_bmatch([$3], [%glr-parser], [$1], [$2])])
432m4_pushdef([AT_PURE_AND_LOC_IF],
433[m4_bmatch([$3], [%locations.*%pure-parser\|%pure-parser.*%locations],
434 [$1], [$2])])
435m4_pushdef([AT_GLR_OR_PARAM_IF],
436[m4_bmatch([$3], [%glr-parser\|%parse-param], [$1], [$2])])
437
438# yyerror receives the location if %location & %pure & (%glr or %parse-param).
439m4_pushdef([AT_YYERROR_ARG_LOC_IF],
440[AT_GLR_OR_PARAM_IF([AT_PURE_AND_LOC_IF([$1], [$2])],
441 [$2])])
793a58bb 442# yyerror cannot see the locations if !glr & pure & !param.
2a8d363a
AD
443m4_pushdef([AT_YYERROR_SEES_LOC_IF],
444[AT_LOCATION_IF([AT_GLR_IF([$1],
793a58bb
AD
445 [AT_PURE_IF([AT_PARAM_IF([$1], [$2])],
446 [$1])])],
2a8d363a
AD
447 [$2])])
448])
449
450
451# AT_CALC_POPDEFS
452# ---------------
453m4_define([AT_CHECK_POPDEFS],
454[m4_popdef([AT_YYERROR_SEES_LOC_IF])
455m4_popdef([AT_YYERROR_ARG_LOC_IF])
456m4_popdef([AT_GLR_OR_PARAM_IF])
457m4_popdef([AT_PURE_AND_LOC_IF])
458m4_popdef([AT_GLR_IF])
459m4_popdef([AT_LOCATION_IF])
460m4_popdef([AT_PARAM_IF])
461])
462
463
464
f50adbbd
AD
465# AT_CHECK_CALC([BISON-OPTIONS])
466# ------------------------------
bfb07874
AD
467# Start a testing chunk which compiles `calc' grammar with
468# BISON-OPTIONS, and performs several tests over the parser.
342b8b6e 469m4_define([AT_CHECK_CALC],
bfb07874
AD
470[# We use integers to avoid dependencies upon the precision of doubles.
471AT_SETUP([Calculator $1])
472
2a8d363a
AD
473AT_CHECK_PUSHDEFS($[1], $[2], [$1])
474
bfb07874
AD
475AT_DATA_CALC_Y([$1])
476
477# Specify the output files to avoid problems on different file systems.
9e32add8 478AT_CHECK([bison -o calc.c calc.y],
bfb07874 479 [0], [], [])
3c1a79b3 480
1154cced 481AT_COMPILE([calc])
bfb07874
AD
482
483# Test the priorities.
484_AT_CHECK_CALC([$1],
485[1 + 2 * 3 = 7
4861 + 2 * -3 = -5
487
488-1^2 = -1
489(-1)^2 = 1
490
491---1 = -1
492
4931 - 2 - 3 = -4
4941 - (2 - 3) = 2
495
4962^2^3 = 256
e7cb57c0
AD
497(2^2)^3 = 64],
498 [486])
bfb07874
AD
499
500# Some parse errors.
b0f98b10 501_AT_CHECK_CALC_ERROR([$1], [1], [0 0], [11],
51dec47b 502 [1.3-1.4: parse error, unexpected "number"])
b0f98b10 503_AT_CHECK_CALC_ERROR([$1], [1], [1//2], [15],
51dec47b 504 [1.3-1.4: parse error, unexpected '/', expecting "number" or '-' or '('])
b0f98b10 505_AT_CHECK_CALC_ERROR([$1], [1], [error], [4],
88bce5a2 506 [1.1-1.2: parse error, unexpected $undefined, expecting "number" or '-' or '\n' or '('])
b0f98b10 507_AT_CHECK_CALC_ERROR([$1], [1], [1 = 2 = 3], [22],
51dec47b 508 [1.7-1.8: parse error, unexpected '='])
b0f98b10 509_AT_CHECK_CALC_ERROR([$1], [1],
bfb07874
AD
510 [
511+1],
366eea36 512 [14],
51dec47b 513 [2.1-2.2: parse error, unexpected '+'])
b7c49edf 514# Exercise error messages with EOF: work on an empty file.
b0f98b10 515_AT_CHECK_CALC_ERROR([$1], [1], [/dev/null], [4],
c19988b7 516 [1.1-1.2: parse error, unexpected "end of input", expecting "number" or '-' or '\n' or '('])
51dec47b
AD
517
518# Exercise the error token: without it, we die at the first error,
519# hence be sure i. to have several errors, ii. to test the action
520# associated to `error'.
b0f98b10 521_AT_CHECK_CALC_ERROR([$1], [0], [(1 ++ 2) + (0 0) = 1], [82],
51dec47b
AD
522[1.5-1.6: parse error, unexpected '+', expecting "number" or '-' or '('
5231.15-1.16: parse error, unexpected "number"
524calc: error: 0 != 1])
525
2a8d363a
AD
526AT_CHECK_POPDEFS
527
d803322e 528AT_CLEANUP
bfb07874
AD
529])# AT_CHECK_CALC
530
531
532
533
f50adbbd
AD
534# ------------------------ #
535# Simple LALR Calculator. #
536# ------------------------ #
537
538AT_BANNER([[Simple LALR Calculator.]])
539
540# AT_CHECK_CALC_LALR([BISON-OPTIONS])
541# -----------------------------------
542# Start a testing chunk which compiles `calc' grammar with
543# BISON-OPTIONS, and performs several tests over the parser.
544m4_define([AT_CHECK_CALC_LALR],
545[AT_CHECK_CALC($@)])
546
547AT_CHECK_CALC_LALR()
548
9e32add8 549AT_CHECK_CALC_LALR([%defines])
ae7453f2 550AT_CHECK_CALC_LALR([%locations])
9e32add8
AD
551AT_CHECK_CALC_LALR([%name-prefix="calc"])
552AT_CHECK_CALC_LALR([%verbose])
553AT_CHECK_CALC_LALR([%yacc])
f50adbbd
AD
554AT_CHECK_CALC_LALR([%error-verbose])
555
ae7453f2 556AT_CHECK_CALC_LALR([%error-verbose %locations])
f50adbbd 557
9e32add8 558AT_CHECK_CALC_LALR([%error-verbose %locations %defines %name-prefix="calc" %verbose %yacc])
f50adbbd
AD
559
560AT_CHECK_CALC_LALR([%debug])
9e32add8 561AT_CHECK_CALC_LALR([%error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc])
c19988b7 562
2a8d363a
AD
563AT_CHECK_CALC_LALR([%pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc])
564
0f39aab9 565AT_CHECK_CALC_LALR([%pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc %parse-param {value_t *result}, {result} %parse-param {int *count}, {count}])
f50adbbd
AD
566
567
568# ----------------------- #
569# Simple GLR Calculator. #
570# ----------------------- #
571
572AT_BANNER([[Simple GLR Calculator.]])
573
574# AT_CHECK_CALC_GLR([BISON-OPTIONS])
575# ----------------------------------
576# Start a testing chunk which compiles `calc' grammar with
577# BISON-OPTIONS and %glr-parser, and performs several tests over the parser.
578m4_define([AT_CHECK_CALC_GLR],
ae7453f2 579[AT_CHECK_CALC([%glr-parser] $@)])
f50adbbd 580
bfb07874 581
f50adbbd 582AT_CHECK_CALC_GLR()
bfb07874 583
9e32add8 584AT_CHECK_CALC_GLR([%defines])
ae7453f2 585AT_CHECK_CALC_GLR([%locations])
9e32add8
AD
586AT_CHECK_CALC_GLR([%name-prefix="calc"])
587AT_CHECK_CALC_GLR([%verbose])
588AT_CHECK_CALC_GLR([%yacc])
f50adbbd 589AT_CHECK_CALC_GLR([%error-verbose])
bfb07874 590
ae7453f2 591AT_CHECK_CALC_GLR([%error-verbose %locations])
bfb07874 592
9e32add8 593AT_CHECK_CALC_GLR([%error-verbose %locations %defines %name-prefix="calc" %verbose %yacc])
bfb07874 594
f50adbbd 595AT_CHECK_CALC_GLR([%debug])
9e32add8 596AT_CHECK_CALC_GLR([%error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc])
21964f43 597
2a8d363a
AD
598AT_CHECK_CALC_GLR([%pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc])
599
0f39aab9 600AT_CHECK_CALC_GLR([%pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc %parse-param {value_t *result}, {result} %parse-param {int *count}, {count}])