Path: blob/main_old/tools/flex-bison/third_party/skeletons/yacc.c
2633 views
-*- C -*-1# Yacc compatible skeleton for Bison23# Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software4# Foundation, Inc.56m4_pushdef([b4_copyright_years],7[1984, 1989-1990, 2000-2015, 2018-2019])89# This program is free software: you can redistribute it and/or modify10# it under the terms of the GNU General Public License as published by11# the Free Software Foundation, either version 3 of the License, or12# (at your option) any later version.13#14# This program is distributed in the hope that it will be useful,15# but WITHOUT ANY WARRANTY; without even the implied warranty of16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the17# GNU General Public License for more details.18#19# You should have received a copy of the GNU General Public License20# along with this program. If not, see <http://www.gnu.org/licenses/>.2122# Check the value of %define api.push-pull.23b4_percent_define_default([[api.push-pull]], [[pull]])24b4_percent_define_check_values([[[[api.push-pull]],25[[pull]], [[push]], [[both]]]])26b4_define_flag_if([pull]) m4_define([b4_pull_flag], [[1]])27b4_define_flag_if([push]) m4_define([b4_push_flag], [[1]])28m4_case(b4_percent_define_get([[api.push-pull]]),29[pull], [m4_define([b4_push_flag], [[0]])],30[push], [m4_define([b4_pull_flag], [[0]])])3132# Handle BISON_USE_PUSH_FOR_PULL for the test suite. So that push parsing33# tests function as written, do not let BISON_USE_PUSH_FOR_PULL modify the34# behavior of Bison at all when push parsing is already requested.35b4_define_flag_if([use_push_for_pull])36b4_use_push_for_pull_if([37b4_push_if([m4_define([b4_use_push_for_pull_flag], [[0]])],38[m4_define([b4_push_flag], [[1]])])])3940# Check the value of %define parse.lac and friends, where LAC stands for41# lookahead correction.42b4_percent_define_default([[parse.lac]], [[none]])43b4_percent_define_default([[parse.lac.es-capacity-initial]], [[20]])44b4_percent_define_default([[parse.lac.memory-trace]], [[failures]])45b4_percent_define_check_values([[[[parse.lac]], [[full]], [[none]]]],46[[[[parse.lac.memory-trace]],47[[failures]], [[full]]]])48b4_define_flag_if([lac])49m4_define([b4_lac_flag],50[m4_if(b4_percent_define_get([[parse.lac]]),51[none], [[0]], [[1]])])5253m4_include(b4_skeletonsdir/[c.m4])5455## ---------------- ##56## Default values. ##57## ---------------- ##5859# Stack parameters.60m4_define_default([b4_stack_depth_max], [10000])61m4_define_default([b4_stack_depth_init], [200])626364## ------------------------ ##65## Pure/impure interfaces. ##66## ------------------------ ##6768b4_percent_define_default([[api.pure]], [[false]])69b4_percent_define_check_values([[[[api.pure]],70[[false]], [[true]], [[]], [[full]]]])7172m4_define([b4_pure_flag], [[0]])73m4_case(b4_percent_define_get([[api.pure]]),74[false], [m4_define([b4_pure_flag], [[0]])],75[true], [m4_define([b4_pure_flag], [[1]])],76[], [m4_define([b4_pure_flag], [[1]])],77[full], [m4_define([b4_pure_flag], [[2]])])7879m4_define([b4_pure_if],80[m4_case(b4_pure_flag,81[0], [$2],82[1], [$1],83[2], [$1])])84[m4_fatal([invalid api.pure value: ]$1)])])8586# b4_yyerror_arg_loc_if(ARG)87# --------------------------88# Expand ARG iff yyerror is to be given a location as argument.89m4_define([b4_yyerror_arg_loc_if],90[b4_locations_if([m4_case(b4_pure_flag,91[1], [m4_ifset([b4_parse_param], [$1])],92[2], [$1])])])9394# b4_yyerror_args95# ---------------96# Arguments passed to yyerror: user args plus yylloc.97m4_define([b4_yyerror_args],98[b4_yyerror_arg_loc_if([&yylloc, ])dnl99m4_ifset([b4_parse_param], [b4_args(b4_parse_param), ])])100101102103## ------------ ##104## Data Types. ##105## ------------ ##106107# b4_int_type(MIN, MAX)108# ---------------------109# Return the smallest int type able to handle numbers ranging from110# MIN to MAX (included). Overwrite the version from c.m4, which111# uses only C89 types, so that the user can override the shorter112# types, and so that pre-C89 compilers are handled correctly.113m4_define([b4_int_type],114[m4_if(b4_ints_in($@, [0], [255]), [1], [yytype_uint8],115b4_ints_in($@, [-128], [127]), [1], [yytype_int8],116117b4_ints_in($@, [0], [65535]), [1], [yytype_uint16],118b4_ints_in($@, [-32768], [32767]), [1], [yytype_int16],119120m4_eval([0 <= $1]), [1], [unsigned],121122[int])])123124125## ----------------- ##126## Semantic Values. ##127## ----------------- ##128129130# b4_lhs_value(SYMBOL-NUM, [TYPE])131# --------------------------------132# See README.133m4_define([b4_lhs_value],134[b4_symbol_value(yyval, [$1], [$2])])135136137# b4_rhs_value(RULE-LENGTH, POS, [SYMBOL-NUM], [TYPE])138# ----------------------------------------------------139# See README.140m4_define([b4_rhs_value],141[b4_symbol_value([yyvsp@{b4_subtract([$2], [$1])@}], [$3], [$4])])142143144## ----------- ##145## Locations. ##146## ----------- ##147148# b4_lhs_location()149# -----------------150# Expansion of @$.151m4_define([b4_lhs_location],152[(yyloc)])153154155# b4_rhs_location(RULE-LENGTH, POS)156# ---------------------------------157# Expansion of @POS, where the current rule has RULE-LENGTH symbols158# on RHS.159m4_define([b4_rhs_location],160[(yylsp@{b4_subtract([$2], [$1])@})])161162163## -------------- ##164## Declarations. ##165## -------------- ##166167# b4_declare_scanner_communication_variables168# ------------------------------------------169# Declare the variables that are global, or local to YYPARSE if170# pure-parser.171m4_define([b4_declare_scanner_communication_variables], [[172/* The lookahead symbol. */173int yychar;174175]b4_pure_if([[176/* The semantic value of the lookahead symbol. */177/* Default value used for initialization, for pacifying older GCCs178or non-GCC compilers. */179YY_INITIAL_VALUE (static YYSTYPE yyval_default;)180YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);]b4_locations_if([[181182/* Location data for the lookahead symbol. */183static YYLTYPE yyloc_default]b4_yyloc_default[;184YYLTYPE yylloc = yyloc_default;]])],185[[/* The semantic value of the lookahead symbol. */186YYSTYPE yylval;]b4_locations_if([[187/* Location data for the lookahead symbol. */188YYLTYPE yylloc]b4_yyloc_default[;]])[189/* Number of syntax errors so far. */190int yynerrs;]])])191192193# b4_declare_parser_state_variables194# ---------------------------------195# Declare all the variables that are needed to maintain the parser state196# between calls to yypush_parse.197m4_define([b4_declare_parser_state_variables], [b4_pure_if([[198/* Number of syntax errors so far. */199int yynerrs;200]])[201int yystate;202/* Number of tokens to shift before error messages enabled. */203int yyerrstatus;204205/* The stacks and their tools:206'yyss': related to states.207'yyvs': related to semantic values.]b4_locations_if([[208'yyls': related to locations.]])[209210Refer to the stacks through separate pointers, to allow yyoverflow211to reallocate them elsewhere. */212213/* The state stack. */214yytype_int16 yyssa[YYINITDEPTH];215yytype_int16 *yyss;216yytype_int16 *yyssp;217218/* The semantic value stack. */219YYSTYPE yyvsa[YYINITDEPTH];220YYSTYPE *yyvs;221YYSTYPE *yyvsp;]b4_locations_if([[222223/* The location stack. */224YYLTYPE yylsa[YYINITDEPTH];225YYLTYPE *yyls;226YYLTYPE *yylsp;227228/* The locations where the error started and ended. */229YYLTYPE yyerror_range[3];]])[230231YYSIZE_T yystacksize;]b4_lac_if([[232233yytype_int16 yyesa@{]b4_percent_define_get([[parse.lac.es-capacity-initial]])[@};234yytype_int16 *yyes;235YYSIZE_T yyes_capacity;]])])236237238# _b4_declare_yyparse_push239# ------------------------240# Declaration of yyparse (and dependencies) when using the push parser241# (including in pull mode).242m4_define([_b4_declare_yyparse_push],243[[#ifndef YYPUSH_MORE_DEFINED244# define YYPUSH_MORE_DEFINED245enum { YYPUSH_MORE = 4 };246#endif247248typedef struct ]b4_prefix[pstate ]b4_prefix[pstate;249250]b4_pull_if([b4_function_declare([b4_prefix[parse]], [[int]], b4_parse_param)251])b4_function_declare([b4_prefix[push_parse]], [[int]],252[[b4_prefix[pstate *ps]], [[ps]]]b4_pure_if([,253[[[int pushed_char]], [[pushed_char]]],254[[b4_api_PREFIX[STYPE const *pushed_val]], [[pushed_val]]]b4_locations_if([,255[[b4_api_PREFIX[LTYPE *pushed_loc]], [[pushed_loc]]]])])m4_ifset([b4_parse_param], [,256b4_parse_param]))257b4_pull_if([b4_function_declare([b4_prefix[pull_parse]], [[int]],258[[b4_prefix[pstate *ps]], [[ps]]]m4_ifset([b4_parse_param], [,259b4_parse_param]))])260b4_function_declare([b4_prefix[pstate_new]], [b4_prefix[pstate *]],261[[[void]], []])262b4_function_declare([b4_prefix[pstate_delete]], [[void]],263[[b4_prefix[pstate *ps]], [[ps]]])dnl264])265266# _b4_declare_yyparse267# -------------------268# When not the push parser.269m4_define([_b4_declare_yyparse],270[b4_function_declare(b4_prefix[parse], [int], b4_parse_param)])271272273# b4_declare_yyparse274# ------------------275m4_define([b4_declare_yyparse],276[b4_push_if([_b4_declare_yyparse_push],277[_b4_declare_yyparse])[]dnl278])279280281# b4_shared_declarations282# ----------------------283# Declaration that might either go into the header (if --defines)284# or open coded in the parser body.285m4_define([b4_shared_declarations],286[b4_cpp_guard_open([b4_spec_defines_file])[287]b4_declare_yydebug[288]b4_percent_code_get([[requires]])[289]b4_token_enums_defines[290]b4_declare_yylstype[291]b4_declare_yyparse[292]b4_percent_code_get([[provides]])[293]b4_cpp_guard_close([b4_spec_defines_file])[]dnl294])295296## -------------- ##297## Output files. ##298## -------------- ##299300b4_output_begin([b4_parser_file_name])[301]b4_copyright([Bison implementation for Yacc-like parsers in C])[302/* C LALR(1) parser skeleton written by Richard Stallman, by303simplifying the original so-called "semantic" parser. */304305/* All symbols defined below should begin with yy or YY, to avoid306infringing on user name space. This should be done even for local307variables, as they might otherwise be expanded by user macros.308There are some unavoidable exceptions within include files to309define necessary library symbols; they are noted "INFRINGES ON310USER NAME SPACE" below. */311312]b4_disclaimer[313]b4_identification[314]b4_percent_code_get([[top]])[]dnl315m4_if(b4_api_prefix, [yy], [],316[[/* Substitute the type names. */317#define YYSTYPE ]b4_api_PREFIX[STYPE]b4_locations_if([[318#define YYLTYPE ]b4_api_PREFIX[LTYPE]])])[319]m4_if(b4_prefix, [yy], [],320[[/* Substitute the variable and function names. */]b4_pull_if([[321#define yyparse ]b4_prefix[parse]])b4_push_if([[322#define yypush_parse ]b4_prefix[push_parse]b4_pull_if([[323#define yypull_parse ]b4_prefix[pull_parse]])[324#define yypstate_new ]b4_prefix[pstate_new325#define yypstate_delete ]b4_prefix[pstate_delete326#define yypstate ]b4_prefix[pstate]])[327#define yylex ]b4_prefix[lex328#define yyerror ]b4_prefix[error329#define yydebug ]b4_prefix[debug330#define yynerrs ]b4_prefix[nerrs331]]b4_pure_if([], [[332#define yylval ]b4_prefix[lval333#define yychar ]b4_prefix[char]b4_locations_if([[334#define yylloc ]b4_prefix[lloc]])]))[335336]b4_user_pre_prologue[337]b4_null_define[338339/* Enabling verbose error messages. */340#ifdef YYERROR_VERBOSE341# undef YYERROR_VERBOSE342# define YYERROR_VERBOSE 1343#else344# define YYERROR_VERBOSE ]b4_error_verbose_if([1], [0])[345#endif346347]m4_ifval(m4_quote(b4_spec_defines_file),348[[/* In a future release of Bison, this section will be replaced349by #include "@basename(]b4_spec_defines_file[@)". */350]])dnl351b4_shared_declarations[352353]b4_user_post_prologue[354]b4_percent_code_get[]dnl355356[#ifdef short357# undef short358#endif359360#ifdef YYTYPE_UINT8361typedef YYTYPE_UINT8 yytype_uint8;362#else363typedef unsigned char yytype_uint8;364#endif365366#ifdef YYTYPE_INT8367typedef YYTYPE_INT8 yytype_int8;368#else369typedef signed char yytype_int8;370#endif371372#ifdef YYTYPE_UINT16373typedef YYTYPE_UINT16 yytype_uint16;374#else375typedef unsigned short yytype_uint16;376#endif377378#ifdef YYTYPE_INT16379typedef YYTYPE_INT16 yytype_int16;380#else381typedef short yytype_int16;382#endif383384#ifndef YYSIZE_T385# ifdef __SIZE_TYPE__386# define YYSIZE_T __SIZE_TYPE__387# elif defined size_t388# define YYSIZE_T size_t389# elif ! defined YYSIZE_T390# include <stddef.h> /* INFRINGES ON USER NAME SPACE */391# define YYSIZE_T size_t392# else393# define YYSIZE_T unsigned394# endif395#endif396397#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)398399#ifndef YY_400# if defined YYENABLE_NLS && YYENABLE_NLS401# if ENABLE_NLS402# include <libintl.h> /* INFRINGES ON USER NAME SPACE */403# define YY_(Msgid) dgettext ("bison-runtime", Msgid)404# endif405# endif406# ifndef YY_407# define YY_(Msgid) Msgid408# endif409#endif410411]b4_attribute_define[412413#if ]b4_lac_if([[1]], [[! defined yyoverflow || YYERROR_VERBOSE]])[414415/* The parser invokes alloca or malloc; define the necessary symbols. */]dnl416b4_push_if([], [b4_lac_if([], [[417418# ifdef YYSTACK_USE_ALLOCA419# if YYSTACK_USE_ALLOCA420# ifdef __GNUC__421# define YYSTACK_ALLOC __builtin_alloca422# elif defined __BUILTIN_VA_ARG_INCR423# include <alloca.h> /* INFRINGES ON USER NAME SPACE */424# elif defined _AIX425# define YYSTACK_ALLOC __alloca426# elif defined _MSC_VER427# include <malloc.h> /* INFRINGES ON USER NAME SPACE */428# define alloca _alloca429# else430# define YYSTACK_ALLOC alloca431# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS432# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */433/* Use EXIT_SUCCESS as a witness for stdlib.h. */434# ifndef EXIT_SUCCESS435# define EXIT_SUCCESS 0436# endif437# endif438# endif439# endif440# endif]])])[441442# ifdef YYSTACK_ALLOC443/* Pacify GCC's 'empty if-body' warning. */444# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)445# ifndef YYSTACK_ALLOC_MAXIMUM446/* The OS might guarantee only one guard page at the bottom of the stack,447and a page size can be as small as 4096 bytes. So we cannot safely448invoke alloca (N) if N exceeds 4096. Use a slightly smaller number449to allow for a few compiler-allocated temporary stack slots. */450# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */451# endif452# else453# define YYSTACK_ALLOC YYMALLOC454# define YYSTACK_FREE YYFREE455# ifndef YYSTACK_ALLOC_MAXIMUM456# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM457# endif458# if (defined __cplusplus && ! defined EXIT_SUCCESS \459&& ! ((defined YYMALLOC || defined malloc) \460&& (defined YYFREE || defined free)))461# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */462# ifndef EXIT_SUCCESS463# define EXIT_SUCCESS 0464# endif465# endif466# ifndef YYMALLOC467# define YYMALLOC malloc468# if ! defined malloc && ! defined EXIT_SUCCESS469void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */470# endif471# endif472# ifndef YYFREE473# define YYFREE free474# if ! defined free && ! defined EXIT_SUCCESS475void free (void *); /* INFRINGES ON USER NAME SPACE */476# endif477# endif478# endif]b4_lac_if([[479# define YYCOPY_NEEDED 1]])[480#endif]b4_lac_if([], [[ /* ! defined yyoverflow || YYERROR_VERBOSE */]])[481482483#if (! defined yyoverflow \484&& (! defined __cplusplus \485|| (]b4_locations_if([[defined ]b4_api_PREFIX[LTYPE_IS_TRIVIAL && ]b4_api_PREFIX[LTYPE_IS_TRIVIAL \486&& ]])[defined ]b4_api_PREFIX[STYPE_IS_TRIVIAL && ]b4_api_PREFIX[STYPE_IS_TRIVIAL)))487488/* A type that is properly aligned for any stack member. */489union yyalloc490{491yytype_int16 yyss_alloc;492YYSTYPE yyvs_alloc;]b4_locations_if([493YYLTYPE yyls_alloc;])[494};495496/* The size of the maximum gap between one aligned stack and the next. */497# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)498499/* The size of an array large to enough to hold all stacks, each with500N elements. */501]b4_locations_if(502[# define YYSTACK_BYTES(N) \503((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \504+ 2 * YYSTACK_GAP_MAXIMUM)],505[# define YYSTACK_BYTES(N) \506((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \507+ YYSTACK_GAP_MAXIMUM)])[508509# define YYCOPY_NEEDED 1510511/* Relocate STACK from its old location to the new one. The512local variables YYSIZE and YYSTACKSIZE give the old and new number of513elements in the stack, and YYPTR gives the new location of the514stack. Advance YYPTR to a properly aligned location for the next515stack. */516# define YYSTACK_RELOCATE(Stack_alloc, Stack) \517do \518{ \519YYSIZE_T yynewbytes; \520YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \521Stack = &yyptr->Stack_alloc; \522yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \523yyptr += yynewbytes / sizeof (*yyptr); \524} \525while (0)526527#endif528529#if defined YYCOPY_NEEDED && YYCOPY_NEEDED530/* Copy COUNT objects from SRC to DST. The source and destination do531not overlap. */532# ifndef YYCOPY533# if defined __GNUC__ && 1 < __GNUC__534# define YYCOPY(Dst, Src, Count) \535__builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))536# else537# define YYCOPY(Dst, Src, Count) \538do \539{ \540YYSIZE_T yyi; \541for (yyi = 0; yyi < (Count); yyi++) \542(Dst)[yyi] = (Src)[yyi]; \543} \544while (0)545# endif546# endif547#endif /* !YYCOPY_NEEDED */548549/* YYFINAL -- State number of the termination state. */550#define YYFINAL ]b4_final_state_number[551/* YYLAST -- Last index in YYTABLE. */552#define YYLAST ]b4_last[553554/* YYNTOKENS -- Number of terminals. */555#define YYNTOKENS ]b4_tokens_number[556/* YYNNTS -- Number of nonterminals. */557#define YYNNTS ]b4_nterms_number[558/* YYNRULES -- Number of rules. */559#define YYNRULES ]b4_rules_number[560/* YYNSTATES -- Number of states. */561#define YYNSTATES ]b4_states_number[562563#define YYUNDEFTOK ]b4_undef_token_number[564#define YYMAXUTOK ]b4_user_token_number_max[565566/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM567as returned by yylex, with out-of-bounds checking. */568#define YYTRANSLATE(YYX) \569((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)570571/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM572as returned by yylex. */573static const ]b4_int_type_for([b4_translate])[ yytranslate[] =574{575]b4_translate[576};577578#if ]b4_api_PREFIX[DEBUG579]b4_integral_parser_table_define([rline], [b4_rline],580[[YYRLINE[YYN] -- Source line where rule number YYN was defined.]])[581#endif582583#if ]b4_api_PREFIX[DEBUG || YYERROR_VERBOSE || ]b4_token_table_flag[584/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.585First, the terminals, then, starting at YYNTOKENS, nonterminals. */586static const char *const yytname[] =587{588]b4_tname[589};590#endif591592# ifdef YYPRINT593/* YYTOKNUM[NUM] -- (External) token number corresponding to the594(internal) symbol number NUM (which must be that of a token). */595static const ]b4_int_type_for([b4_toknum])[ yytoknum[] =596{597]b4_toknum[598};599# endif600601#define YYPACT_NINF ]b4_pact_ninf[602603#define yypact_value_is_default(Yystate) \604]b4_table_value_equals([[pact]], [[Yystate]], [b4_pact_ninf])[605606#define YYTABLE_NINF ]b4_table_ninf[607608#define yytable_value_is_error(Yytable_value) \609]b4_table_value_equals([[table]], [[Yytable_value]], [b4_table_ninf])[610611]b4_parser_tables_define[612613#define yyerrok (yyerrstatus = 0)614#define yyclearin (yychar = YYEMPTY)615#define YYEMPTY (-2)616#define YYEOF 0617618#define YYACCEPT goto yyacceptlab619#define YYABORT goto yyabortlab620#define YYERROR goto yyerrorlab621622623#define YYRECOVERING() (!!yyerrstatus)624625#define YYBACKUP(Token, Value) \626do \627if (yychar == YYEMPTY) \628{ \629yychar = (Token); \630yylval = (Value); \631YYPOPSTACK (yylen); \632yystate = *yyssp; \]b4_lac_if([[633YY_LAC_DISCARD ("YYBACKUP"); \]])[634goto yybackup; \635} \636else \637{ \638yyerror (]b4_yyerror_args[YY_("syntax error: cannot back up")); \639YYERROR; \640} \641while (0)642643/* Error token number */644#define YYTERROR 1645#define YYERRCODE 256646647]b4_locations_if([[648]b4_yylloc_default_define[649#define YYRHSLOC(Rhs, K) ((Rhs)[K])650]])[651652/* Enable debugging if requested. */653#if ]b4_api_PREFIX[DEBUG654655# ifndef YYFPRINTF656# include <stdio.h> /* INFRINGES ON USER NAME SPACE */657# define YYFPRINTF fprintf658# endif659660# define YYDPRINTF(Args) \661do { \662if (yydebug) \663YYFPRINTF Args; \664} while (0)665666]b4_yy_location_print_define[667668# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \669do { \670if (yydebug) \671{ \672YYFPRINTF (stderr, "%s ", Title); \673yy_symbol_print (stderr, \674Type, Value]b4_locations_if([, Location])[]b4_user_args[); \675YYFPRINTF (stderr, "\n"); \676} \677} while (0)678679]b4_yy_symbol_print_define[680681/*------------------------------------------------------------------.682| yy_stack_print -- Print the state stack from its BOTTOM up to its |683| TOP (included). |684`------------------------------------------------------------------*/685686]b4_function_define([yy_stack_print], [static void],687[[yytype_int16 *yybottom], [yybottom]],688[[yytype_int16 *yytop], [yytop]])[689{690YYFPRINTF (stderr, "Stack now");691for (; yybottom <= yytop; yybottom++)692{693int yybot = *yybottom;694YYFPRINTF (stderr, " %d", yybot);695}696YYFPRINTF (stderr, "\n");697}698699# define YY_STACK_PRINT(Bottom, Top) \700do { \701if (yydebug) \702yy_stack_print ((Bottom), (Top)); \703} while (0)704705706/*------------------------------------------------.707| Report that the YYRULE is going to be reduced. |708`------------------------------------------------*/709710]b4_function_define([yy_reduce_print], [static void],711[[yytype_int16 *yyssp], [yyssp]],712[[YYSTYPE *yyvsp], [yyvsp]],713b4_locations_if([[[YYLTYPE *yylsp], [yylsp]],714])[[int yyrule], [yyrule]]m4_ifset([b4_parse_param], [,715b4_parse_param]))[716{717unsigned long yylno = yyrline[yyrule];718int yynrhs = yyr2[yyrule];719int yyi;720YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",721yyrule - 1, yylno);722/* The symbols being reduced. */723for (yyi = 0; yyi < yynrhs; yyi++)724{725YYFPRINTF (stderr, " $%d = ", yyi + 1);726yy_symbol_print (stderr,727yystos[yyssp[yyi + 1 - yynrhs]],728&]b4_rhs_value(yynrhs, yyi + 1)[729]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl730b4_user_args[);731YYFPRINTF (stderr, "\n");732}733}734735# define YY_REDUCE_PRINT(Rule) \736do { \737if (yydebug) \738yy_reduce_print (yyssp, yyvsp, ]b4_locations_if([yylsp, ])[Rule]b4_user_args[); \739} while (0)740741/* Nonzero means print parse trace. It is left uninitialized so that742multiple parsers can coexist. */743int yydebug;744#else /* !]b4_api_PREFIX[DEBUG */745# define YYDPRINTF(Args)746# define YY_SYMBOL_PRINT(Title, Type, Value, Location)747# define YY_STACK_PRINT(Bottom, Top)748# define YY_REDUCE_PRINT(Rule)749#endif /* !]b4_api_PREFIX[DEBUG */750751752/* YYINITDEPTH -- initial size of the parser's stacks. */753#ifndef YYINITDEPTH754# define YYINITDEPTH ]b4_stack_depth_init[755#endif756757/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only758if the built-in stack extension method is used).759760Do not make this value too large; the results are undefined if761YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)762evaluated with infinite-precision integer arithmetic. */763764#ifndef YYMAXDEPTH765# define YYMAXDEPTH ]b4_stack_depth_max[766#endif]b4_lac_if([[767768/* Given a state stack such that *YYBOTTOM is its bottom, such that769*YYTOP is either its top or is YYTOP_EMPTY to indicate an empty770stack, and such that *YYCAPACITY is the maximum number of elements it771can hold without a reallocation, make sure there is enough room to772store YYADD more elements. If not, allocate a new stack using773YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,774*YYTOP, and *YYCAPACITY to reflect the new capacity and memory775location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack776using YYSTACK_FREE. Return 0 if successful or if no reallocation is777required. Return 1 if memory is exhausted. */778static int779yy_lac_stack_realloc (YYSIZE_T *yycapacity, YYSIZE_T yyadd,780#if ]b4_api_PREFIX[DEBUG781char const *yydebug_prefix,782char const *yydebug_suffix,783#endif784yytype_int16 **yybottom,785yytype_int16 *yybottom_no_free,786yytype_int16 **yytop, yytype_int16 *yytop_empty)787{788YYSIZE_T yysize_old =789(YYSIZE_T) (*yytop == yytop_empty ? 0 : *yytop - *yybottom + 1);790YYSIZE_T yysize_new = yysize_old + yyadd;791if (*yycapacity < yysize_new)792{793YYSIZE_T yyalloc = 2 * yysize_new;794yytype_int16 *yybottom_new;795/* Use YYMAXDEPTH for maximum stack size given that the stack796should never need to grow larger than the main state stack797needs to grow without LAC. */798if (YYMAXDEPTH < yysize_new)799{800YYDPRINTF ((stderr, "%smax size exceeded%s", yydebug_prefix,801yydebug_suffix));802return 1;803}804if (YYMAXDEPTH < yyalloc)805yyalloc = YYMAXDEPTH;806yybottom_new =807(yytype_int16*) YYSTACK_ALLOC (yyalloc * sizeof *yybottom_new);808if (!yybottom_new)809{810YYDPRINTF ((stderr, "%srealloc failed%s", yydebug_prefix,811yydebug_suffix));812return 1;813}814if (*yytop != yytop_empty)815{816YYCOPY (yybottom_new, *yybottom, yysize_old);817*yytop = yybottom_new + (yysize_old - 1);818}819if (*yybottom != yybottom_no_free)820YYSTACK_FREE (*yybottom);821*yybottom = yybottom_new;822*yycapacity = yyalloc;]m4_if(b4_percent_define_get([[parse.lac.memory-trace]]),823[full], [[824YYDPRINTF ((stderr, "%srealloc to %lu%s", yydebug_prefix,825(unsigned long) yyalloc, yydebug_suffix));]])[826}827return 0;828}829830/* Establish the initial context for the current lookahead if no initial831context is currently established.832833We define a context as a snapshot of the parser stacks. We define834the initial context for a lookahead as the context in which the835parser initially examines that lookahead in order to select a836syntactic action. Thus, if the lookahead eventually proves837syntactically unacceptable (possibly in a later context reached via a838series of reductions), the initial context can be used to determine839the exact set of tokens that would be syntactically acceptable in the840lookahead's place. Moreover, it is the context after which any841further semantic actions would be erroneous because they would be842determined by a syntactically unacceptable token.843844YY_LAC_ESTABLISH should be invoked when a reduction is about to be845performed in an inconsistent state (which, for the purposes of LAC,846includes consistent states that don't know they're consistent because847their default reductions have been disabled). Iff there is a848lookahead token, it should also be invoked before reporting a syntax849error. This latter case is for the sake of the debugging output.850851For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as852follows. If no initial context is currently established for the853current lookahead, then check if that lookahead can eventually be854shifted if syntactic actions continue from the current context.855Report a syntax error if it cannot. */856#define YY_LAC_ESTABLISH \857do { \858if (!yy_lac_established) \859{ \860YYDPRINTF ((stderr, \861"LAC: initial context established for %s\n", \862yytname[yytoken])); \863yy_lac_established = 1; \864{ \865int yy_lac_status = \866yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \867if (yy_lac_status == 2) \868goto yyexhaustedlab; \869if (yy_lac_status == 1) \870goto yyerrlab; \871} \872} \873} while (0)874875/* Discard any previous initial lookahead context because of Event,876which may be a lookahead change or an invalidation of the currently877established initial context for the current lookahead.878879The most common example of a lookahead change is a shift. An example880of both cases is syntax error recovery. That is, a syntax error881occurs when the lookahead is syntactically erroneous for the882currently established initial context, so error recovery manipulates883the parser stacks to try to find a new initial context in which the884current lookahead is syntactically acceptable. If it fails to find885such a context, it discards the lookahead. */886#if ]b4_api_PREFIX[DEBUG887# define YY_LAC_DISCARD(Event) \888do { \889if (yy_lac_established) \890{ \891if (yydebug) \892YYFPRINTF (stderr, "LAC: initial context discarded due to " \893Event "\n"); \894yy_lac_established = 0; \895} \896} while (0)897#else898# define YY_LAC_DISCARD(Event) yy_lac_established = 0899#endif900901/* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can902eventually (after perhaps some reductions) be shifted, return 1 if903not, or return 2 if memory is exhausted. As preconditions and904postconditions: *YYES_CAPACITY is the allocated size of the array to905which *YYES points, and either *YYES = YYESA or *YYES points to an906array allocated with YYSTACK_ALLOC. yy_lac may overwrite the907contents of either array, alter *YYES and *YYES_CAPACITY, and free908any old *YYES other than YYESA. */909static int910yy_lac (yytype_int16 *yyesa, yytype_int16 **yyes,911YYSIZE_T *yyes_capacity, yytype_int16 *yyssp, int yytoken)912{913yytype_int16 *yyes_prev = yyssp;914yytype_int16 *yyesp = yyes_prev;915YYDPRINTF ((stderr, "LAC: checking lookahead %s:", yytname[yytoken]));916if (yytoken == YYUNDEFTOK)917{918YYDPRINTF ((stderr, " Always Err\n"));919return 1;920}921while (1)922{923int yyrule = yypact[*yyesp];924if (yypact_value_is_default (yyrule)925|| (yyrule += yytoken) < 0 || YYLAST < yyrule926|| yycheck[yyrule] != yytoken)927{928yyrule = yydefact[*yyesp];929if (yyrule == 0)930{931YYDPRINTF ((stderr, " Err\n"));932return 1;933}934}935else936{937yyrule = yytable[yyrule];938if (yytable_value_is_error (yyrule))939{940YYDPRINTF ((stderr, " Err\n"));941return 1;942}943if (0 < yyrule)944{945YYDPRINTF ((stderr, " S%d\n", yyrule));946return 0;947}948yyrule = -yyrule;949}950{951YYSIZE_T yylen = yyr2[yyrule];952YYDPRINTF ((stderr, " R%d", yyrule - 1));953if (yyesp != yyes_prev)954{955YYSIZE_T yysize = (YYSIZE_T) (yyesp - *yyes + 1);956if (yylen < yysize)957{958yyesp -= yylen;959yylen = 0;960}961else962{963yylen -= yysize;964yyesp = yyes_prev;965}966}967if (yylen)968yyesp = yyes_prev -= yylen;969}970{971yytype_int16 yystate;972{973const int yylhs = yyr1[yyrule] - YYNTOKENS;974const int yyi = yypgoto[yylhs] + *yyesp;975yystate = ((yytype_int16)976(0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyesp977? yytable[yyi]978: yydefgoto[yylhs]));979}980if (yyesp == yyes_prev)981{982yyesp = *yyes;983*yyesp = yystate;984}985else986{987if (yy_lac_stack_realloc (yyes_capacity, 1,988#if ]b4_api_PREFIX[DEBUG989" (", ")",990#endif991yyes, yyesa, &yyesp, yyes_prev))992{993YYDPRINTF ((stderr, "\n"));994return 2;995}996*++yyesp = yystate;997}998YYDPRINTF ((stderr, " G%d", (int) yystate));999}1000}1001}]])[100210031004#if YYERROR_VERBOSE10051006# ifndef yystrlen1007# if defined __GLIBC__ && defined _STRING_H1008# define yystrlen strlen1009# else1010/* Return the length of YYSTR. */1011]b4_function_define([yystrlen], [static YYSIZE_T],1012[[const char *yystr], [yystr]])[1013{1014YYSIZE_T yylen;1015for (yylen = 0; yystr[yylen]; yylen++)1016continue;1017return yylen;1018}1019# endif1020# endif10211022# ifndef yystpcpy1023# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE1024# define yystpcpy stpcpy1025# else1026/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in1027YYDEST. */1028]b4_function_define([yystpcpy], [static char *],1029[[char *yydest], [yydest]], [[const char *yysrc], [yysrc]])[1030{1031char *yyd = yydest;1032const char *yys = yysrc;10331034while ((*yyd++ = *yys++) != '\0')1035continue;10361037return yyd - 1;1038}1039# endif1040# endif10411042# ifndef yytnamerr1043/* Copy to YYRES the contents of YYSTR after stripping away unnecessary1044quotes and backslashes, so that it's suitable for yyerror. The1045heuristic is that double-quoting is unnecessary unless the string1046contains an apostrophe, a comma, or backslash (other than1047backslash-backslash). YYSTR is taken from yytname. If YYRES is1048null, do not copy; instead, return the length of what the result1049would have been. */1050static YYSIZE_T1051yytnamerr (char *yyres, const char *yystr)1052{1053if (*yystr == '"')1054{1055YYSIZE_T yyn = 0;1056char const *yyp = yystr;10571058for (;;)1059switch (*++yyp)1060{1061case '\'':1062case ',':1063goto do_not_strip_quotes;10641065case '\\':1066if (*++yyp != '\\')1067goto do_not_strip_quotes;1068else1069goto append;10701071append:1072default:1073if (yyres)1074yyres[yyn] = *yyp;1075yyn++;1076break;10771078case '"':1079if (yyres)1080yyres[yyn] = '\0';1081return yyn;1082}1083do_not_strip_quotes: ;1084}10851086if (! yyres)1087return yystrlen (yystr);10881089return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres);1090}1091# endif10921093/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message1094about the unexpected token YYTOKEN for the state stack whose top is1095YYSSP.]b4_lac_if([[ In order to see if a particular token T is a1096valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).]])[10971098Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is1099not large enough to hold the message. In that case, also set1100*YYMSG_ALLOC to the required number of bytes. Return 2 if the1101required number of bytes is too large to store]b4_lac_if([[ or if1102yy_lac returned 2]])[. */1103static int1104yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,1105]b4_lac_if([[yytype_int16 *yyesa, yytype_int16 **yyes,1106YYSIZE_T *yyes_capacity, ]])[yytype_int16 *yyssp, int yytoken)1107{1108YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);1109YYSIZE_T yysize = yysize0;1110enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };1111/* Internationalized format string. */1112const char *yyformat = YY_NULLPTR;1113/* Arguments of yyformat. */1114char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];1115/* Number of reported tokens (one for the "unexpected", one per1116"expected"). */1117int yycount = 0;11181119/* There are many possibilities here to consider:1120- If this state is a consistent state with a default action, then1121the only way this function was invoked is if the default action1122is an error action. In that case, don't check for expected1123tokens because there are none.1124- The only way there can be no lookahead present (in yychar) is if1125this state is a consistent state with a default action. Thus,1126detecting the absence of a lookahead is sufficient to determine1127that there is no unexpected or expected token to report. In that1128case, just report a simple "syntax error".1129- Don't assume there isn't a lookahead just because this state is a1130consistent state with a default action. There might have been a1131previous inconsistent state, consistent state with a non-default1132action, or user semantic action that manipulated yychar.]b4_lac_if([[1133In the first two cases, it might appear that the current syntax1134error should have been detected in the previous state when yy_lac1135was invoked. However, at that time, there might have been a1136different syntax error that discarded a different initial context1137during error recovery, leaving behind the current lookahead.]], [[1138- Of course, the expected token list depends on states to have1139correct lookahead information, and it depends on the parser not1140to perform extra reductions after fetching a lookahead from the1141scanner and before detecting a syntax error. Thus, state merging1142(from LALR or IELR) and default reductions corrupt the expected1143token list. However, the list is correct for canonical LR with1144one exception: it will still contain any token that will not be1145accepted due to an error action in a later state.]])[1146*/1147if (yytoken != YYEMPTY)1148{1149int yyn = yypact[*yyssp];]b4_lac_if([[1150YYDPRINTF ((stderr, "Constructing syntax error message\n"));]])[1151yyarg[yycount++] = yytname[yytoken];1152if (!yypact_value_is_default (yyn))1153{]b4_lac_if([], [[1154/* Start YYX at -YYN if negative to avoid negative indexes in1155YYCHECK. In other words, skip the first -YYN actions for1156this state because they are default actions. */1157int yyxbegin = yyn < 0 ? -yyn : 0;1158/* Stay within bounds of both yycheck and yytname. */1159int yychecklim = YYLAST - yyn + 1;1160int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;]])[1161int yyx;]b4_lac_if([[11621163for (yyx = 0; yyx < YYNTOKENS; ++yyx)1164if (yyx != YYTERROR && yyx != YYUNDEFTOK)1165{1166{1167int yy_lac_status = yy_lac (yyesa, yyes, yyes_capacity,1168yyssp, yyx);1169if (yy_lac_status == 2)1170return 2;1171if (yy_lac_status == 1)1172continue;1173}]], [[11741175for (yyx = yyxbegin; yyx < yyxend; ++yyx)1176if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR1177&& !yytable_value_is_error (yytable[yyx + yyn]))1178{]])[1179if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)1180{1181yycount = 1;1182yysize = yysize0;1183break;1184}1185yyarg[yycount++] = yytname[yyx];1186{1187YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);1188if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)1189yysize = yysize1;1190else1191return 2;1192}1193}1194}]b4_lac_if([[1195# if ]b4_api_PREFIX[DEBUG1196else if (yydebug)1197YYFPRINTF (stderr, "No expected tokens.\n");1198# endif]])[1199}12001201switch (yycount)1202{1203# define YYCASE_(N, S) \1204case N: \1205yyformat = S; \1206break1207default: /* Avoid compiler warnings. */1208YYCASE_(0, YY_("syntax error"));1209YYCASE_(1, YY_("syntax error, unexpected %s"));1210YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));1211YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));1212YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));1213YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));1214# undef YYCASE_1215}12161217{1218YYSIZE_T yysize1 = yysize + yystrlen (yyformat);1219if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)1220yysize = yysize1;1221else1222return 2;1223}12241225if (*yymsg_alloc < yysize)1226{1227*yymsg_alloc = 2 * yysize;1228if (! (yysize <= *yymsg_alloc1229&& *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))1230*yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;1231return 1;1232}12331234/* Avoid sprintf, as that infringes on the user's name space.1235Don't have undefined behavior even if the translation1236produced a string with the wrong number of "%s"s. */1237{1238char *yyp = *yymsg;1239int yyi = 0;1240while ((*yyp = *yyformat) != '\0')1241if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)1242{1243yyp += yytnamerr (yyp, yyarg[yyi++]);1244yyformat += 2;1245}1246else1247{1248yyp++;1249yyformat++;1250}1251}1252return 0;1253}1254#endif /* YYERROR_VERBOSE */12551256]b4_yydestruct_define[12571258]b4_pure_if([], [12591260b4_declare_scanner_communication_variables])[]b4_push_if([[12611262struct yypstate1263{]b4_declare_parser_state_variables[1264/* Used to determine if this is the first time this instance has1265been used. */1266int yynew;1267};]b4_pure_if([], [[12681269static char yypstate_allocated = 0;]])b4_pull_if([12701271b4_function_define([[yyparse]], [[int]], b4_parse_param)[1272{1273return yypull_parse (YY_NULLPTR]m4_ifset([b4_parse_param],1274[[, ]b4_args(b4_parse_param)])[);1275}12761277]b4_function_define([[yypull_parse]], [[int]],1278[[[yypstate *yyps]], [[yyps]]]m4_ifset([b4_parse_param], [,1279b4_parse_param]))[1280{]b4_pure_if([b4_locations_if([[1281static YYLTYPE yyloc_default][]b4_yyloc_default[;1282YYLTYPE yylloc = yyloc_default;]])])[1283yypstate *yyps_local;1284if (yyps)1285yyps_local = yyps;1286else1287{1288yyps_local = yypstate_new ();1289if (!yyps_local)1290{]b4_pure_if([[1291yyerror (]b4_yyerror_args[YY_("memory exhausted"));]], [[1292if (!yypstate_allocated)1293yyerror (]b4_yyerror_args[YY_("memory exhausted"));]])[1294return 2;1295}1296}1297int yystatus;1298do {]b4_pure_if([[1299YYSTYPE yylval;1300int ]])[yychar = ]b4_lex[;1301yystatus =1302yypush_parse (yyps_local]b4_pure_if([[, yychar, &yylval]b4_locations_if([[, &yylloc]])])m4_ifset([b4_parse_param], [, b4_args(b4_parse_param)])[);1303} while (yystatus == YYPUSH_MORE);1304if (!yyps)1305yypstate_delete (yyps_local);1306return yystatus;1307}]])[13081309/* Initialize the parser data structure. */1310]b4_function_define([[yypstate_new]], [[yypstate *]])[1311{1312yypstate *yyps;]b4_pure_if([], [[1313if (yypstate_allocated)1314return YY_NULLPTR;]])[1315yyps = (yypstate *) malloc (sizeof *yyps);1316if (!yyps)1317return YY_NULLPTR;1318yyps->yynew = 1;]b4_pure_if([], [[1319yypstate_allocated = 1;]])[1320return yyps;1321}13221323]b4_function_define([[yypstate_delete]], [[void]],1324[[[yypstate *yyps]], [[yyps]]])[1325{1326if (yyps)1327{1328#ifndef yyoverflow1329/* If the stack was reallocated but the parse did not complete, then the1330stack still needs to be freed. */1331if (!yyps->yynew && yyps->yyss != yyps->yyssa)1332YYSTACK_FREE (yyps->yyss);1333#endif]b4_lac_if([[1334if (!yyps->yynew && yyps->yyes != yyps->yyesa)1335YYSTACK_FREE (yyps->yyes);]])[1336free (yyps);]b4_pure_if([], [[1337yypstate_allocated = 0;]])[1338}1339}1340]b4_pure_if([[1341#define ]b4_prefix[nerrs yyps->]b4_prefix[nerrs]])[1342#define yystate yyps->yystate1343#define yyerrstatus yyps->yyerrstatus1344#define yyssa yyps->yyssa1345#define yyss yyps->yyss1346#define yyssp yyps->yyssp1347#define yyvsa yyps->yyvsa1348#define yyvs yyps->yyvs1349#define yyvsp yyps->yyvsp]b4_locations_if([[1350#define yylsa yyps->yylsa1351#define yyls yyps->yyls1352#define yylsp yyps->yylsp1353#define yyerror_range yyps->yyerror_range]])[1354#define yystacksize yyps->yystacksize]b4_lac_if([[1355#define yyesa yyps->yyesa1356#define yyes yyps->yyes1357#define yyes_capacity yyps->yyes_capacity]])[135813591360/*---------------.1361| yypush_parse. |1362`---------------*/13631364]b4_function_define([[yypush_parse]], [[int]],1365[[[yypstate *yyps]], [[yyps]]]b4_pure_if([,1366[[[int yypushed_char]], [[yypushed_char]]],1367[[[YYSTYPE const *yypushed_val]], [[yypushed_val]]]b4_locations_if([,1368[[[YYLTYPE *yypushed_loc]], [[yypushed_loc]]]])])m4_ifset([b4_parse_param], [,1369b4_parse_param]))], [[137013711372/*----------.1373| yyparse. |1374`----------*/13751376]b4_function_define([yyparse], [int], b4_parse_param)])[1377{]b4_pure_if([b4_declare_scanner_communication_variables1378])b4_push_if([b4_pure_if([], [[1379int yypushed_char = yychar;1380YYSTYPE yypushed_val = yylval;]b4_locations_if([[1381YYLTYPE yypushed_loc = yylloc;]])1382])],1383[b4_declare_parser_state_variables1384])b4_lac_if([[1385int yy_lac_established = 0;]])[1386int yyn;1387int yyresult;1388/* Lookahead token as an internal (translated) token number. */1389int yytoken = 0;1390/* The variables used to return semantic value and location from the1391action routines. */1392YYSTYPE yyval;]b4_locations_if([[1393YYLTYPE yyloc;]])[13941395#if YYERROR_VERBOSE1396/* Buffer for error messages, and its allocated size. */1397char yymsgbuf[128];1398char *yymsg = yymsgbuf;1399YYSIZE_T yymsg_alloc = sizeof yymsgbuf;1400#endif14011402#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)]b4_locations_if([, yylsp -= (N)])[)14031404/* The number of symbols on the RHS of the reduced rule.1405Keep to zero when no symbol should be popped. */1406int yylen = 0;]b4_push_if([[14071408if (!yyps->yynew)1409{1410yyn = yypact[yystate];1411goto yyread_pushed_token;1412}]])[14131414yyssp = yyss = yyssa;1415yyvsp = yyvs = yyvsa;]b4_locations_if([[1416yylsp = yyls = yylsa;]])[1417yystacksize = YYINITDEPTH;]b4_lac_if([[14181419yyes = yyesa;1420yyes_capacity = sizeof yyesa / sizeof *yyes;1421if (YYMAXDEPTH < yyes_capacity)1422yyes_capacity = YYMAXDEPTH;]])[14231424YYDPRINTF ((stderr, "Starting parse\n"));14251426yystate = 0;1427yyerrstatus = 0;1428yynerrs = 0;1429yychar = YYEMPTY; /* Cause a token to be read. */1430]m4_ifdef([b4_initial_action], [1431b4_dollar_pushdef([m4_define([b4_dollar_dollar_used])yylval], [], [],1432[b4_push_if([b4_pure_if([*])yypushed_loc], [yylloc])])dnl1433b4_user_initial_action1434b4_dollar_popdef[]dnl1435m4_ifdef([b4_dollar_dollar_used],[[ yyvsp[0] = yylval;1436]])])dnl1437b4_locations_if([[ yylsp[0] = ]b4_push_if([b4_pure_if([*])yypushed_loc], [yylloc])[;1438]])dnl1439[ goto yysetstate;144014411442/*------------------------------------------------------------.1443| yynewstate -- push a new state, which is found in yystate. |1444`------------------------------------------------------------*/1445yynewstate:1446/* In all cases, when you get here, the value and location stacks1447have just been pushed. So pushing a state here evens the stacks. */1448yyssp++;144914501451/*--------------------------------------------------------------------.1452| yynewstate -- set current state (the top of the stack) to yystate. |1453`--------------------------------------------------------------------*/1454yysetstate:1455*yyssp = (yytype_int16) yystate;14561457if (yyss + yystacksize - 1 <= yyssp)1458#if !defined yyoverflow && !defined YYSTACK_RELOCATE1459goto yyexhaustedlab;1460#else1461{1462/* Get the current used size of the three stacks, in elements. */1463YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);14641465# if defined yyoverflow1466{1467/* Give user a chance to reallocate the stack. Use copies of1468these so that the &'s don't force the real ones into1469memory. */1470YYSTYPE *yyvs1 = yyvs;1471yytype_int16 *yyss1 = yyss;]b4_locations_if([1472YYLTYPE *yyls1 = yyls;])[14731474/* Each stack pointer address is followed by the size of the1475data in use in that stack, in bytes. This used to be a1476conditional around just the two extra args, but that might1477be undefined if yyoverflow is a macro. */1478yyoverflow (YY_("memory exhausted"),1479&yyss1, yysize * sizeof (*yyssp),1480&yyvs1, yysize * sizeof (*yyvsp),]b4_locations_if([1481&yyls1, yysize * sizeof (*yylsp),])[1482&yystacksize);1483yyss = yyss1;1484yyvs = yyvs1;]b4_locations_if([1485yyls = yyls1;])[1486}1487# else /* defined YYSTACK_RELOCATE */1488/* Extend the stack our own way. */1489if (YYMAXDEPTH <= yystacksize)1490goto yyexhaustedlab;1491yystacksize *= 2;1492if (YYMAXDEPTH < yystacksize)1493yystacksize = YYMAXDEPTH;14941495{1496yytype_int16 *yyss1 = yyss;1497union yyalloc *yyptr =1498(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));1499if (! yyptr)1500goto yyexhaustedlab;1501YYSTACK_RELOCATE (yyss_alloc, yyss);1502YYSTACK_RELOCATE (yyvs_alloc, yyvs);]b4_locations_if([1503YYSTACK_RELOCATE (yyls_alloc, yyls);])[1504# undef YYSTACK_RELOCATE1505if (yyss1 != yyssa)1506YYSTACK_FREE (yyss1);1507}1508# endif15091510yyssp = yyss + yysize - 1;1511yyvsp = yyvs + yysize - 1;]b4_locations_if([1512yylsp = yyls + yysize - 1;])[15131514YYDPRINTF ((stderr, "Stack size increased to %lu\n",1515(unsigned long) yystacksize));15161517if (yyss + yystacksize - 1 <= yyssp)1518YYABORT;1519}1520#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */15211522YYDPRINTF ((stderr, "Entering state %d\n", yystate));15231524if (yystate == YYFINAL)1525YYACCEPT;15261527goto yybackup;152815291530/*-----------.1531| yybackup. |1532`-----------*/1533yybackup:1534/* Do appropriate processing given the current state. Read a1535lookahead token if we need one and don't already have one. */15361537/* First try to decide what to do without reference to lookahead token. */1538yyn = yypact[yystate];1539if (yypact_value_is_default (yyn))1540goto yydefault;15411542/* Not known => get a lookahead token if don't already have one. */15431544/* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */1545if (yychar == YYEMPTY)1546{]b4_push_if([[1547if (!yyps->yynew)1548{]b4_use_push_for_pull_if([], [[1549YYDPRINTF ((stderr, "Return for a new token:\n"));]])[1550yyresult = YYPUSH_MORE;1551goto yypushreturn;1552}1553yyps->yynew = 0;]b4_pure_if([], [[1554/* Restoring the pushed token is only necessary for the first1555yypush_parse invocation since subsequent invocations don't overwrite1556it before jumping to yyread_pushed_token. */1557yychar = yypushed_char;1558yylval = yypushed_val;]b4_locations_if([[1559yylloc = yypushed_loc;]])])[1560yyread_pushed_token:]])[1561YYDPRINTF ((stderr, "Reading a token: "));]b4_push_if([b4_pure_if([[1562yychar = yypushed_char;1563if (yypushed_val)1564yylval = *yypushed_val;]b4_locations_if([[1565if (yypushed_loc)1566yylloc = *yypushed_loc;]])])], [[1567yychar = ]b4_lex[;]])[1568}15691570if (yychar <= YYEOF)1571{1572yychar = yytoken = YYEOF;1573YYDPRINTF ((stderr, "Now at end of input.\n"));1574}1575else1576{1577yytoken = YYTRANSLATE (yychar);1578YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);1579}15801581/* If the proper action on seeing token YYTOKEN is to reduce or to1582detect an error, take that action. */1583yyn += yytoken;1584if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)]b4_lac_if([[1585{1586YY_LAC_ESTABLISH;1587goto yydefault;1588}]], [[1589goto yydefault;]])[1590yyn = yytable[yyn];1591if (yyn <= 0)1592{1593if (yytable_value_is_error (yyn))1594goto yyerrlab;]b4_lac_if([[1595YY_LAC_ESTABLISH;]])[1596yyn = -yyn;1597goto yyreduce;1598}15991600/* Count tokens shifted since error; after three, turn off error1601status. */1602if (yyerrstatus)1603yyerrstatus--;16041605/* Shift the lookahead token. */1606YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);16071608/* Discard the shifted token. */1609yychar = YYEMPTY;]b4_lac_if([[1610YY_LAC_DISCARD ("shift");]])[16111612yystate = yyn;1613YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN1614*++yyvsp = yylval;1615YY_IGNORE_MAYBE_UNINITIALIZED_END1616]b4_locations_if([ *++yylsp = yylloc;])[1617goto yynewstate;161816191620/*-----------------------------------------------------------.1621| yydefault -- do the default action for the current state. |1622`-----------------------------------------------------------*/1623yydefault:1624yyn = yydefact[yystate];1625if (yyn == 0)1626goto yyerrlab;1627goto yyreduce;162816291630/*-----------------------------.1631| yyreduce -- do a reduction. |1632`-----------------------------*/1633yyreduce:1634/* yyn is the number of a rule to reduce with. */1635yylen = yyr2[yyn];16361637/* If YYLEN is nonzero, implement the default value of the action:1638'$$ = $1'.16391640Otherwise, the following line sets YYVAL to garbage.1641This behavior is undocumented and Bison1642users should not rely upon it. Assigning to YYVAL1643unconditionally makes the parser a bit smaller, and it avoids a1644GCC warning that YYVAL may be used uninitialized. */1645yyval = yyvsp[1-yylen];16461647]b4_locations_if(1648[[ /* Default location. */1649YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);1650yyerror_range[1] = yyloc;]])[1651YY_REDUCE_PRINT (yyn);]b4_lac_if([[1652{1653int yychar_backup = yychar;1654switch (yyn)1655{1656]b4_user_actions[1657default: break;1658}1659if (yychar_backup != yychar)1660YY_LAC_DISCARD ("yychar change");1661}]], [[1662switch (yyn)1663{1664]b4_user_actions[1665default: break;1666}]])[1667/* User semantic actions sometimes alter yychar, and that requires1668that yytoken be updated with the new translation. We take the1669approach of translating immediately before every use of yytoken.1670One alternative is translating here after every semantic action,1671but that translation would be missed if the semantic action invokes1672YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or1673if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an1674incorrect destructor might then be invoked immediately. In the1675case of YYERROR or YYBACKUP, subsequent parser actions might lead1676to an incorrect destructor call or verbose syntax error message1677before the lookahead is translated. */1678YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);16791680YYPOPSTACK (yylen);1681yylen = 0;1682YY_STACK_PRINT (yyss, yyssp);16831684*++yyvsp = yyval;]b4_locations_if([1685*++yylsp = yyloc;])[16861687/* Now 'shift' the result of the reduction. Determine what state1688that goes to, based on the state we popped back to and the rule1689number reduced by. */1690{1691const int yylhs = yyr1[yyn] - YYNTOKENS;1692const int yyi = yypgoto[yylhs] + *yyssp;1693yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp1694? yytable[yyi]1695: yydefgoto[yylhs]);1696}16971698goto yynewstate;169917001701/*--------------------------------------.1702| yyerrlab -- here on detecting error. |1703`--------------------------------------*/1704yyerrlab:1705/* Make sure we have latest lookahead translation. See comments at1706user semantic actions for why this is necessary. */1707yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);17081709/* If not already recovering from an error, report this error. */1710if (!yyerrstatus)1711{1712++yynerrs;1713#if ! YYERROR_VERBOSE1714yyerror (]b4_yyerror_args[YY_("syntax error"));1715#else1716# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \]b4_lac_if([[1717yyesa, &yyes, &yyes_capacity, \]])[1718yyssp, yytoken)1719{1720char const *yymsgp = YY_("syntax error");1721int yysyntax_error_status;]b4_lac_if([[1722if (yychar != YYEMPTY)1723YY_LAC_ESTABLISH;]])[1724yysyntax_error_status = YYSYNTAX_ERROR;1725if (yysyntax_error_status == 0)1726yymsgp = yymsg;1727else if (yysyntax_error_status == 1)1728{1729if (yymsg != yymsgbuf)1730YYSTACK_FREE (yymsg);1731yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);1732if (!yymsg)1733{1734yymsg = yymsgbuf;1735yymsg_alloc = sizeof yymsgbuf;1736yysyntax_error_status = 2;1737}1738else1739{1740yysyntax_error_status = YYSYNTAX_ERROR;1741yymsgp = yymsg;1742}1743}1744yyerror (]b4_yyerror_args[yymsgp);1745if (yysyntax_error_status == 2)1746goto yyexhaustedlab;1747}1748# undef YYSYNTAX_ERROR1749#endif1750}17511752]b4_locations_if([[ yyerror_range[1] = yylloc;]])[17531754if (yyerrstatus == 3)1755{1756/* If just tried and failed to reuse lookahead token after an1757error, discard it. */17581759if (yychar <= YYEOF)1760{1761/* Return failure if at end of input. */1762if (yychar == YYEOF)1763YYABORT;1764}1765else1766{1767yydestruct ("Error: discarding",1768yytoken, &yylval]b4_locations_if([, &yylloc])[]b4_user_args[);1769yychar = YYEMPTY;1770}1771}17721773/* Else will try to reuse lookahead token after shifting the error1774token. */1775goto yyerrlab1;177617771778/*---------------------------------------------------.1779| yyerrorlab -- error raised explicitly by YYERROR. |1780`---------------------------------------------------*/1781yyerrorlab:1782/* Pacify compilers when the user code never invokes YYERROR and the1783label yyerrorlab therefore never appears in user code. */1784if (0)1785YYERROR;17861787/* Do not reclaim the symbols of the rule whose action triggered1788this YYERROR. */1789YYPOPSTACK (yylen);1790yylen = 0;1791YY_STACK_PRINT (yyss, yyssp);1792yystate = *yyssp;1793goto yyerrlab1;179417951796/*-------------------------------------------------------------.1797| yyerrlab1 -- common code for both syntax error and YYERROR. |1798`-------------------------------------------------------------*/1799yyerrlab1:1800yyerrstatus = 3; /* Each real token shifted decrements this. */18011802for (;;)1803{1804yyn = yypact[yystate];1805if (!yypact_value_is_default (yyn))1806{1807yyn += YYTERROR;1808if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)1809{1810yyn = yytable[yyn];1811if (0 < yyn)1812break;1813}1814}18151816/* Pop the current state because it cannot handle the error token. */1817if (yyssp == yyss)1818YYABORT;18191820]b4_locations_if([[ yyerror_range[1] = *yylsp;]])[1821yydestruct ("Error: popping",1822yystos[yystate], yyvsp]b4_locations_if([, yylsp])[]b4_user_args[);1823YYPOPSTACK (1);1824yystate = *yyssp;1825YY_STACK_PRINT (yyss, yyssp);1826}]b4_lac_if([[18271828/* If the stack popping above didn't lose the initial context for the1829current lookahead token, the shift below will for sure. */1830YY_LAC_DISCARD ("error recovery");]])[18311832YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN1833*++yyvsp = yylval;1834YY_IGNORE_MAYBE_UNINITIALIZED_END1835]b4_locations_if([[1836yyerror_range[2] = yylloc;1837/* Using YYLLOC is tempting, but would change the location of1838the lookahead. YYLOC is available though. */1839YYLLOC_DEFAULT (yyloc, yyerror_range, 2);1840*++yylsp = yyloc;]])[18411842/* Shift the error token. */1843YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);18441845yystate = yyn;1846goto yynewstate;184718481849/*-------------------------------------.1850| yyacceptlab -- YYACCEPT comes here. |1851`-------------------------------------*/1852yyacceptlab:1853yyresult = 0;1854goto yyreturn;185518561857/*-----------------------------------.1858| yyabortlab -- YYABORT comes here. |1859`-----------------------------------*/1860yyabortlab:1861yyresult = 1;1862goto yyreturn;186318641865#if ]b4_lac_if([[1]], [[!defined yyoverflow || YYERROR_VERBOSE]])[1866/*-------------------------------------------------.1867| yyexhaustedlab -- memory exhaustion comes here. |1868`-------------------------------------------------*/1869yyexhaustedlab:1870yyerror (]b4_yyerror_args[YY_("memory exhausted"));1871yyresult = 2;1872/* Fall through. */1873#endif187418751876/*-----------------------------------------------------.1877| yyreturn -- parsing is finished, return the result. |1878`-----------------------------------------------------*/1879yyreturn:1880if (yychar != YYEMPTY)1881{1882/* Make sure we have latest lookahead translation. See comments at1883user semantic actions for why this is necessary. */1884yytoken = YYTRANSLATE (yychar);1885yydestruct ("Cleanup: discarding lookahead",1886yytoken, &yylval]b4_locations_if([, &yylloc])[]b4_user_args[);1887}1888/* Do not reclaim the symbols of the rule whose action triggered1889this YYABORT or YYACCEPT. */1890YYPOPSTACK (yylen);1891YY_STACK_PRINT (yyss, yyssp);1892while (yyssp != yyss)1893{1894yydestruct ("Cleanup: popping",1895yystos[*yyssp], yyvsp]b4_locations_if([, yylsp])[]b4_user_args[);1896YYPOPSTACK (1);1897}1898#ifndef yyoverflow1899if (yyss != yyssa)1900YYSTACK_FREE (yyss);1901#endif]b4_lac_if([[1902if (yyes != yyesa)1903YYSTACK_FREE (yyes);]])b4_push_if([[1904yyps->yynew = 1;190519061907/*-----------------------------------------.1908| yypushreturn -- ask for the next token. |1909`-----------------------------------------*/1910yypushreturn:]])[1911#if YYERROR_VERBOSE1912if (yymsg != yymsgbuf)1913YYSTACK_FREE (yymsg);1914#endif1915return yyresult;1916}1917]b4_epilogue[]dnl1918b4_output_end19191920b4_defines_if([[1921]b4_output_begin([b4_spec_defines_file])[1922]b4_copyright([Bison interface for Yacc-like parsers in C])[1923]b4_disclaimer[1924]b4_shared_declarations[1925]b4_output_end[1926]])# b4_defines_if192719281929