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