]> git.saurik.com Git - bison.git/blame_incremental - data/yacc.c
* data/yacc.c: Say "parser skeleton" rather than "file", since
[bison.git] / data / yacc.c
... / ...
CommitLineData
1m4_divert(-1) -*- C -*-
2
3# Yacc compatible skeleton for Bison
4
5# Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005
6# Free Software Foundation, Inc.
7
8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 2 of the License, or
11# (at your option) any later version.
12
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17
18# You should have received a copy of the GNU General Public License
19# along with this program; if not, write to the Free Software
20# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21# 02110-1301 USA
22
23
24
25## ---------------- ##
26## Default values. ##
27## ---------------- ##
28
29# Stack parameters.
30m4_define_default([b4_stack_depth_max], [10000])
31m4_define_default([b4_stack_depth_init], [200])
32
33
34## ------------------------ ##
35## Pure/impure interfaces. ##
36## ------------------------ ##
37
38
39# b4_yacc_pure_if(IF-TRUE, IF-FALSE)
40# ----------------------------------
41# Expand IF-TRUE, if %pure-parser and %parse-param, IF-FALSE otherwise.
42m4_define([b4_yacc_pure_if],
43[b4_pure_if([m4_ifset([b4_parse_param],
44 [$1], [$2])],
45 [$2])])
46
47
48# b4_yyerror_args
49# ---------------
50# Arguments passed to yyerror: user args plus yylloc.
51m4_define([b4_yyerror_args],
52[b4_yacc_pure_if([b4_location_if([&yylloc, ])])dnl
53m4_ifset([b4_parse_param], [b4_c_args(b4_parse_param), ])])
54
55
56# b4_lex_param
57# ------------
58# Accumulate in b4_lex_param all the yylex arguments.
59# b4_lex_param arrives quoted twice, but we want to keep only one level.
60m4_define([b4_lex_param],
61m4_dquote(b4_pure_if([[[[YYSTYPE *]], [[&yylval]]][]dnl
62b4_location_if([, [[YYLTYPE *], [&yylloc]]])m4_ifdef([b4_lex_param], [, ])])dnl
63m4_ifdef([b4_lex_param], b4_lex_param)))
64
65
66
67## ------------ ##
68## Data Types. ##
69## ------------ ##
70
71# b4_int_type(MIN, MAX)
72# ---------------------
73# Return the smallest int type able to handle numbers ranging from
74# MIN to MAX (included). We overwrite the version from c.m4 which relies
75# on "signed char" which is not portable to old K&R compilers.
76m4_define([b4_int_type],
77[m4_if(b4_ints_in($@, [0], [255]), [1], [unsigned char],
78 b4_ints_in($@, [-128], [127]), [1], [yysigned_char],
79
80 b4_ints_in($@, [0], [65535]), [1], [unsigned short int],
81 b4_ints_in($@, [-32768], [32767]), [1], [short int],
82
83 m4_eval([0 <= $1]), [1], [unsigned int],
84
85 [int])])
86
87
88## ----------------- ##
89## Semantic Values. ##
90## ----------------- ##
91
92
93# b4_lhs_value([TYPE])
94# --------------------
95# Expansion of $<TYPE>$.
96m4_define([b4_lhs_value],
97[(yyval[]m4_ifval([$1], [.$1]))])
98
99
100# b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
101# --------------------------------------
102# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
103# symbols on RHS.
104m4_define([b4_rhs_value],
105[(yyvsp@{($2) - ($1)@}m4_ifval([$3], [.$3]))])
106
107
108
109## ----------- ##
110## Locations. ##
111## ----------- ##
112
113# b4_lhs_location()
114# -----------------
115# Expansion of @$.
116m4_define([b4_lhs_location],
117[(yyloc)])
118
119
120# b4_rhs_location(RULE-LENGTH, NUM)
121# ---------------------------------
122# Expansion of @NUM, where the current rule has RULE-LENGTH symbols
123# on RHS.
124m4_define([b4_rhs_location],
125[(yylsp@{($2) - ($1)@})])
126
127
128
129## --------------------------------------------------------- ##
130## Defining symbol actions, e.g., printers and destructors. ##
131## --------------------------------------------------------- ##
132
133# We do want M4 expansion after # for CPP macros.
134m4_changecom()
135m4_divert(0)dnl
136@output @output_parser_name@
137b4_copyright([Skeleton parser for Yacc-like parsing with Bison],
138 [1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005])[
139
140/* As a special exception, when this parser skeleton is copied by
141 Bison into a Bison output file, you may use that output file
142 without restriction. This special exception was added by the Free
143 Software Foundation for C LALR(1) parsers in version 1.24 of
144 Bison. */
145
146/* C LALR(1) parser skeleton written by Richard Stallman, by
147 simplifying the original so-called "semantic" parser. */
148
149/* All symbols defined below should begin with yy or YY, to avoid
150 infringing on user name space. This should be done even for local
151 variables, as they might otherwise be expanded by user macros.
152 There are some unavoidable exceptions within include files to
153 define necessary library symbols; they are noted "INFRINGES ON
154 USER NAME SPACE" below. */
155
156]b4_identification
157m4_if(b4_prefix[], [yy], [],
158[/* Substitute the variable and function names. */
159#define yyparse b4_prefix[]parse
160#define yylex b4_prefix[]lex
161#define yyerror b4_prefix[]error
162#define yylval b4_prefix[]lval
163#define yychar b4_prefix[]char
164#define yydebug b4_prefix[]debug
165#define yynerrs b4_prefix[]nerrs
166b4_location_if([#define yylloc b4_prefix[]lloc])])[
167
168]b4_token_enums_defines(b4_tokens)[
169
170/* Copy the first part of user declarations. */
171]b4_pre_prologue[
172
173/* Enabling traces. */
174#ifndef YYDEBUG
175# define YYDEBUG ]b4_debug[
176#endif
177
178/* Enabling verbose error messages. */
179#ifdef YYERROR_VERBOSE
180# undef YYERROR_VERBOSE
181# define YYERROR_VERBOSE 1
182#else
183# define YYERROR_VERBOSE ]b4_error_verbose[
184#endif
185
186/* Enabling the token table. */
187#ifndef YYTOKEN_TABLE
188# define YYTOKEN_TABLE ]b4_token_table[
189#endif
190
191#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
192]m4_ifdef([b4_stype],
193[b4_syncline([b4_stype_line], [b4_file_name])
194typedef union m4_bregexp(b4_stype, [^{], [YYSTYPE ])b4_stype YYSTYPE;
195/* Line __line__ of yacc.c. */
196b4_syncline([@oline@], [@ofile@])],
197[typedef int YYSTYPE;])[
198# define yystype YYSTYPE /* obsolescent; will be withdrawn */
199# define YYSTYPE_IS_DECLARED 1
200# define YYSTYPE_IS_TRIVIAL 1
201#endif
202
203]b4_location_if([#if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
204typedef struct YYLTYPE
205{
206 int first_line;
207 int first_column;
208 int last_line;
209 int last_column;
210} YYLTYPE;
211# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
212# define YYLTYPE_IS_DECLARED 1
213# define YYLTYPE_IS_TRIVIAL 1
214#endif
215])[
216
217/* Copy the second part of user declarations. */
218]b4_post_prologue
219
220/* Line __line__ of yacc.c. */
221b4_syncline([@oline@], [@ofile@])[
222
223/* Define YYMODERN_C if this compiler supports C89 or better. If
224 __STDC__ is defined, the compiler is modern. IBM xlc 7.0 when run
225 as 'cc' doesn't define __STDC__ (or __STDC_VERSION__) for pedantic
226 reasons, but it defines __C99__FUNC__ so check that as well.
227 Consider a C++ compiler to be modern if it defines __cplusplus. */
228#ifndef YYMODERN_C
229# if defined (__STDC__) || defined (__C99__FUNC__) || defined (__cplusplus)
230# define YYMODERN_C 1
231# else
232# define YYMODERN_C 0
233# endif
234#endif
235
236#ifndef YYSIZE_T
237# if defined (__SIZE_TYPE__)
238# define YYSIZE_T __SIZE_TYPE__
239# elif defined (size_t)
240# define YYSIZE_T size_t
241# elif ! defined (YYSIZE_T) && YYMODERN_C
242# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
243# define YYSIZE_T size_t
244# else
245# define YYSIZE_T unsigned int
246# endif
247#endif
248
249#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
250
251#ifndef YY_
252# if YYENABLE_NLS
253# if ENABLE_NLS
254# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
255# define YY_(msgid) dgettext ("bison-runtime", msgid)
256# endif
257# endif
258# ifndef YY_
259# define YY_(msgid) msgid
260# endif
261#endif
262
263/* Suppress unused-variable warnings by "using" E. */
264#define YYUSE(e) do {;} while (/*CONSTCOND*/ 0 && (e))
265
266#if ! defined (yyoverflow) || YYERROR_VERBOSE
267
268/* The parser invokes alloca or malloc; define the necessary symbols. */
269
270# ifdef YYSTACK_USE_ALLOCA
271# if YYSTACK_USE_ALLOCA
272# ifdef __GNUC__
273# define YYSTACK_ALLOC __builtin_alloca
274# elif defined (__BUILTIN_VA_ARG_INCR)
275# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
276# elif defined (_AIX)
277# define YYSTACK_ALLOC __alloca
278# elif defined (_MSC_VER)
279# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
280# define alloca _alloca
281# else
282# define YYSTACK_ALLOC alloca
283# if ! defined (_ALLOCA_H) && ! defined (_STDLIB_H) && YYMODERN_C
284# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
285# ifndef _STDLIB_H
286# define _STDLIB_H 1
287# endif
288# endif
289# endif
290# endif
291# endif
292
293# ifdef YYSTACK_ALLOC
294 /* Pacify GCC's `empty if-body' warning. */
295# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
296# ifndef YYSTACK_ALLOC_MAXIMUM
297 /* The OS might guarantee only one guard page at the bottom of the stack,
298 and a page size can be as small as 4096 bytes. So we cannot safely
299 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
300 to allow for a few compiler-allocated temporary stack slots. */
301# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
302# endif
303# else
304# define YYSTACK_ALLOC YYMALLOC
305# define YYSTACK_FREE YYFREE
306# ifndef YYSTACK_ALLOC_MAXIMUM
307# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
308# endif
309# ifdef __cplusplus
310extern "C" {
311# endif
312# ifndef YYMALLOC
313# define YYMALLOC malloc
314# if ! defined (malloc) && ! defined (_STDLIB_H) && YYMODERN_C
315void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
316# endif
317# endif
318# ifndef YYFREE
319# define YYFREE free
320# if ! defined (free) && ! defined (_STDLIB_H) && YYMODERN_C
321void free (void *); /* INFRINGES ON USER NAME SPACE */
322# endif
323# endif
324# ifdef __cplusplus
325}
326# endif
327# endif
328#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
329
330
331#if (! defined (yyoverflow) \
332 && (! defined (__cplusplus) \
333 || (]b4_location_if([[defined (YYLTYPE_IS_TRIVIAL) && YYLTYPE_IS_TRIVIAL \
334 && ]])[defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
335
336/* A type that is properly aligned for any stack member. */
337union yyalloc
338{
339 short int yyss;
340 YYSTYPE yyvs;
341 ]b4_location_if([ YYLTYPE yyls;
342])dnl
343[};
344
345/* The size of the maximum gap between one aligned stack and the next. */
346# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
347
348/* The size of an array large to enough to hold all stacks, each with
349 N elements. */
350]b4_location_if(
351[# define YYSTACK_BYTES(N) \
352 ((N) * (sizeof (short int) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
353 + 2 * YYSTACK_GAP_MAXIMUM)],
354[# define YYSTACK_BYTES(N) \
355 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
356 + YYSTACK_GAP_MAXIMUM)])[
357
358/* Copy COUNT objects from FROM to TO. The source and destination do
359 not overlap. */
360# ifndef YYCOPY
361# if defined (__GNUC__) && 1 < __GNUC__
362# define YYCOPY(To, From, Count) \
363 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
364# else
365# define YYCOPY(To, From, Count) \
366 do \
367 { \
368 YYSIZE_T yyi; \
369 for (yyi = 0; yyi < (Count); yyi++) \
370 (To)[yyi] = (From)[yyi]; \
371 } \
372 while (/*CONSTCOND*/ 0)
373# endif
374# endif
375
376/* Relocate STACK from its old location to the new one. The
377 local variables YYSIZE and YYSTACKSIZE give the old and new number of
378 elements in the stack, and YYPTR gives the new location of the
379 stack. Advance YYPTR to a properly aligned location for the next
380 stack. */
381# define YYSTACK_RELOCATE(Stack) \
382 do \
383 { \
384 YYSIZE_T yynewbytes; \
385 YYCOPY (&yyptr->Stack, Stack, yysize); \
386 Stack = &yyptr->Stack; \
387 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
388 yyptr += yynewbytes / sizeof (*yyptr); \
389 } \
390 while (/*CONSTCOND*/ 0)
391
392#endif
393
394#if YYMODERN_C
395 typedef signed char yysigned_char;
396#else
397 typedef short int yysigned_char;
398#endif
399
400/* YYFINAL -- State number of the termination state. */
401#define YYFINAL ]b4_final_state_number[
402/* YYLAST -- Last index in YYTABLE. */
403#define YYLAST ]b4_last[
404
405/* YYNTOKENS -- Number of terminals. */
406#define YYNTOKENS ]b4_tokens_number[
407/* YYNNTS -- Number of nonterminals. */
408#define YYNNTS ]b4_nterms_number[
409/* YYNRULES -- Number of rules. */
410#define YYNRULES ]b4_rules_number[
411/* YYNRULES -- Number of states. */
412#define YYNSTATES ]b4_states_number[
413
414/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
415#define YYUNDEFTOK ]b4_undef_token_number[
416#define YYMAXUTOK ]b4_user_token_number_max[
417
418#define YYTRANSLATE(YYX) \
419 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
420
421/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
422static const ]b4_int_type_for([b4_translate])[ yytranslate[] =
423{
424 ]b4_translate[
425};
426
427#if YYDEBUG
428/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
429 YYRHS. */
430static const ]b4_int_type_for([b4_prhs])[ yyprhs[] =
431{
432 ]b4_prhs[
433};
434
435/* YYRHS -- A `-1'-separated list of the rules' RHS. */
436static const ]b4_int_type_for([b4_rhs])[ yyrhs[] =
437{
438 ]b4_rhs[
439};
440
441/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
442static const ]b4_int_type_for([b4_rline])[ yyrline[] =
443{
444 ]b4_rline[
445};
446#endif
447
448#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
449/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
450 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
451static const char *const yytname[] =
452{
453 ]b4_tname[
454};
455#endif
456
457# ifdef YYPRINT
458/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
459 token YYLEX-NUM. */
460static const ]b4_int_type_for([b4_toknum])[ yytoknum[] =
461{
462 ]b4_toknum[
463};
464# endif
465
466/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
467static const ]b4_int_type_for([b4_r1])[ yyr1[] =
468{
469 ]b4_r1[
470};
471
472/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
473static const ]b4_int_type_for([b4_r2])[ yyr2[] =
474{
475 ]b4_r2[
476};
477
478/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
479 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
480 means the default is an error. */
481static const ]b4_int_type_for([b4_defact])[ yydefact[] =
482{
483 ]b4_defact[
484};
485
486/* YYDEFGOTO[NTERM-NUM]. */
487static const ]b4_int_type_for([b4_defgoto])[ yydefgoto[] =
488{
489 ]b4_defgoto[
490};
491
492/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
493 STATE-NUM. */
494#define YYPACT_NINF ]b4_pact_ninf[
495static const ]b4_int_type_for([b4_pact])[ yypact[] =
496{
497 ]b4_pact[
498};
499
500/* YYPGOTO[NTERM-NUM]. */
501static const ]b4_int_type_for([b4_pgoto])[ yypgoto[] =
502{
503 ]b4_pgoto[
504};
505
506/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
507 positive, shift that token. If negative, reduce the rule which
508 number is the opposite. If zero, do what YYDEFACT says.
509 If YYTABLE_NINF, syntax error. */
510#define YYTABLE_NINF ]b4_table_ninf[
511static const ]b4_int_type_for([b4_table])[ yytable[] =
512{
513 ]b4_table[
514};
515
516static const ]b4_int_type_for([b4_check])[ yycheck[] =
517{
518 ]b4_check[
519};
520
521/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
522 symbol of state STATE-NUM. */
523static const ]b4_int_type_for([b4_stos])[ yystos[] =
524{
525 ]b4_stos[
526};
527
528#define yyerrok (yyerrstatus = 0)
529#define yyclearin (yychar = YYEMPTY)
530#define YYEMPTY (-2)
531#define YYEOF 0
532
533#define YYACCEPT goto yyacceptlab
534#define YYABORT goto yyabortlab
535#define YYERROR goto yyerrorlab
536
537
538/* Like YYERROR except do call yyerror. This remains here temporarily
539 to ease the transition to the new meaning of YYERROR, for GCC.
540 Once GCC version 2 has supplanted version 1, this can go. */
541
542#define YYFAIL goto yyerrlab
543
544#define YYRECOVERING() (!!yyerrstatus)
545
546#define YYBACKUP(Token, Value) \
547do \
548 if (yychar == YYEMPTY && yylen == 1) \
549 { \
550 yychar = (Token); \
551 yylval = (Value); \
552 yytoken = YYTRANSLATE (yychar); \
553 YYPOPSTACK; \
554 goto yybackup; \
555 } \
556 else \
557 { \
558 yyerror (]b4_yyerror_args[YY_("syntax error: cannot back up")); \
559 YYERROR; \
560 } \
561while (/*CONSTCOND*/ 0)
562
563
564#define YYTERROR 1
565#define YYERRCODE 256
566
567
568/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
569 If N is 0, then set CURRENT to the empty location which ends
570 the previous symbol: RHS[0] (always defined). */
571
572#define YYRHSLOC(Rhs, K) ((Rhs)[K])
573#ifndef YYLLOC_DEFAULT
574# define YYLLOC_DEFAULT(Current, Rhs, N) \
575 do \
576 if (N) \
577 { \
578 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
579 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
580 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
581 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
582 } \
583 else \
584 { \
585 (Current).first_line = (Current).last_line = \
586 YYRHSLOC (Rhs, 0).last_line; \
587 (Current).first_column = (Current).last_column = \
588 YYRHSLOC (Rhs, 0).last_column; \
589 } \
590 while (/*CONSTCOND*/ 0)
591#endif
592
593
594/* YY_LOCATION_PRINT -- Print the location on the stream.
595 This macro was not mandated originally: define only if we know
596 we won't break user code: when these are the locations we know. */
597
598#ifndef YY_LOCATION_PRINT
599# if YYLTYPE_IS_TRIVIAL
600# define YY_LOCATION_PRINT(File, Loc) \
601 fprintf (File, "%d.%d-%d.%d", \
602 (Loc).first_line, (Loc).first_column, \
603 (Loc).last_line, (Loc).last_column)
604# else
605# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
606# endif
607#endif
608
609
610/* YYLEX -- calling `yylex' with the right arguments. */
611
612#ifdef YYLEX_PARAM
613# define YYLEX yylex (]b4_pure_if([&yylval[]b4_location_if([, &yylloc]), ])[YYLEX_PARAM)
614#else
615# define YYLEX ]b4_c_function_call([yylex], [int], b4_lex_param)[
616#endif
617
618/* Enable debugging if requested. */
619#if YYDEBUG
620
621# ifndef YYFPRINTF
622# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
623# define YYFPRINTF fprintf
624# endif
625
626# define YYDPRINTF(Args) \
627do { \
628 if (yydebug) \
629 YYFPRINTF Args; \
630} while (/*CONSTCOND*/ 0)
631
632# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
633do { \
634 if (yydebug) \
635 { \
636 YYFPRINTF (stderr, "%s ", Title); \
637 yysymprint (stderr, \
638 Type, Value]b4_location_if([, Location])[]b4_user_args[); \
639 YYFPRINTF (stderr, "\n"); \
640 } \
641} while (/*CONSTCOND*/ 0)
642
643]b4_yysymprint_generate([b4_c_function_def])[
644
645/*------------------------------------------------------------------.
646| yy_stack_print -- Print the state stack from its BOTTOM up to its |
647| TOP (included). |
648`------------------------------------------------------------------*/
649
650]b4_c_function_def([yy_stack_print], [static void],
651 [[short int *bottom], [bottom]],
652 [[short int *top], [top]])[
653{
654 YYFPRINTF (stderr, "Stack now");
655 for (/* Nothing. */; bottom <= top; ++bottom)
656 YYFPRINTF (stderr, " %d", *bottom);
657 YYFPRINTF (stderr, "\n");
658}
659
660# define YY_STACK_PRINT(Bottom, Top) \
661do { \
662 if (yydebug) \
663 yy_stack_print ((Bottom), (Top)); \
664} while (/*CONSTCOND*/ 0)
665
666
667/*------------------------------------------------.
668| Report that the YYRULE is going to be reduced. |
669`------------------------------------------------*/
670
671]b4_c_function_def([yy_reduce_print], [static void],
672 [[YYSTYPE *yyvsp], [yyvsp]],
673 b4_location_if([[[YYLTYPE *yylsp], [yylsp]],])
674 [[int yyrule], [yyrule]]m4_ifset([b4_parse_param], [,])
675 b4_parse_param)[
676{
677 int yynrhs = yyr2[yyrule];
678 int yyi;
679 unsigned long int yylno = yyrline[yyrule];
680 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
681 yyrule - 1, yylno);
682 /* The symbols being reduced. */
683 for (yyi = 0; yyi < yynrhs; yyi++)
684 {
685 fprintf (stderr, " $%d = ", yyi + 1);
686 yysymprint (stderr, yyrhs[yyprhs[yyrule] + yyi],
687 &]b4_rhs_value(yynrhs, yyi + 1)[
688 ]b4_location_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl
689 b4_user_args[);
690 fprintf (stderr, "\n");
691 }
692}
693
694# define YY_REDUCE_PRINT(Rule) \
695do { \
696 if (yydebug) \
697 yy_reduce_print (yyvsp, ]b4_location_if([yylsp, ])[Rule]b4_user_args[); \
698} while (/*CONSTCOND*/ 0)
699
700/* Nonzero means print parse trace. It is left uninitialized so that
701 multiple parsers can coexist. */
702int yydebug;
703#else /* !YYDEBUG */
704# define YYDPRINTF(Args)
705# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
706# define YY_STACK_PRINT(Bottom, Top)
707# define YY_REDUCE_PRINT(Rule)
708#endif /* !YYDEBUG */
709
710
711/* YYINITDEPTH -- initial size of the parser's stacks. */
712#ifndef YYINITDEPTH
713# define YYINITDEPTH ]b4_stack_depth_init[
714#endif
715
716/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
717 if the built-in stack extension method is used).
718
719 Do not make this value too large; the results are undefined if
720 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
721 evaluated with infinite-precision integer arithmetic. */
722
723#ifndef YYMAXDEPTH
724# define YYMAXDEPTH ]b4_stack_depth_max[
725#endif
726
727\f
728
729#if YYERROR_VERBOSE
730
731# ifndef yystrlen
732# if defined (__GLIBC__) && defined (_STRING_H)
733# define yystrlen strlen
734# else
735/* Return the length of YYSTR. */
736static YYSIZE_T
737# if YYMODERN_C
738yystrlen (const char *yystr)
739# else
740yystrlen (yystr)
741 const char *yystr;
742# endif
743{
744 const char *yys = yystr;
745
746 while (*yys++ != '\0')
747 continue;
748
749 return yys - yystr - 1;
750}
751# endif
752# endif
753
754# ifndef yystpcpy
755# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
756# define yystpcpy stpcpy
757# else
758/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
759 YYDEST. */
760static char *
761# if YYMODERN_C
762yystpcpy (char *yydest, const char *yysrc)
763# else
764yystpcpy (yydest, yysrc)
765 char *yydest;
766 const char *yysrc;
767# endif
768{
769 char *yyd = yydest;
770 const char *yys = yysrc;
771
772 while ((*yyd++ = *yys++) != '\0')
773 continue;
774
775 return yyd - 1;
776}
777# endif
778# endif
779
780# ifndef yytnamerr
781/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
782 quotes and backslashes, so that it's suitable for yyerror. The
783 heuristic is that double-quoting is unnecessary unless the string
784 contains an apostrophe, a comma, or backslash (other than
785 backslash-backslash). YYSTR is taken from yytname. If YYRES is
786 null, do not copy; instead, return the length of what the result
787 would have been. */
788static YYSIZE_T
789yytnamerr (char *yyres, const char *yystr)
790{
791 if (*yystr == '"')
792 {
793 size_t yyn = 0;
794 char const *yyp = yystr;
795
796 for (;;)
797 switch (*++yyp)
798 {
799 case '\'':
800 case ',':
801 goto do_not_strip_quotes;
802
803 case '\\':
804 if (*++yyp != '\\')
805 goto do_not_strip_quotes;
806 /* Fall through. */
807 default:
808 if (yyres)
809 yyres[yyn] = *yyp;
810 yyn++;
811 break;
812
813 case '"':
814 if (yyres)
815 yyres[yyn] = '\0';
816 return yyn;
817 }
818 do_not_strip_quotes: ;
819 }
820
821 if (! yyres)
822 return yystrlen (yystr);
823
824 return yystpcpy (yyres, yystr) - yyres;
825}
826# endif
827
828/* Copy into YYRESULT an error message about the unexpected token
829 YYCHAR while in state YYSTATE. Return the number of bytes copied,
830 including the terminating null byte. If YYRESULT is null, do not
831 copy anything; just return the number of bytes that would be
832 copied. As a special case, return 0 if an ordinary "syntax error"
833 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
834 size calculation. */
835static YYSIZE_T
836yysyntax_error (char *yyresult, int yystate, int yychar)
837{
838 int yyn = yypact[yystate];
839
840 if (! (YYPACT_NINF < yyn && yyn < YYLAST))
841 return 0;
842 else
843 {
844 int yytype = YYTRANSLATE (yychar);
845 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
846 YYSIZE_T yysize = yysize0;
847 YYSIZE_T yysize1;
848 int yysize_overflow = 0;
849 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
850 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
851 int yyx;
852
853# if 0
854 /* This is so xgettext sees the translatable formats that are
855 constructed on the fly. */
856 YY_("syntax error, unexpected %s");
857 YY_("syntax error, unexpected %s, expecting %s");
858 YY_("syntax error, unexpected %s, expecting %s or %s");
859 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
860 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
861# endif
862 char *yyfmt;
863 char const *yyf;
864 static char const yyunexpected[] = "syntax error, unexpected %s";
865 static char const yyexpecting[] = ", expecting %s";
866 static char const yyor[] = " or %s";
867 char yyformat[sizeof yyunexpected
868 + sizeof yyexpecting - 1
869 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
870 * (sizeof yyor - 1))];
871 char const *yyprefix = yyexpecting;
872
873 /* Start YYX at -YYN if negative to avoid negative indexes in
874 YYCHECK. */
875 int yyxbegin = yyn < 0 ? -yyn : 0;
876
877 /* Stay within bounds of both yycheck and yytname. */
878 int yychecklim = YYLAST - yyn;
879 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
880 int yycount = 1;
881
882 yyarg[0] = yytname[yytype];
883 yyfmt = yystpcpy (yyformat, yyunexpected);
884
885 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
886 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
887 {
888 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
889 {
890 yycount = 1;
891 yysize = yysize0;
892 yyformat[sizeof yyunexpected - 1] = '\0';
893 break;
894 }
895 yyarg[yycount++] = yytname[yyx];
896 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
897 yysize_overflow |= yysize1 < yysize;
898 yysize = yysize1;
899 yyfmt = yystpcpy (yyfmt, yyprefix);
900 yyprefix = yyor;
901 }
902
903 yyf = YY_(yyformat);
904 yysize1 = yysize + yystrlen (yyf);
905 yysize_overflow |= yysize1 < yysize;
906 yysize = yysize1;
907
908 if (yysize_overflow)
909 return YYSIZE_MAXIMUM;
910
911 if (yyresult)
912 {
913 /* Avoid sprintf, as that infringes on the user's name space.
914 Don't have undefined behavior even if the translation
915 produced a string with the wrong number of "%s"s. */
916 char *yyp = yyresult;
917 int yyi = 0;
918 while ((*yyp = *yyf))
919 {
920 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
921 {
922 yyp += yytnamerr (yyp, yyarg[yyi++]);
923 yyf += 2;
924 }
925 else
926 {
927 yyp++;
928 yyf++;
929 }
930 }
931 }
932 return yysize;
933 }
934}
935#endif /* YYERROR_VERBOSE */
936\f
937
938]b4_yydestruct_generate([b4_c_function_def])[
939\f
940
941/* Prevent warnings from -Wmissing-prototypes. */
942
943#ifdef YYPARSE_PARAM
944# if YYMODERN_C
945int yyparse (void *YYPARSE_PARAM);
946# else
947int yyparse ();
948# endif
949#else /* ! YYPARSE_PARAM */
950]b4_c_function_decl([yyparse], [int], b4_parse_param)[
951#endif /* ! YYPARSE_PARAM */
952
953
954]m4_divert_push([KILL])# ======================== M4 code.
955# b4_declare_parser_variables
956# ---------------------------
957# Declare the variables that are global, or local to YYPARSE if
958# pure-parser.
959m4_define([b4_declare_parser_variables],
960[/* The look-ahead symbol. */
961int yychar;
962
963/* The semantic value of the look-ahead symbol. */
964YYSTYPE yylval;
965
966/* Number of syntax errors so far. */
967int yynerrs;b4_location_if([
968/* Location data for the look-ahead symbol. */
969YYLTYPE yylloc;])
970])
971m4_divert_pop([KILL])dnl# ====================== End of M4 code.
972
973b4_pure_if([],
974 [b4_declare_parser_variables])
975
976
977/*----------.
978| yyparse. |
979`----------*/
980
981#ifdef YYPARSE_PARAM
982# if YYMODERN_C
983int yyparse (void *YYPARSE_PARAM)
984# else
985int yyparse (YYPARSE_PARAM)
986 void *YYPARSE_PARAM;
987# endif
988#else /* ! YYPARSE_PARAM */
989b4_c_function_def([yyparse], [int], b4_parse_param)
990#endif
991{[
992 ]b4_pure_if([b4_declare_parser_variables])[
993 int yystate;
994 int yyn;
995 int yyresult;
996 /* Number of tokens to shift before error messages enabled. */
997 int yyerrstatus;
998 /* Look-ahead token as an internal (translated) token number. */
999 int yytoken = 0;
1000#if YYERROR_VERBOSE
1001 /* Buffer for error messages, and its allocated size. */
1002 char yymsgbuf[128];
1003 char *yymsg = yymsgbuf;
1004 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1005#endif
1006
1007 /* Three stacks and their tools:
1008 `yyss': related to states,
1009 `yyvs': related to semantic values,
1010 `yyls': related to locations.
1011
1012 Refer to the stacks thru separate pointers, to allow yyoverflow
1013 to reallocate them elsewhere. */
1014
1015 /* The state stack. */
1016 short int yyssa[YYINITDEPTH];
1017 short int *yyss = yyssa;
1018 short int *yyssp;
1019
1020 /* The semantic value stack. */
1021 YYSTYPE yyvsa[YYINITDEPTH];
1022 YYSTYPE *yyvs = yyvsa;
1023 YYSTYPE *yyvsp;
1024
1025]b4_location_if(
1026[[ /* The location stack. */
1027 YYLTYPE yylsa[YYINITDEPTH];
1028 YYLTYPE *yyls = yylsa;
1029 YYLTYPE *yylsp;
1030 /* The locations where the error started and ended. */
1031 YYLTYPE yyerror_range[2];]])[
1032
1033#define YYPOPSTACK (yyvsp--, yyssp--]b4_location_if([, yylsp--])[)
1034
1035 YYSIZE_T yystacksize = YYINITDEPTH;
1036
1037 /* The variables used to return semantic value and location from the
1038 action routines. */
1039 YYSTYPE yyval;
1040]b4_location_if([ YYLTYPE yyloc;])[
1041
1042 /* When reducing, the number of symbols on the RHS of the reduced
1043 rule. */
1044 int yylen;
1045
1046 YYDPRINTF ((stderr, "Starting parse\n"));
1047
1048 yystate = 0;
1049 yyerrstatus = 0;
1050 yynerrs = 0;
1051 yychar = YYEMPTY; /* Cause a token to be read. */
1052
1053 /* Initialize stack pointers.
1054 Waste one element of value and location stack
1055 so that they stay on the same level as the state stack.
1056 The wasted elements are never initialized. */
1057
1058 yyssp = yyss;
1059 yyvsp = yyvs;
1060]b4_location_if([[ yylsp = yyls;
1061#if YYLTYPE_IS_TRIVIAL
1062 /* Initialize the default location before parsing starts. */
1063 yylloc.first_line = yylloc.last_line = 1;
1064 yylloc.first_column = yylloc.last_column = 0;
1065#endif
1066]])
1067m4_ifdef([b4_initial_action], [
1068m4_pushdef([b4_at_dollar], [m4_define([b4_at_dollar_used])yylloc])dnl
1069m4_pushdef([b4_dollar_dollar], [m4_define([b4_dollar_dollar_used])yylval])dnl
1070 /* User initialization code. */
1071b4_initial_action
1072m4_popdef([b4_dollar_dollar])dnl
1073m4_popdef([b4_at_dollar])dnl
1074/* Line __line__ of yacc.c. */
1075b4_syncline([@oline@], [@ofile@])
1076])dnl
1077m4_ifdef([b4_dollar_dollar_used],[[ yyvsp[0] = yylval;
1078]])dnl
1079m4_ifdef([b4_at_dollar_used], [[ yylsp[0] = yylloc;
1080]])dnl
1081[ goto yysetstate;
1082
1083/*------------------------------------------------------------.
1084| yynewstate -- Push a new state, which is found in yystate. |
1085`------------------------------------------------------------*/
1086 yynewstate:
1087 /* In all cases, when you get here, the value and location stacks
1088 have just been pushed. so pushing a state here evens the stacks.
1089 */
1090 yyssp++;
1091
1092 yysetstate:
1093 *yyssp = yystate;
1094
1095 if (yyss + yystacksize - 1 <= yyssp)
1096 {
1097 /* Get the current used size of the three stacks, in elements. */
1098 YYSIZE_T yysize = yyssp - yyss + 1;
1099
1100#ifdef yyoverflow
1101 {
1102 /* Give user a chance to reallocate the stack. Use copies of
1103 these so that the &'s don't force the real ones into
1104 memory. */
1105 YYSTYPE *yyvs1 = yyvs;
1106 short int *yyss1 = yyss;
1107]b4_location_if([ YYLTYPE *yyls1 = yyls;])[
1108
1109 /* Each stack pointer address is followed by the size of the
1110 data in use in that stack, in bytes. This used to be a
1111 conditional around just the two extra args, but that might
1112 be undefined if yyoverflow is a macro. */
1113 yyoverflow (YY_("memory exhausted"),
1114 &yyss1, yysize * sizeof (*yyssp),
1115 &yyvs1, yysize * sizeof (*yyvsp),
1116]b4_location_if([ &yyls1, yysize * sizeof (*yylsp),])[
1117 &yystacksize);
1118]b4_location_if([ yyls = yyls1;])[
1119 yyss = yyss1;
1120 yyvs = yyvs1;
1121 }
1122#else /* no yyoverflow */
1123# ifndef YYSTACK_RELOCATE
1124 goto yyexhaustedlab;
1125# else
1126 /* Extend the stack our own way. */
1127 if (YYMAXDEPTH <= yystacksize)
1128 goto yyexhaustedlab;
1129 yystacksize *= 2;
1130 if (YYMAXDEPTH < yystacksize)
1131 yystacksize = YYMAXDEPTH;
1132
1133 {
1134 short int *yyss1 = yyss;
1135 union yyalloc *yyptr =
1136 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1137 if (! yyptr)
1138 goto yyexhaustedlab;
1139 YYSTACK_RELOCATE (yyss);
1140 YYSTACK_RELOCATE (yyvs);
1141]b4_location_if([ YYSTACK_RELOCATE (yyls);])[
1142# undef YYSTACK_RELOCATE
1143 if (yyss1 != yyssa)
1144 YYSTACK_FREE (yyss1);
1145 }
1146# endif
1147#endif /* no yyoverflow */
1148
1149 yyssp = yyss + yysize - 1;
1150 yyvsp = yyvs + yysize - 1;
1151]b4_location_if([ yylsp = yyls + yysize - 1;])[
1152
1153 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1154 (unsigned long int) yystacksize));
1155
1156 if (yyss + yystacksize - 1 <= yyssp)
1157 YYABORT;
1158 }
1159
1160 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1161
1162 goto yybackup;
1163
1164/*-----------.
1165| yybackup. |
1166`-----------*/
1167yybackup:
1168
1169/* Do appropriate processing given the current state. */
1170/* Read a look-ahead token if we need one and don't already have one. */
1171/* yyresume: */
1172
1173 /* First try to decide what to do without reference to look-ahead token. */
1174
1175 yyn = yypact[yystate];
1176 if (yyn == YYPACT_NINF)
1177 goto yydefault;
1178
1179 /* Not known => get a look-ahead token if don't already have one. */
1180
1181 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1182 if (yychar == YYEMPTY)
1183 {
1184 YYDPRINTF ((stderr, "Reading a token: "));
1185 yychar = YYLEX;
1186 }
1187
1188 if (yychar <= YYEOF)
1189 {
1190 yychar = yytoken = YYEOF;
1191 YYDPRINTF ((stderr, "Now at end of input.\n"));
1192 }
1193 else
1194 {
1195 yytoken = YYTRANSLATE (yychar);
1196 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1197 }
1198
1199 /* If the proper action on seeing token YYTOKEN is to reduce or to
1200 detect an error, take that action. */
1201 yyn += yytoken;
1202 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1203 goto yydefault;
1204 yyn = yytable[yyn];
1205 if (yyn <= 0)
1206 {
1207 if (yyn == 0 || yyn == YYTABLE_NINF)
1208 goto yyerrlab;
1209 yyn = -yyn;
1210 goto yyreduce;
1211 }
1212
1213 if (yyn == YYFINAL)
1214 YYACCEPT;
1215
1216 /* Shift the look-ahead token. */
1217 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1218
1219 /* Discard the token being shifted unless it is eof. */
1220 if (yychar != YYEOF)
1221 yychar = YYEMPTY;
1222
1223 *++yyvsp = yylval;
1224]b4_location_if([ *++yylsp = yylloc;])[
1225
1226 /* Count tokens shifted since error; after three, turn off error
1227 status. */
1228 if (yyerrstatus)
1229 yyerrstatus--;
1230
1231 yystate = yyn;
1232 goto yynewstate;
1233
1234
1235/*-----------------------------------------------------------.
1236| yydefault -- do the default action for the current state. |
1237`-----------------------------------------------------------*/
1238yydefault:
1239 yyn = yydefact[yystate];
1240 if (yyn == 0)
1241 goto yyerrlab;
1242 goto yyreduce;
1243
1244
1245/*-----------------------------.
1246| yyreduce -- Do a reduction. |
1247`-----------------------------*/
1248yyreduce:
1249 /* yyn is the number of a rule to reduce with. */
1250 yylen = yyr2[yyn];
1251
1252 /* If YYLEN is nonzero, implement the default value of the action:
1253 `$$ = $1'.
1254
1255 Otherwise, the following line sets YYVAL to garbage.
1256 This behavior is undocumented and Bison
1257 users should not rely upon it. Assigning to YYVAL
1258 unconditionally makes the parser a bit smaller, and it avoids a
1259 GCC warning that YYVAL may be used uninitialized. */
1260 yyval = yyvsp[1-yylen];
1261
1262]b4_location_if(
1263[[ /* Default location. */
1264 YYLLOC_DEFAULT (yyloc, yylsp - yylen, yylen);]])[
1265 YY_REDUCE_PRINT (yyn);
1266 switch (yyn)
1267 {
1268 ]b4_actions[
1269 default: break;
1270 }
1271 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1272
1273/* Line __line__ of yacc.c. */
1274]b4_syncline([@oline@], [@ofile@])[
1275\f
1276 yyvsp -= yylen;
1277 yyssp -= yylen;
1278]b4_location_if([ yylsp -= yylen;])[
1279
1280 YY_STACK_PRINT (yyss, yyssp);
1281
1282 *++yyvsp = yyval;
1283]b4_location_if([ *++yylsp = yyloc;])[
1284
1285 /* Now `shift' the result of the reduction. Determine what state
1286 that goes to, based on the state we popped back to and the rule
1287 number reduced by. */
1288
1289 yyn = yyr1[yyn];
1290
1291 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1292 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1293 yystate = yytable[yystate];
1294 else
1295 yystate = yydefgoto[yyn - YYNTOKENS];
1296
1297 goto yynewstate;
1298
1299
1300/*------------------------------------.
1301| yyerrlab -- here on detecting error |
1302`------------------------------------*/
1303yyerrlab:
1304 /* If not already recovering from an error, report this error. */
1305 if (!yyerrstatus)
1306 {
1307 ++yynerrs;
1308#if ! YYERROR_VERBOSE
1309 yyerror (]b4_yyerror_args[YY_("syntax error"));
1310#else
1311 {
1312 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1313 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1314 {
1315 YYSIZE_T yyalloc = 2 * yysize;
1316 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1317 yyalloc = YYSTACK_ALLOC_MAXIMUM;
1318 if (yymsg != yymsgbuf)
1319 YYSTACK_FREE (yymsg);
1320 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1321 if (yymsg)
1322 yymsg_alloc = yyalloc;
1323 else
1324 {
1325 yymsg = yymsgbuf;
1326 yymsg_alloc = sizeof yymsgbuf;
1327 }
1328 }
1329
1330 if (0 < yysize && yysize <= yymsg_alloc)
1331 {
1332 (void) yysyntax_error (yymsg, yystate, yychar);
1333 yyerror (]b4_yyerror_args[yymsg);
1334 }
1335 else
1336 {
1337 yyerror (]b4_yyerror_args[YY_("syntax error"));
1338 if (yysize != 0)
1339 goto yyexhaustedlab;
1340 }
1341 }
1342#endif
1343 }
1344
1345]b4_location_if([[ yyerror_range[0] = yylloc;]])[
1346
1347 if (yyerrstatus == 3)
1348 {
1349 /* If just tried and failed to reuse look-ahead token after an
1350 error, discard it. */
1351
1352 if (yychar <= YYEOF)
1353 {
1354 /* Return failure if at end of input. */
1355 if (yychar == YYEOF)
1356 YYABORT;
1357 }
1358 else
1359 {
1360 yydestruct ("Error: discarding",
1361 yytoken, &yylval]b4_location_if([, &yylloc])[]b4_user_args[);
1362 yychar = YYEMPTY;
1363 }
1364 }
1365
1366 /* Else will try to reuse look-ahead token after shifting the error
1367 token. */
1368 goto yyerrlab1;
1369
1370
1371/*---------------------------------------------------.
1372| yyerrorlab -- error raised explicitly by YYERROR. |
1373`---------------------------------------------------*/
1374yyerrorlab:
1375
1376 /* Pacify compilers like GCC when the user code never invokes
1377 YYERROR and the label yyerrorlab therefore never appears in user
1378 code. */
1379 if (/*CONSTCOND*/ 0)
1380 goto yyerrorlab;
1381
1382]b4_location_if([[ yyerror_range[0] = yylsp[1-yylen];
1383 yylsp -= yylen;
1384 ]])[yyvsp -= yylen;
1385 yyssp -= yylen;
1386 yystate = *yyssp;
1387 goto yyerrlab1;
1388
1389
1390/*-------------------------------------------------------------.
1391| yyerrlab1 -- common code for both syntax error and YYERROR. |
1392`-------------------------------------------------------------*/
1393yyerrlab1:
1394 yyerrstatus = 3; /* Each real token shifted decrements this. */
1395
1396 for (;;)
1397 {
1398 yyn = yypact[yystate];
1399 if (yyn != YYPACT_NINF)
1400 {
1401 yyn += YYTERROR;
1402 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1403 {
1404 yyn = yytable[yyn];
1405 if (0 < yyn)
1406 break;
1407 }
1408 }
1409
1410 /* Pop the current state because it cannot handle the error token. */
1411 if (yyssp == yyss)
1412 YYABORT;
1413
1414]b4_location_if([[ yyerror_range[0] = *yylsp;]])[
1415 yydestruct ("Error: popping",
1416 yystos[yystate], yyvsp]b4_location_if([, yylsp])[]b4_user_args[);
1417 YYPOPSTACK;
1418 yystate = *yyssp;
1419 YY_STACK_PRINT (yyss, yyssp);
1420 }
1421
1422 if (yyn == YYFINAL)
1423 YYACCEPT;
1424
1425 *++yyvsp = yylval;
1426]b4_location_if([[
1427 yyerror_range[1] = yylloc;
1428 /* Using YYLLOC is tempting, but would change the location of
1429 the look-ahead. YYLOC is available though. */
1430 YYLLOC_DEFAULT (yyloc, yyerror_range - 1, 2);
1431 *++yylsp = yyloc;]])[
1432
1433 /* Shift the error token. */
1434 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1435
1436 yystate = yyn;
1437 goto yynewstate;
1438
1439
1440/*-------------------------------------.
1441| yyacceptlab -- YYACCEPT comes here. |
1442`-------------------------------------*/
1443yyacceptlab:
1444 yyresult = 0;
1445 goto yyreturn;
1446
1447/*-----------------------------------.
1448| yyabortlab -- YYABORT comes here. |
1449`-----------------------------------*/
1450yyabortlab:
1451 yyresult = 1;
1452 goto yyreturn;
1453
1454#ifndef yyoverflow
1455/*-------------------------------------------------.
1456| yyexhaustedlab -- memory exhaustion comes here. |
1457`-------------------------------------------------*/
1458yyexhaustedlab:
1459 yyerror (]b4_yyerror_args[YY_("memory exhausted"));
1460 yyresult = 2;
1461 /* Fall through. */
1462#endif
1463
1464yyreturn:
1465 if (yychar != YYEOF && yychar != YYEMPTY)
1466 yydestruct ("Cleanup: discarding lookahead",
1467 yytoken, &yylval]b4_location_if([, &yylloc])[]b4_user_args[);
1468 while (yyssp != yyss)
1469 {
1470 yydestruct ("Cleanup: popping",
1471 yystos[*yyssp], yyvsp]b4_location_if([, yylsp])[]b4_user_args[);
1472 YYPOPSTACK;
1473 }
1474#ifndef yyoverflow
1475 if (yyss != yyssa)
1476 YYSTACK_FREE (yyss);
1477#endif
1478#if YYERROR_VERBOSE
1479 if (yymsg != yymsgbuf)
1480 YYSTACK_FREE (yymsg);
1481#endif
1482 return yyresult;
1483]}
1484
1485
1486b4_epilogue
1487m4_if(b4_defines_flag, 0, [],
1488[@output @output_header_name@
1489b4_copyright([Skeleton parser for Yacc-like parsing with Bison],
1490 [1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005])
1491
1492/* As a special exception, when this file is copied by Bison into a
1493 Bison output file, you may use that output file without restriction.
1494 This special exception was added by the Free Software Foundation
1495 in version 1.24 of Bison. */
1496
1497b4_token_enums_defines(b4_tokens)
1498
1499#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
1500m4_ifdef([b4_stype],
1501[b4_syncline([b4_stype_line], [b4_file_name])
1502typedef union m4_bregexp(b4_stype, [^{], [YYSTYPE ])b4_stype YYSTYPE;
1503/* Line __line__ of yacc.c. */
1504b4_syncline([@oline@], [@ofile@])],
1505[typedef int YYSTYPE;])
1506# define yystype YYSTYPE /* obsolescent; will be withdrawn */
1507# define YYSTYPE_IS_DECLARED 1
1508# define YYSTYPE_IS_TRIVIAL 1
1509#endif
1510
1511b4_pure_if([],
1512[extern YYSTYPE b4_prefix[]lval;])
1513
1514b4_location_if(
1515[#if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
1516typedef struct YYLTYPE
1517{
1518 int first_line;
1519 int first_column;
1520 int last_line;
1521 int last_column;
1522} YYLTYPE;
1523# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
1524# define YYLTYPE_IS_DECLARED 1
1525# define YYLTYPE_IS_TRIVIAL 1
1526#endif
1527
1528m4_if(b4_pure, [0],
1529[extern YYLTYPE b4_prefix[]lloc;])
1530])
1531])