From cf499cff31eabd04e37107484647bdd453137d1d Mon Sep 17 00:00:00 2001 From: "Joel E. Denny" Date: Fri, 28 Aug 2009 03:46:37 -0400 Subject: [PATCH] %define: accept unquoted values. * NEWS (2.5): Group all %define changes together, and document this one. Remove quotes in IELR and canonical LR entry. * doc/bison.texinfo: Remove quotes in most examples throughout. (Decl Summary): Update %define documentation. (Table of Symbols): Likewise. * src/ielr.c (LrType): Update documentation. * src/parse-gram.y (content.opt): Add production for ID. * tests/actions.at: Remove quotes in most tests. * tests/calc.at: Likewise. * tests/existing.at: Likewise. * tests/input.at: Likewise. * tests/local.at: Likewise. * tests/push.at: Likewise. * tests/reduce.at: Likewise. * tests/torture.at: Likewise. --- ChangeLog | 19 +++++ NEWS | 27 ++++-- doc/bison.texinfo | 86 ++++++++++--------- src/ielr.c | 2 +- src/parse-gram.c | 204 ++++++++++++++++++++++++---------------------- src/parse-gram.h | 2 +- src/parse-gram.y | 1 + tests/actions.at | 12 +-- tests/calc.at | 56 ++++++------- tests/existing.at | 6 +- tests/input.at | 14 ++-- tests/local.at | 2 +- tests/push.at | 6 +- tests/reduce.at | 24 +++--- tests/torture.at | 4 +- 15 files changed, 256 insertions(+), 209 deletions(-) diff --git a/ChangeLog b/ChangeLog index 83f0a2dc..4de30cf5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2009-08-28 Joel E. Denny + + %define: accept unquoted values. + * NEWS (2.5): Group all %define changes together, and document + this one. Remove quotes in IELR and canonical LR entry. + * doc/bison.texinfo: Remove quotes in most examples throughout. + (Decl Summary): Update %define documentation. + (Table of Symbols): Likewise. + * src/ielr.c (LrType): Update documentation. + * src/parse-gram.y (content.opt): Add production for ID. + * tests/actions.at: Remove quotes in most tests. + * tests/calc.at: Likewise. + * tests/existing.at: Likewise. + * tests/input.at: Likewise. + * tests/local.at: Likewise. + * tests/push.at: Likewise. + * tests/reduce.at: Likewise. + * tests/torture.at: Likewise. + 2009-08-28 Joel E. Denny %define lr.type: make values lowercase IDs. diff --git a/NEWS b/NEWS index 6bfe53a7..ca458c7e 100644 --- a/NEWS +++ b/NEWS @@ -55,9 +55,9 @@ Bison News default. You can specify the type of parser tables in the grammar file with these directives: - %define lr.type "lalr" - %define lr.type "ielr" - %define lr.type "canonical-lr" + %define lr.type lalr + %define lr.type ielr + %define lr.type canonical-lr The default reduction optimization in the parser tables can also be adjusted using `%define lr.default-reductions'. See the documentation @@ -68,9 +68,11 @@ Bison News These features are experimental. More user feedback will help to stabilize them. -** Multiple %define's for any variable is now an error not a warning. +** %define improvements. -** %define can now be invoked via the command line. +*** Multiple invocations for any variable is now an error not a warning. + +*** Can now be invoked via the command line. Each of these command-line options @@ -89,7 +91,7 @@ Bison News quietly override %define, but -D and --define do not. For further details, see the section "Bison Options" in the Bison manual. -** %define variables renamed. +*** Variables renamed. The following %define variables @@ -104,7 +106,18 @@ Bison News The old names are now deprecated but will be maintained indefinitely for backward compatibility. -** Symbols names +*** Values no longer need to be quoted in grammar file. + + If a %define value is an identifier, it no longer needs to be placed + within quotations marks. For example, + + %define api.push-pull "push" + + can be rewritten as + + %define api.push-pull push + +** Symbol names. Consistently with directives (such as %error-verbose) and variables (e.g. push-pull), symbol names may include dashes in any position, diff --git a/doc/bison.texinfo b/doc/bison.texinfo index 6dd6037f..4cc5a77f 100644 --- a/doc/bison.texinfo +++ b/doc/bison.texinfo @@ -4588,7 +4588,7 @@ The following Bison declaration says that you want the parser to be a push parser (@pxref{Decl Summary,,%define api.push-pull}): @example -%define api.push-pull "push" +%define api.push-pull push @end example In almost all cases, you want to ensure that your push parser is also @@ -4599,7 +4599,7 @@ what you are doing, your declarations should look like this: @example %define api.pure -%define api.push-pull "push" +%define api.push-pull push @end example There is a major notable functional difference between the pure push parser @@ -4648,14 +4648,14 @@ for use by the next invocation of the @code{yypush_parse} function. Bison also supports both the push parser interface along with the pull parser interface in the same generated parser. In order to get this functionality, -you should replace the @samp{%define api.push-pull "push"} declaration with the -@samp{%define api.push-pull "both"} declaration. Doing this will create all of +you should replace the @samp{%define api.push-pull push} declaration with the +@samp{%define api.push-pull both} declaration. Doing this will create all of the symbols mentioned earlier along with the two extra symbols, @code{yyparse} and @code{yypull_parse}. @code{yyparse} can be used exactly as it normally would be used. However, the user should note that it is implemented in the generated parser by calling @code{yypull_parse}. This makes the @code{yyparse} function that is generated with the -@samp{%define api.push-pull "both"} declaration slower than the normal +@samp{%define api.push-pull both} declaration slower than the normal @code{yyparse} function. If the user calls the @code{yypull_parse} function it will parse the rest of the input stream. It is possible to @code{yypush_parse} tokens to select a subgrammar @@ -4672,8 +4672,8 @@ yypstate_delete (ps); @end example Adding the @samp{%define api.pure} declaration does exactly the same thing to -the generated parser with @samp{%define api.push-pull "both"} as it did for -@samp{%define api.push-pull "push"}. +the generated parser with @samp{%define api.push-pull both} as it did for +@samp{%define api.push-pull push}. @node Decl Summary @subsection Bison Declaration Summary @@ -4842,6 +4842,7 @@ parse.trace}. @end deffn @deffn {Directive} %define @var{variable} +@deffnx {Directive} %define @var{variable} @var{value} @deffnx {Directive} %define @var{variable} "@var{value}" Define a variable to adjust Bison's behavior. The possible choices for @var{variable}, as well as their meanings, depend on @@ -4851,7 +4852,11 @@ Summary,,%language}, @pxref{Decl Summary,,%skeleton}). It is an error if a @var{variable} is defined by @code{%define} multiple times, but see @ref{Bison Options,,-D @var{name}[=@var{value}]}. -Omitting @code{"@var{value}"} is always equivalent to specifying it as +@var{value} must be placed in quotation marks if it contains any +character other than a letter, underscore, period, dash, or non-initial +digit. + +Omitting @code{"@var{value}"} entirely is always equivalent to specifying @code{""}. Some @var{variable}s may be used as Booleans. @@ -4859,12 +4864,12 @@ In this case, Bison will complain if the variable definition does not meet one of the following four conditions: @enumerate -@item @code{"@var{value}"} is @code{"true"} +@item @code{@var{value}} is @code{true} -@item @code{"@var{value}"} is omitted (or is @code{""}). -This is equivalent to @code{"true"}. +@item @code{@var{value}} is omitted (or @code{""} is specified). +This is equivalent to @code{true}. -@item @code{"@var{value}"} is @code{"false"}. +@item @code{@var{value}} is @code{false}. @item @var{variable} is never defined. In this case, Bison selects a default value, which may depend on the selected @@ -4940,7 +4945,7 @@ The parser namespace is @code{foo} and @code{yylex} is referenced as @item Accepted Values: Boolean -@item Default Value: @code{"false"} +@item Default Value: @code{false} @end itemize @c api.pure @@ -4958,9 +4963,9 @@ The parser namespace is @code{foo} and @code{yylex} is referenced as (The current push parsing interface is experimental and may evolve. More user feedback will help to stabilize it.) -@item Accepted Values: @code{"pull"}, @code{"push"}, @code{"both"} +@item Accepted Values: @code{pull}, @code{push}, @code{both} -@item Default Value: @code{"pull"} +@item Default Value: @code{pull} @end itemize @c api.push-pull @@ -5025,7 +5030,7 @@ More user feedback will help to stabilize it.) @item Accepted Values: @itemize -@item @code{"all"}. +@item @code{all}. For @acronym{LALR} and @acronym{IELR} parsers (@pxref{Decl Summary,,lr.type}) by default, all states are permitted to contain default reductions. @@ -5037,7 +5042,7 @@ That is, unlike in a canonical @acronym{LR} state, the lookahead sets of reductions in an @acronym{LALR} or @acronym{IELR} state can contain tokens that are syntactically incorrect for some left contexts. -@item @code{"consistent"}. +@item @code{consistent}. @cindex consistent states A consistent state is a state that has only one possible action. If that action is a reduction, then the parser does not need to request @@ -5049,7 +5054,7 @@ states, then a canonical @acronym{LR} parser reports a syntax error as soon as it @emph{needs} the syntactically unacceptable token from the scanner. -@item @code{"accepting"}. +@item @code{accepting}. @cindex accepting state By default, the only default reduction permitted in a canonical @acronym{LR} parser is the accept action in the accepting state, which @@ -5061,8 +5066,8 @@ without performing any extra reductions. @item Default Value: @itemize -@item @code{"accepting"} if @code{lr.type} is @code{"canonical-lr"}. -@item @code{"all"} otherwise. +@item @code{accepting} if @code{lr.type} is @code{canonical-lr}. +@item @code{all} otherwise. @end itemize @end itemize @@ -5083,7 +5088,7 @@ are useless in the generated parser. @item Accepted Values: Boolean -@item Default Value: @code{"false"} +@item Default Value: @code{false} @item Caveats: @@ -5126,7 +5131,7 @@ More user feedback will help to stabilize it.) @item Accepted Values: @itemize -@item @code{"lalr"}. +@item @code{lalr}. While Bison generates @acronym{LALR} parser tables by default for historical reasons, @acronym{IELR} or canonical @acronym{LR} is almost always preferable for deterministic parsers. @@ -5155,7 +5160,7 @@ investigate such problems while ignoring the more subtle differences from @acronym{IELR} and canonical @acronym{LR}. @end itemize -@item @code{"ielr"}. +@item @code{ielr}. @acronym{IELR} is a minimal @acronym{LR} algorithm. That is, given any grammar (@acronym{LR} or non-@acronym{LR}), @acronym{IELR} and canonical @acronym{LR} always accept exactly the same @@ -5169,7 +5174,7 @@ grammars, the number of conflicts for @acronym{IELR} is often an order of magnitude less as well. This can significantly reduce the complexity of developing of a grammar. -@item @code{"canonical-lr"}. +@item @code{canonical-lr}. @cindex delayed syntax errors @cindex syntax errors delayed The only advantage of canonical @acronym{LR} over @acronym{IELR} is @@ -5185,7 +5190,7 @@ Even when canonical @acronym{LR} behavior is ultimately desired, facilitate the development of a grammar. @end itemize -@item Default Value: @code{"lalr"} +@item Default Value: @code{lalr} @end itemize @@ -5226,10 +5231,10 @@ function. @xref{Error Reporting, ,The Error Reporting Function @code{yyerror}}. @item Accepted Values: @itemize -@item @code{"simple"} +@item @code{simple} Error messages passed to @code{yyerror} are simply @w{@code{"syntax error"}}. -@item @code{"verbose"} +@item @code{verbose} Error messages report the unexpected token, and possibly the expected ones. @end itemize @@ -5585,8 +5590,8 @@ exp: @dots{} @{ @dots{}; *randomness += 1; @dots{} @} More user feedback will help to stabilize it.) You call the function @code{yypush_parse} to parse a single token. This -function is available if either the @samp{%define api.push-pull "push"} or -@samp{%define api.push-pull "both"} declaration is used. +function is available if either the @samp{%define api.push-pull push} or +@samp{%define api.push-pull both} declaration is used. @xref{Push Decl, ,A Push Parser}. @deftypefun int yypush_parse (yypstate *yyps) @@ -5603,7 +5608,7 @@ is required to finish parsing the grammar. More user feedback will help to stabilize it.) You call the function @code{yypull_parse} to parse the rest of the input -stream. This function is available if the @samp{%define api.push-pull "both"} +stream. This function is available if the @samp{%define api.push-pull both} declaration is used. @xref{Push Decl, ,A Push Parser}. @@ -5619,8 +5624,8 @@ The value returned by @code{yypull_parse} is the same as for @code{yyparse}. More user feedback will help to stabilize it.) You call the function @code{yypstate_new} to create a new parser instance. -This function is available if either the @samp{%define api.push-pull "push"} or -@samp{%define api.push-pull "both"} declaration is used. +This function is available if either the @samp{%define api.push-pull push} or +@samp{%define api.push-pull both} declaration is used. @xref{Push Decl, ,A Push Parser}. @deftypefun yypstate *yypstate_new (void) @@ -5638,8 +5643,8 @@ allocated. More user feedback will help to stabilize it.) You call the function @code{yypstate_delete} to delete a parser instance. -function is available if either the @samp{%define api.push-pull "push"} or -@samp{%define api.push-pull "both"} declaration is used. +function is available if either the @samp{%define api.push-pull push} or +@samp{%define api.push-pull both} declaration is used. @xref{Push Decl, ,A Push Parser}. @deftypefun void yypstate_delete (yypstate *yyps) @@ -5913,7 +5918,7 @@ receives one argument. For a syntax error, the string is normally @w{@code{"syntax error"}}. @findex %define parse.error -If you invoke @samp{%define parse.error "verbose"} in the Bison +If you invoke @samp{%define parse.error verbose} in the Bison declarations section (@pxref{Bison Declarations, ,The Bison Declarations Section}), then Bison provides a more verbose and specific error message string instead of just plain @w{@code{"syntax error"}}. @@ -8837,7 +8842,7 @@ error messages. @comment file: calc++-parser.yy @example %define parse.trace -%define parse.error "verbose" +%define parse.error verbose @end example @noindent @@ -9226,7 +9231,7 @@ in a file; Bison itself defines a class representing a @dfn{location}, a range composed of a pair of positions (possibly spanning several files). The location class is an inner class of the parser; the name is @code{Location} by default, and may also be renamed using -@samp{%define location_type "@var{class-name}}. +@samp{%define location_type "@var{class-name}"}. The location class treats the position as a completely opaque value. By default, the class name is @code{Position}, but this can be changed @@ -9325,7 +9330,7 @@ Run the syntactic analysis, and return @code{true} on success, @deftypemethod {YYParser} {boolean} getErrorVerbose () @deftypemethodx {YYParser} {void} setErrorVerbose (boolean @var{verbose}) Get or set the option to produce verbose error messages. These are only -available with @samp{%define parse.error "verbose"}, which also turns on +available with @samp{%define parse.error verbose}, which also turns on verbose error messages. @end deftypemethod @@ -10212,6 +10217,7 @@ Precedence}. @deffn {Directive} %define @var{define-variable} @deffnx {Directive} %define @var{define-variable} @var{value} +@deffnx {Directive} %define @var{define-variable} "@var{value}" Define a variable to adjust Bison's behavior. @xref{Decl Summary,,%define}. @end deffn @@ -10254,7 +10260,7 @@ token is reset to the token that originally caused the violation. @end deffn @deffn {Directive} %error-verbose -An obsolete directive standing for @samp{%define parse.error "verbose"}. +An obsolete directive standing for @samp{%define parse.error verbose}. @end deffn @deffn {Directive} %file-prefix "@var{prefix}" @@ -10460,7 +10466,7 @@ An obsolete macro used in the @file{yacc.c} skeleton, that you define with @code{#define} in the prologue to request verbose, specific error message strings when @code{yyerror} is called. It doesn't matter what definition you use for @code{YYERROR_VERBOSE}, just whether you define -it. Using @samp{%define parse.error "verbose"} is preferred +it. Using @samp{%define parse.error verbose} is preferred (@pxref{Error Reporting, ,The Error Reporting Function @code{yyerror}}). @end deffn diff --git a/src/ielr.c b/src/ielr.c index dfe981a5..e47c0202 100644 --- a/src/ielr.c +++ b/src/ielr.c @@ -35,7 +35,7 @@ #include "state.h" #include "symtab.h" -/** Records the value of the \%define variable "lr.type". */ +/** Records the value of the \%define variable lr.type. */ typedef enum { LR_TYPE__LALR, LR_TYPE__IELR, LR_TYPE__CANONICAL_LR } LrType; /** diff --git a/src/parse-gram.c b/src/parse-gram.c index feeef1a6..7353b3e7 100644 --- a/src/parse-gram.c +++ b/src/parse-gram.c @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 2.4.394-10e5b80-dirty. */ +/* A Bison parser, made by GNU Bison 2.4.395-7910-dirty. */ /* Implementation for Bison's Yacc-like parsers in C @@ -45,7 +45,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.4.394-10e5b80-dirty" +#define YYBISON_VERSION "2.4.395-7910-dirty" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -553,16 +553,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 3 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 160 +#define YYLAST 161 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 57 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 34 /* YYNRULES -- Number of rules. */ -#define YYNRULES 106 +#define YYNRULES 107 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 146 +#define YYNSTATES 147 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ @@ -623,8 +623,8 @@ static const yytype_uint16 yyrline[] = 435, 440, 442, 447, 448, 452, 453, 454, 455, 460, 465, 470, 476, 482, 493, 494, 503, 504, 510, 511, 512, 519, 519, 524, 525, 526, 531, 533, 535, 537, - 539, 541, 546, 548, 559, 560, 565, 566, 575, 595, - 597, 606, 611, 612, 617, 624, 626 + 539, 541, 546, 548, 559, 560, 565, 566, 567, 576, + 596, 598, 607, 612, 613, 618, 625, 627 }; #endif @@ -672,12 +672,12 @@ static const yytype_uint16 yytoknum[] = }; # endif -#define YYPACT_NINF -53 +#define YYPACT_NINF -136 #define yypact_value_is_default(yystate) \ - ((yystate) == (-53)) + ((yystate) == (-136)) -#define YYTABLE_NINF -106 +#define YYTABLE_NINF -107 #define yytable_value_is_error(yytable_value) \ YYID (0) @@ -686,21 +686,21 @@ static const yytype_uint16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - -53, 5, 102, -53, -53, -53, -10, 8, 27, -53, - -53, -53, -53, 18, -53, 32, 55, -53, 70, 77, - -53, 17, -53, 43, 91, 53, 41, -53, -53, -53, - 42, 54, 94, 96, 0, -53, -53, -53, 16, -53, - -53, 56, -53, -53, -53, -53, 48, 30, 30, 0, - 13, 13, -53, 61, -53, -53, -53, 101, -53, -53, - -53, -53, 113, -53, -53, -53, -53, 114, -53, 115, - -53, -53, -53, -53, -53, -53, -53, -53, -53, 93, - -53, 95, 1, -53, -53, 50, -53, 61, -53, 0, - -53, -53, 30, 33, 30, 0, -53, -53, -53, -53, - 13, -53, -53, 13, -53, -53, -53, -53, -53, -53, - -53, -53, 103, -53, -53, -53, -53, -53, 0, -53, - 141, -53, 145, -53, -53, -53, -53, -53, -53, -53, - -53, 39, 37, -53, -53, 0, 147, 97, 50, 50, - 37, -53, -53, -53, -53, -53 + -136, 36, 103, -136, -136, -136, -2, 18, 22, -136, + -136, -136, -136, -1, -136, 32, 66, -136, 70, 90, + -136, 17, -136, 53, 93, 55, 39, -136, -136, -136, + 41, 56, 97, 98, 0, -136, -136, -136, 16, -136, + -136, 57, -136, -136, -136, -136, 52, 30, 30, 0, + 13, 13, -136, 63, -136, -136, -136, 35, -136, -136, + -136, -136, 114, -136, -136, -136, -136, 115, -136, 116, + -136, -136, -136, -136, -136, -136, -136, -136, -136, 94, + -136, 95, 1, -136, -136, 51, -136, 63, -136, 0, + -136, -136, 30, 89, 30, 0, -136, -136, -136, -136, + 13, -136, -136, 13, -136, -136, -136, -136, -136, -136, + -136, -136, -136, 104, -136, -136, -136, -136, -136, 0, + -136, 143, -136, 146, -136, -136, -136, -136, -136, -136, + -136, -136, 19, 37, -136, -136, 0, 148, 105, 51, + 51, 37, -136, -136, -136, -136, -136 }; /* YYDEFACT[S] -- default reduction number in state S. Performed when @@ -713,34 +713,34 @@ static const yytype_uint8 yydefact[] = 7, 0, 16, 0, 0, 0, 0, 39, 22, 23, 0, 0, 0, 0, 0, 29, 30, 31, 0, 6, 32, 42, 4, 5, 34, 33, 55, 0, 0, 0, - 0, 0, 98, 0, 40, 95, 94, 96, 10, 12, + 0, 0, 99, 0, 40, 95, 94, 96, 10, 12, 13, 14, 0, 17, 18, 19, 20, 0, 24, 0, - 26, 27, 28, 104, 100, 99, 102, 35, 103, 0, - 101, 0, 0, 76, 78, 92, 43, 0, 56, 0, + 26, 27, 28, 105, 101, 100, 103, 35, 104, 0, + 102, 0, 0, 76, 78, 92, 43, 0, 56, 0, 69, 74, 48, 70, 46, 49, 61, 66, 67, 68, - 36, 63, 65, 37, 41, 97, 8, 15, 21, 25, - 80, 79, 0, 77, 2, 93, 81, 44, 50, 57, - 59, 75, 71, 72, 62, 64, 106, 86, 58, 60, - 73, 82, 83, 86, 85, 0, 0, 0, 92, 92, - 84, 89, 90, 91, 88, 87 + 36, 63, 65, 37, 41, 98, 97, 8, 15, 21, + 25, 80, 79, 0, 77, 2, 93, 81, 44, 50, + 57, 59, 75, 71, 72, 62, 64, 107, 86, 58, + 60, 73, 82, 83, 86, 85, 0, 0, 0, 92, + 92, 84, 89, 90, 91, 88, 87 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -53, -53, -53, -53, 152, -53, -53, -53, -53, -53, - -53, -53, -53, 38, -53, 104, -32, -3, 109, -53, - 78, -53, -53, -53, 26, -46, -53, -53, -49, -17, - -53, -34, -52, -53 + -136, -136, -136, -136, 153, -136, -136, -136, -136, -136, + -136, -136, -136, 31, -136, 107, -13, -3, 108, -136, + 78, -136, -136, -136, 27, -135, -136, -136, -16, -17, + -136, -34, -35, -136 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 1, 2, 42, 81, 87, 44, 48, 47, 45, - 46, 89, 118, 119, 95, 100, 101, 91, 92, 82, - 83, 84, 127, 131, 132, 116, 57, 106, 54, 76, - 85, 102, 78, 114 + 46, 89, 119, 120, 95, 100, 101, 91, 92, 82, + 83, 84, 128, 132, 133, 117, 57, 107, 54, 76, + 85, 102, 78, 115 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -748,44 +748,44 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 77, -105, 79, 73, 104, 3, 4, 5, 6, 7, + 77, -106, 79, 73, 145, 146, 4, 5, 6, 7, 8, 9, 10, 11, 12, 96, 73, 79, 13, 14, 61, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 93, 93, 27, 13, 14, 55, 73, 122, 117, 34, - 73, 123, 49, 74, 66, 68, 75, 27, 80, 112, - 50, 135, 136, 137, 34, 120, 74, 41, 58, 75, - 52, 124, 62, 80, 53, 97, 98, 99, 125, 51, - 130, 125, 41, 74, 59, 93, 75, 93, 56, 138, - 74, 60, 90, 75, 120, 63, 67, 69, 133, 121, - 134, 121, 144, 145, 64, 65, 70, 71, 139, 72, - 88, 141, 86, 52, 105, 115, 139, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 107, 108, 109, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 110, 129, 111, 126, 73, 143, - 38, 142, 39, 40, 43, 103, 128, 94, 41, 140, - 113 + 93, 93, 27, 13, 14, 55, 3, 104, 105, 34, + 73, 52, 66, 74, 68, 53, 75, 27, 80, 113, + 49, 136, 137, 138, 34, 121, 74, 41, 124, 75, + 50, 125, 62, 80, 51, 97, 98, 99, 134, 58, + 135, 118, 41, 74, 59, 93, 75, 93, 56, 139, + 74, 106, 90, 75, 67, 121, 69, 126, 131, 122, + 126, 122, 73, 123, 60, 63, 64, 65, 70, 140, + 71, 72, 142, 86, 88, 52, 116, 140, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 108, 109, 110, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 111, 112, 130, 127, 73, + 129, 38, 143, 39, 40, 43, 94, 144, 103, 41, + 114, 141 }; static const yytype_uint8 yycheck[] = { - 34, 0, 1, 3, 53, 0, 5, 6, 7, 8, + 34, 0, 1, 3, 139, 140, 5, 6, 7, 8, 9, 10, 11, 12, 13, 49, 3, 1, 17, 18, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 47, 48, 31, 17, 18, 3, 3, 4, 87, 38, - 3, 93, 52, 43, 3, 3, 46, 31, 47, 48, - 42, 14, 15, 16, 38, 89, 43, 56, 3, 46, - 42, 95, 45, 47, 46, 52, 53, 54, 100, 42, - 122, 103, 56, 43, 4, 92, 46, 94, 46, 42, - 43, 4, 52, 46, 118, 42, 45, 45, 49, 92, - 51, 94, 138, 139, 3, 42, 42, 3, 132, 3, - 52, 135, 46, 42, 3, 55, 140, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 3, 3, 3, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 51, 4, 51, 44, 3, 52, - 48, 4, 50, 51, 2, 51, 118, 48, 56, 133, - 82 + 47, 48, 31, 17, 18, 3, 0, 53, 3, 38, + 3, 42, 3, 43, 3, 46, 46, 31, 47, 48, + 52, 14, 15, 16, 38, 89, 43, 56, 93, 46, + 42, 95, 45, 47, 42, 52, 53, 54, 49, 3, + 51, 87, 56, 43, 4, 92, 46, 94, 46, 42, + 43, 46, 52, 46, 45, 119, 45, 100, 123, 92, + 103, 94, 3, 4, 4, 42, 3, 42, 42, 133, + 3, 3, 136, 46, 52, 42, 55, 141, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 3, 3, 3, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 51, 51, 4, 44, 3, + 119, 48, 4, 50, 51, 2, 48, 52, 51, 56, + 82, 134 }; /* STOS_[STATE-NUM] -- The (internal number of the) accessing @@ -802,11 +802,11 @@ static const yytype_uint8 yystos[] = 42, 3, 3, 3, 43, 46, 86, 88, 89, 1, 47, 61, 76, 77, 78, 87, 46, 62, 52, 68, 52, 74, 75, 86, 75, 71, 88, 52, 53, 54, - 72, 73, 88, 72, 85, 3, 84, 3, 3, 3, - 51, 51, 48, 77, 90, 55, 82, 85, 69, 70, - 88, 74, 4, 89, 88, 73, 44, 79, 70, 4, - 89, 80, 81, 49, 51, 14, 15, 16, 42, 88, - 81, 88, 4, 52, 82, 82 + 72, 73, 88, 72, 85, 3, 46, 84, 3, 3, + 3, 51, 51, 48, 77, 90, 55, 82, 85, 69, + 70, 88, 74, 4, 89, 88, 73, 44, 79, 70, + 4, 89, 80, 81, 49, 51, 14, 15, 16, 42, + 88, 81, 88, 4, 52, 82, 82 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ @@ -821,8 +821,8 @@ static const yytype_uint8 yyr1[] = 70, 71, 71, 72, 72, 73, 73, 73, 73, 74, 74, 74, 74, 74, 75, 75, 76, 76, 77, 77, 77, 79, 78, 80, 80, 80, 81, 81, 81, 81, - 81, 81, 82, 82, 83, 83, 84, 84, 85, 86, - 86, 87, 88, 88, 89, 90, 90 + 81, 81, 82, 82, 83, 83, 84, 84, 84, 85, + 86, 86, 87, 88, 88, 89, 90, 90 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -838,7 +838,7 @@ static const yytype_uint8 yyr2[] = 1, 2, 2, 3, 1, 2, 1, 2, 1, 2, 2, 0, 4, 1, 3, 2, 0, 3, 3, 3, 3, 3, 0, 1, 1, 1, 0, 1, 1, 1, - 1, 1, 1, 1, 1, 0, 2 + 1, 1, 1, 1, 1, 1, 0, 2 }; @@ -2602,9 +2602,17 @@ yyreduce: #line 2603 "src/parse-gram.c" break; - case 98: + case 97: +/* Line 1388 of yacc.c */ +#line 566 "parse-gram.y" + { (yyval.chars) = (yyvsp[0].uniqstr); } +/* Line 1388 of yacc.c */ +#line 2611 "src/parse-gram.c" + break; + + case 99: /* Line 1388 of yacc.c */ -#line 576 "parse-gram.y" +#line 577 "parse-gram.y" { code_props plain_code; (yyvsp[0].code)[strlen ((yyvsp[0].code)) - 1] = '\n'; @@ -2614,51 +2622,51 @@ yyreduce: (yyval.chars) = plain_code.code; } /* Line 1388 of yacc.c */ -#line 2618 "src/parse-gram.c" +#line 2626 "src/parse-gram.c" break; - case 99: + case 100: /* Line 1388 of yacc.c */ -#line 596 "parse-gram.y" +#line 597 "parse-gram.y" { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); } /* Line 1388 of yacc.c */ -#line 2626 "src/parse-gram.c" +#line 2634 "src/parse-gram.c" break; - case 100: + case 101: /* Line 1388 of yacc.c */ -#line 598 "parse-gram.y" +#line 599 "parse-gram.y" { (yyval.symbol) = symbol_get (char_name ((yyvsp[0].character)), (yylsp[0])); symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false); symbol_user_token_number_set ((yyval.symbol), (yyvsp[0].character), (yylsp[0])); } /* Line 1388 of yacc.c */ -#line 2638 "src/parse-gram.c" +#line 2646 "src/parse-gram.c" break; - case 101: + case 102: /* Line 1388 of yacc.c */ -#line 606 "parse-gram.y" +#line 607 "parse-gram.y" { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); } /* Line 1388 of yacc.c */ -#line 2646 "src/parse-gram.c" +#line 2654 "src/parse-gram.c" break; - case 104: + case 105: /* Line 1388 of yacc.c */ -#line 618 "parse-gram.y" +#line 619 "parse-gram.y" { (yyval.symbol) = symbol_get (quotearg_style (c_quoting_style, (yyvsp[0].chars)), (yylsp[0])); symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false); } /* Line 1388 of yacc.c */ -#line 2657 "src/parse-gram.c" +#line 2665 "src/parse-gram.c" break; - case 106: + case 107: /* Line 1388 of yacc.c */ -#line 627 "parse-gram.y" +#line 628 "parse-gram.y" { code_props plain_code; code_props_plain_init (&plain_code, (yyvsp[0].chars), (yylsp[0])); @@ -2668,12 +2676,12 @@ yyreduce: code_scanner_last_string_free (); } /* Line 1388 of yacc.c */ -#line 2672 "src/parse-gram.c" +#line 2680 "src/parse-gram.c" break; /* Line 1388 of yacc.c */ -#line 2677 "src/parse-gram.c" +#line 2685 "src/parse-gram.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -2890,7 +2898,7 @@ yyreturn: } /* Line 1607 of yacc.c */ -#line 637 "parse-gram.y" +#line 638 "parse-gram.y" diff --git a/src/parse-gram.h b/src/parse-gram.h index 1eeb8b78..e361ac4c 100644 --- a/src/parse-gram.h +++ b/src/parse-gram.h @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 2.4.394-10e5b80-dirty. */ +/* A Bison parser, made by GNU Bison 2.4.395-7910-dirty. */ /* Interface for Bison's Yacc-like parsers in C diff --git a/src/parse-gram.y b/src/parse-gram.y index 6f9ac83b..62c56599 100644 --- a/src/parse-gram.y +++ b/src/parse-gram.y @@ -563,6 +563,7 @@ variable: /* Some content or empty by default. */ content.opt: /* Nothing. */ { $$ = ""; } +| ID { $$ = $1; } | STRING ; diff --git a/tests/actions.at b/tests/actions.at index be52791c..d317920d 100644 --- a/tests/actions.at +++ b/tests/actions.at @@ -29,7 +29,7 @@ AT_SETUP([Mid-rule actions]) # action. AT_DATA_GRAMMAR([[input.y]], -[[%define parse.error "verbose" +[[%define parse.error verbose %debug %{ # include @@ -93,7 +93,7 @@ AT_CLEANUP AT_SETUP([Exotic Dollars]) AT_DATA_GRAMMAR([[input.y]], -[[%define parse.error "verbose" +[[%define parse.error verbose %debug %{ # include @@ -557,7 +557,7 @@ m4_define([AT_CHECK_PRINTER_AND_DESTRUCTOR], $3 _AT_CHECK_PRINTER_AND_DESTRUCTOR($[1], $[2], $[3], $[4], -[%define parse.error "verbose" +[%define parse.error verbose %debug %verbose %locations @@ -588,7 +588,7 @@ AT_CHECK_PRINTER_AND_DESTRUCTOR([%glr-parser], [with union]) AT_SETUP([Default tagless %printer and %destructor]) AT_DATA_GRAMMAR([[input.y]], -[[%define parse.error "verbose" +[[%define parse.error verbose %debug %locations %initial-action { @@ -706,7 +706,7 @@ AT_CLEANUP AT_SETUP([Default tagged and per-type %printer and %destructor]) AT_DATA_GRAMMAR([[input.y]], -[[%define parse.error "verbose" +[[%define parse.error verbose %debug %{ @@ -850,7 +850,7 @@ m4_define([_AT_CHECK_DEFAULT_PRINTER_AND_DESTRUCTOR_FOR_END_TOKEN], [m4_pushdef([kind], [*]) m4_pushdef([not_kind], [])]) AT_DATA_GRAMMAR([[input]]$1[[.y]], -[[%define parse.error "verbose" +[[%define parse.error verbose %debug %locations %initial-action { diff --git a/tests/calc.at b/tests/calc.at index 9eee68d6..52051ef7 100644 --- a/tests/calc.at +++ b/tests/calc.at @@ -401,7 +401,7 @@ AT_PARSER_CHECK([./calc input], 0, [], [stderr]) # If BISON-OPTIONS contains `%location', then make sure the ERROR-LOCATION # is correctly output on stderr. # -# If BISON-OPTIONS contains `%define parse.error "verbose"', then make sure the +# If BISON-OPTIONS contains `%define parse.error verbose', then make sure the # IF-YYERROR-VERBOSE message is properly output after `syntax error, ' # on STDERR. # @@ -443,7 +443,7 @@ AT_YYERROR_SEES_LOC_IF([], [[sed 's/^[-0-9.]*: //' expout >at-expout mv at-expout expout]]) # 4. If error-verbose is not used, strip the`, unexpected....' part. -m4_bmatch([$1], [%define parse.error "verbose"], [], +m4_bmatch([$1], [%define parse.error verbose], [], [[sed 's/syntax error, .*$/syntax error/' expout >at-expout mv at-expout expout]]) # 5. Check @@ -572,22 +572,22 @@ AT_CHECK_CALC_LALR([%locations]) AT_CHECK_CALC_LALR([%name-prefix="calc"]) dnl test deprecated `=' AT_CHECK_CALC_LALR([%verbose]) AT_CHECK_CALC_LALR([%yacc]) -AT_CHECK_CALC_LALR([%define parse.error "verbose"]) +AT_CHECK_CALC_LALR([%define parse.error verbose]) AT_CHECK_CALC_LALR([%define api.pure %locations]) -AT_CHECK_CALC_LALR([%define api.push-pull "both" %define api.pure %locations]) -AT_CHECK_CALC_LALR([%define parse.error "verbose" %locations]) +AT_CHECK_CALC_LALR([%define api.push-pull both %define api.pure %locations]) +AT_CHECK_CALC_LALR([%define parse.error verbose %locations]) -AT_CHECK_CALC_LALR([%define parse.error "verbose" %locations %defines %name-prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_LALR([%define parse.error "verbose" %locations %defines %name-prefix "calc" %define api.tokens.prefix "TOK_" %verbose %yacc]) +AT_CHECK_CALC_LALR([%define parse.error verbose %locations %defines %name-prefix "calc" %verbose %yacc]) +AT_CHECK_CALC_LALR([%define parse.error verbose %locations %defines %name-prefix "calc" %define api.tokens.prefix "TOK_" %verbose %yacc]) AT_CHECK_CALC_LALR([%debug]) -AT_CHECK_CALC_LALR([%define parse.error "verbose" %debug %locations %defines %name-prefix "calc" %verbose %yacc]) +AT_CHECK_CALC_LALR([%define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_LALR([%define api.pure %define parse.error "verbose" %debug %locations %defines %name-prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_LALR([%define api.push-pull "both" %define api.pure %define parse.error "verbose" %debug %locations %defines %name-prefix "calc" %verbose %yacc]) +AT_CHECK_CALC_LALR([%define api.pure %define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc]) +AT_CHECK_CALC_LALR([%define api.push-pull both %define api.pure %define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_LALR([%define api.pure %define parse.error "verbose" %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}]) +AT_CHECK_CALC_LALR([%define api.pure %define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}]) # ----------------------- # @@ -611,20 +611,20 @@ AT_CHECK_CALC_GLR([%locations]) AT_CHECK_CALC_GLR([%name-prefix "calc"]) AT_CHECK_CALC_GLR([%verbose]) AT_CHECK_CALC_GLR([%yacc]) -AT_CHECK_CALC_GLR([%define parse.error "verbose"]) +AT_CHECK_CALC_GLR([%define parse.error verbose]) AT_CHECK_CALC_GLR([%define api.pure %locations]) -AT_CHECK_CALC_GLR([%define parse.error "verbose" %locations]) +AT_CHECK_CALC_GLR([%define parse.error verbose %locations]) -AT_CHECK_CALC_GLR([%define parse.error "verbose" %locations %defines %name-prefix "calc" %verbose %yacc]) +AT_CHECK_CALC_GLR([%define parse.error verbose %locations %defines %name-prefix "calc" %verbose %yacc]) AT_CHECK_CALC_GLR([%debug]) -AT_CHECK_CALC_GLR([%define parse.error "verbose" %debug %locations %defines %name-prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_GLR([%define parse.error "verbose" %debug %locations %defines %name-prefix "calc" %define api.tokens.prefix "TOK_" %verbose %yacc]) +AT_CHECK_CALC_GLR([%define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc]) +AT_CHECK_CALC_GLR([%define parse.error verbose %debug %locations %defines %name-prefix "calc" %define api.tokens.prefix "TOK_" %verbose %yacc]) -AT_CHECK_CALC_GLR([%define api.pure %define parse.error "verbose" %debug %locations %defines %name-prefix "calc" %verbose %yacc]) +AT_CHECK_CALC_GLR([%define api.pure %define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_GLR([%define api.pure %define parse.error "verbose" %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}]) +AT_CHECK_CALC_GLR([%define api.pure %define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}]) # ----------------------------- # @@ -645,14 +645,14 @@ m4_define([AT_CHECK_CALC_LALR1_CC], AT_CHECK_CALC_LALR1_CC([]) AT_CHECK_CALC_LALR1_CC([%locations]) -AT_CHECK_CALC_LALR1_CC([%locations %define parse.error "verbose" %name-prefix "calc" %verbose %yacc]) +AT_CHECK_CALC_LALR1_CC([%locations %define parse.error verbose %name-prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_LALR1_CC([%locations %define parse.error "verbose" %debug %name-prefix "calc" %verbose %yacc]) +AT_CHECK_CALC_LALR1_CC([%locations %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_LALR1_CC([%locations %pure-parser %define parse.error "verbose" %debug %name-prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_LALR1_CC([%locations %pure-parser %define parse.error "verbose" %debug %name-prefix "calc" %define api.tokens.prefix "TOK_" %verbose %yacc]) +AT_CHECK_CALC_LALR1_CC([%locations %pure-parser %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc]) +AT_CHECK_CALC_LALR1_CC([%locations %pure-parser %define parse.error verbose %debug %name-prefix "calc" %define api.tokens.prefix "TOK_" %verbose %yacc]) -AT_CHECK_CALC_LALR1_CC([%locations %pure-parser %define parse.error "verbose" %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}]) +AT_CHECK_CALC_LALR1_CC([%locations %pure-parser %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}]) @@ -673,12 +673,12 @@ m4_define([AT_CHECK_CALC_GLR_CC], [AT_CHECK_CALC([%language "C++" %glr-parser %defines %locations] $@)]) AT_CHECK_CALC_GLR_CC([]) -AT_CHECK_CALC_GLR_CC([%define parse.error "verbose" %name-prefix "calc" %verbose %yacc]) +AT_CHECK_CALC_GLR_CC([%define parse.error verbose %name-prefix "calc" %verbose %yacc]) AT_CHECK_CALC_GLR_CC([%debug]) -AT_CHECK_CALC_GLR_CC([%define parse.error "verbose" %debug %name-prefix "calc" %verbose %yacc]) +AT_CHECK_CALC_GLR_CC([%define parse.error verbose %debug %name-prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_GLR_CC([%pure-parser %define parse.error "verbose" %debug %name-prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_GLR_CC([%pure-parser %define parse.error "verbose" %debug %name-prefix "calc" %define api.tokens.prefix "TOK_" %verbose %yacc]) +AT_CHECK_CALC_GLR_CC([%pure-parser %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc]) +AT_CHECK_CALC_GLR_CC([%pure-parser %define parse.error verbose %debug %name-prefix "calc" %define api.tokens.prefix "TOK_" %verbose %yacc]) -AT_CHECK_CALC_GLR_CC([%pure-parser %define parse.error "verbose" %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}]) +AT_CHECK_CALC_GLR_CC([%pure-parser %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}]) diff --git a/tests/existing.at b/tests/existing.at index 5a897324..ba06626b 100644 --- a/tests/existing.at +++ b/tests/existing.at @@ -42,18 +42,18 @@ AT_CHECK([[diff -u input-lalr.output input.output \ [[0]], [$1])]) AT_TEST_TABLES_AND_PARSE([$2[: LALR(1)]], [[LALR]], [[last-state]], - [[%define lr.type "lalr" + [[%define lr.type lalr ]$3], [$4], [$5], [$6], [$7], [AT_LALR1_DIFF_CHECK([$8])$9], [$10], [$11], [$12]) AT_TEST_TABLES_AND_PARSE([$2[: IELR(1)]], [[IELR]], [[last-state]], - [[%define lr.type "ielr" + [[%define lr.type ielr ]$3], [$4], [$5], [$6], [$7], [AT_LALR1_DIFF_CHECK([$8])$9], [$10], [$11], [$12]) AT_TEST_TABLES_AND_PARSE([$2[: Canonical LR(1)]], [[canonical LR]], [[last-state,no-xml]], - [[%define lr.type "canonical-lr" + [[%define lr.type canonical-lr ]$3], [$4], [$5], [$6], [$7], [$9], [$10], [$11], [$12]) diff --git a/tests/input.at b/tests/input.at index 3d82159a..3f08a1b2 100644 --- a/tests/input.at +++ b/tests/input.at @@ -999,7 +999,7 @@ AT_SETUP([[%define enum variables]]) # Front-end. AT_DATA([[input.y]], -[[%define lr.default-reductions "bogus" +[[%define lr.default-reductions bogus %% start: ; ]]) @@ -1012,7 +1012,7 @@ input.y:1.9-29: accepted value: `accepting' # Back-end. AT_DATA([[input.y]], -[[%define api.push-pull "neither" +[[%define api.push-pull neither %% start: ; ]]) @@ -1047,7 +1047,7 @@ input.y:1.9-21: accepted value: `both' ]]) AT_DATA([[input.y]], -[[%define lr.keep_unreachable_states "maybe" +[[%define lr.keep_unreachable_states maybe %% start: ; ]]) @@ -1102,11 +1102,11 @@ AT_BISON_CHECK([[input.y]], [0], [], ]) AT_CHECK_API_PURE([[%language "c++" %defines]], [[]]) -AT_CHECK_API_PURE([[%language "c++" %defines]], [["false"]]) +AT_CHECK_API_PURE([[%language "c++" %defines]], [[false]]) AT_CHECK_API_PURE([[%language "c++" %defines %glr-parser]], [[""]]) -AT_CHECK_API_PURE([[%language "c++" %defines %glr-parser]], [["false"]]) -AT_CHECK_API_PURE([[%language "java"]], [["true"]]) -AT_CHECK_API_PURE([[%language "java"]], [["false"]]) +AT_CHECK_API_PURE([[%language "c++" %defines %glr-parser]], [[false]]) +AT_CHECK_API_PURE([[%language "java"]], [[true]]) +AT_CHECK_API_PURE([[%language "java"]], [[false]]) AT_CLEANUP diff --git a/tests/local.at b/tests/local.at index b09c5177..dc3897b5 100644 --- a/tests/local.at +++ b/tests/local.at @@ -77,7 +77,7 @@ m4_pushdef([AT_LOCATION_IF], [m4_bmatch([$3], [%locations], [$1], [$2])]) m4_pushdef([AT_PURE_IF], [m4_bmatch([$3], [%define *api\.pure\|%pure-parser], - [m4_bmatch([$3], [%define *api\.pure *"false"], [$2], [$1])], + [m4_bmatch([$3], [%define *api\.pure *"?false"?], [$2], [$1])], [$2])]) m4_pushdef([AT_PURE_AND_LOC_IF], [m4_bmatch([$3], [%locations], [AT_PURE_IF($@)], [$2])]) diff --git a/tests/push.at b/tests/push.at index bf48c682..831be0c0 100644 --- a/tests/push.at +++ b/tests/push.at @@ -33,7 +33,7 @@ AT_DATA_GRAMMAR([[input.y]], void yyerror (char const *msg); %} -%define api.pure %define api.push-pull "push" +%define api.pure %define api.push-pull push %% @@ -93,7 +93,7 @@ AT_DATA_GRAMMAR([[input.y]], int yylex (void); %} -%define api.push-pull "]$1[" +%define api.push-pull ]$1[ %% @@ -156,7 +156,7 @@ AT_SETUP([[Push Parsing: Unsupported Skeletons]]) AT_DATA([[input.y]], [[%glr-parser -%define api.push-pull "push" +%define api.push-pull push %% start: ; ]]) diff --git a/tests/reduce.at b/tests/reduce.at index 45a856a5..e1e33678 100644 --- a/tests/reduce.at +++ b/tests/reduce.at @@ -375,19 +375,19 @@ m4_define([AT_TEST_LR_TYPE], AT_TEST_TABLES_AND_PARSE([[no %define lr.type: ]$1], [[LALR]], [[]], [$2], m4_shiftn(2, $@)) -AT_TEST_TABLES_AND_PARSE([[%define lr.type "lalr": ]$1], +AT_TEST_TABLES_AND_PARSE([[%define lr.type lalr: ]$1], [[LALR]], [[]], - [[%define lr.type "lalr" + [[%define lr.type lalr ]$2], m4_shiftn(2, $@)) -AT_TEST_TABLES_AND_PARSE([[%define lr.type "ielr": ]$1], +AT_TEST_TABLES_AND_PARSE([[%define lr.type ielr: ]$1], [[IELR]], [[]], - [[%define lr.type "ielr" + [[%define lr.type ielr ]$2], m4_shiftn(2, $@)) -AT_TEST_TABLES_AND_PARSE([[%define lr.type "canonical-lr": ]$1], +AT_TEST_TABLES_AND_PARSE([[%define lr.type canonical-lr: ]$1], [[canonical LR]], [[]], - [[%define lr.type "canonical-lr" + [[%define lr.type canonical-lr ]$2], m4_shiftn(2, $@)) ]) @@ -1454,17 +1454,17 @@ AT_TEST_TABLES_AND_PARSE([[no %define lr.default-reductions]], [[all]], [[]], [[]], [$1], [$2], [[]], [$3]) -AT_TEST_TABLES_AND_PARSE([[%define lr.default-reductions "all"]], +AT_TEST_TABLES_AND_PARSE([[%define lr.default-reductions all]], [[all]], [[]], - [[%define lr.default-reductions "all"]], + [[%define lr.default-reductions all]], [$1], [$2], [[]], [$3]) -AT_TEST_TABLES_AND_PARSE([[%define lr.default-reductions "consistent"]], +AT_TEST_TABLES_AND_PARSE([[%define lr.default-reductions consistent]], [[consistent]], [[]], - [[%define lr.default-reductions "consistent"]], + [[%define lr.default-reductions consistent]], [$1], [$2], [[]], [$3]) -AT_TEST_TABLES_AND_PARSE([[%define lr.default-reductions "accepting"]], +AT_TEST_TABLES_AND_PARSE([[%define lr.default-reductions accepting]], [[accepting]], [[]], - [[%define lr.default-reductions "accepting"]], + [[%define lr.default-reductions accepting]], [$1], [$2], [[]], [$3]) ]) diff --git a/tests/torture.at b/tests/torture.at index 91b3b1b9..47435cbc 100644 --- a/tests/torture.at +++ b/tests/torture.at @@ -496,7 +496,7 @@ AT_PARSER_CHECK([./input 10000], 2, [], [ignore], # just helps guarantee we don't let the YYSTACK_USE_ALLOCA feature affect # push parsers. AT_DATA_STACK_TORTURE([AT_USE_ALLOCA], -[[%define api.push-pull "both" +[[%define api.push-pull both ]]) AT_PARSER_CHECK([./input 20], 0, [], [ignore], [[VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1"]]) @@ -534,7 +534,7 @@ AT_PARSER_CHECK([./input 10000], 2, [], [ignore], [[VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1"]]) AT_DATA_STACK_TORTURE([AT_USE_ALLOCA], -[[%define api.push-pull "both" +[[%define api.push-pull both ]]) AT_PARSER_CHECK([./input 20], 0, [], [ignore], [[VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1"]]) -- 2.47.2