]> git.saurik.com Git - bison.git/blob - data/yacc.c
5ba564e87eb58da3d51592f601c57626bae38fbf
[bison.git] / data / yacc.c
1 -*- C -*-
2 # Yacc compatible skeleton for Bison
3
4 # Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005,
5 # 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
6
7 m4_pushdef([b4_copyright_years],
8 [1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010])
9
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.
14 #
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.
19 #
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/>.
22
23 # Check the value of %define api.push-pull.
24 b4_percent_define_default([[api.push-pull]], [[pull]])
25 b4_percent_define_check_values([[[[api.push-pull]],
26 [[pull]], [[push]], [[both]]]])
27 b4_define_flag_if([pull]) m4_define([b4_pull_flag], [[1]])
28 b4_define_flag_if([push]) m4_define([b4_push_flag], [[1]])
29 m4_case(b4_percent_define_get([[api.push-pull]]),
30 [pull], [m4_define([b4_push_flag], [[0]])],
31 [push], [m4_define([b4_pull_flag], [[0]])])
32
33 # Handle BISON_USE_PUSH_FOR_PULL for the test suite. So that push parsing
34 # tests function as written, don't let BISON_USE_PUSH_FOR_PULL modify Bison's
35 # behavior at all when push parsing is already requested.
36 b4_define_flag_if([use_push_for_pull])
37 b4_use_push_for_pull_if([
38 b4_push_if([m4_define([b4_use_push_for_pull_flag], [[0]])],
39 [m4_define([b4_push_flag], [[1]])])])
40
41 # Check the value of %define parse.lac, where LAC stands for lookahead
42 # correction.
43 b4_percent_define_default([[parse.lac]], [[none]])
44 b4_percent_define_default([[parse.lac.es-capacity]], [[20]])
45 b4_percent_define_check_values([[[[parse.lac]], [[full]], [[none]]]])
46 b4_define_flag_if([lac])
47 m4_define([b4_lac_flag],
48 [m4_if(b4_percent_define_get([[parse.lac]]),
49 [none], [[0]], [[1]])])
50
51 m4_include(b4_pkgdatadir/[c.m4])
52
53 ## ---------------- ##
54 ## Default values. ##
55 ## ---------------- ##
56
57 # Stack parameters.
58 m4_define_default([b4_stack_depth_max], [10000])
59 m4_define_default([b4_stack_depth_init], [200])
60
61
62 ## ------------------------ ##
63 ## Pure/impure interfaces. ##
64 ## ------------------------ ##
65
66 b4_percent_define_default([[api.pure]], [[false]])
67 b4_define_flag_if([pure])
68 m4_define([b4_pure_flag],
69 [b4_percent_define_flag_if([[api.pure]], [[1]], [[0]])])
70
71 # b4_yacc_pure_if(IF-TRUE, IF-FALSE)
72 # ----------------------------------
73 # Expand IF-TRUE, if %pure-parser and %parse-param, IF-FALSE otherwise.
74 m4_define([b4_yacc_pure_if],
75 [b4_pure_if([m4_ifset([b4_parse_param],
76 [$1], [$2])],
77 [$2])])
78
79
80 # b4_yyerror_args
81 # ---------------
82 # Arguments passed to yyerror: user args plus yylloc.
83 m4_define([b4_yyerror_args],
84 [b4_yacc_pure_if([b4_locations_if([&yylloc, ])])dnl
85 m4_ifset([b4_parse_param], [b4_c_args(b4_parse_param), ])])
86
87
88 # b4_lex_param
89 # ------------
90 # Accumulate in b4_lex_param all the yylex arguments.
91 # b4_lex_param arrives quoted twice, but we want to keep only one level.
92 m4_define([b4_lex_param],
93 m4_dquote(b4_pure_if([[[[YYSTYPE *]], [[&yylval]]][]dnl
94 b4_locations_if([, [[YYLTYPE *], [&yylloc]]])m4_ifdef([b4_lex_param], [, ])])dnl
95 m4_ifdef([b4_lex_param], b4_lex_param)))
96
97
98 ## ------------ ##
99 ## Data Types. ##
100 ## ------------ ##
101
102 # b4_int_type(MIN, MAX)
103 # ---------------------
104 # Return the smallest int type able to handle numbers ranging from
105 # MIN to MAX (included). Overwrite the version from c.m4, which
106 # uses only C89 types, so that the user can override the shorter
107 # types, and so that pre-C89 compilers are handled correctly.
108 m4_define([b4_int_type],
109 [m4_if(b4_ints_in($@, [0], [255]), [1], [yytype_uint8],
110 b4_ints_in($@, [-128], [127]), [1], [yytype_int8],
111
112 b4_ints_in($@, [0], [65535]), [1], [yytype_uint16],
113 b4_ints_in($@, [-32768], [32767]), [1], [yytype_int16],
114
115 m4_eval([0 <= $1]), [1], [unsigned int],
116
117 [int])])
118
119
120 ## ----------------- ##
121 ## Semantic Values. ##
122 ## ----------------- ##
123
124
125 # b4_lhs_value([TYPE])
126 # --------------------
127 # Expansion of $<TYPE>$.
128 m4_define([b4_lhs_value],
129 [b4_symbol_value(yyval, [$1])])
130
131
132 # b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
133 # --------------------------------------
134 # Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
135 # symbols on RHS.
136 m4_define([b4_rhs_value],
137 [b4_symbol_value([yyvsp@{b4_subtract([$2], [$1])@}], [$3])])
138
139
140
141 ## ----------- ##
142 ## Locations. ##
143 ## ----------- ##
144
145 # b4_lhs_location()
146 # -----------------
147 # Expansion of @$.
148 m4_define([b4_lhs_location],
149 [(yyloc)])
150
151
152 # b4_rhs_location(RULE-LENGTH, NUM)
153 # ---------------------------------
154 # Expansion of @NUM, where the current rule has RULE-LENGTH symbols
155 # on RHS.
156 m4_define([b4_rhs_location],
157 [(yylsp@{b4_subtract([$2], [$1])@})])
158
159
160 ## ------------------ ##
161 ## Parser variables. ##
162 ## ------------------ ##
163
164 # b4_declare_scanner_communication_variables
165 # ------------------------------------------
166 # Declare the variables that are global, or local to YYPARSE if
167 # pure-parser.
168 m4_define([b4_declare_scanner_communication_variables], [[
169 /* The lookahead symbol. */
170 int yychar;
171
172 /* The semantic value of the lookahead symbol. */
173 YYSTYPE yylval;]b4_locations_if([[
174
175 /* Location data for the lookahead symbol. */
176 YYLTYPE yylloc;]])b4_pure_if([], [[
177
178 /* Number of syntax errors so far. */
179 int yynerrs;]])])
180
181
182 # b4_declare_parser_state_variables
183 # ---------------------------------
184 # Declare all the variables that are needed to maintain the parser state
185 # between calls to yypush_parse.
186 m4_define([b4_declare_parser_state_variables], [b4_pure_if([[
187 /* Number of syntax errors so far. */
188 int yynerrs;
189 ]])[
190 int yystate;
191 /* Number of tokens to shift before error messages enabled. */
192 int yyerrstatus;
193
194 /* The stacks and their tools:
195 `yyss': related to states.
196 `yyvs': related to semantic values.]b4_locations_if([[
197 `yyls': related to locations.]])[
198
199 Refer to the stacks thru separate pointers, to allow yyoverflow
200 to reallocate them elsewhere. */
201
202 /* The state stack. */
203 yytype_int16 yyssa[YYINITDEPTH];
204 yytype_int16 *yyss;
205 yytype_int16 *yyssp;
206
207 /* The semantic value stack. */
208 YYSTYPE yyvsa[YYINITDEPTH];
209 YYSTYPE *yyvs;
210 YYSTYPE *yyvsp;]b4_locations_if([[
211
212 /* The location stack. */
213 YYLTYPE yylsa[YYINITDEPTH];
214 YYLTYPE *yyls;
215 YYLTYPE *yylsp;
216
217 /* The locations where the error started and ended. */
218 YYLTYPE yyerror_range[3];]])[
219
220 YYSIZE_T yystacksize;]])
221
222
223 ## --------------------------------------------------------- ##
224 ## Defining symbol actions, e.g., printers and destructors. ##
225 ## --------------------------------------------------------- ##
226
227 # We do want M4 expansion after # for CPP macros.
228 m4_changecom()
229 m4_divert_push(0)dnl
230 @output(b4_parser_file_name@)@
231 b4_copyright([Implementation for Bison's Yacc-like parsers in C])[
232
233 /* C LALR(1) parser skeleton written by Richard Stallman, by
234 simplifying the original so-called "semantic" parser. */
235
236 /* All symbols defined below should begin with yy or YY, to avoid
237 infringing on user name space. This should be done even for local
238 variables, as they might otherwise be expanded by user macros.
239 There are some unavoidable exceptions within include files to
240 define necessary library symbols; they are noted "INFRINGES ON
241 USER NAME SPACE" below. */
242
243 ]b4_identification
244 b4_percent_code_get([[top]])[]dnl
245 m4_if(b4_prefix, [yy], [],
246 [[/* Substitute the variable and function names. */]b4_pull_if([[
247 #define yyparse ]b4_prefix[parse]])b4_push_if([[
248 #define yypush_parse ]b4_prefix[push_parse]b4_pull_if([[
249 #define yypull_parse ]b4_prefix[pull_parse]])[
250 #define yypstate_new ]b4_prefix[pstate_new
251 #define yypstate_delete ]b4_prefix[pstate_delete
252 #define yypstate ]b4_prefix[pstate]])[
253 #define yylex ]b4_prefix[lex
254 #define yyerror ]b4_prefix[error
255 #define yylval ]b4_prefix[lval
256 #define yychar ]b4_prefix[char
257 #define yydebug ]b4_prefix[debug
258 #define yynerrs ]b4_prefix[nerrs
259 ]b4_locations_if([[#define yylloc ]b4_prefix[lloc]])])[
260
261 /* Copy the first part of user declarations. */
262 ]b4_user_pre_prologue[
263
264 /* Enabling traces. */
265 #ifndef YYDEBUG
266 # define YYDEBUG ]b4_parse_trace_if([1], [0])[
267 #endif
268
269 /* Enabling verbose error messages. */
270 #ifdef YYERROR_VERBOSE
271 # undef YYERROR_VERBOSE
272 # define YYERROR_VERBOSE 1
273 #else
274 # define YYERROR_VERBOSE ]b4_error_verbose_if([1], [0])[
275 #endif
276
277 /* Enabling the token table. */
278 #ifndef YYTOKEN_TABLE
279 # define YYTOKEN_TABLE ]b4_token_table[
280 #endif
281
282 ]b4_percent_code_get([[requires]])[]dnl
283
284 b4_token_enums_defines(b4_tokens)[
285
286 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
287 ]m4_ifdef([b4_stype],
288 [[typedef union ]b4_union_name[
289 {
290 ]b4_user_stype[
291 } YYSTYPE;
292 # define YYSTYPE_IS_TRIVIAL 1]],
293 [m4_if(b4_tag_seen_flag, 0,
294 [[typedef int YYSTYPE;
295 # define YYSTYPE_IS_TRIVIAL 1]])])[
296 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
297 # define YYSTYPE_IS_DECLARED 1
298 #endif]b4_locations_if([[
299
300 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
301 typedef struct YYLTYPE
302 {
303 int first_line;
304 int first_column;
305 int last_line;
306 int last_column;
307 } YYLTYPE;
308 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
309 # define YYLTYPE_IS_DECLARED 1
310 # define YYLTYPE_IS_TRIVIAL 1
311 #endif]])b4_push_if([[
312
313 #ifndef YYPUSH_DECLS
314 # define YYPUSH_DECLS
315 struct yypstate;
316 typedef struct yypstate yypstate;
317 enum { YYPUSH_MORE = 4 };
318
319 ]b4_pull_if([b4_c_function_decl([[yyparse]], [[int]], b4_parse_param)
320 ])b4_c_function_decl([[yypush_parse]], [[int]],
321 [[[yypstate *yyps]], [[yyps]]]b4_pure_if([,
322 [[[int yypushed_char]], [[yypushed_char]]],
323 [[[YYSTYPE const *yypushed_val]], [[yypushed_val]]]b4_locations_if([,
324 [[[YYLTYPE const *yypushed_loc]], [[yypushed_loc]]]])])m4_ifset([b4_parse_param], [,
325 b4_parse_param]))
326 b4_pull_if([b4_c_function_decl([[yypull_parse]], [[int]],
327 [[[yypstate *yyps]], [[yyps]]]m4_ifset([b4_parse_param], [,
328 b4_parse_param]))])
329 b4_c_function_decl([[yypstate_new]], [[yypstate *]], [[[void]], []])
330 b4_c_function_decl([[yypstate_delete]], [[void]],
331 [[[yypstate *yyps]], [[yyps]]])[
332 #endif]])
333
334 b4_percent_code_get([[provides]])[]dnl
335
336 [/* Copy the second part of user declarations. */
337 ]b4_user_post_prologue
338 b4_percent_code_get[]dnl
339
340 [#ifdef short
341 # undef short
342 #endif
343
344 #ifdef YYTYPE_UINT8
345 typedef YYTYPE_UINT8 yytype_uint8;
346 #else
347 typedef unsigned char yytype_uint8;
348 #endif
349
350 #ifdef YYTYPE_INT8
351 typedef YYTYPE_INT8 yytype_int8;
352 #elif ]b4_c_modern[
353 typedef signed char yytype_int8;
354 #else
355 typedef short int yytype_int8;
356 #endif
357
358 #ifdef YYTYPE_UINT16
359 typedef YYTYPE_UINT16 yytype_uint16;
360 #else
361 typedef unsigned short int yytype_uint16;
362 #endif
363
364 #ifdef YYTYPE_INT16
365 typedef YYTYPE_INT16 yytype_int16;
366 #else
367 typedef short int yytype_int16;
368 #endif
369
370 #ifndef YYSIZE_T
371 # ifdef __SIZE_TYPE__
372 # define YYSIZE_T __SIZE_TYPE__
373 # elif defined size_t
374 # define YYSIZE_T size_t
375 # elif ! defined YYSIZE_T && ]b4_c_modern[
376 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
377 # define YYSIZE_T size_t
378 # else
379 # define YYSIZE_T unsigned int
380 # endif
381 #endif
382
383 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
384
385 #ifndef YY_
386 # if defined YYENABLE_NLS && YYENABLE_NLS
387 # if ENABLE_NLS
388 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
389 # define YY_(msgid) dgettext ("bison-runtime", msgid)
390 # endif
391 # endif
392 # ifndef YY_
393 # define YY_(msgid) msgid
394 # endif
395 #endif
396
397 /* Suppress unused-variable warnings by "using" E. */
398 #if ! defined lint || defined __GNUC__
399 # define YYUSE(e) ((void) (e))
400 #else
401 # define YYUSE(e) /* empty */
402 #endif
403
404 /* Identity function, used to suppress warnings about constant conditions. */
405 #ifndef lint
406 # define YYID(n) (n)
407 #else
408 ]b4_c_function_def([YYID], [static int], [[int yyi], [yyi]])[
409 {
410 return yyi;
411 }
412 #endif
413
414 #if ! defined yyoverflow || YYERROR_VERBOSE
415
416 ]b4_push_if([],
417 [[/* The parser invokes alloca or malloc; define the necessary symbols. */
418
419 # ifdef YYSTACK_USE_ALLOCA
420 # if YYSTACK_USE_ALLOCA
421 # ifdef __GNUC__
422 # define YYSTACK_ALLOC __builtin_alloca
423 # elif defined __BUILTIN_VA_ARG_INCR
424 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
425 # elif defined _AIX
426 # define YYSTACK_ALLOC __alloca
427 # elif defined _MSC_VER
428 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
429 # define alloca _alloca
430 # else
431 # define YYSTACK_ALLOC alloca
432 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && ]b4_c_modern[
433 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
434 # ifndef EXIT_SUCCESS
435 # define EXIT_SUCCESS 0
436 # endif
437 # endif
438 # endif
439 # endif
440 # endif
441
442 ]])dnl
443 [# ifdef YYSTACK_ALLOC
444 /* Pacify GCC's `empty if-body' warning. */
445 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
446 # ifndef YYSTACK_ALLOC_MAXIMUM
447 /* The OS might guarantee only one guard page at the bottom of the stack,
448 and a page size can be as small as 4096 bytes. So we cannot safely
449 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
450 to allow for a few compiler-allocated temporary stack slots. */
451 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
452 # endif
453 # else
454 # define YYSTACK_ALLOC YYMALLOC
455 # define YYSTACK_FREE YYFREE
456 # ifndef YYSTACK_ALLOC_MAXIMUM
457 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
458 # endif
459 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
460 && ! ((defined YYMALLOC || defined malloc) \
461 && (defined YYFREE || defined free)))
462 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
463 # ifndef EXIT_SUCCESS
464 # define EXIT_SUCCESS 0
465 # endif
466 # endif
467 # ifndef YYMALLOC
468 # define YYMALLOC malloc
469 # if ! defined malloc && ! defined EXIT_SUCCESS && ]b4_c_modern[
470 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
471 # endif
472 # endif
473 # ifndef YYFREE
474 # define YYFREE free
475 # if ! defined free && ! defined EXIT_SUCCESS && ]b4_c_modern[
476 void free (void *); /* INFRINGES ON USER NAME SPACE */
477 # endif
478 # endif
479 # endif
480 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
481
482
483 #if (! defined yyoverflow \
484 && (! defined __cplusplus \
485 || (]b4_locations_if([[defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
486 && ]])[defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
487
488 /* A type that is properly aligned for any stack member. */
489 union yyalloc
490 {
491 yytype_int16 yyss_alloc;
492 YYSTYPE yyvs_alloc;]b4_locations_if([
493 YYLTYPE yyls_alloc;])[
494 };
495
496 /* The size of the maximum gap between one aligned stack and the next. */
497 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
498
499 /* The size of an array large to enough to hold all stacks, each with
500 N 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)])[
508
509 /* Copy COUNT objects from FROM to TO. The source and destination do
510 not overlap. */
511 # ifndef YYCOPY
512 # if defined __GNUC__ && 1 < __GNUC__
513 # define YYCOPY(To, From, Count) \
514 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
515 # else
516 # define YYCOPY(To, From, Count) \
517 do \
518 { \
519 YYSIZE_T yyi; \
520 for (yyi = 0; yyi < (Count); yyi++) \
521 (To)[yyi] = (From)[yyi]; \
522 } \
523 while (YYID (0))
524 # endif
525 # endif
526
527 /* Relocate STACK from its old location to the new one. The
528 local variables YYSIZE and YYSTACKSIZE give the old and new number of
529 elements in the stack, and YYPTR gives the new location of the
530 stack. Advance YYPTR to a properly aligned location for the next
531 stack. */
532 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
533 do \
534 { \
535 YYSIZE_T yynewbytes; \
536 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
537 Stack = &yyptr->Stack_alloc; \
538 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
539 yyptr += yynewbytes / sizeof (*yyptr); \
540 } \
541 while (YYID (0))
542
543 #endif
544
545 /* YYFINAL -- State number of the termination state. */
546 #define YYFINAL ]b4_final_state_number[
547 /* YYLAST -- Last index in YYTABLE. */
548 #define YYLAST ]b4_last[
549
550 /* YYNTOKENS -- Number of terminals. */
551 #define YYNTOKENS ]b4_tokens_number[
552 /* YYNNTS -- Number of nonterminals. */
553 #define YYNNTS ]b4_nterms_number[
554 /* YYNRULES -- Number of rules. */
555 #define YYNRULES ]b4_rules_number[
556 /* YYNSTATES -- Number of states. */
557 #define YYNSTATES ]b4_states_number[
558
559 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
560 by yylex, with out-of-bounds checking. */
561 #define YYUNDEFTOK ]b4_undef_token_number[
562 #define YYMAXUTOK ]b4_user_token_number_max[
563
564 #define YYTRANSLATE(YYX) \
565 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
566
567 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
568 as returned by yylex, without out-of-bounds checking. */
569 static const ]b4_int_type_for([b4_translate])[ yytranslate[] =
570 {
571 ]b4_translate[
572 };
573
574 #if YYDEBUG
575 ]b4_integral_parser_table_define([rline], [b4_rline],
576 [YYRLINE[YYN] -- Source line where rule number YYN was defined.])[
577 #endif
578
579 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
580 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
581 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
582 static const char *const yytname[] =
583 {
584 ]b4_tname[
585 };
586 #endif
587
588 # ifdef YYPRINT
589 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
590 (internal) symbol number NUM (which must be that of a token). */
591 static const ]b4_int_type_for([b4_toknum])[ yytoknum[] =
592 {
593 ]b4_toknum[
594 };
595 # endif
596
597 #define YYPACT_NINF ]b4_pact_ninf[
598
599 #define yypact_value_is_default(yystate) \
600 ]b4_table_value_equals([[pact]], [[yystate]], [b4_pact_ninf])[
601
602 #define YYTABLE_NINF ]b4_table_ninf[
603
604 #define yytable_value_is_error(yytable_value) \
605 ]b4_table_value_equals([[table]], [[yytable_value]], [b4_table_ninf])[
606
607 ]b4_parser_tables_define[
608
609 #define yyerrok (yyerrstatus = 0)
610 #define yyclearin (yychar = YYEMPTY)
611 #define YYEMPTY (-2)
612 #define YYEOF 0
613
614 #define YYACCEPT goto yyacceptlab
615 #define YYABORT goto yyabortlab
616 #define YYERROR goto yyerrorlab
617
618
619 /* Like YYERROR except do call yyerror. This remains here temporarily
620 to ease the transition to the new meaning of YYERROR, for GCC.
621 Once GCC version 2 has supplanted version 1, this can go. However,
622 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
623 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
624 discussed. */
625
626 #define YYFAIL goto yyerrlab
627 #if defined YYFAIL
628 /* This is here to suppress warnings from the GCC cpp's
629 -Wunused-macros. Normally we don't worry about that warning, but
630 some users do, and we want to make it easy for users to remove
631 YYFAIL uses, which will produce warnings from Bison 2.5. */
632 #endif
633
634 #define YYRECOVERING() (!!yyerrstatus)
635
636 #define YYBACKUP(Token, Value) \
637 do \
638 if (yychar == YYEMPTY && yylen == 1) \
639 { \
640 yychar = (Token); \
641 yylval = (Value); \
642 YYPOPSTACK (1); \]b4_lac_if([[
643 YY_LAC_DISCARD ("YYBACKUP"); \]])[
644 goto yybackup; \
645 } \
646 else \
647 { \
648 yyerror (]b4_yyerror_args[YY_("syntax error: cannot back up")); \
649 YYERROR; \
650 } \
651 while (YYID (0))
652
653
654 #define YYTERROR 1
655 #define YYERRCODE 256
656
657
658 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
659 If N is 0, then set CURRENT to the empty location which ends
660 the previous symbol: RHS[0] (always defined). */
661
662 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
663 #ifndef YYLLOC_DEFAULT
664 # define YYLLOC_DEFAULT(Current, Rhs, N) \
665 do \
666 if (YYID (N)) \
667 { \
668 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
669 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
670 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
671 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
672 } \
673 else \
674 { \
675 (Current).first_line = (Current).last_line = \
676 YYRHSLOC (Rhs, 0).last_line; \
677 (Current).first_column = (Current).last_column = \
678 YYRHSLOC (Rhs, 0).last_column; \
679 } \
680 while (YYID (0))
681 #endif]b4_locations_if([[
682
683
684 /* YY_LOCATION_PRINT -- Print the location on the stream.
685 This macro was not mandated originally: define only if we know
686 we won't break user code: when these are the locations we know. */
687
688 #ifndef YY_LOCATION_PRINT
689 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
690 # define YY_LOCATION_PRINT(File, Loc) \
691 fprintf (File, "%d.%d-%d.%d", \
692 (Loc).first_line, (Loc).first_column, \
693 (Loc).last_line, (Loc).last_column)
694 # else
695 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
696 # endif
697 #endif]], [[
698
699
700 /* This macro is provided for backward compatibility. */
701
702 #ifndef YY_LOCATION_PRINT
703 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
704 #endif]])[
705
706
707 /* YYLEX -- calling `yylex' with the right arguments. */
708
709 #ifdef YYLEX_PARAM
710 # define YYLEX yylex (]b4_pure_if([&yylval[]b4_locations_if([, &yylloc]), ])[YYLEX_PARAM)
711 #else
712 # define YYLEX ]b4_c_function_call([yylex], [int], b4_lex_param)[
713 #endif
714
715 /* Enable debugging if requested. */
716 #if YYDEBUG
717
718 # ifndef YYFPRINTF
719 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
720 # define YYFPRINTF fprintf
721 # endif
722
723 # define YYDPRINTF(Args) \
724 do { \
725 if (yydebug) \
726 YYFPRINTF Args; \
727 } while (YYID (0))
728
729 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
730 do { \
731 if (yydebug) \
732 { \
733 YYFPRINTF (stderr, "%s ", Title); \
734 yy_symbol_print (stderr, \
735 Type, Value]b4_locations_if([, Location])[]b4_user_args[); \
736 YYFPRINTF (stderr, "\n"); \
737 } \
738 } while (YYID (0))
739
740 ]b4_yy_symbol_print_generate([b4_c_function_def])[
741
742 /*------------------------------------------------------------------.
743 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
744 | TOP (included). |
745 `------------------------------------------------------------------*/
746
747 ]b4_c_function_def([yy_stack_print], [static void],
748 [[yytype_int16 *yybottom], [yybottom]],
749 [[yytype_int16 *yytop], [yytop]])[
750 {
751 YYFPRINTF (stderr, "Stack now");
752 for (; yybottom <= yytop; yybottom++)
753 {
754 int yybot = *yybottom;
755 YYFPRINTF (stderr, " %d", yybot);
756 }
757 YYFPRINTF (stderr, "\n");
758 }
759
760 # define YY_STACK_PRINT(Bottom, Top) \
761 do { \
762 if (yydebug) \
763 yy_stack_print ((Bottom), (Top)); \
764 } while (YYID (0))
765
766
767 /*------------------------------------------------.
768 | Report that the YYRULE is going to be reduced. |
769 `------------------------------------------------*/
770
771 ]b4_c_function_def([yy_reduce_print], [static void],
772 [[yytype_int16 *yyssp], [yyssp]],
773 [[YYSTYPE *yyvsp], [yyvsp]],
774 b4_locations_if([[[YYLTYPE *yylsp], [yylsp]],
775 ])[[int yyrule], [yyrule]]m4_ifset([b4_parse_param], [,
776 b4_parse_param]))[
777 {
778 unsigned long int yylno = yyrline[yyrule];
779 int yynrhs = yyr2[yyrule];
780 int yyi;
781 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
782 yyrule - 1, yylno);
783 /* The symbols being reduced. */
784 for (yyi = 0; yyi < yynrhs; yyi++)
785 {
786 YYFPRINTF (stderr, " $%d = ", yyi + 1);
787 yy_symbol_print (stderr,
788 yystos[yyssp[yyi + 1 - yynrhs]],
789 &]b4_rhs_value(yynrhs, yyi + 1)[
790 ]b4_locations_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl
791 b4_user_args[);
792 YYFPRINTF (stderr, "\n");
793 }
794 }
795
796 # define YY_REDUCE_PRINT(Rule) \
797 do { \
798 if (yydebug) \
799 yy_reduce_print (yyssp, yyvsp, ]b4_locations_if([yylsp, ])[Rule]b4_user_args[); \
800 } while (YYID (0))
801
802 /* Nonzero means print parse trace. It is left uninitialized so that
803 multiple parsers can coexist. */
804 int yydebug;
805 #else /* !YYDEBUG */
806 # define YYDPRINTF(Args)
807 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
808 # define YY_STACK_PRINT(Bottom, Top)
809 # define YY_REDUCE_PRINT(Rule)
810 #endif /* !YYDEBUG */
811
812
813 /* YYINITDEPTH -- initial size of the parser's stacks. */
814 #ifndef YYINITDEPTH
815 # define YYINITDEPTH ]b4_stack_depth_init[
816 #endif
817
818 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
819 if the built-in stack extension method is used).
820
821 Do not make this value too large; the results are undefined if
822 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
823 evaluated with infinite-precision integer arithmetic. */
824
825 #ifndef YYMAXDEPTH
826 # define YYMAXDEPTH ]b4_stack_depth_max[
827 #endif]b4_lac_if([[
828
829 /* Establish the initial context for the current lookahead if no initial
830 context is currently established.
831
832 We define a context as a snapshot of the parser stacks. We define
833 the initial context for a lookahead as the context in which the
834 parser initially examines that lookahead in order to select a
835 syntactic action. Thus, if the lookahead eventually proves
836 syntactically unacceptable (possibly in a later context reached via a
837 series of reductions), the initial context can be used to determine
838 the exact set of tokens that would be syntactically acceptable in the
839 lookahead's place. Moreover, it is the context after which any
840 further semantic actions would be erroneous because they would be
841 determined by a syntactically unacceptable token.
842
843 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
844 performed in an inconsistent state (which, for the purposes of LAC,
845 includes consistent states that don't know they're consistent because
846 their default reductions have been disabled). Iff there is a
847 lookahead token, it should also be invoked before reporting a syntax
848 error. This latter case is for the sake of the debugging output.
849
850 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
851 follows. If no initial context is currently established for the
852 current lookahead, then check if that lookahead can eventually be
853 shifted if syntactic actions continue from the current context.
854 Report a syntax error if it cannot. */
855 #define YY_LAC_ESTABLISH \
856 do { \
857 if (!yy_lac_established) \
858 { \
859 YYDPRINTF ((stderr, \
860 "LAC: initial context established for %s\n", \
861 yytname[yytoken])); \
862 yy_lac_established = 1; \
863 { \
864 int yy_lac_status = \
865 yy_lac (yyssp, yytoken); \
866 if (yy_lac_status == 2) \
867 goto yyexhaustedlab; \
868 if (yy_lac_status == 1) \
869 goto yyerrlab; \
870 } \
871 } \
872 } while (YYID (0))
873
874 /* Discard any previous initial lookahead context because of Event,
875 which may be a lookahead change or an invalidation of the currently
876 established initial context for the current lookahead.
877
878 The most common example of a lookahead change is a shift. An example
879 of both cases is syntax error recovery. That is, a syntax error
880 occurs when the lookahead is syntactically erroneous for the
881 currently established initial context, so error recovery manipulates
882 the parser stacks to try to find a new initial context in which the
883 current lookahead is syntactically acceptable. If it fails to find
884 such a context, it discards the lookahead. */
885 #if YYDEBUG
886 # define YY_LAC_DISCARD(Event) \
887 do { \
888 if (yy_lac_established) \
889 { \
890 if (yydebug) \
891 YYFPRINTF (stderr, "LAC: initial context discarded due to " \
892 Event "\n"); \
893 yy_lac_established = 0; \
894 } \
895 } while (YYID (0))
896 #else
897 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
898 #endif
899
900 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
901 eventually (after perhaps some reductions) be shifted, and return 1
902 if not. Return 2 if memory is exhausted. */
903 static int
904 yy_lac (yytype_int16 *yyssp, int yytoken)
905 {
906 yytype_int16 *yyes_prev = yyssp;
907 yytype_int16 yyes@{]b4_percent_define_get([[parse.lac.es-capacity]])[@};
908 yytype_int16 *yyesp = yyes_prev;
909 YYDPRINTF ((stderr, "LAC: checking lookahead %s:", yytname[yytoken]));
910 if (yytoken == YYUNDEFTOK)
911 {
912 YYDPRINTF ((stderr, " Always Err\n"));
913 return 1;
914 }
915 while (1)
916 {
917 int yyrule = yypact[*yyesp];
918 if (yypact_value_is_default (yyrule)
919 || (yyrule += yytoken) < 0 || YYLAST < yyrule
920 || yycheck[yyrule] != yytoken)
921 {
922 yyrule = yydefact[*yyesp];
923 if (yyrule == 0)
924 {
925 YYDPRINTF ((stderr, " Err\n"));
926 return 1;
927 }
928 }
929 else
930 {
931 yyrule = yytable[yyrule];
932 if (yytable_value_is_error (yyrule))
933 {
934 YYDPRINTF ((stderr, " Err\n"));
935 return 1;
936 }
937 if (0 < yyrule)
938 {
939 YYDPRINTF ((stderr, " S%d\n", yyrule));
940 return 0;
941 }
942 yyrule = -yyrule;
943 }
944 {
945 YYSIZE_T yylen = yyr2[yyrule];
946 YYDPRINTF ((stderr, " R%d", yyrule - 1));
947 if (yyesp != yyes_prev)
948 {
949 YYSIZE_T yysize = yyesp - yyes + 1;
950 if (yylen < yysize)
951 {
952 yyesp -= yylen;
953 yylen = 0;
954 }
955 else
956 {
957 yylen -= yysize;
958 yyesp = yyes_prev;
959 }
960 }
961 if (yylen)
962 yyesp = yyes_prev -= yylen;
963 }
964 {
965 int yystate;
966 {
967 int yylhs = yyr1[yyrule] - YYNTOKENS;
968 yystate = yypgoto[yylhs] + *yyesp;
969 if (yystate < 0 || YYLAST < yystate
970 || yycheck[yystate] != *yyesp)
971 yystate = yydefgoto[yylhs];
972 else
973 yystate = yytable[yystate];
974 }
975 if (yyesp == yyes_prev)
976 {
977 yyesp = yyes;
978 *yyesp = yystate;
979 }
980 else
981 {
982 if (yyesp == yyes + (sizeof yyes / sizeof *yyes) - 1)
983 {
984 YYDPRINTF ((stderr, " (max stack size exceeded)\n"));
985 return 2;
986 }
987 *++yyesp = yystate;
988 }
989 YYDPRINTF ((stderr, " G%d", *yyesp));
990 }
991 }
992 }]])[
993
994
995 #if YYERROR_VERBOSE
996
997 # ifndef yystrlen
998 # if defined __GLIBC__ && defined _STRING_H
999 # define yystrlen strlen
1000 # else
1001 /* Return the length of YYSTR. */
1002 ]b4_c_function_def([yystrlen], [static YYSIZE_T],
1003 [[const char *yystr], [yystr]])[
1004 {
1005 YYSIZE_T yylen;
1006 for (yylen = 0; yystr[yylen]; yylen++)
1007 continue;
1008 return yylen;
1009 }
1010 # endif
1011 # endif
1012
1013 # ifndef yystpcpy
1014 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1015 # define yystpcpy stpcpy
1016 # else
1017 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1018 YYDEST. */
1019 ]b4_c_function_def([yystpcpy], [static char *],
1020 [[char *yydest], [yydest]], [[const char *yysrc], [yysrc]])[
1021 {
1022 char *yyd = yydest;
1023 const char *yys = yysrc;
1024
1025 while ((*yyd++ = *yys++) != '\0')
1026 continue;
1027
1028 return yyd - 1;
1029 }
1030 # endif
1031 # endif
1032
1033 # ifndef yytnamerr
1034 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1035 quotes and backslashes, so that it's suitable for yyerror. The
1036 heuristic is that double-quoting is unnecessary unless the string
1037 contains an apostrophe, a comma, or backslash (other than
1038 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1039 null, do not copy; instead, return the length of what the result
1040 would have been. */
1041 static YYSIZE_T
1042 yytnamerr (char *yyres, const char *yystr)
1043 {
1044 if (*yystr == '"')
1045 {
1046 YYSIZE_T yyn = 0;
1047 char const *yyp = yystr;
1048
1049 for (;;)
1050 switch (*++yyp)
1051 {
1052 case '\'':
1053 case ',':
1054 goto do_not_strip_quotes;
1055
1056 case '\\':
1057 if (*++yyp != '\\')
1058 goto do_not_strip_quotes;
1059 /* Fall through. */
1060 default:
1061 if (yyres)
1062 yyres[yyn] = *yyp;
1063 yyn++;
1064 break;
1065
1066 case '"':
1067 if (yyres)
1068 yyres[yyn] = '\0';
1069 return yyn;
1070 }
1071 do_not_strip_quotes: ;
1072 }
1073
1074 if (! yyres)
1075 return yystrlen (yystr);
1076
1077 return yystpcpy (yyres, yystr) - yyres;
1078 }
1079 # endif
1080
1081 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1082 about the unexpected token YYTOKEN for the state stack whose top is
1083 YYSSP.]b4_lac_if([[ In order to see if a particular token T is a
1084 valid looakhead, invoke yy_lac (YYSSP, T).]])[
1085
1086 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1087 not large enough to hold the message. In that case, also set
1088 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1089 required number of bytes is too large to store]b4_lac_if([[ or if
1090 yy_lac returned 2]])[. */
1091 static int
1092 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1093 yytype_int16 *yyssp, int yytoken)
1094 {
1095 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
1096 YYSIZE_T yysize = yysize0;
1097 YYSIZE_T yysize1;
1098 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1099 /* Internationalized format string. */
1100 const char *yyformat = 0;
1101 /* Arguments of yyformat. */
1102 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1103 /* Number of reported tokens (one for the "unexpected", one per
1104 "expected"). */
1105 int yycount = 0;
1106
1107 /* There are many possibilities here to consider:
1108 - Assume YYFAIL is not used. It's too flawed to consider. See
1109 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1110 for details. YYERROR is fine as it does not invoke this
1111 function.
1112 - If this state is a consistent state with a default action, then
1113 the only way this function was invoked is if the default action
1114 is an error action. In that case, don't check for expected
1115 tokens because there are none.
1116 - The only way there can be no lookahead present (in yychar) is if
1117 this state is a consistent state with a default action. Thus,
1118 detecting the absence of a lookahead is sufficient to determine
1119 that there is no unexpected or expected token to report. In that
1120 case, just report a simple "syntax error".
1121 - Don't assume there isn't a lookahead just because this state is a
1122 consistent state with a default action. There might have been a
1123 previous inconsistent state, consistent state with a non-default
1124 action, or user semantic action that manipulated yychar.]b4_lac_if([[
1125 In the first two cases, it might appear that the current syntax
1126 error should have been detected in the previous state when yy_lac
1127 was invoked. However, at that time, there might have been a
1128 different syntax error that discarded a different initial context
1129 during error recovery, leaving behind the current lookahead.]], [[
1130 - Of course, the expected token list depends on states to have
1131 correct lookahead information, and it depends on the parser not
1132 to perform extra reductions after fetching a lookahead from the
1133 scanner and before detecting a syntax error. Thus, state merging
1134 (from LALR or IELR) and default reductions corrupt the expected
1135 token list. However, the list is correct for canonical LR with
1136 one exception: it will still contain any token that will not be
1137 accepted due to an error action in a later state.]])[
1138 */
1139 if (yytoken != YYEMPTY)
1140 {
1141 int yyn = yypact[*yyssp];]b4_lac_if([[
1142 YYDPRINTF ((stderr, "Constructing syntax error message\n"));]])[
1143 yyarg[yycount++] = yytname[yytoken];
1144 if (!yypact_value_is_default (yyn))
1145 {]b4_lac_if([], [[
1146 /* Start YYX at -YYN if negative to avoid negative indexes in
1147 YYCHECK. In other words, skip the first -YYN actions for
1148 this state because they are default actions. */
1149 int yyxbegin = yyn < 0 ? -yyn : 0;
1150 /* Stay within bounds of both yycheck and yytname. */
1151 int yychecklim = YYLAST - yyn + 1;
1152 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;]])[
1153 int yyx;]b4_lac_if([[
1154
1155 for (yyx = 0; yyx < YYNTOKENS; ++yyx)
1156 if (yyx != YYTERROR && yyx != YYUNDEFTOK)
1157 {
1158 {
1159 int yy_lac_status = yy_lac (yyssp, yyx);
1160 if (yy_lac_status == 2)
1161 return 2;
1162 if (yy_lac_status == 1)
1163 continue;
1164 }]], [[
1165
1166 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1167 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1168 && !yytable_value_is_error (yytable[yyx + yyn]))
1169 {]])[
1170 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1171 {
1172 yycount = 1;
1173 yysize = yysize0;
1174 break;
1175 }
1176 yyarg[yycount++] = yytname[yyx];
1177 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1178 if (! (yysize <= yysize1
1179 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1180 return 2;
1181 yysize = yysize1;
1182 }
1183 }]b4_lac_if([[
1184 # if YYDEBUG
1185 else if (yydebug)
1186 YYFPRINTF (stderr, "No expected tokens.\n");
1187 # endif]])[
1188 }
1189
1190 switch (yycount)
1191 {
1192 # define YYCASE_(N, S) \
1193 case N: \
1194 yyformat = S; \
1195 break
1196 YYCASE_(0, YY_("syntax error"));
1197 YYCASE_(1, YY_("syntax error, unexpected %s"));
1198 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1199 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1200 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1201 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1202 # undef YYCASE_
1203 }
1204
1205 yysize1 = yysize + yystrlen (yyformat);
1206 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1207 return 2;
1208 yysize = yysize1;
1209
1210 if (*yymsg_alloc < yysize)
1211 {
1212 *yymsg_alloc = 2 * yysize;
1213 if (! (yysize <= *yymsg_alloc
1214 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1215 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1216 return 1;
1217 }
1218
1219 /* Avoid sprintf, as that infringes on the user's name space.
1220 Don't have undefined behavior even if the translation
1221 produced a string with the wrong number of "%s"s. */
1222 {
1223 char *yyp = *yymsg;
1224 int yyi = 0;
1225 while ((*yyp = *yyformat) != '\0')
1226 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1227 {
1228 yyp += yytnamerr (yyp, yyarg[yyi++]);
1229 yyformat += 2;
1230 }
1231 else
1232 {
1233 yyp++;
1234 yyformat++;
1235 }
1236 }
1237 return 0;
1238 }
1239 #endif /* YYERROR_VERBOSE */
1240
1241 ]b4_yydestruct_generate([b4_c_function_def])b4_push_if([], [[
1242
1243
1244 /* Prevent warnings from -Wmissing-prototypes. */
1245 #ifdef YYPARSE_PARAM
1246 ]b4_c_function_decl([yyparse], [int],
1247 [[void *YYPARSE_PARAM], [YYPARSE_PARAM]])[
1248 #else /* ! YYPARSE_PARAM */
1249 ]b4_c_function_decl([yyparse], [int], b4_parse_param)[
1250 #endif /* ! YYPARSE_PARAM */]])b4_pure_if([], [
1251
1252 b4_declare_scanner_communication_variables])[]b4_push_if([[
1253
1254
1255 struct yypstate
1256 {]b4_declare_parser_state_variables[
1257 /* Used to determine if this is the first time this instance has
1258 been used. */
1259 int yynew;
1260 };]b4_pure_if([], [[
1261
1262 static char yypstate_allocated = 0;]])b4_pull_if([
1263
1264 b4_c_function_def([[yyparse]], [[int]], b4_parse_param)[
1265 {
1266 return yypull_parse (0]m4_ifset([b4_parse_param],
1267 [[, ]b4_c_args(b4_parse_param)])[);
1268 }
1269
1270 ]b4_c_function_def([[yypull_parse]], [[int]],
1271 [[[yypstate *yyps]], [[yyps]]]m4_ifset([b4_parse_param], [,
1272 b4_parse_param]))[
1273 {
1274 int yystatus;
1275 yypstate *yyps_local;]b4_pure_if([[
1276 int yychar;
1277 YYSTYPE yylval;]b4_locations_if([[
1278 YYLTYPE yylloc;]])])[
1279 if (yyps == 0)
1280 {
1281 yyps_local = yypstate_new ();
1282 if (!yyps_local)
1283 {]b4_pure_if([[
1284 yyerror (]b4_yyerror_args[YY_("memory exhausted"));]], [[
1285 if (!yypstate_allocated)
1286 yyerror (]b4_yyerror_args[YY_("memory exhausted"));]])[
1287 return 2;
1288 }
1289 }
1290 else
1291 yyps_local = yyps;
1292 do {
1293 yychar = YYLEX;
1294 yystatus =
1295 yypush_parse (yyps_local]b4_pure_if([[, yychar, &yylval]b4_locations_if([[, &yylloc]])])m4_ifset([b4_parse_param], [, b4_c_args(b4_parse_param)])[);
1296 } while (yystatus == YYPUSH_MORE);
1297 if (yyps == 0)
1298 yypstate_delete (yyps_local);
1299 return yystatus;
1300 }]])[
1301
1302 /* Initialize the parser data structure. */
1303 ]b4_c_function_def([[yypstate_new]], [[yypstate *]])[
1304 {
1305 yypstate *yyps;]b4_pure_if([], [[
1306 if (yypstate_allocated)
1307 return 0;]])[
1308 yyps = (yypstate *) malloc (sizeof *yyps);
1309 if (!yyps)
1310 return 0;
1311 yyps->yynew = 1;]b4_pure_if([], [[
1312 yypstate_allocated = 1;]])[
1313 return yyps;
1314 }
1315
1316 ]b4_c_function_def([[yypstate_delete]], [[void]],
1317 [[[yypstate *yyps]], [[yyps]]])[
1318 {
1319 #ifndef yyoverflow
1320 /* If the stack was reallocated but the parse did not complete, then the
1321 stack still needs to be freed. */
1322 if (!yyps->yynew && yyps->yyss != yyps->yyssa)
1323 YYSTACK_FREE (yyps->yyss);
1324 #endif
1325 free (yyps);]b4_pure_if([], [[
1326 yypstate_allocated = 0;]])[
1327 }
1328 ]b4_pure_if([[
1329 #define ]b4_prefix[nerrs yyps->]b4_prefix[nerrs]])[
1330 #define yystate yyps->yystate
1331 #define yyerrstatus yyps->yyerrstatus
1332 #define yyssa yyps->yyssa
1333 #define yyss yyps->yyss
1334 #define yyssp yyps->yyssp
1335 #define yyvsa yyps->yyvsa
1336 #define yyvs yyps->yyvs
1337 #define yyvsp yyps->yyvsp]b4_locations_if([[
1338 #define yylsa yyps->yylsa
1339 #define yyls yyps->yyls
1340 #define yylsp yyps->yylsp
1341 #define yyerror_range yyps->yyerror_range]])[
1342 #define yystacksize yyps->yystacksize
1343
1344
1345 /*---------------.
1346 | yypush_parse. |
1347 `---------------*/
1348
1349 ]b4_c_function_def([[yypush_parse]], [[int]],
1350 [[[yypstate *yyps]], [[yyps]]]b4_pure_if([,
1351 [[[int yypushed_char]], [[yypushed_char]]],
1352 [[[YYSTYPE const *yypushed_val]], [[yypushed_val]]]b4_locations_if([,
1353 [[[YYLTYPE const *yypushed_loc]], [[yypushed_loc]]]])])m4_ifset([b4_parse_param], [,
1354 b4_parse_param]))], [[
1355
1356
1357 /*----------.
1358 | yyparse. |
1359 `----------*/
1360
1361 #ifdef YYPARSE_PARAM
1362 ]b4_c_function_def([yyparse], [int],
1363 [[void *YYPARSE_PARAM], [YYPARSE_PARAM]])[
1364 #else /* ! YYPARSE_PARAM */
1365 ]b4_c_function_def([yyparse], [int], b4_parse_param)[
1366 #endif]])[
1367 {]b4_pure_if([b4_declare_scanner_communication_variables
1368 ])b4_push_if([b4_pure_if([], [[
1369 int yypushed_char = yychar;
1370 YYSTYPE yypushed_val = yylval;]b4_locations_if([[
1371 YYLTYPE yypushed_loc = yylloc;]])
1372 ])],
1373 [b4_declare_parser_state_variables
1374 ])b4_lac_if([[
1375 int yy_lac_established = 0;]])[
1376 int yyn;
1377 int yyresult;
1378 /* Lookahead token as an internal (translated) token number. */
1379 int yytoken;
1380 /* The variables used to return semantic value and location from the
1381 action routines. */
1382 YYSTYPE yyval;]b4_locations_if([[
1383 YYLTYPE yyloc;]])[
1384
1385 #if YYERROR_VERBOSE
1386 /* Buffer for error messages, and its allocated size. */
1387 char yymsgbuf[128];
1388 char *yymsg = yymsgbuf;
1389 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1390 #endif
1391
1392 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)]b4_locations_if([, yylsp -= (N)])[)
1393
1394 /* The number of symbols on the RHS of the reduced rule.
1395 Keep to zero when no symbol should be popped. */
1396 int yylen = 0;]b4_push_if([[
1397
1398 if (!yyps->yynew)
1399 {
1400 yyn = yypact[yystate];
1401 goto yyread_pushed_token;
1402 }]])[
1403
1404 yytoken = 0;
1405 yyss = yyssa;
1406 yyvs = yyvsa;]b4_locations_if([[
1407 yyls = yylsa;]])[
1408 yystacksize = YYINITDEPTH;
1409
1410 YYDPRINTF ((stderr, "Starting parse\n"));
1411
1412 yystate = 0;
1413 yyerrstatus = 0;
1414 yynerrs = 0;
1415 yychar = YYEMPTY; /* Cause a token to be read. */
1416
1417 /* Initialize stack pointers.
1418 Waste one element of value and location stack
1419 so that they stay on the same level as the state stack.
1420 The wasted elements are never initialized. */
1421 yyssp = yyss;
1422 yyvsp = yyvs;]b4_locations_if([[
1423 yylsp = yyls;
1424
1425 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1426 /* Initialize the default location before parsing starts. */
1427 yylloc.first_line = yylloc.last_line = ]b4_location_initial_line[;
1428 yylloc.first_column = yylloc.last_column = ]b4_location_initial_column[;
1429 #endif]])
1430 m4_ifdef([b4_initial_action],[
1431 m4_pushdef([b4_at_dollar], [m4_define([b4_at_dollar_used])yylloc])dnl
1432 m4_pushdef([b4_dollar_dollar], [m4_define([b4_dollar_dollar_used])yylval])dnl
1433 /* User initialization code. */
1434 b4_user_initial_action
1435 m4_popdef([b4_dollar_dollar])dnl
1436 m4_popdef([b4_at_dollar])])dnl
1437 m4_ifdef([b4_dollar_dollar_used],[[ yyvsp[0] = yylval;
1438 ]])dnl
1439 m4_ifdef([b4_at_dollar_used], [[ yylsp[0] = yylloc;
1440 ]])[
1441 goto yysetstate;
1442
1443 /*------------------------------------------------------------.
1444 | yynewstate -- Push a new state, which is found in yystate. |
1445 `------------------------------------------------------------*/
1446 yynewstate:
1447 /* In all cases, when you get here, the value and location stacks
1448 have just been pushed. So pushing a state here evens the stacks. */
1449 yyssp++;
1450
1451 yysetstate:
1452 *yyssp = yystate;
1453
1454 if (yyss + yystacksize - 1 <= yyssp)
1455 {
1456 /* Get the current used size of the three stacks, in elements. */
1457 YYSIZE_T yysize = yyssp - yyss + 1;
1458
1459 #ifdef yyoverflow
1460 {
1461 /* Give user a chance to reallocate the stack. Use copies of
1462 these so that the &'s don't force the real ones into
1463 memory. */
1464 YYSTYPE *yyvs1 = yyvs;
1465 yytype_int16 *yyss1 = yyss;]b4_locations_if([
1466 YYLTYPE *yyls1 = yyls;])[
1467
1468 /* Each stack pointer address is followed by the size of the
1469 data in use in that stack, in bytes. This used to be a
1470 conditional around just the two extra args, but that might
1471 be undefined if yyoverflow is a macro. */
1472 yyoverflow (YY_("memory exhausted"),
1473 &yyss1, yysize * sizeof (*yyssp),
1474 &yyvs1, yysize * sizeof (*yyvsp),]b4_locations_if([
1475 &yyls1, yysize * sizeof (*yylsp),])[
1476 &yystacksize);
1477 ]b4_locations_if([
1478 yyls = yyls1;])[
1479 yyss = yyss1;
1480 yyvs = yyvs1;
1481 }
1482 #else /* no yyoverflow */
1483 # ifndef YYSTACK_RELOCATE
1484 goto yyexhaustedlab;
1485 # else
1486 /* Extend the stack our own way. */
1487 if (YYMAXDEPTH <= yystacksize)
1488 goto yyexhaustedlab;
1489 yystacksize *= 2;
1490 if (YYMAXDEPTH < yystacksize)
1491 yystacksize = YYMAXDEPTH;
1492
1493 {
1494 yytype_int16 *yyss1 = yyss;
1495 union yyalloc *yyptr =
1496 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1497 if (! yyptr)
1498 goto yyexhaustedlab;
1499 YYSTACK_RELOCATE (yyss_alloc, yyss);
1500 YYSTACK_RELOCATE (yyvs_alloc, yyvs);]b4_locations_if([
1501 YYSTACK_RELOCATE (yyls_alloc, yyls);])[
1502 # undef YYSTACK_RELOCATE
1503 if (yyss1 != yyssa)
1504 YYSTACK_FREE (yyss1);
1505 }
1506 # endif
1507 #endif /* no yyoverflow */
1508
1509 yyssp = yyss + yysize - 1;
1510 yyvsp = yyvs + yysize - 1;]b4_locations_if([
1511 yylsp = yyls + yysize - 1;])[
1512
1513 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1514 (unsigned long int) yystacksize));
1515
1516 if (yyss + yystacksize - 1 <= yyssp)
1517 YYABORT;
1518 }
1519
1520 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1521
1522 if (yystate == YYFINAL)
1523 YYACCEPT;
1524
1525 goto yybackup;
1526
1527 /*-----------.
1528 | yybackup. |
1529 `-----------*/
1530 yybackup:
1531
1532 /* Do appropriate processing given the current state. Read a
1533 lookahead token if we need one and don't already have one. */
1534
1535 /* First try to decide what to do without reference to lookahead token. */
1536 yyn = yypact[yystate];
1537 if (yypact_value_is_default (yyn))
1538 goto yydefault;
1539
1540 /* Not known => get a lookahead token if don't already have one. */
1541
1542 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1543 if (yychar == YYEMPTY)
1544 {]b4_push_if([[
1545 if (!yyps->yynew)
1546 {]b4_use_push_for_pull_if([], [[
1547 YYDPRINTF ((stderr, "Return for a new token:\n"));]])[
1548 yyresult = YYPUSH_MORE;
1549 goto yypushreturn;
1550 }
1551 yyps->yynew = 0;]b4_pure_if([], [[
1552 /* Restoring the pushed token is only necessary for the first
1553 yypush_parse invocation since subsequent invocations don't overwrite
1554 it before jumping to yyread_pushed_token. */
1555 yychar = yypushed_char;
1556 yylval = yypushed_val;]b4_locations_if([[
1557 yylloc = yypushed_loc;]])])[
1558 yyread_pushed_token:]])[
1559 YYDPRINTF ((stderr, "Reading a token: "));]b4_push_if([b4_pure_if([[
1560 yychar = yypushed_char;
1561 if (yypushed_val)
1562 yylval = *yypushed_val;]b4_locations_if([[
1563 if (yypushed_loc)
1564 yylloc = *yypushed_loc;]])])], [[
1565 yychar = YYLEX;]])[
1566 }
1567
1568 if (yychar <= YYEOF)
1569 {
1570 yychar = yytoken = YYEOF;
1571 YYDPRINTF ((stderr, "Now at end of input.\n"));
1572 }
1573 else
1574 {
1575 yytoken = YYTRANSLATE (yychar);
1576 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1577 }
1578
1579 /* If the proper action on seeing token YYTOKEN is to reduce or to
1580 detect an error, take that action. */
1581 yyn += yytoken;
1582 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)]b4_lac_if([[
1583 {
1584 YY_LAC_ESTABLISH;
1585 goto yydefault;
1586 }]], [[
1587 goto yydefault;]])[
1588 yyn = yytable[yyn];
1589 if (yyn <= 0)
1590 {
1591 if (yytable_value_is_error (yyn))
1592 goto yyerrlab;]b4_lac_if([[
1593 YY_LAC_ESTABLISH;]])[
1594 yyn = -yyn;
1595 goto yyreduce;
1596 }
1597
1598 /* Count tokens shifted since error; after three, turn off error
1599 status. */
1600 if (yyerrstatus)
1601 yyerrstatus--;
1602
1603 /* Shift the lookahead token. */
1604 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1605
1606 /* Discard the shifted token. */
1607 yychar = YYEMPTY;]b4_lac_if([[
1608 YY_LAC_DISCARD ("shift");]])[
1609
1610 yystate = yyn;
1611 *++yyvsp = yylval;
1612 ]b4_locations_if([ *++yylsp = yylloc;])[
1613 goto yynewstate;
1614
1615
1616 /*-----------------------------------------------------------.
1617 | yydefault -- do the default action for the current state. |
1618 `-----------------------------------------------------------*/
1619 yydefault:
1620 yyn = yydefact[yystate];
1621 if (yyn == 0)
1622 goto yyerrlab;
1623 goto yyreduce;
1624
1625
1626 /*-----------------------------.
1627 | yyreduce -- Do a reduction. |
1628 `-----------------------------*/
1629 yyreduce:
1630 /* yyn is the number of a rule to reduce with. */
1631 yylen = yyr2[yyn];
1632
1633 /* If YYLEN is nonzero, implement the default value of the action:
1634 `$$ = $1'.
1635
1636 Otherwise, the following line sets YYVAL to garbage.
1637 This behavior is undocumented and Bison
1638 users should not rely upon it. Assigning to YYVAL
1639 unconditionally makes the parser a bit smaller, and it avoids a
1640 GCC warning that YYVAL may be used uninitialized. */
1641 yyval = yyvsp[1-yylen];
1642
1643 ]b4_locations_if(
1644 [[ /* Default location. */
1645 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);]])[
1646 YY_REDUCE_PRINT (yyn);]b4_lac_if([[
1647 {
1648 int yychar_backup = yychar;
1649 switch (yyn)
1650 {
1651 ]b4_user_actions[
1652 default: break;
1653 }
1654 if (yychar_backup != yychar)
1655 YY_LAC_DISCARD ("yychar change");
1656 }]], [[
1657 switch (yyn)
1658 {
1659 ]b4_user_actions[
1660 default: break;
1661 }]])[
1662 /* User semantic actions sometimes alter yychar, and that requires
1663 that yytoken be updated with the new translation. We take the
1664 approach of translating immediately before every use of yytoken.
1665 One alternative is translating here after every semantic action,
1666 but that translation would be missed if the semantic action invokes
1667 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1668 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1669 incorrect destructor might then be invoked immediately. In the
1670 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1671 to an incorrect destructor call or verbose syntax error message
1672 before the lookahead is translated. */
1673 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1674
1675 YYPOPSTACK (yylen);
1676 yylen = 0;
1677 YY_STACK_PRINT (yyss, yyssp);
1678
1679 *++yyvsp = yyval;]b4_locations_if([
1680 *++yylsp = yyloc;])[
1681
1682 /* Now `shift' the result of the reduction. Determine what state
1683 that goes to, based on the state we popped back to and the rule
1684 number reduced by. */
1685
1686 yyn = yyr1[yyn];
1687
1688 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1689 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1690 yystate = yytable[yystate];
1691 else
1692 yystate = yydefgoto[yyn - YYNTOKENS];
1693
1694 goto yynewstate;
1695
1696
1697 /*------------------------------------.
1698 | yyerrlab -- here on detecting error |
1699 `------------------------------------*/
1700 yyerrlab:
1701 /* Make sure we have latest lookahead translation. See comments at
1702 user semantic actions for why this is necessary. */
1703 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1704
1705 /* If not already recovering from an error, report this error. */
1706 if (!yyerrstatus)
1707 {
1708 ++yynerrs;
1709 #if ! YYERROR_VERBOSE
1710 yyerror (]b4_yyerror_args[YY_("syntax error"));
1711 #else
1712 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, yyssp, \
1713 yytoken)
1714 {
1715 char const *yymsgp = YY_("syntax error");
1716 int yysyntax_error_status;]b4_lac_if([[
1717 if (yychar != YYEMPTY)
1718 YY_LAC_ESTABLISH;]])[
1719 yysyntax_error_status = YYSYNTAX_ERROR;
1720 if (yysyntax_error_status == 0)
1721 yymsgp = yymsg;
1722 else if (yysyntax_error_status == 1)
1723 {
1724 if (yymsg != yymsgbuf)
1725 YYSTACK_FREE (yymsg);
1726 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1727 if (!yymsg)
1728 {
1729 yymsg = yymsgbuf;
1730 yymsg_alloc = sizeof yymsgbuf;
1731 yysyntax_error_status = 2;
1732 }
1733 else
1734 {
1735 yysyntax_error_status = YYSYNTAX_ERROR;
1736 yymsgp = yymsg;
1737 }
1738 }
1739 yyerror (]b4_yyerror_args[yymsgp);
1740 if (yysyntax_error_status == 2)
1741 goto yyexhaustedlab;
1742 }
1743 # undef YYSYNTAX_ERROR
1744 #endif
1745 }
1746
1747 ]b4_locations_if([[ yyerror_range[1] = yylloc;]])[
1748
1749 if (yyerrstatus == 3)
1750 {
1751 /* If just tried and failed to reuse lookahead token after an
1752 error, discard it. */
1753
1754 if (yychar <= YYEOF)
1755 {
1756 /* Return failure if at end of input. */
1757 if (yychar == YYEOF)
1758 YYABORT;
1759 }
1760 else
1761 {
1762 yydestruct ("Error: discarding",
1763 yytoken, &yylval]b4_locations_if([, &yylloc])[]b4_user_args[);
1764 yychar = YYEMPTY;
1765 }
1766 }
1767
1768 /* Else will try to reuse lookahead token after shifting the error
1769 token. */
1770 goto yyerrlab1;
1771
1772
1773 /*---------------------------------------------------.
1774 | yyerrorlab -- error raised explicitly by YYERROR. |
1775 `---------------------------------------------------*/
1776 yyerrorlab:
1777
1778 /* Pacify compilers like GCC when the user code never invokes
1779 YYERROR and the label yyerrorlab therefore never appears in user
1780 code. */
1781 if (/*CONSTCOND*/ 0)
1782 goto yyerrorlab;
1783
1784 ]b4_locations_if([[ yyerror_range[1] = yylsp[1-yylen];
1785 ]])[ /* Do not reclaim the symbols of the rule which action triggered
1786 this YYERROR. */
1787 YYPOPSTACK (yylen);
1788 yylen = 0;
1789 YY_STACK_PRINT (yyss, yyssp);
1790 yystate = *yyssp;
1791 goto yyerrlab1;
1792
1793
1794 /*-------------------------------------------------------------.
1795 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1796 `-------------------------------------------------------------*/
1797 yyerrlab1:
1798 yyerrstatus = 3; /* Each real token shifted decrements this. */
1799
1800 for (;;)
1801 {
1802 yyn = yypact[yystate];
1803 if (!yypact_value_is_default (yyn))
1804 {
1805 yyn += YYTERROR;
1806 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1807 {
1808 yyn = yytable[yyn];
1809 if (0 < yyn)
1810 break;
1811 }
1812 }
1813
1814 /* Pop the current state because it cannot handle the error token. */
1815 if (yyssp == yyss)
1816 YYABORT;
1817
1818 ]b4_locations_if([[ yyerror_range[1] = *yylsp;]])[
1819 yydestruct ("Error: popping",
1820 yystos[yystate], yyvsp]b4_locations_if([, yylsp])[]b4_user_args[);
1821 YYPOPSTACK (1);
1822 yystate = *yyssp;
1823 YY_STACK_PRINT (yyss, yyssp);
1824 }]b4_lac_if([[
1825
1826 /* If the stack popping above didn't lose the initial context for the
1827 current lookahead token, the shift below will for sure. */
1828 YY_LAC_DISCARD ("error recovery");]])[
1829
1830 *++yyvsp = yylval;
1831 ]b4_locations_if([[
1832 yyerror_range[2] = yylloc;
1833 /* Using YYLLOC is tempting, but would change the location of
1834 the lookahead. YYLOC is available though. */
1835 YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
1836 *++yylsp = yyloc;]])[
1837
1838 /* Shift the error token. */
1839 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1840
1841 yystate = yyn;
1842 goto yynewstate;
1843
1844
1845 /*-------------------------------------.
1846 | yyacceptlab -- YYACCEPT comes here. |
1847 `-------------------------------------*/
1848 yyacceptlab:
1849 yyresult = 0;
1850 goto yyreturn;
1851
1852 /*-----------------------------------.
1853 | yyabortlab -- YYABORT comes here. |
1854 `-----------------------------------*/
1855 yyabortlab:
1856 yyresult = 1;
1857 goto yyreturn;
1858
1859 #if ]b4_lac_if([[1]], [[!defined(yyoverflow) || YYERROR_VERBOSE]])[
1860 /*-------------------------------------------------.
1861 | yyexhaustedlab -- memory exhaustion comes here. |
1862 `-------------------------------------------------*/
1863 yyexhaustedlab:
1864 yyerror (]b4_yyerror_args[YY_("memory exhausted"));
1865 yyresult = 2;
1866 /* Fall through. */
1867 #endif
1868
1869 yyreturn:
1870 if (yychar != YYEMPTY)
1871 {
1872 /* Make sure we have latest lookahead translation. See comments at
1873 user semantic actions for why this is necessary. */
1874 yytoken = YYTRANSLATE (yychar);
1875 yydestruct ("Cleanup: discarding lookahead",
1876 yytoken, &yylval]b4_locations_if([, &yylloc])[]b4_user_args[);
1877 }
1878 /* Do not reclaim the symbols of the rule which action triggered
1879 this YYABORT or YYACCEPT. */
1880 YYPOPSTACK (yylen);
1881 YY_STACK_PRINT (yyss, yyssp);
1882 while (yyssp != yyss)
1883 {
1884 yydestruct ("Cleanup: popping",
1885 yystos[*yyssp], yyvsp]b4_locations_if([, yylsp])[]b4_user_args[);
1886 YYPOPSTACK (1);
1887 }
1888 #ifndef yyoverflow
1889 if (yyss != yyssa)
1890 YYSTACK_FREE (yyss);
1891 #endif]b4_push_if([[
1892 yyps->yynew = 1;
1893
1894 yypushreturn:]])[
1895 #if YYERROR_VERBOSE
1896 if (yymsg != yymsgbuf)
1897 YYSTACK_FREE (yymsg);
1898 #endif
1899 /* Make sure YYID is used. */
1900 return YYID (yyresult);
1901 }
1902
1903 ]b4_epilogue[]dnl
1904 b4_defines_if(
1905 [@output(b4_spec_defines_file@)@
1906 b4_copyright([Interface for Bison's Yacc-like parsers in C])dnl
1907
1908 b4_percent_code_get([[requires]])[]dnl
1909
1910 b4_token_enums_defines(b4_tokens)
1911
1912 [#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1913 ]m4_ifdef([b4_stype],
1914 [[typedef union ]b4_union_name[
1915 {
1916 ]b4_user_stype[
1917 } YYSTYPE;
1918 # define YYSTYPE_IS_TRIVIAL 1]],
1919 [m4_if(b4_tag_seen_flag, 0,
1920 [[typedef int YYSTYPE;
1921 # define YYSTYPE_IS_TRIVIAL 1]])])[
1922 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1923 # define YYSTYPE_IS_DECLARED 1
1924 #endif
1925
1926 ]b4_pure_if([], [[extern YYSTYPE ]b4_prefix[lval;]])
1927
1928 b4_locations_if(
1929 [#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
1930 typedef struct YYLTYPE
1931 {
1932 int first_line;
1933 int first_column;
1934 int last_line;
1935 int last_column;
1936 } YYLTYPE;
1937 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
1938 # define YYLTYPE_IS_DECLARED 1
1939 # define YYLTYPE_IS_TRIVIAL 1
1940 #endif
1941
1942 ]b4_pure_if([], [[extern YYLTYPE ]b4_prefix[lloc;]])
1943 )dnl b4_locations_if
1944 b4_push_if([[
1945 #ifndef YYPUSH_DECLS
1946 # define YYPUSH_DECLS
1947 struct ]b4_prefix[pstate;
1948 typedef struct ]b4_prefix[pstate ]b4_prefix[pstate;
1949 enum { YYPUSH_MORE = 4 };
1950 ]b4_pull_if([b4_c_function_decl([b4_prefix[parse]], [[int]], b4_parse_param)
1951 ])b4_c_function_decl([b4_prefix[push_parse]], [[int]],
1952 [[b4_prefix[pstate *yyps]], [[yyps]]]b4_pure_if([,
1953 [[[int yypushed_char]], [[yypushed_char]]],
1954 [[[YYSTYPE const *yypushed_val]], [[yypushed_val]]]b4_locations_if([,
1955 [[[YYLTYPE const *yypushed_loc]], [[yypushed_loc]]]])])m4_ifset([b4_parse_param], [,
1956 b4_parse_param]))
1957 b4_pull_if([b4_c_function_decl([b4_prefix[pull_parse]], [[int]],
1958 [[b4_prefix[pstate *yyps]], [[yyps]]]m4_ifset([b4_parse_param], [,
1959 b4_parse_param]))])
1960 b4_c_function_decl([b4_prefix[pstate_new]], [b4_prefix[pstate *]],
1961 [[[void]], []])
1962 b4_c_function_decl([b4_prefix[pstate_delete]], [[void]],
1963 [[b4_prefix[pstate *yyps]], [[yyps]]])[
1964 #endif
1965 ]])
1966 b4_percent_code_get([[provides]])[]dnl
1967 ])dnl b4_defines_if
1968 m4_divert_pop(0)
1969 m4_popdef([b4_copyright_years])