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