From: Akim Demaille Date: Tue, 6 Nov 2012 17:23:47 +0000 (+0100) Subject: Merge remote-tracking branch 'origin/maint' X-Git-Tag: v2.7.90~277 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/e42906f7904ca7516e9867a3a19ee08d963b1205 Merge remote-tracking branch 'origin/maint' * origin/maint: (24 commits) tests: calc: modernize the use of locations tests: remove useless location initializations lalr1.cc: always initialize yylval. tests: check that C and C++ objects can be linked together. yacc.c: also disable -Wuninitialized. glr.cc, yacc.c: initialize yylloc properly yacc.c, glr.c: a better YY_LOCATION_PRINT yacc.c: simplify initialization doc: formatting changes c++: fix position operator signatures tests: remove useless location initialization. tests: fix locations in C tests: handle %parse-param in the generated yyerror tests: simplifications grammars: fix display of nul character in error message tests: sort tests: cosmetic changes comment changes autoconf: update gnulib: update ... Conflicts: data/lalr1.cc gnulib src/scan-gram.l submodules/autoconf tests/calc.at --- e42906f7904ca7516e9867a3a19ee08d963b1205 diff --cc THANKS index 4fbbbb0b,21e7a1dd..eab6349b --- a/THANKS +++ b/THANKS @@@ -89,8 -89,8 +90,9 @@@ Paul Hilfinger Hilfinger@CS. Per Allansson per@appgate.com Peter Fales psfales@lucent.com Peter Hamorsky hamo@upjs.sk + Peter Simons simons@cryp.to Piotr Gackiewicz gacek@intertel.com.pl +Quentin Hocquet hocquet@gostai.com Quoc Peyrot chojin@lrde.epita.fr R Blake blakers@mac.com Raja R Harinath harinath@cs.umn.edu diff --cc data/c.m4 index 51ffbe3b,8bd96b85..91126a82 --- a/data/c.m4 +++ b/data/c.m4 @@@ -595,6 -640,49 +595,49 @@@ m4_define([b4_yylloc_default_define] (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ - while (YYID (0)) + while (0) #endif ]]) + + # b4_yy_location_print_define + # --------------------------- + # Define YY_LOCATION_PRINT. + m4_define([b4_yy_location_print_define], + [b4_locations_if([[ + /* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + + #ifndef YY_LOCATION_PRINT + # if defined ]b4_api_PREFIX[LTYPE_IS_TRIVIAL && ]b4_api_PREFIX[LTYPE_IS_TRIVIAL + # define YY_LOCATION_PRINT(File, Loc) \ + do { \ + fprintf (File, "%d.%d", (Loc).first_line, (Loc).first_column); \ + if ((Loc).first_line < (Loc).last_line) \ + fprintf (File, "-%d.%d", (Loc).last_line, (Loc).last_column - 1); \ + else if ((Loc).first_column < (Loc).last_column - 1) \ + fprintf (File, "-%d", (Loc).last_column - 1); \ + } while (0) + # else + # define YY_LOCATION_PRINT(File, Loc) ((void) 0) + # endif + #endif]], + [[/* This macro is provided for backward compatibility. */ + #ifndef YY_LOCATION_PRINT + # define YY_LOCATION_PRINT(File, Loc) ((void) 0) + #endif]]) + ]) + + # b4_yyloc_default + # ---------------- + # Expand to a possible default value for yylloc. + m4_define([b4_yyloc_default], + [[ + # if defined ]b4_api_PREFIX[LTYPE_IS_TRIVIAL && ]b4_api_PREFIX[LTYPE_IS_TRIVIAL + = { ]m4_join([, ], + m4_defn([b4_location_initial_line]), + m4_defn([b4_location_initial_column]), + m4_defn([b4_location_initial_line]), + m4_defn([b4_location_initial_column]))[ } + # endif + ]]) diff --cc data/glr.c index e2363a20,9bd95228..9038c747 --- a/data/glr.c +++ b/data/glr.c @@@ -412,31 -475,13 +412,13 @@@ dnl We probably ought to introduce a ty #define YYTERROR 1 ]b4_locations_if([[ - #ifndef YYLLOC_DEFAULT ]b4_yylloc_default_define[ # define YYRHSLOC(Rhs, K) ((Rhs)[K].yystate.yyloc) - - /* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - - # define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) - #endif - ]],[ - #ifndef YYLLOC_DEFAULT - # define YYLLOC_DEFAULT(Current, Rhs, N) ((void) 0) - #endif - ])[ - - #ifndef YY_LOCATION_PRINT - # define YY_LOCATION_PRINT(File, Loc) ((void) 0) - #endif + ]])[ + ]b4_yy_location_print_define[ /* YYLEX -- calling `yylex' with the right arguments. */ -#define YYLEX ]b4_c_function_call([yylex], [int], b4_lex_param)[ +#define YYLEX ]b4_function_call([yylex], [int], b4_lex_param)[ ]b4_pure_if( [ @@@ -2278,17 -2277,12 +2260,12 @@@ yyrecoverSyntaxError (yyGLRStack* yysta YYDPRINTF ((stderr, "Starting parse\n")); yychar = YYEMPTY; - yylval = yyval_default; - ]b4_locations_if([ - #if defined ]b4_api_PREFIX[LTYPE_IS_TRIVIAL && ]b4_api_PREFIX[LTYPE_IS_TRIVIAL - yylloc.first_line = yylloc.last_line = ]b4_location_initial_line[; - yylloc.first_column = yylloc.last_column = ]b4_location_initial_column[; - #endif - ]) - m4_ifdef([b4_initial_action], [ + yylval = yyval_default;]b4_locations_if([ + yylloc = yyloc_default;])[ + ]m4_ifdef([b4_initial_action], [ b4_dollar_pushdef([yylval], [], [yylloc])dnl -/* User initialization code. */ -b4_user_initial_action + /* User initialization code. */ + b4_user_initial_action b4_dollar_popdef])[]dnl [ if (! yyinitGLRStack (yystackp, YYINITDEPTH)) diff --cc data/lalr1.cc index 7e5baeb0,e45b2e1f..34eef138 --- a/data/lalr1.cc +++ b/data/lalr1.cc @@@ -660,14 -508,16 +660,14 @@@ m4_if(b4_prefix, [yy], [] int ]b4_parser_class_name[::parse () { - /// Lookahead and lookahead in internal form. - int yychar = yyempty_; - int yytoken = 0; + /// Whether yyla contains a lookahead. + bool yyempty = true; - /* State. */ + // State. int yyn; int yylen = 0; - int yystate = 0; - /* Error handling. */ + // Error handling. int yynerrs_ = 0; int yyerrstatus_ = 0; diff --cc data/yacc.c index 9ff20322,2e0ecc25..ebc41276 --- a/data/yacc.c +++ b/data/yacc.c @@@ -266,14 -266,14 +268,14 @@@ typedef struct ]b4_prefix[pstate ]b4_pr [[b4_prefix[pstate *ps]], [[ps]]]b4_pure_if([, [[[int pushed_char]], [[pushed_char]]], [[b4_api_PREFIX[STYPE const *pushed_val]], [[pushed_val]]]b4_locations_if([, - [[b4_api_PREFIX[LTYPE const *pushed_loc]], [[pushed_loc]]]])])m4_ifset([b4_parse_param], [, + [[b4_api_PREFIX[LTYPE *pushed_loc]], [[pushed_loc]]]])])m4_ifset([b4_parse_param], [, b4_parse_param])) -b4_pull_if([b4_c_function_decl([b4_prefix[pull_parse]], [[int]], +b4_pull_if([b4_function_declare([b4_prefix[pull_parse]], [[int]], [[b4_prefix[pstate *ps]], [[ps]]]m4_ifset([b4_parse_param], [, b4_parse_param]))]) -b4_c_function_decl([b4_prefix[pstate_new]], [b4_prefix[pstate *]], +b4_function_declare([b4_prefix[pstate_new]], [b4_prefix[pstate *]], [[[void]], []]) -b4_c_function_decl([b4_prefix[pstate_delete]], [[void]], +b4_function_declare([b4_prefix[pstate_delete]], [[void]], [[b4_prefix[pstate *ps]], [[ps]]])dnl ]) @@@ -660,13 -763,13 +662,13 @@@ d else \ { \ yyerror (]b4_yyerror_args[YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) + YYERROR; \ + } \ +while (0) - + /* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 +#define YYTERROR 1 +#define YYERRCODE 256 ]b4_locations_if([[ ]b4_yylloc_default_define[ diff --cc src/scan-gram.l index 95edacc5,ad061cc6..98124556 --- a/src/scan-gram.l +++ b/src/scan-gram.l @@@ -354,7 -291,7 +354,8 @@@ eqopt ([[:space:]]*=) } . { - complain (loc, complaint, _("invalid character: %s"), quote (yytext)); - complain_at (*loc, _("invalid character: %s"), quote_mem (yytext, yyleng)); ++ complain (loc, complaint, _("invalid character: %s"), ++ quote_mem (yytext, yyleng)); } <> { @@@ -437,20 -362,20 +438,20 @@@ BEGIN bracketed_id_context_state; if (bracketed_id_str) { - if (INITIAL == bracketed_id_context_state) - { - val->uniqstr = bracketed_id_str; - bracketed_id_str = 0; - *loc = bracketed_id_loc; - return BRACKETED_ID; - } + if (INITIAL == bracketed_id_context_state) + { + val->uniqstr = bracketed_id_str; + bracketed_id_str = 0; + *loc = bracketed_id_loc; + return BRACKETED_ID; + } } else - complain_at (*loc, _("an identifier expected")); + complain (loc, complaint, _("an identifier expected")); } . { - complain_at (*loc, _("invalid character in bracketed name: %s"), - quote_mem (yytext, yyleng)); + complain (loc, complaint, _("invalid character in bracketed name: %s"), - quote (yytext)); ++ quote_mem (yytext, yyleng)); } <> { BEGIN bracketed_id_context_state; diff --cc tests/actions.at index 4b0019b8,01e3e57d..7b220a28 --- a/tests/actions.at +++ b/tests/actions.at @@@ -592,13 -661,9 +661,9 @@@ AT_CHECK_PRINTER_AND_DESTRUCTOR([%glr-p AT_SETUP([Default tagless %printer and %destructor]) AT_BISON_OPTION_PUSHDEFS([%locations]) AT_DATA_GRAMMAR([[input.y]], -[[%error-verbose +[[%define parse.error verbose %debug %locations - %initial-action { - @$.first_line = @$.last_line = 1; - @$.first_column = @$.last_column = 1; - } %{ # include @@@ -646,10 -711,7 +711,10 @@@ main (void } ]]) -AT_BISON_CHECK([-o input.c input.y]) +AT_BISON_CHECK([-o input.c input.y], [], [], - [[input.y:27.3-5: warning: useless %destructor for type <*> [-Wother] - input.y:27.3-5: warning: useless %printer for type <*> [-Wother] ++[[input.y:23.3-5: warning: useless %destructor for type <*> [-Wother] ++input.y:23.3-5: warning: useless %printer for type <*> [-Wother] +]]) AT_COMPILE([input]) AT_PARSER_CHECK([./input], 1, [[<> destructor for 'd' @ 4. @@@ -832,13 -891,9 +897,9 @@@ m4_pushdef([AT_TEST] AT_BISON_OPTION_PUSHDEFS([%locations]) AT_DATA_GRAMMAR([[input]]$1[[.y]], -[[%error-verbose +[[%define parse.error verbose %debug %locations - %initial-action { - @$.first_line = @$.last_line = 1; - @$.first_column = @$.last_column = 1; - } %{ # include @@@ -897,17 -952,8 +958,17 @@@ main (void ]]) AT_BISON_OPTION_POPDEFS -AT_BISON_CHECK([-o input$1.c input$1.y]) +AT_BISON_CHECK([-o input$1.c input$1.y], [], [], +[m4_if([$1], [0], - [[input0.y:27.3-5: warning: useless %destructor for type <*> [-Wother] - input0.y:27.3-5: warning: useless %printer for type <*> [-Wother] ++[[input0.y:23.3-5: warning: useless %destructor for type <*> [-Wother] ++input0.y:23.3-5: warning: useless %printer for type <*> [-Wother] +]], - [[input1.y:27.3-4: warning: useless %destructor for type <> [-Wother] - input1.y:27.3-4: warning: useless %printer for type <> [-Wother] ++[[input1.y:23.3-4: warning: useless %destructor for type <> [-Wother] ++input1.y:23.3-4: warning: useless %printer for type <> [-Wother] +]])]) + AT_COMPILE([input$1]) + AT_PARSER_CHECK([./input$1], 0, [[<]]kind[[> for 'E' @ 1. <]]kind[[> for 'S' @ 1. diff --cc tests/calc.at index bdc80284,4ab725b3..f336b69e --- a/tests/calc.at +++ b/tests/calc.at @@@ -644,19 -606,19 +608,19 @@@ AT_CHECK_CALC_LALR([%define parse.erro 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([%error-verbose %locations]) +AT_CHECK_CALC_LALR([%define parse.error verbose %locations]) -AT_CHECK_CALC_LALR([%error-verbose %locations %defines %name-prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_LALR([%error-verbose %locations %defines %define api.prefix "calc" %verbose %yacc]) +AT_CHECK_CALC_LALR([%define parse.error verbose %locations %defines %define api.prefix "calc" %verbose %yacc]) +AT_CHECK_CALC_LALR([%define parse.error verbose %locations %defines %name-prefix "calc" %define api.token.prefix "TOK_" %verbose %yacc]) AT_CHECK_CALC_LALR([%debug]) -AT_CHECK_CALC_LALR([%error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_LALR([%error-verbose %debug %locations %defines %define api.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 parse.error verbose %debug %locations %defines %define api.prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_LALR([%define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_LALR([%define api.push-pull both %define api.pure %error-verbose %debug %locations %defines %define api.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 %define api.prefix "calc" %verbose %yacc]) - AT_CHECK_CALC_LALR([%define api.pure %define parse.error verbose %debug %locations %defines %define api.prefix "calc" %verbose %yacc %parse-param {semantic_value *result} {int *count}]) -AT_CHECK_CALC_LALR([%define api.pure %error-verbose %debug %locations %defines %define api.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 %define api.prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}]) # ----------------------- # @@@ -681,21 -643,21 +645,21 @@@ AT_CHECK_CALC_GLR([%name-prefix "calc"] AT_CHECK_CALC_GLR([%define api.prefix "calc"]) AT_CHECK_CALC_GLR([%verbose]) AT_CHECK_CALC_GLR([%yacc]) -AT_CHECK_CALC_GLR([%error-verbose]) +AT_CHECK_CALC_GLR([%define parse.error verbose]) AT_CHECK_CALC_GLR([%define api.pure %locations]) -AT_CHECK_CALC_GLR([%error-verbose %locations]) +AT_CHECK_CALC_GLR([%define parse.error verbose %locations]) -AT_CHECK_CALC_GLR([%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([%error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_GLR([%error-verbose %debug %locations %defines %define api.prefix "calc" %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 %define api.prefix "calc" %define api.token.prefix "TOK_" %verbose %yacc]) -AT_CHECK_CALC_GLR([%define api.pure %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} {int *count}]) - AT_CHECK_CALC_GLR([%define api.pure %define parse.error verbose %debug %locations %defines %define api.prefix "calc" %verbose %yacc %parse-param {semantic_value *result} {int *count}]) -AT_CHECK_CALC_GLR([%define api.pure %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 %error-verbose %debug %locations %defines %define api.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}]) ++AT_CHECK_CALC_GLR([%define api.pure %define parse.error verbose %debug %locations %defines %define api.prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}]) # ----------------------------- # @@@ -712,23 -674,18 +676,23 @@@ AT_CHECK_CALC([%skeleton "lalr1.cc" %de # Start a testing chunk which compiles `calc' grammar with # the C++ skeleton, and performs several tests over the parser. m4_define([AT_CHECK_CALC_LALR1_CC], -[AT_CHECK_CALC([%language "C++" %defines %locations] $@)]) +[AT_CHECK_CALC([%language "C++"] $@)]) AT_CHECK_CALC_LALR1_CC([]) -AT_CHECK_CALC_LALR1_CC([%define api.location.type Span]) -AT_CHECK_CALC_LALR1_CC([%error-verbose %name-prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_LALR1_CC([%error-verbose %define api.prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_LALR1_CC([%error-verbose %debug %name-prefix "calc" %verbose %yacc]) +AT_CHECK_CALC_LALR1_CC([%locations]) +AT_CHECK_CALC_LALR1_CC([%locations %define api.location.type Span]) +AT_CHECK_CALC_LALR1_CC([%defines %locations %define parse.error verbose %name-prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_LALR1_CC([%pure-parser %error-verbose %debug %define api.prefix "calc" %verbose %yacc]) +AT_CHECK_CALC_LALR1_CC([%locations %define parse.error verbose %define api.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([%pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}]) -AT_CHECK_CALC_LALR1_CC([%pure-parser %error-verbose %debug %define api.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 %define api.prefix "calc" %verbose %yacc]) +AT_CHECK_CALC_LALR1_CC([%locations %pure-parser %define parse.error verbose %debug %define api.prefix "calc" %define api.token.prefix "TOK_" %verbose %yacc]) + - AT_CHECK_CALC_LALR1_CC([%defines %locations %pure-parser %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} {int *count}]) ++AT_CHECK_CALC_LALR1_CC([%defines %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([%pure-parser %define parse.error verbose %debug %define api.prefix "calc" %verbose %yacc %parse-param {semantic_value *result} {int *count}]) - AT_CHECK_CALC_LALR1_CC([%defines %locations %pure-parser %define parse.error verbose %debug %define api.prefix "calc" %verbose %yacc %parse-param {semantic_value *result} {int *count}]) ++AT_CHECK_CALC_LALR1_CC([%pure-parser %define parse.error verbose %debug %define api.prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}]) ++AT_CHECK_CALC_LALR1_CC([%defines %locations %pure-parser %define parse.error verbose %debug %define api.prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}]) @@@ -746,19 -703,17 +710,19 @@@ AT_CHECK_CALC([%skeleton "glr.cc"] # Start a testing chunk which compiles `calc' grammar with # the GLR C++ skeleton, and performs several tests over the parser. m4_define([AT_CHECK_CALC_GLR_CC], -[AT_CHECK_CALC([%language "C++" %glr-parser %defines %locations] $@)]) +[AT_CHECK_CALC([%language "C++" %glr-parser] $@)]) AT_CHECK_CALC_GLR_CC([]) -AT_CHECK_CALC_GLR_CC([%define api.location.type Span]) -AT_CHECK_CALC_GLR_CC([%error-verbose %name-prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_GLR_CC([%error-verbose %define api.prefix "calc" %verbose %yacc]) +AT_CHECK_CALC_GLR_CC([%locations]) +AT_CHECK_CALC_GLR_CC([%locations %define api.location.type Span]) +AT_CHECK_CALC_GLR_CC([%defines %define parse.error verbose %name-prefix "calc" %verbose %yacc]) +AT_CHECK_CALC_GLR_CC([%define parse.error verbose %define api.prefix "calc" %verbose %yacc]) AT_CHECK_CALC_GLR_CC([%debug]) -AT_CHECK_CALC_GLR_CC([%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 %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.token.prefix "TOK_" %verbose %yacc]) - AT_CHECK_CALC_GLR_CC([%locations %defines %pure-parser %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} {int *count}]) - AT_CHECK_CALC_GLR_CC([%locations %defines %pure-parser %define parse.error verbose %debug %define api.prefix "calc" %verbose %yacc %parse-param {semantic_value *result} {int *count}]) -AT_CHECK_CALC_GLR_CC([%pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}]) -AT_CHECK_CALC_GLR_CC([%pure-parser %error-verbose %debug %define api.prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}]) ++AT_CHECK_CALC_GLR_CC([%locations %defines %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([%locations %defines %pure-parser %define parse.error verbose %debug %define api.prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}]) diff --cc tests/local.at index 9fd641c4,e2fd1beb..d120712d --- a/tests/local.at +++ b/tests/local.at @@@ -140,6 -141,12 +141,13 @@@ m4_pushdef([AT_LOCATION_TYPE_IF] [m4_bmatch([$3], [%define \(api\.location\.type\|location_type\)], [$1], [$2])]) m4_pushdef([AT_PARAM_IF], [m4_bmatch([$3], [%parse-param], [$1], [$2])]) + # Comma-terminated list of formals parse-parameters. -# E.g., %parse-param { int x } {int y} -> "int x, int y, ". ++# E.g., %parse-param { int x } %parse-param {int y} -> "int x, int y, ". ++# FIXME: Support grouped parse-param. + m4_pushdef([AT_PARSE_PARAMS]) + m4_bpatsubst([$3], [%parse-param { *\([^{}]*[^{} ]\) *}], + [m4_append([AT_PARSE_PARAMS], [\1, ])]) + m4_pushdef([AT_PURE_IF], [m4_bmatch([$3], [%define *api\.pure\|%pure-parser], [m4_bmatch([$3], [%define *api\.pure *"?false"?], [$2], [$1])],