yacc: use the most appropriate integral type for state numbers
[bison.git] / data / skeletons / yacc.c
blob057cc7a00515ed9320f9ad8458e1395d73238c21
1 # -*- C -*-
2 # Yacc compatible skeleton for Bison
4 # Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software
5 # Foundation, Inc.
7 m4_pushdef([b4_copyright_years],
8 [1984, 1989-1990, 2000-2015, 2018-2019])
10 # This program is free software: you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation, either version 3 of the License, or
13 # (at your option) any later version.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program. If not, see <http://www.gnu.org/licenses/>.
23 m4_include(b4_skeletonsdir/[c.m4])
25 ## ---------- ##
26 ## api.pure. ##
27 ## ---------- ##
29 b4_percent_define_default([[api.pure]], [[false]])
30 b4_percent_define_check_values([[[[api.pure]],
31 [[false]], [[true]], [[]], [[full]]]])
33 m4_define([b4_pure_flag], [[0]])
34 m4_case(b4_percent_define_get([[api.pure]]),
35 [false], [m4_define([b4_pure_flag], [[0]])],
36 [true], [m4_define([b4_pure_flag], [[1]])],
37 [], [m4_define([b4_pure_flag], [[1]])],
38 [full], [m4_define([b4_pure_flag], [[2]])])
40 m4_define([b4_pure_if],
41 [m4_case(b4_pure_flag,
42 [0], [$2],
43 [1], [$1],
44 [2], [$1])])
45 [m4_fatal([invalid api.pure value: ]$1)])])
47 ## --------------- ##
48 ## api.push-pull. ##
49 ## --------------- ##
51 b4_percent_define_default([[api.push-pull]], [[pull]])
52 b4_percent_define_check_values([[[[api.push-pull]],
53 [[pull]], [[push]], [[both]]]])
54 b4_define_flag_if([pull]) m4_define([b4_pull_flag], [[1]])
55 b4_define_flag_if([push]) m4_define([b4_push_flag], [[1]])
56 m4_case(b4_percent_define_get([[api.push-pull]]),
57 [pull], [m4_define([b4_push_flag], [[0]])],
58 [push], [m4_define([b4_pull_flag], [[0]])])
60 # Handle BISON_USE_PUSH_FOR_PULL for the test suite. So that push parsing
61 # tests function as written, do not let BISON_USE_PUSH_FOR_PULL modify the
62 # behavior of Bison at all when push parsing is already requested.
63 b4_define_flag_if([use_push_for_pull])
64 b4_use_push_for_pull_if([
65 b4_push_if([m4_define([b4_use_push_for_pull_flag], [[0]])],
66 [m4_define([b4_push_flag], [[1]])])])
68 ## ----------- ##
69 ## parse.lac. ##
70 ## ----------- ##
72 b4_percent_define_default([[parse.lac]], [[none]])
73 b4_percent_define_default([[parse.lac.es-capacity-initial]], [[20]])
74 b4_percent_define_default([[parse.lac.memory-trace]], [[failures]])
75 b4_percent_define_check_values([[[[parse.lac]], [[full]], [[none]]]],
76 [[[[parse.lac.memory-trace]],
77 [[failures]], [[full]]]])
78 b4_define_flag_if([lac])
79 m4_define([b4_lac_flag],
80 [m4_if(b4_percent_define_get([[parse.lac]]),
81 [none], [[0]], [[1]])])
83 ## ---------------- ##
84 ## Default values. ##
85 ## ---------------- ##
87 # Stack parameters.
88 m4_define_default([b4_stack_depth_max], [10000])
89 m4_define_default([b4_stack_depth_init], [200])
92 # b4_yyerror_arg_loc_if(ARG)
93 # --------------------------
94 # Expand ARG iff yyerror is to be given a location as argument.
95 m4_define([b4_yyerror_arg_loc_if],
96 [b4_locations_if([m4_case(b4_pure_flag,
97 [1], [m4_ifset([b4_parse_param], [$1])],
98 [2], [$1])])])
100 # b4_yyerror_args
101 # ---------------
102 # Arguments passed to yyerror: user args plus yylloc.
103 m4_define([b4_yyerror_args],
104 [b4_yyerror_arg_loc_if([&yylloc, ])dnl
105 m4_ifset([b4_parse_param], [b4_args(b4_parse_param), ])])
109 ## ------------ ##
110 ## Data Types. ##
111 ## ------------ ##
113 # b4_int_type(MIN, MAX)
114 # ---------------------
115 # Return the smallest int type able to handle numbers ranging from
116 # MIN to MAX (included). Overwrite the version from c.m4, which
117 # uses only C89 types, so that the user can override the shorter
118 # types, and so that pre-C89 compilers are handled correctly.
119 m4_define([b4_int_type],
120 [m4_if(b4_ints_in($@, [0], [255]), [1], [yytype_uint8],
121 b4_ints_in($@, [-128], [127]), [1], [yytype_int8],
123 b4_ints_in($@, [0], [65535]), [1], [yytype_uint16],
124 b4_ints_in($@, [-32768], [32767]), [1], [yytype_int16],
126 m4_eval([0 <= $1]), [1], [unsigned],
128 [int])])
130 # b4_state_num_type(MIN, MAX)
131 # ---------------------------
132 # Likewise, but prefer 'int' to 'unsigned' for large integers.
133 m4_define([b4_state_num_type],
134 [m4_if(b4_ints_in($@, [0], [255]), [1], [yytype_uint8],
135 b4_ints_in($@, [-128], [127]), [1], [yytype_int8],
137 b4_ints_in($@, [0], [65535]), [1], [yytype_uint16],
138 b4_ints_in($@, [-32768], [32767]), [1], [yytype_int16],
140 [int])])
143 ## ----------------- ##
144 ## Semantic Values. ##
145 ## ----------------- ##
148 # b4_lhs_value(SYMBOL-NUM, [TYPE])
149 # --------------------------------
150 # See README.
151 m4_define([b4_lhs_value],
152 [b4_symbol_value(yyval, [$1], [$2])])
155 # b4_rhs_value(RULE-LENGTH, POS, [SYMBOL-NUM], [TYPE])
156 # ----------------------------------------------------
157 # See README.
158 m4_define([b4_rhs_value],
159 [b4_symbol_value([yyvsp@{b4_subtract([$2], [$1])@}], [$3], [$4])])
162 ## ----------- ##
163 ## Locations. ##
164 ## ----------- ##
166 # b4_lhs_location()
167 # -----------------
168 # Expansion of @$.
169 m4_define([b4_lhs_location],
170 [(yyloc)])
173 # b4_rhs_location(RULE-LENGTH, POS)
174 # ---------------------------------
175 # Expansion of @POS, where the current rule has RULE-LENGTH symbols
176 # on RHS.
177 m4_define([b4_rhs_location],
178 [(yylsp@{b4_subtract([$2], [$1])@})])
181 ## -------------- ##
182 ## Declarations. ##
183 ## -------------- ##
185 # b4_declare_scanner_communication_variables
186 # ------------------------------------------
187 # Declare the variables that are global, or local to YYPARSE if
188 # pure-parser.
189 m4_define([b4_declare_scanner_communication_variables], [[
190 /* The lookahead symbol. */
191 int yychar;
193 ]b4_pure_if([[
194 /* The semantic value of the lookahead symbol. */
195 /* Default value used for initialization, for pacifying older GCCs
196 or non-GCC compilers. */
197 YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
198 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);]b4_locations_if([[
200 /* Location data for the lookahead symbol. */
201 static YYLTYPE yyloc_default]b4_yyloc_default[;
202 YYLTYPE yylloc = yyloc_default;]])],
203 [[/* The semantic value of the lookahead symbol. */
204 YYSTYPE yylval;]b4_locations_if([[
205 /* Location data for the lookahead symbol. */
206 YYLTYPE yylloc]b4_yyloc_default[;]])[
207 /* Number of syntax errors so far. */
208 int yynerrs;]])])
211 # b4_declare_parser_state_variables
212 # ---------------------------------
213 # Declare all the variables that are needed to maintain the parser state
214 # between calls to yypush_parse.
215 m4_define([b4_declare_parser_state_variables], [b4_pure_if([[
216 /* Number of syntax errors so far. */
217 int yynerrs;
218 ]])[
219 int yystate;
220 /* Number of tokens to shift before error messages enabled. */
221 int yyerrstatus;
223 /* The stacks and their tools:
224 'yyss': related to states.
225 'yyvs': related to semantic values.]b4_locations_if([[
226 'yyls': related to locations.]])[
228 Refer to the stacks through separate pointers, to allow yyoverflow
229 to reallocate them elsewhere. */
231 /* The state stack. */
232 yy_state_num yyssa[YYINITDEPTH];
233 yy_state_num *yyss;
234 yy_state_num *yyssp;
236 /* The semantic value stack. */
237 YYSTYPE yyvsa[YYINITDEPTH];
238 YYSTYPE *yyvs;
239 YYSTYPE *yyvsp;]b4_locations_if([[
241 /* The location stack. */
242 YYLTYPE yylsa[YYINITDEPTH];
243 YYLTYPE *yyls;
244 YYLTYPE *yylsp;
246 /* The locations where the error started and ended. */
247 YYLTYPE yyerror_range[3];]])[
249 YYSIZE_T yystacksize;]b4_lac_if([[
251 yy_state_num yyesa@{]b4_percent_define_get([[parse.lac.es-capacity-initial]])[@};
252 yy_state_num *yyes;
253 YYSIZE_T yyes_capacity;]])])
256 # _b4_declare_yyparse_push
257 # ------------------------
258 # Declaration of yyparse (and dependencies) when using the push parser
259 # (including in pull mode).
260 m4_define([_b4_declare_yyparse_push],
261 [[#ifndef YYPUSH_MORE_DEFINED
262 # define YYPUSH_MORE_DEFINED
263 enum { YYPUSH_MORE = 4 };
264 #endif
266 typedef struct ]b4_prefix[pstate ]b4_prefix[pstate;
268 ]b4_pull_if([b4_function_declare([b4_prefix[parse]], [[int]], b4_parse_param)
269 ])b4_function_declare([b4_prefix[push_parse]], [[int]],
270 [[b4_prefix[pstate *ps]], [[ps]]]b4_pure_if([,
271 [[[int pushed_char]], [[pushed_char]]],
272 [[b4_api_PREFIX[STYPE const *pushed_val]], [[pushed_val]]]b4_locations_if([,
273 [[b4_api_PREFIX[LTYPE *pushed_loc]], [[pushed_loc]]]])])m4_ifset([b4_parse_param], [,
274 b4_parse_param]))
275 b4_pull_if([b4_function_declare([b4_prefix[pull_parse]], [[int]],
276 [[b4_prefix[pstate *ps]], [[ps]]]m4_ifset([b4_parse_param], [,
277 b4_parse_param]))])
278 b4_function_declare([b4_prefix[pstate_new]], [b4_prefix[pstate *]],
279 [[[void]], []])
280 b4_function_declare([b4_prefix[pstate_delete]], [[void]],
281 [[b4_prefix[pstate *ps]], [[ps]]])dnl
284 # _b4_declare_yyparse
285 # -------------------
286 # When not the push parser.
287 m4_define([_b4_declare_yyparse],
288 [b4_function_declare(b4_prefix[parse], [int], b4_parse_param)])
291 # b4_declare_yyparse
292 # ------------------
293 m4_define([b4_declare_yyparse],
294 [b4_push_if([_b4_declare_yyparse_push],
295 [_b4_declare_yyparse])[]dnl
299 # b4_shared_declarations
300 # ----------------------
301 # Declaration that might either go into the header (if --defines)
302 # or open coded in the parser body.
303 m4_define([b4_shared_declarations],
304 [b4_cpp_guard_open([b4_spec_header_file])[
305 ]b4_declare_yydebug[
306 ]b4_percent_code_get([[requires]])[
307 ]b4_token_enums_defines[
308 ]b4_declare_yylstype[
309 ]b4_declare_yyparse[
310 ]b4_percent_code_get([[provides]])[
311 ]b4_cpp_guard_close([b4_spec_header_file])[]dnl
315 # b4_header_include_if(IF-TRUE, IF-FALSE)
316 # ---------------------------------------
317 # Run IF-TRUE if we generate an output file and api.header.include
318 # is defined.
319 m4_define([b4_header_include_if],
320 [m4_ifval(m4_quote(b4_spec_header_file),
321 [b4_percent_define_ifdef([[api.header.include]],
322 [$1],
323 [$2])],
324 [$2])])
326 m4_if(b4_spec_header_file, [[y.tab.h]],
327 [b4_percent_define_default([[api.header.include]],
328 [["@basename(]b4_spec_header_file[@)"]])])
333 ## -------------- ##
334 ## Output files. ##
335 ## -------------- ##
338 b4_defines_if([[
339 ]b4_output_begin([b4_spec_header_file])[
340 ]b4_copyright([Bison interface for Yacc-like parsers in C])[
341 ]b4_disclaimer[
342 ]b4_shared_declarations[
343 ]b4_output_end[
344 ]])# b4_defines_if
346 b4_output_begin([b4_parser_file_name])[
347 ]b4_copyright([Bison implementation for Yacc-like parsers in C])[
348 /* C LALR(1) parser skeleton written by Richard Stallman, by
349 simplifying the original so-called "semantic" parser. */
351 /* All symbols defined below should begin with yy or YY, to avoid
352 infringing on user name space. This should be done even for local
353 variables, as they might otherwise be expanded by user macros.
354 There are some unavoidable exceptions within include files to
355 define necessary library symbols; they are noted "INFRINGES ON
356 USER NAME SPACE" below. */
358 ]b4_disclaimer[
359 ]b4_identification[
360 ]b4_percent_code_get([[top]])[]dnl
361 m4_if(b4_api_prefix, [yy], [],
362 [[/* Substitute the type names. */
363 #define YYSTYPE ]b4_api_PREFIX[STYPE]b4_locations_if([[
364 #define YYLTYPE ]b4_api_PREFIX[LTYPE]])])[
365 ]m4_if(b4_prefix, [yy], [],
366 [[/* Substitute the variable and function names. */]b4_pull_if([[
367 #define yyparse ]b4_prefix[parse]])b4_push_if([[
368 #define yypush_parse ]b4_prefix[push_parse]b4_pull_if([[
369 #define yypull_parse ]b4_prefix[pull_parse]])[
370 #define yypstate_new ]b4_prefix[pstate_new
371 #define yypstate_delete ]b4_prefix[pstate_delete
372 #define yypstate ]b4_prefix[pstate]])[
373 #define yylex ]b4_prefix[lex
374 #define yyerror ]b4_prefix[error
375 #define yydebug ]b4_prefix[debug
376 #define yynerrs ]b4_prefix[nerrs
377 ]]b4_pure_if([], [[
378 #define yylval ]b4_prefix[lval
379 #define yychar ]b4_prefix[char]b4_locations_if([[
380 #define yylloc ]b4_prefix[lloc]])]))[
382 ]b4_user_pre_prologue[
383 ]b4_null_define[
385 /* Enabling verbose error messages. */
386 #ifdef YYERROR_VERBOSE
387 # undef YYERROR_VERBOSE
388 # define YYERROR_VERBOSE 1
389 #else
390 # define YYERROR_VERBOSE ]b4_error_verbose_if([1], [0])[
391 #endif
393 ]b4_header_include_if([[#include ]b4_percent_define_get([[api.header.include]])],
394 [m4_ifval(m4_quote(b4_spec_header_file),
395 [/* Use api.header.include to #include this header
396 instead of duplicating it here. */
397 ])b4_shared_declarations])[
399 ]b4_user_post_prologue[
400 ]b4_percent_code_get[]dnl
402 [#ifdef short
403 # undef short
404 #endif
406 #ifdef YYTYPE_UINT8
407 typedef YYTYPE_UINT8 yytype_uint8;
408 #else
409 typedef unsigned char yytype_uint8;
410 #endif
412 #ifdef YYTYPE_INT8
413 typedef YYTYPE_INT8 yytype_int8;
414 #else
415 typedef signed char yytype_int8;
416 #endif
418 #ifdef YYTYPE_UINT16
419 typedef YYTYPE_UINT16 yytype_uint16;
420 #else
421 typedef unsigned short yytype_uint16;
422 #endif
424 #ifdef YYTYPE_INT16
425 typedef YYTYPE_INT16 yytype_int16;
426 #else
427 typedef short yytype_int16;
428 #endif
430 #ifndef YYSIZE_T
431 # ifdef __SIZE_TYPE__
432 # define YYSIZE_T __SIZE_TYPE__
433 # elif defined size_t
434 # define YYSIZE_T size_t
435 # elif ! defined YYSIZE_T
436 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
437 # define YYSIZE_T size_t
438 # else
439 # define YYSIZE_T unsigned
440 # endif
441 #endif
443 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
446 /* State numbers. */
447 typedef ]b4_state_num_type(0, m4_eval(b4_states_number - 1))[ yy_state_num;
450 #ifndef YY_
451 # if defined YYENABLE_NLS && YYENABLE_NLS
452 # if ENABLE_NLS
453 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
454 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
455 # endif
456 # endif
457 # ifndef YY_
458 # define YY_(Msgid) Msgid
459 # endif
460 #endif
462 ]b4_attribute_define[
464 ]b4_parse_assert_if([[#ifdef NDEBUG
465 # define YY_ASSERT(E) ((void) (0 && (E)))
466 #else
467 # include <assert.h> /* INFRINGES ON USER NAME SPACE */
468 # define YY_ASSERT(E) assert (E)
469 #endif
471 [[#define YY_ASSERT(E) ((void) (0 && (E)))]])[
473 #if ]b4_lac_if([[1]], [[! defined yyoverflow || YYERROR_VERBOSE]])[
475 /* The parser invokes alloca or malloc; define the necessary symbols. */]dnl
476 b4_push_if([], [b4_lac_if([], [[
478 # ifdef YYSTACK_USE_ALLOCA
479 # if YYSTACK_USE_ALLOCA
480 # ifdef __GNUC__
481 # define YYSTACK_ALLOC __builtin_alloca
482 # elif defined __BUILTIN_VA_ARG_INCR
483 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
484 # elif defined _AIX
485 # define YYSTACK_ALLOC __alloca
486 # elif defined _MSC_VER
487 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
488 # define alloca _alloca
489 # else
490 # define YYSTACK_ALLOC alloca
491 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
492 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
493 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
494 # ifndef EXIT_SUCCESS
495 # define EXIT_SUCCESS 0
496 # endif
497 # endif
498 # endif
499 # endif
500 # endif]])])[
502 # ifdef YYSTACK_ALLOC
503 /* Pacify GCC's 'empty if-body' warning. */
504 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
505 # ifndef YYSTACK_ALLOC_MAXIMUM
506 /* The OS might guarantee only one guard page at the bottom of the stack,
507 and a page size can be as small as 4096 bytes. So we cannot safely
508 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
509 to allow for a few compiler-allocated temporary stack slots. */
510 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
511 # endif
512 # else
513 # define YYSTACK_ALLOC YYMALLOC
514 # define YYSTACK_FREE YYFREE
515 # ifndef YYSTACK_ALLOC_MAXIMUM
516 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
517 # endif
518 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
519 && ! ((defined YYMALLOC || defined malloc) \
520 && (defined YYFREE || defined free)))
521 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
522 # ifndef EXIT_SUCCESS
523 # define EXIT_SUCCESS 0
524 # endif
525 # endif
526 # ifndef YYMALLOC
527 # define YYMALLOC malloc
528 # if ! defined malloc && ! defined EXIT_SUCCESS
529 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
530 # endif
531 # endif
532 # ifndef YYFREE
533 # define YYFREE free
534 # if ! defined free && ! defined EXIT_SUCCESS
535 void free (void *); /* INFRINGES ON USER NAME SPACE */
536 # endif
537 # endif
538 # endif]b4_lac_if([[
539 # define YYCOPY_NEEDED 1]])[
540 #endif]b4_lac_if([], [[ /* ! defined yyoverflow || YYERROR_VERBOSE */]])[
543 #if (! defined yyoverflow \
544 && (! defined __cplusplus \
545 || (]b4_locations_if([[defined ]b4_api_PREFIX[LTYPE_IS_TRIVIAL && ]b4_api_PREFIX[LTYPE_IS_TRIVIAL \
546 && ]])[defined ]b4_api_PREFIX[STYPE_IS_TRIVIAL && ]b4_api_PREFIX[STYPE_IS_TRIVIAL)))
548 /* A type that is properly aligned for any stack member. */
549 union yyalloc
551 yy_state_num yyss_alloc;
552 YYSTYPE yyvs_alloc;]b4_locations_if([
553 YYLTYPE yyls_alloc;])[
556 /* The size of the maximum gap between one aligned stack and the next. */
557 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
559 /* The size of an array large to enough to hold all stacks, each with
560 N elements. */
561 ]b4_locations_if(
562 [# define YYSTACK_BYTES(N) \
563 ((N) * (sizeof (yy_state_num) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
564 + 2 * YYSTACK_GAP_MAXIMUM)],
565 [# define YYSTACK_BYTES(N) \
566 ((N) * (sizeof (yy_state_num) + sizeof (YYSTYPE)) \
567 + YYSTACK_GAP_MAXIMUM)])[
569 # define YYCOPY_NEEDED 1
571 /* Relocate STACK from its old location to the new one. The
572 local variables YYSIZE and YYSTACKSIZE give the old and new number of
573 elements in the stack, and YYPTR gives the new location of the
574 stack. Advance YYPTR to a properly aligned location for the next
575 stack. */
576 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
577 do \
579 YYSIZE_T yynewbytes; \
580 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
581 Stack = &yyptr->Stack_alloc; \
582 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
583 yyptr += yynewbytes / sizeof (*yyptr); \
585 while (0)
587 #endif
589 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
590 /* Copy COUNT objects from SRC to DST. The source and destination do
591 not overlap. */
592 # ifndef YYCOPY
593 # if defined __GNUC__ && 1 < __GNUC__
594 # define YYCOPY(Dst, Src, Count) \
595 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
596 # else
597 # define YYCOPY(Dst, Src, Count) \
598 do \
600 YYSIZE_T yyi; \
601 for (yyi = 0; yyi < (Count); yyi++) \
602 (Dst)[yyi] = (Src)[yyi]; \
604 while (0)
605 # endif
606 # endif
607 #endif /* !YYCOPY_NEEDED */
609 /* YYFINAL -- State number of the termination state. */
610 #define YYFINAL ]b4_final_state_number[
611 /* YYLAST -- Last index in YYTABLE. */
612 #define YYLAST ]b4_last[
614 /* YYNTOKENS -- Number of terminals. */
615 #define YYNTOKENS ]b4_tokens_number[
616 /* YYNNTS -- Number of nonterminals. */
617 #define YYNNTS ]b4_nterms_number[
618 /* YYNRULES -- Number of rules. */
619 #define YYNRULES ]b4_rules_number[
620 /* YYNSTATES -- Number of states. */
621 #define YYNSTATES ]b4_states_number[
623 #define YYUNDEFTOK ]b4_undef_token_number[
624 #define YYMAXUTOK ]b4_user_token_number_max[
627 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
628 as returned by yylex, with out-of-bounds checking. */
629 ]b4_api_token_raw_if(dnl
630 [[#define YYTRANSLATE(YYX) (YYX)]],
631 [[#define YYTRANSLATE(YYX) \
632 ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
634 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
635 as returned by yylex. */
636 static const ]b4_int_type_for([b4_translate])[ yytranslate[] =
638 ]b4_translate[
639 };]])[
641 #if ]b4_api_PREFIX[DEBUG
642 ]b4_integral_parser_table_define([rline], [b4_rline],
643 [[YYRLINE[YYN] -- Source line where rule number YYN was defined.]])[
644 #endif
646 #if ]b4_api_PREFIX[DEBUG || YYERROR_VERBOSE || ]b4_token_table_flag[
647 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
648 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
649 static const char *const yytname[] =
651 ]b4_tname[
653 #endif
655 # ifdef YYPRINT
656 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
657 (internal) symbol number NUM (which must be that of a token). */
658 static const ]b4_int_type_for([b4_toknum])[ yytoknum[] =
660 ]b4_toknum[
662 # endif
664 #define YYPACT_NINF (]b4_pact_ninf[)
666 #define yypact_value_is_default(Yyn) \
667 ]b4_table_value_equals([[pact]], [[Yyn]], [b4_pact_ninf], [YYPACT_NINF])[
669 #define YYTABLE_NINF (]b4_table_ninf[)
671 #define yytable_value_is_error(Yyn) \
672 ]b4_table_value_equals([[table]], [[Yyn]], [b4_table_ninf], [YYTABLE_NINF])[
674 ]b4_parser_tables_define[
676 #define yyerrok (yyerrstatus = 0)
677 #define yyclearin (yychar = YYEMPTY)
678 #define YYEMPTY (-2)
679 #define YYEOF 0
681 #define YYACCEPT goto yyacceptlab
682 #define YYABORT goto yyabortlab
683 #define YYERROR goto yyerrorlab
686 #define YYRECOVERING() (!!yyerrstatus)
688 #define YYBACKUP(Token, Value) \
689 do \
690 if (yychar == YYEMPTY) \
692 yychar = (Token); \
693 yylval = (Value); \
694 YYPOPSTACK (yylen); \
695 yystate = *yyssp; \]b4_lac_if([[
696 YY_LAC_DISCARD ("YYBACKUP"); \]])[
697 goto yybackup; \
699 else \
701 yyerror (]b4_yyerror_args[YY_("syntax error: cannot back up")); \
702 YYERROR; \
704 while (0)
706 /* Error token number */
707 #define YYTERROR 1
708 #define YYERRCODE 256
710 ]b4_locations_if([[
711 ]b4_yylloc_default_define[
712 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
713 ]])[
715 /* Enable debugging if requested. */
716 #if ]b4_api_PREFIX[DEBUG
718 # ifndef YYFPRINTF
719 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
720 # define YYFPRINTF fprintf
721 # endif
723 # define YYDPRINTF(Args) \
724 do { \
725 if (yydebug) \
726 YYFPRINTF Args; \
727 } while (0)
729 ]b4_yy_location_print_define[
731 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
732 do { \
733 if (yydebug) \
735 YYFPRINTF (stderr, "%s ", Title); \
736 yy_symbol_print (stderr, \
737 Type, Value]b4_locations_if([, Location])[]b4_user_args[); \
738 YYFPRINTF (stderr, "\n"); \
740 } while (0)
742 ]b4_yy_symbol_print_define[
744 /*------------------------------------------------------------------.
745 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
746 | TOP (included). |
747 `------------------------------------------------------------------*/
749 ]b4_function_define([yy_stack_print], [static void],
750 [[yy_state_num *yybottom], [yybottom]],
751 [[yy_state_num *yytop], [yytop]])[
753 YYFPRINTF (stderr, "Stack now");
754 for (; yybottom <= yytop; yybottom++)
755 YYFPRINTF (stderr, " %u", (unsigned) *yybottom);
756 YYFPRINTF (stderr, "\n");
759 # define YY_STACK_PRINT(Bottom, Top) \
760 do { \
761 if (yydebug) \
762 yy_stack_print ((Bottom), (Top)); \
763 } while (0)
766 /*------------------------------------------------.
767 | Report that the YYRULE is going to be reduced. |
768 `------------------------------------------------*/
770 ]b4_function_define([yy_reduce_print], [static void],
771 [[yy_state_num *yyssp], [yyssp]],
772 [[YYSTYPE *yyvsp], [yyvsp]],
773 b4_locations_if([[[YYLTYPE *yylsp], [yylsp]],
774 ])[[int yyrule], [yyrule]]m4_ifset([b4_parse_param], [,
775 b4_parse_param]))[
777 unsigned long yylno = yyrline[yyrule];
778 int yynrhs = yyr2[yyrule];
779 int yyi;
780 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
781 yyrule - 1, yylno);
782 /* The symbols being reduced. */
783 for (yyi = 0; yyi < yynrhs; yyi++)
785 YYFPRINTF (stderr, " $%d = ", yyi + 1);
786 yy_symbol_print (stderr,
787 yystos[yyssp[yyi + 1 - yynrhs]],
788 &]b4_rhs_value(yynrhs, yyi + 1)[
789 ]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl
790 b4_user_args[);
791 YYFPRINTF (stderr, "\n");
795 # define YY_REDUCE_PRINT(Rule) \
796 do { \
797 if (yydebug) \
798 yy_reduce_print (yyssp, yyvsp, ]b4_locations_if([yylsp, ])[Rule]b4_user_args[); \
799 } while (0)
801 /* Nonzero means print parse trace. It is left uninitialized so that
802 multiple parsers can coexist. */
803 int yydebug;
804 #else /* !]b4_api_PREFIX[DEBUG */
805 # define YYDPRINTF(Args)
806 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
807 # define YY_STACK_PRINT(Bottom, Top)
808 # define YY_REDUCE_PRINT(Rule)
809 #endif /* !]b4_api_PREFIX[DEBUG */
812 /* YYINITDEPTH -- initial size of the parser's stacks. */
813 #ifndef YYINITDEPTH
814 # define YYINITDEPTH ]b4_stack_depth_init[
815 #endif
817 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
818 if the built-in stack extension method is used).
820 Do not make this value too large; the results are undefined if
821 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
822 evaluated with infinite-precision integer arithmetic. */
824 #ifndef YYMAXDEPTH
825 # define YYMAXDEPTH ]b4_stack_depth_max[
826 #endif]b4_lac_if([[
828 /* Given a state stack such that *YYBOTTOM is its bottom, such that
829 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
830 stack, and such that *YYCAPACITY is the maximum number of elements it
831 can hold without a reallocation, make sure there is enough room to
832 store YYADD more elements. If not, allocate a new stack using
833 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
834 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
835 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
836 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
837 required. Return 1 if memory is exhausted. */
838 static int
839 yy_lac_stack_realloc (YYSIZE_T *yycapacity, YYSIZE_T yyadd,
840 #if ]b4_api_PREFIX[DEBUG
841 char const *yydebug_prefix,
842 char const *yydebug_suffix,
843 #endif
844 yy_state_num **yybottom,
845 yy_state_num *yybottom_no_free,
846 yy_state_num **yytop, yy_state_num *yytop_empty)
848 YYSIZE_T yysize_old =
849 (YYSIZE_T) (*yytop == yytop_empty ? 0 : *yytop - *yybottom + 1);
850 YYSIZE_T yysize_new = yysize_old + yyadd;
851 if (*yycapacity < yysize_new)
853 YYSIZE_T yyalloc = 2 * yysize_new;
854 yy_state_num *yybottom_new;
855 /* Use YYMAXDEPTH for maximum stack size given that the stack
856 should never need to grow larger than the main state stack
857 needs to grow without LAC. */
858 if (YYMAXDEPTH < yysize_new)
860 YYDPRINTF ((stderr, "%smax size exceeded%s", yydebug_prefix,
861 yydebug_suffix));
862 return 1;
864 if (YYMAXDEPTH < yyalloc)
865 yyalloc = YYMAXDEPTH;
866 yybottom_new =
867 (yy_state_num*) YYSTACK_ALLOC (yyalloc * sizeof *yybottom_new);
868 if (!yybottom_new)
870 YYDPRINTF ((stderr, "%srealloc failed%s", yydebug_prefix,
871 yydebug_suffix));
872 return 1;
874 if (*yytop != yytop_empty)
876 YYCOPY (yybottom_new, *yybottom, yysize_old);
877 *yytop = yybottom_new + (yysize_old - 1);
879 if (*yybottom != yybottom_no_free)
880 YYSTACK_FREE (*yybottom);
881 *yybottom = yybottom_new;
882 *yycapacity = yyalloc;]m4_if(b4_percent_define_get([[parse.lac.memory-trace]]),
883 [full], [[
884 YYDPRINTF ((stderr, "%srealloc to %lu%s", yydebug_prefix,
885 (unsigned long) yyalloc, yydebug_suffix));]])[
887 return 0;
890 /* Establish the initial context for the current lookahead if no initial
891 context is currently established.
893 We define a context as a snapshot of the parser stacks. We define
894 the initial context for a lookahead as the context in which the
895 parser initially examines that lookahead in order to select a
896 syntactic action. Thus, if the lookahead eventually proves
897 syntactically unacceptable (possibly in a later context reached via a
898 series of reductions), the initial context can be used to determine
899 the exact set of tokens that would be syntactically acceptable in the
900 lookahead's place. Moreover, it is the context after which any
901 further semantic actions would be erroneous because they would be
902 determined by a syntactically unacceptable token.
904 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
905 performed in an inconsistent state (which, for the purposes of LAC,
906 includes consistent states that don't know they're consistent because
907 their default reductions have been disabled). Iff there is a
908 lookahead token, it should also be invoked before reporting a syntax
909 error. This latter case is for the sake of the debugging output.
911 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
912 follows. If no initial context is currently established for the
913 current lookahead, then check if that lookahead can eventually be
914 shifted if syntactic actions continue from the current context.
915 Report a syntax error if it cannot. */
916 #define YY_LAC_ESTABLISH \
917 do { \
918 if (!yy_lac_established) \
920 YYDPRINTF ((stderr, \
921 "LAC: initial context established for %s\n", \
922 yytname[yytoken])); \
923 yy_lac_established = 1; \
925 int yy_lac_status = \
926 yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken); \
927 if (yy_lac_status == 2) \
928 goto yyexhaustedlab; \
929 if (yy_lac_status == 1) \
930 goto yyerrlab; \
933 } while (0)
935 /* Discard any previous initial lookahead context because of Event,
936 which may be a lookahead change or an invalidation of the currently
937 established initial context for the current lookahead.
939 The most common example of a lookahead change is a shift. An example
940 of both cases is syntax error recovery. That is, a syntax error
941 occurs when the lookahead is syntactically erroneous for the
942 currently established initial context, so error recovery manipulates
943 the parser stacks to try to find a new initial context in which the
944 current lookahead is syntactically acceptable. If it fails to find
945 such a context, it discards the lookahead. */
946 #if ]b4_api_PREFIX[DEBUG
947 # define YY_LAC_DISCARD(Event) \
948 do { \
949 if (yy_lac_established) \
951 if (yydebug) \
952 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
953 Event "\n"); \
954 yy_lac_established = 0; \
956 } while (0)
957 #else
958 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
959 #endif
961 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
962 eventually (after perhaps some reductions) be shifted, return 1 if
963 not, or return 2 if memory is exhausted. As preconditions and
964 postconditions: *YYES_CAPACITY is the allocated size of the array to
965 which *YYES points, and either *YYES = YYESA or *YYES points to an
966 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
967 contents of either array, alter *YYES and *YYES_CAPACITY, and free
968 any old *YYES other than YYESA. */
969 static int
970 yy_lac (yy_state_num *yyesa, yy_state_num **yyes,
971 YYSIZE_T *yyes_capacity, yy_state_num *yyssp, int yytoken)
973 yy_state_num *yyes_prev = yyssp;
974 yy_state_num *yyesp = yyes_prev;
975 YYDPRINTF ((stderr, "LAC: checking lookahead %s:", yytname[yytoken]));
976 if (yytoken == YYUNDEFTOK)
978 YYDPRINTF ((stderr, " Always Err\n"));
979 return 1;
981 while (1)
983 int yyrule = yypact[*yyesp];
984 if (yypact_value_is_default (yyrule)
985 || (yyrule += yytoken) < 0 || YYLAST < yyrule
986 || yycheck[yyrule] != yytoken)
988 yyrule = yydefact[*yyesp];
989 if (yyrule == 0)
991 YYDPRINTF ((stderr, " Err\n"));
992 return 1;
995 else
997 yyrule = (int) yytable[yyrule];
998 if (yytable_value_is_error (yyrule))
1000 YYDPRINTF ((stderr, " Err\n"));
1001 return 1;
1003 if (0 < yyrule)
1005 YYDPRINTF ((stderr, " S%d\n", yyrule));
1006 return 0;
1008 yyrule = -yyrule;
1011 YYSIZE_T yylen = yyr2[yyrule];
1012 YYDPRINTF ((stderr, " R%d", yyrule - 1));
1013 if (yyesp != yyes_prev)
1015 YYSIZE_T yysize = (YYSIZE_T) (yyesp - *yyes + 1);
1016 if (yylen < yysize)
1018 yyesp -= yylen;
1019 yylen = 0;
1021 else
1023 yylen -= yysize;
1024 yyesp = yyes_prev;
1027 if (yylen)
1028 yyesp = yyes_prev -= yylen;
1031 int yystate;
1033 const int yylhs = yyr1[yyrule] - YYNTOKENS;
1034 const int yyi = yypgoto[yylhs] + (int) *yyesp;
1035 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyesp
1036 ? (int) yytable[yyi]
1037 : yydefgoto[yylhs]);
1039 if (yyesp == yyes_prev)
1041 yyesp = *yyes;
1042 *yyesp = (yy_state_num) yystate;
1044 else
1046 if (yy_lac_stack_realloc (yyes_capacity, 1,
1047 #if ]b4_api_PREFIX[DEBUG
1048 " (", ")",
1049 #endif
1050 yyes, yyesa, &yyesp, yyes_prev))
1052 YYDPRINTF ((stderr, "\n"));
1053 return 2;
1055 *++yyesp = (yy_state_num) yystate;
1057 YYDPRINTF ((stderr, " G%d", yystate));
1060 }]])[
1063 #if YYERROR_VERBOSE
1065 # ifndef yystrlen
1066 # if defined __GLIBC__ && defined _STRING_H
1067 # define yystrlen strlen
1068 # else
1069 /* Return the length of YYSTR. */
1070 ]b4_function_define([yystrlen], [static YYSIZE_T],
1071 [[const char *yystr], [yystr]])[
1073 YYSIZE_T yylen;
1074 for (yylen = 0; yystr[yylen]; yylen++)
1075 continue;
1076 return yylen;
1078 # endif
1079 # endif
1081 # ifndef yystpcpy
1082 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1083 # define yystpcpy stpcpy
1084 # else
1085 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1086 YYDEST. */
1087 ]b4_function_define([yystpcpy], [static char *],
1088 [[char *yydest], [yydest]], [[const char *yysrc], [yysrc]])[
1090 char *yyd = yydest;
1091 const char *yys = yysrc;
1093 while ((*yyd++ = *yys++) != '\0')
1094 continue;
1096 return yyd - 1;
1098 # endif
1099 # endif
1101 # ifndef yytnamerr
1102 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1103 quotes and backslashes, so that it's suitable for yyerror. The
1104 heuristic is that double-quoting is unnecessary unless the string
1105 contains an apostrophe, a comma, or backslash (other than
1106 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1107 null, do not copy; instead, return the length of what the result
1108 would have been. */
1109 static YYSIZE_T
1110 yytnamerr (char *yyres, const char *yystr)
1112 if (*yystr == '"')
1114 YYSIZE_T yyn = 0;
1115 char const *yyp = yystr;
1117 for (;;)
1118 switch (*++yyp)
1120 case '\'':
1121 case ',':
1122 goto do_not_strip_quotes;
1124 case '\\':
1125 if (*++yyp != '\\')
1126 goto do_not_strip_quotes;
1127 else
1128 goto append;
1130 append:
1131 default:
1132 if (yyres)
1133 yyres[yyn] = *yyp;
1134 yyn++;
1135 break;
1137 case '"':
1138 if (yyres)
1139 yyres[yyn] = '\0';
1140 return yyn;
1142 do_not_strip_quotes: ;
1145 if (! yyres)
1146 return yystrlen (yystr);
1148 return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres);
1150 # endif
1152 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1153 about the unexpected token YYTOKEN for the state stack whose top is
1154 YYSSP.]b4_lac_if([[ In order to see if a particular token T is a
1155 valid looakhead, invoke yy_lac (YYESA, YYES, YYES_CAPACITY, YYSSP, T).]])[
1157 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1158 not large enough to hold the message. In that case, also set
1159 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1160 required number of bytes is too large to store]b4_lac_if([[ or if
1161 yy_lac returned 2]])[. */
1162 static int
1163 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1164 ]b4_lac_if([[yy_state_num *yyesa, yy_state_num **yyes,
1165 YYSIZE_T *yyes_capacity, ]])[yy_state_num *yyssp, int yytoken)
1167 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1168 YYSIZE_T yysize = yysize0;
1169 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1170 /* Internationalized format string. */
1171 const char *yyformat = YY_NULLPTR;
1172 /* Arguments of yyformat. */
1173 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1174 /* Number of reported tokens (one for the "unexpected", one per
1175 "expected"). */
1176 int yycount = 0;
1178 /* There are many possibilities here to consider:
1179 - If this state is a consistent state with a default action, then
1180 the only way this function was invoked is if the default action
1181 is an error action. In that case, don't check for expected
1182 tokens because there are none.
1183 - The only way there can be no lookahead present (in yychar) is if
1184 this state is a consistent state with a default action. Thus,
1185 detecting the absence of a lookahead is sufficient to determine
1186 that there is no unexpected or expected token to report. In that
1187 case, just report a simple "syntax error".
1188 - Don't assume there isn't a lookahead just because this state is a
1189 consistent state with a default action. There might have been a
1190 previous inconsistent state, consistent state with a non-default
1191 action, or user semantic action that manipulated yychar.]b4_lac_if([[
1192 In the first two cases, it might appear that the current syntax
1193 error should have been detected in the previous state when yy_lac
1194 was invoked. However, at that time, there might have been a
1195 different syntax error that discarded a different initial context
1196 during error recovery, leaving behind the current lookahead.]], [[
1197 - Of course, the expected token list depends on states to have
1198 correct lookahead information, and it depends on the parser not
1199 to perform extra reductions after fetching a lookahead from the
1200 scanner and before detecting a syntax error. Thus, state merging
1201 (from LALR or IELR) and default reductions corrupt the expected
1202 token list. However, the list is correct for canonical LR with
1203 one exception: it will still contain any token that will not be
1204 accepted due to an error action in a later state.]])[
1206 if (yytoken != YYEMPTY)
1208 int yyn = yypact[*yyssp];]b4_lac_if([[
1209 YYDPRINTF ((stderr, "Constructing syntax error message\n"));]])[
1210 yyarg[yycount++] = yytname[yytoken];
1211 if (!yypact_value_is_default (yyn))
1212 {]b4_lac_if([[
1213 int yyx;
1215 for (yyx = 0; yyx < YYNTOKENS; ++yyx)
1216 if (yyx != YYTERROR && yyx != YYUNDEFTOK)
1219 int yy_lac_status = yy_lac (yyesa, yyes, yyes_capacity,
1220 yyssp, yyx);
1221 if (yy_lac_status == 2)
1222 return 2;
1223 if (yy_lac_status == 1)
1224 continue;
1225 }]], [[
1226 /* Start YYX at -YYN if negative to avoid negative indexes in
1227 YYCHECK. In other words, skip the first -YYN actions for
1228 this state because they are default actions. */
1229 int yyxbegin = yyn < 0 ? -yyn : 0;
1230 /* Stay within bounds of both yycheck and yytname. */
1231 int yychecklim = YYLAST - yyn + 1;
1232 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1233 int yyx;
1235 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1236 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1237 && !yytable_value_is_error (yytable[yyx + yyn]))
1238 {]])[
1239 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1241 yycount = 1;
1242 yysize = yysize0;
1243 break;
1245 yyarg[yycount++] = yytname[yyx];
1247 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1248 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1249 yysize = yysize1;
1250 else
1251 return 2;
1254 }]b4_lac_if([[
1255 # if ]b4_api_PREFIX[DEBUG
1256 else if (yydebug)
1257 YYFPRINTF (stderr, "No expected tokens.\n");
1258 # endif]])[
1261 switch (yycount)
1263 # define YYCASE_(N, S) \
1264 case N: \
1265 yyformat = S; \
1266 break
1267 default: /* Avoid compiler warnings. */
1268 YYCASE_(0, YY_("syntax error"));
1269 YYCASE_(1, YY_("syntax error, unexpected %s"));
1270 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1271 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1272 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1273 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1274 # undef YYCASE_
1278 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1279 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1280 yysize = yysize1;
1281 else
1282 return 2;
1285 if (*yymsg_alloc < yysize)
1287 *yymsg_alloc = 2 * yysize;
1288 if (! (yysize <= *yymsg_alloc
1289 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1290 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1291 return 1;
1294 /* Avoid sprintf, as that infringes on the user's name space.
1295 Don't have undefined behavior even if the translation
1296 produced a string with the wrong number of "%s"s. */
1298 char *yyp = *yymsg;
1299 int yyi = 0;
1300 while ((*yyp = *yyformat) != '\0')
1301 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1303 yyp += yytnamerr (yyp, yyarg[yyi++]);
1304 yyformat += 2;
1306 else
1308 yyp++;
1309 yyformat++;
1312 return 0;
1314 #endif /* YYERROR_VERBOSE */
1316 ]b4_yydestruct_define[
1318 ]b4_pure_if([], [
1320 b4_declare_scanner_communication_variables])[]b4_push_if([[
1322 struct yypstate
1323 {]b4_declare_parser_state_variables[
1324 /* Used to determine if this is the first time this instance has
1325 been used. */
1326 int yynew;
1327 };]b4_pure_if([], [[
1329 static char yypstate_allocated = 0;]])b4_pull_if([
1331 b4_function_define([[yyparse]], [[int]], b4_parse_param)[
1333 return yypull_parse (YY_NULLPTR]m4_ifset([b4_parse_param],
1334 [[, ]b4_args(b4_parse_param)])[);
1337 ]b4_function_define([[yypull_parse]], [[int]],
1338 [[[yypstate *yyps]], [[yyps]]]m4_ifset([b4_parse_param], [,
1339 b4_parse_param]))[
1340 {]b4_pure_if([b4_locations_if([[
1341 static YYLTYPE yyloc_default][]b4_yyloc_default[;
1342 YYLTYPE yylloc = yyloc_default;]])])[
1343 yypstate *yyps_local;
1344 if (yyps)
1345 yyps_local = yyps;
1346 else
1348 yyps_local = yypstate_new ();
1349 if (!yyps_local)
1350 {]b4_pure_if([[
1351 yyerror (]b4_yyerror_args[YY_("memory exhausted"));]], [[
1352 if (!yypstate_allocated)
1353 yyerror (]b4_yyerror_args[YY_("memory exhausted"));]])[
1354 return 2;
1357 int yystatus;
1358 do {]b4_pure_if([[
1359 YYSTYPE yylval;
1360 int ]])[yychar = ]b4_lex[;
1361 yystatus =
1362 yypush_parse (yyps_local]b4_pure_if([[, yychar, &yylval]b4_locations_if([[, &yylloc]])])m4_ifset([b4_parse_param], [, b4_args(b4_parse_param)])[);
1363 } while (yystatus == YYPUSH_MORE);
1364 if (!yyps)
1365 yypstate_delete (yyps_local);
1366 return yystatus;
1367 }]])[
1369 /* Initialize the parser data structure. */
1370 ]b4_function_define([[yypstate_new]], [[yypstate *]])[
1372 yypstate *yyps;]b4_pure_if([], [[
1373 if (yypstate_allocated)
1374 return YY_NULLPTR;]])[
1375 yyps = (yypstate *) malloc (sizeof *yyps);
1376 if (!yyps)
1377 return YY_NULLPTR;
1378 yyps->yynew = 1;]b4_pure_if([], [[
1379 yypstate_allocated = 1;]])[
1380 return yyps;
1383 ]b4_function_define([[yypstate_delete]], [[void]],
1384 [[[yypstate *yyps]], [[yyps]]])[
1386 if (yyps)
1388 #ifndef yyoverflow
1389 /* If the stack was reallocated but the parse did not complete, then the
1390 stack still needs to be freed. */
1391 if (!yyps->yynew && yyps->yyss != yyps->yyssa)
1392 YYSTACK_FREE (yyps->yyss);
1393 #endif]b4_lac_if([[
1394 if (!yyps->yynew && yyps->yyes != yyps->yyesa)
1395 YYSTACK_FREE (yyps->yyes);]])[
1396 free (yyps);]b4_pure_if([], [[
1397 yypstate_allocated = 0;]])[
1400 ]b4_pure_if([[
1401 #define ]b4_prefix[nerrs yyps->]b4_prefix[nerrs]])[
1402 #define yystate yyps->yystate
1403 #define yyerrstatus yyps->yyerrstatus
1404 #define yyssa yyps->yyssa
1405 #define yyss yyps->yyss
1406 #define yyssp yyps->yyssp
1407 #define yyvsa yyps->yyvsa
1408 #define yyvs yyps->yyvs
1409 #define yyvsp yyps->yyvsp]b4_locations_if([[
1410 #define yylsa yyps->yylsa
1411 #define yyls yyps->yyls
1412 #define yylsp yyps->yylsp
1413 #define yyerror_range yyps->yyerror_range]])[
1414 #define yystacksize yyps->yystacksize]b4_lac_if([[
1415 #define yyesa yyps->yyesa
1416 #define yyes yyps->yyes
1417 #define yyes_capacity yyps->yyes_capacity]])[
1420 /*---------------.
1421 | yypush_parse. |
1422 `---------------*/
1424 ]b4_function_define([[yypush_parse]], [[int]],
1425 [[[yypstate *yyps]], [[yyps]]]b4_pure_if([,
1426 [[[int yypushed_char]], [[yypushed_char]]],
1427 [[[YYSTYPE const *yypushed_val]], [[yypushed_val]]]b4_locations_if([,
1428 [[[YYLTYPE *yypushed_loc]], [[yypushed_loc]]]])])m4_ifset([b4_parse_param], [,
1429 b4_parse_param]))], [[
1432 /*----------.
1433 | yyparse. |
1434 `----------*/
1436 ]b4_function_define([yyparse], [int], b4_parse_param)])[
1437 {]b4_pure_if([b4_declare_scanner_communication_variables
1438 ])b4_push_if([b4_pure_if([], [[
1439 int yypushed_char = yychar;
1440 YYSTYPE yypushed_val = yylval;]b4_locations_if([[
1441 YYLTYPE yypushed_loc = yylloc;]])
1442 ])],
1443 [b4_declare_parser_state_variables
1444 ])b4_lac_if([[
1445 int yy_lac_established = 0;]])[
1446 int yyn;
1447 int yyresult;
1448 /* Lookahead token as an internal (translated) token number. */
1449 int yytoken = 0;
1450 /* The variables used to return semantic value and location from the
1451 action routines. */
1452 YYSTYPE yyval;]b4_locations_if([[
1453 YYLTYPE yyloc;]])[
1455 #if YYERROR_VERBOSE
1456 /* Buffer for error messages, and its allocated size. */
1457 char yymsgbuf[128];
1458 char *yymsg = yymsgbuf;
1459 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1460 #endif
1462 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)]b4_locations_if([, yylsp -= (N)])[)
1464 /* The number of symbols on the RHS of the reduced rule.
1465 Keep to zero when no symbol should be popped. */
1466 int yylen = 0;]b4_push_if([[
1468 if (!yyps->yynew)
1470 yyn = yypact[yystate];
1471 goto yyread_pushed_token;
1472 }]])[
1474 yyssp = yyss = yyssa;
1475 yyvsp = yyvs = yyvsa;]b4_locations_if([[
1476 yylsp = yyls = yylsa;]])[
1477 yystacksize = YYINITDEPTH;]b4_lac_if([[
1479 yyes = yyesa;
1480 yyes_capacity = sizeof yyesa / sizeof *yyes;
1481 if (YYMAXDEPTH < yyes_capacity)
1482 yyes_capacity = YYMAXDEPTH;]])[
1484 YYDPRINTF ((stderr, "Starting parse\n"));
1486 yystate = 0;
1487 yyerrstatus = 0;
1488 yynerrs = 0;
1489 yychar = YYEMPTY; /* Cause a token to be read. */
1490 ]m4_ifdef([b4_initial_action], [
1491 b4_dollar_pushdef([m4_define([b4_dollar_dollar_used])yylval], [], [],
1492 [b4_push_if([b4_pure_if([*])yypushed_loc], [yylloc])])dnl
1493 b4_user_initial_action
1494 b4_dollar_popdef[]dnl
1495 m4_ifdef([b4_dollar_dollar_used],[[ yyvsp[0] = yylval;
1496 ]])])dnl
1497 b4_locations_if([[ yylsp[0] = ]b4_push_if([b4_pure_if([*])yypushed_loc], [yylloc])[;
1498 ]])dnl
1499 [ goto yysetstate;
1502 /*------------------------------------------------------------.
1503 | yynewstate -- push a new state, which is found in yystate. |
1504 `------------------------------------------------------------*/
1505 yynewstate:
1506 /* In all cases, when you get here, the value and location stacks
1507 have just been pushed. So pushing a state here evens the stacks. */
1508 yyssp++;
1511 /*--------------------------------------------------------------------.
1512 | yynewstate -- set current state (the top of the stack) to yystate. |
1513 `--------------------------------------------------------------------*/
1514 yysetstate:
1515 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1516 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1517 *yyssp = (yy_state_num) yystate;
1519 if (yyss + yystacksize - 1 <= yyssp)
1520 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1521 goto yyexhaustedlab;
1522 #else
1524 /* Get the current used size of the three stacks, in elements. */
1525 YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
1527 # if defined yyoverflow
1529 /* Give user a chance to reallocate the stack. Use copies of
1530 these so that the &'s don't force the real ones into
1531 memory. */
1532 yy_state_num *yyss1 = yyss;
1533 YYSTYPE *yyvs1 = yyvs;]b4_locations_if([
1534 YYLTYPE *yyls1 = yyls;])[
1536 /* Each stack pointer address is followed by the size of the
1537 data in use in that stack, in bytes. This used to be a
1538 conditional around just the two extra args, but that might
1539 be undefined if yyoverflow is a macro. */
1540 yyoverflow (YY_("memory exhausted"),
1541 &yyss1, yysize * sizeof (*yyssp),
1542 &yyvs1, yysize * sizeof (*yyvsp),]b4_locations_if([
1543 &yyls1, yysize * sizeof (*yylsp),])[
1544 &yystacksize);
1545 yyss = yyss1;
1546 yyvs = yyvs1;]b4_locations_if([
1547 yyls = yyls1;])[
1549 # else /* defined YYSTACK_RELOCATE */
1550 /* Extend the stack our own way. */
1551 if (YYMAXDEPTH <= yystacksize)
1552 goto yyexhaustedlab;
1553 yystacksize *= 2;
1554 if (YYMAXDEPTH < yystacksize)
1555 yystacksize = YYMAXDEPTH;
1558 yy_state_num *yyss1 = yyss;
1559 union yyalloc *yyptr =
1560 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1561 if (! yyptr)
1562 goto yyexhaustedlab;
1563 YYSTACK_RELOCATE (yyss_alloc, yyss);
1564 YYSTACK_RELOCATE (yyvs_alloc, yyvs);]b4_locations_if([
1565 YYSTACK_RELOCATE (yyls_alloc, yyls);])[
1566 # undef YYSTACK_RELOCATE
1567 if (yyss1 != yyssa)
1568 YYSTACK_FREE (yyss1);
1570 # endif
1572 yyssp = yyss + yysize - 1;
1573 yyvsp = yyvs + yysize - 1;]b4_locations_if([
1574 yylsp = yyls + yysize - 1;])[
1576 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1577 (unsigned long) yystacksize));
1579 if (yyss + yystacksize - 1 <= yyssp)
1580 YYABORT;
1582 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1584 if (yystate == YYFINAL)
1585 YYACCEPT;
1587 goto yybackup;
1590 /*-----------.
1591 | yybackup. |
1592 `-----------*/
1593 yybackup:
1594 /* Do appropriate processing given the current state. Read a
1595 lookahead token if we need one and don't already have one. */
1597 /* First try to decide what to do without reference to lookahead token. */
1598 yyn = yypact[yystate];
1599 if (yypact_value_is_default (yyn))
1600 goto yydefault;
1602 /* Not known => get a lookahead token if don't already have one. */
1604 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1605 if (yychar == YYEMPTY)
1606 {]b4_push_if([[
1607 if (!yyps->yynew)
1608 {]b4_use_push_for_pull_if([], [[
1609 YYDPRINTF ((stderr, "Return for a new token:\n"));]])[
1610 yyresult = YYPUSH_MORE;
1611 goto yypushreturn;
1613 yyps->yynew = 0;]b4_pure_if([], [[
1614 /* Restoring the pushed token is only necessary for the first
1615 yypush_parse invocation since subsequent invocations don't overwrite
1616 it before jumping to yyread_pushed_token. */
1617 yychar = yypushed_char;
1618 yylval = yypushed_val;]b4_locations_if([[
1619 yylloc = yypushed_loc;]])])[
1620 yyread_pushed_token:]])[
1621 YYDPRINTF ((stderr, "Reading a token: "));]b4_push_if([b4_pure_if([[
1622 yychar = yypushed_char;
1623 if (yypushed_val)
1624 yylval = *yypushed_val;]b4_locations_if([[
1625 if (yypushed_loc)
1626 yylloc = *yypushed_loc;]])])], [[
1627 yychar = ]b4_lex[;]])[
1630 if (yychar <= YYEOF)
1632 yychar = yytoken = YYEOF;
1633 YYDPRINTF ((stderr, "Now at end of input.\n"));
1635 else
1637 yytoken = YYTRANSLATE (yychar);
1638 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1641 /* If the proper action on seeing token YYTOKEN is to reduce or to
1642 detect an error, take that action. */
1643 yyn += yytoken;
1644 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)]b4_lac_if([[
1646 YY_LAC_ESTABLISH;
1647 goto yydefault;
1648 }]], [[
1649 goto yydefault;]])[
1650 yyn = (int) yytable[yyn];
1651 if (yyn <= 0)
1653 if (yytable_value_is_error (yyn))
1654 goto yyerrlab;]b4_lac_if([[
1655 YY_LAC_ESTABLISH;]])[
1656 yyn = -yyn;
1657 goto yyreduce;
1660 /* Count tokens shifted since error; after three, turn off error
1661 status. */
1662 if (yyerrstatus)
1663 yyerrstatus--;
1665 /* Shift the lookahead token. */
1666 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1668 /* Discard the shifted token. */
1669 yychar = YYEMPTY;]b4_lac_if([[
1670 YY_LAC_DISCARD ("shift");]])[
1672 yystate = yyn;
1673 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1674 *++yyvsp = yylval;
1675 YY_IGNORE_MAYBE_UNINITIALIZED_END]b4_locations_if([
1676 *++yylsp = yylloc;])[
1677 goto yynewstate;
1680 /*-----------------------------------------------------------.
1681 | yydefault -- do the default action for the current state. |
1682 `-----------------------------------------------------------*/
1683 yydefault:
1684 yyn = yydefact[yystate];
1685 if (yyn == 0)
1686 goto yyerrlab;
1687 goto yyreduce;
1690 /*-----------------------------.
1691 | yyreduce -- do a reduction. |
1692 `-----------------------------*/
1693 yyreduce:
1694 /* yyn is the number of a rule to reduce with. */
1695 yylen = yyr2[yyn];
1697 /* If YYLEN is nonzero, implement the default value of the action:
1698 '$$ = $1'.
1700 Otherwise, the following line sets YYVAL to garbage.
1701 This behavior is undocumented and Bison
1702 users should not rely upon it. Assigning to YYVAL
1703 unconditionally makes the parser a bit smaller, and it avoids a
1704 GCC warning that YYVAL may be used uninitialized. */
1705 yyval = yyvsp[1-yylen];
1707 ]b4_locations_if(
1708 [[ /* Default location. */
1709 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1710 yyerror_range[1] = yyloc;]])[
1711 YY_REDUCE_PRINT (yyn);]b4_lac_if([[
1713 int yychar_backup = yychar;
1714 switch (yyn)
1716 ]b4_user_actions[
1717 default: break;
1719 if (yychar_backup != yychar)
1720 YY_LAC_DISCARD ("yychar change");
1721 }]], [[
1722 switch (yyn)
1724 ]b4_user_actions[
1725 default: break;
1726 }]])[
1727 /* User semantic actions sometimes alter yychar, and that requires
1728 that yytoken be updated with the new translation. We take the
1729 approach of translating immediately before every use of yytoken.
1730 One alternative is translating here after every semantic action,
1731 but that translation would be missed if the semantic action invokes
1732 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1733 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1734 incorrect destructor might then be invoked immediately. In the
1735 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1736 to an incorrect destructor call or verbose syntax error message
1737 before the lookahead is translated. */
1738 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1740 YYPOPSTACK (yylen);
1741 yylen = 0;
1742 YY_STACK_PRINT (yyss, yyssp);
1744 *++yyvsp = yyval;]b4_locations_if([
1745 *++yylsp = yyloc;])[
1747 /* Now 'shift' the result of the reduction. Determine what state
1748 that goes to, based on the state we popped back to and the rule
1749 number reduced by. */
1751 const int yylhs = yyr1[yyn] - YYNTOKENS;
1752 const int yyi = yypgoto[yylhs] + (int) *yyssp;
1753 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1754 ? (int) yytable[yyi]
1755 : yydefgoto[yylhs]);
1758 goto yynewstate;
1761 /*--------------------------------------.
1762 | yyerrlab -- here on detecting error. |
1763 `--------------------------------------*/
1764 yyerrlab:
1765 /* Make sure we have latest lookahead translation. See comments at
1766 user semantic actions for why this is necessary. */
1767 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1769 /* If not already recovering from an error, report this error. */
1770 if (!yyerrstatus)
1772 ++yynerrs;
1773 #if ! YYERROR_VERBOSE
1774 yyerror (]b4_yyerror_args[YY_("syntax error"));
1775 #else
1776 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \]b4_lac_if([[
1777 yyesa, &yyes, &yyes_capacity, \]])[
1778 yyssp, yytoken)
1780 char const *yymsgp = YY_("syntax error");
1781 int yysyntax_error_status;]b4_lac_if([[
1782 if (yychar != YYEMPTY)
1783 YY_LAC_ESTABLISH;]])[
1784 yysyntax_error_status = YYSYNTAX_ERROR;
1785 if (yysyntax_error_status == 0)
1786 yymsgp = yymsg;
1787 else if (yysyntax_error_status == 1)
1789 if (yymsg != yymsgbuf)
1790 YYSTACK_FREE (yymsg);
1791 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1792 if (!yymsg)
1794 yymsg = yymsgbuf;
1795 yymsg_alloc = sizeof yymsgbuf;
1796 yysyntax_error_status = 2;
1798 else
1800 yysyntax_error_status = YYSYNTAX_ERROR;
1801 yymsgp = yymsg;
1804 yyerror (]b4_yyerror_args[yymsgp);
1805 if (yysyntax_error_status == 2)
1806 goto yyexhaustedlab;
1808 # undef YYSYNTAX_ERROR
1809 #endif
1812 ]b4_locations_if([[ yyerror_range[1] = yylloc;]])[
1814 if (yyerrstatus == 3)
1816 /* If just tried and failed to reuse lookahead token after an
1817 error, discard it. */
1819 if (yychar <= YYEOF)
1821 /* Return failure if at end of input. */
1822 if (yychar == YYEOF)
1823 YYABORT;
1825 else
1827 yydestruct ("Error: discarding",
1828 yytoken, &yylval]b4_locations_if([, &yylloc])[]b4_user_args[);
1829 yychar = YYEMPTY;
1833 /* Else will try to reuse lookahead token after shifting the error
1834 token. */
1835 goto yyerrlab1;
1838 /*---------------------------------------------------.
1839 | yyerrorlab -- error raised explicitly by YYERROR. |
1840 `---------------------------------------------------*/
1841 yyerrorlab:
1842 /* Pacify compilers when the user code never invokes YYERROR and the
1843 label yyerrorlab therefore never appears in user code. */
1844 if (0)
1845 YYERROR;
1847 /* Do not reclaim the symbols of the rule whose action triggered
1848 this YYERROR. */
1849 YYPOPSTACK (yylen);
1850 yylen = 0;
1851 YY_STACK_PRINT (yyss, yyssp);
1852 yystate = *yyssp;
1853 goto yyerrlab1;
1856 /*-------------------------------------------------------------.
1857 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1858 `-------------------------------------------------------------*/
1859 yyerrlab1:
1860 yyerrstatus = 3; /* Each real token shifted decrements this. */
1862 for (;;)
1864 yyn = yypact[yystate];
1865 if (!yypact_value_is_default (yyn))
1867 yyn += YYTERROR;
1868 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1870 yyn = (int) yytable[yyn];
1871 if (0 < yyn)
1872 break;
1876 /* Pop the current state because it cannot handle the error token. */
1877 if (yyssp == yyss)
1878 YYABORT;
1880 ]b4_locations_if([[ yyerror_range[1] = *yylsp;]])[
1881 yydestruct ("Error: popping",
1882 yystos[yystate], yyvsp]b4_locations_if([, yylsp])[]b4_user_args[);
1883 YYPOPSTACK (1);
1884 yystate = *yyssp;
1885 YY_STACK_PRINT (yyss, yyssp);
1886 }]b4_lac_if([[
1888 /* If the stack popping above didn't lose the initial context for the
1889 current lookahead token, the shift below will for sure. */
1890 YY_LAC_DISCARD ("error recovery");]])[
1892 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1893 *++yyvsp = yylval;
1894 YY_IGNORE_MAYBE_UNINITIALIZED_END
1895 ]b4_locations_if([[
1896 yyerror_range[2] = yylloc;
1897 /* Using YYLLOC is tempting, but would change the location of
1898 the lookahead. YYLOC is available though. */
1899 YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
1900 *++yylsp = yyloc;]])[
1902 /* Shift the error token. */
1903 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1905 yystate = yyn;
1906 goto yynewstate;
1909 /*-------------------------------------.
1910 | yyacceptlab -- YYACCEPT comes here. |
1911 `-------------------------------------*/
1912 yyacceptlab:
1913 yyresult = 0;
1914 goto yyreturn;
1917 /*-----------------------------------.
1918 | yyabortlab -- YYABORT comes here. |
1919 `-----------------------------------*/
1920 yyabortlab:
1921 yyresult = 1;
1922 goto yyreturn;
1925 #if ]b4_lac_if([[1]], [[!defined yyoverflow || YYERROR_VERBOSE]])[
1926 /*-------------------------------------------------.
1927 | yyexhaustedlab -- memory exhaustion comes here. |
1928 `-------------------------------------------------*/
1929 yyexhaustedlab:
1930 yyerror (]b4_yyerror_args[YY_("memory exhausted"));
1931 yyresult = 2;
1932 /* Fall through. */
1933 #endif
1936 /*-----------------------------------------------------.
1937 | yyreturn -- parsing is finished, return the result. |
1938 `-----------------------------------------------------*/
1939 yyreturn:
1940 if (yychar != YYEMPTY)
1942 /* Make sure we have latest lookahead translation. See comments at
1943 user semantic actions for why this is necessary. */
1944 yytoken = YYTRANSLATE (yychar);
1945 yydestruct ("Cleanup: discarding lookahead",
1946 yytoken, &yylval]b4_locations_if([, &yylloc])[]b4_user_args[);
1948 /* Do not reclaim the symbols of the rule whose action triggered
1949 this YYABORT or YYACCEPT. */
1950 YYPOPSTACK (yylen);
1951 YY_STACK_PRINT (yyss, yyssp);
1952 while (yyssp != yyss)
1954 yydestruct ("Cleanup: popping",
1955 yystos[*yyssp], yyvsp]b4_locations_if([, yylsp])[]b4_user_args[);
1956 YYPOPSTACK (1);
1958 #ifndef yyoverflow
1959 if (yyss != yyssa)
1960 YYSTACK_FREE (yyss);
1961 #endif]b4_lac_if([[
1962 if (yyes != yyesa)
1963 YYSTACK_FREE (yyes);]])b4_push_if([[
1964 yyps->yynew = 1;
1967 /*-----------------------------------------.
1968 | yypushreturn -- ask for the next token. |
1969 `-----------------------------------------*/
1970 yypushreturn:]])[
1971 #if YYERROR_VERBOSE
1972 if (yymsg != yymsgbuf)
1973 YYSTACK_FREE (yymsg);
1974 #endif
1975 return yyresult;
1977 ]b4_epilogue[]dnl
1978 b4_output_end