]>
Commit | Line | Data |
---|---|---|
be2a1a68 | 1 | m4_divert(-1) |
a8289c62 | 2 | |
be2a1a68 | 3 | m4_define_default([b4_input_suffix], [.y]) |
2992e1e9 | 4 | |
be2a1a68 AD |
5 | m4_define_default([b4_output_parser_suffix], |
6 | [m4_translit(b4_input_suffix, [yY], [cC])]) | |
7 | ||
8 | m4_define_default([b4_output_parser_name], | |
9 | [b4_output_prefix[]b4_output_infix[]b4_output_parser_suffix[]]) | |
10 | ||
11 | ||
12 | m4_define_default([b4_output_header_suffix], | |
13 | [m4_translit(b4_input_suffix, [yY], [hH])]) | |
14 | ||
15 | m4_define_default([b4_output_header_name], | |
16 | [b4_output_prefix[]b4_output_infix[]b4_output_header_suffix[]]) | |
17 | ||
18 | m4_define_default([b4_header_guard], | |
19 | [m4_bpatsubst(m4_toupper([BISON_]b4_output_header_name), | |
20 | [[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]], [_])]) | |
21 | ||
0d8bed56 AD |
22 | |
23 | # b4_token_defines(TOKEN-NAME, TOKEN-NUMBER) | |
24 | # ------------------------------------------ | |
25 | # Output the definition of this token as #define. | |
26 | m4_define([b4_token_define], | |
27 | [#define $1 $2 | |
28 | ]) | |
29 | ||
30 | ||
31 | # b4_token_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER) | |
32 | # ------------------------------------------------------- | |
33 | # Output the definition of the tokens as #define. | |
34 | m4_define([b4_token_defines], | |
35 | [m4_map([b4_token_define], [$@])]) | |
36 | ||
37 | ||
be2a1a68 AD |
38 | m4_divert(0)dnl |
39 | #output "b4_output_parser_name" | |
40 | /* A Bison parser, made from b4_filename | |
41 | by GNU bison b4_version. */ | |
42 | ||
43 | /* Skeleton output parser for Bison, | |
2992e1e9 PE |
44 | Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software |
45 | Foundation, Inc. | |
10fa2066 RS |
46 | |
47 | This program is free software; you can redistribute it and/or modify | |
48 | it under the terms of the GNU General Public License as published by | |
21b14802 | 49 | the Free Software Foundation; either version 2, or (at your option) |
10fa2066 RS |
50 | any later version. |
51 | ||
52 | This program is distributed in the hope that it will be useful, | |
53 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
54 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
55 | GNU General Public License for more details. | |
56 | ||
57 | You should have received a copy of the GNU General Public License | |
58 | along with this program; if not, write to the Free Software | |
c49a8e71 JT |
59 | Foundation, Inc., 59 Temple Place - Suite 330, |
60 | Boston, MA 02111-1307, USA. */ | |
10fa2066 | 61 | |
c71f8bba RS |
62 | /* As a special exception, when this file is copied by Bison into a |
63 | Bison output file, you may use that output file without restriction. | |
64 | This special exception was added by the Free Software Foundation | |
cfeaeb52 | 65 | in version 1.24 of Bison. */ |
10fa2066 | 66 | |
71da9eea AD |
67 | /* This is the parser code that is written into each bison parser when |
68 | the %semantic_parser declaration is not specified in the grammar. | |
69 | It was written by Richard Stallman by simplifying the hairy parser | |
70 | used when %semantic_parser is specified. */ | |
444fbf65 | 71 | |
7093d0f5 AD |
72 | /* Identify Bison output. */ |
73 | #define YYBISON 1 | |
fd51e5ff | 74 | |
7093d0f5 | 75 | /* Pure parsers. */ |
be2a1a68 | 76 | #define YYPURE b4_pure |
7093d0f5 AD |
77 | |
78 | /* Using locations. */ | |
be2a1a68 | 79 | #define YYLSP_NEEDED b4_locations_flag |
7093d0f5 | 80 | |
be2a1a68 AD |
81 | m4_if(b4_prefix[], [yy], [], |
82 | [/* If NAME_PREFIX is specified substitute the variables and functions | |
17da6427 | 83 | names. */ |
be2a1a68 AD |
84 | #define yyparse b4_prefix[]parse |
85 | #define yylex b4_prefix[]lex | |
86 | #define yyerror b4_prefix[]error | |
87 | #define yylval b4_prefix[]lval | |
88 | #define yychar b4_prefix[]char | |
89 | #define yydebug b4_prefix[]debug | |
90 | #define yynerrs b4_prefix[]nerrs | |
b5b61c61 | 91 | #if YYLSP_NEEDED |
be2a1a68 | 92 | # define yylloc b4_prefix[]lloc |
b5b61c61 | 93 | #endif |
be2a1a68 | 94 | ]) |
17da6427 | 95 | |
cce71710 | 96 | /* Copy the user declarations. */ |
be2a1a68 | 97 | b4_prologue |
cce71710 | 98 | |
d99361e6 AD |
99 | /* Enabling traces. */ |
100 | #ifndef YYDEBUG | |
be2a1a68 | 101 | # define YYDEBUG b4_debug |
d99361e6 AD |
102 | #endif |
103 | ||
104 | /* Enabling verbose error messages. */ | |
105 | #ifdef YYERROR_VERBOSE | |
106 | # undef YYERROR_VERBOSE | |
107 | # define YYERROR_VERBOSE 1 | |
108 | #else | |
be2a1a68 | 109 | # define YYERROR_VERBOSE b4_error_verbose |
d99361e6 AD |
110 | #endif |
111 | ||
fd51e5ff | 112 | #ifndef YYSTYPE |
642cb8f8 AD |
113 | m4_ifdef([b4_stype_line], |
114 | [#line b4_stype_line "b4_filename" | |
115 | ])dnl | |
be2a1a68 | 116 | typedef b4_stype yystype; |
fd51e5ff AD |
117 | # define YYSTYPE yystype |
118 | #endif | |
119 | ||
120 | #ifndef YYLTYPE | |
121 | typedef struct yyltype | |
122 | { | |
123 | int first_line; | |
124 | int first_column; | |
125 | int last_line; | |
126 | int last_column; | |
127 | } yyltype; | |
be2a1a68 | 128 | # define YYLTYPE b4_ltype |
fd51e5ff AD |
129 | #endif |
130 | ||
be2a1a68 | 131 | /* Line __line__ of __file__. */ |
26b23c1a | 132 | #line __oline__ |
7093d0f5 | 133 | |
7093d0f5 AD |
134 | /* All symbols defined below should begin with yy or YY, to avoid |
135 | infringing on user name space. This should be done even for local | |
136 | variables, as they might otherwise be expanded by user macros. | |
137 | There are some unavoidable exceptions within include files to | |
b7575ffe | 138 | define necessary library symbols; they are noted "INFRINGES ON |
7093d0f5 AD |
139 | USER NAME SPACE" below. */ |
140 | ||
0d8a7363 | 141 | #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) |
7093d0f5 AD |
142 | |
143 | /* The parser invokes alloca or malloc; define the necessary symbols. */ | |
144 | ||
145 | # if YYSTACK_USE_ALLOCA | |
146 | # define YYSTACK_ALLOC alloca | |
7093d0f5 AD |
147 | # else |
148 | # ifndef YYSTACK_USE_ALLOCA | |
149 | # if defined (alloca) || defined (_ALLOCA_H) | |
150 | # define YYSTACK_ALLOC alloca | |
7093d0f5 | 151 | # else |
0d8a7363 | 152 | # ifdef __GNUC__ |
7093d0f5 AD |
153 | # define YYSTACK_ALLOC __builtin_alloca |
154 | # endif | |
7093d0f5 AD |
155 | # endif |
156 | # endif | |
157 | # endif | |
158 | ||
159 | # ifdef YYSTACK_ALLOC | |
160 | /* Pacify GCC's `empty if-body' warning. */ | |
161 | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) | |
162 | # else | |
45119af1 PE |
163 | # if defined (__STDC__) || defined (__cplusplus) |
164 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ | |
165 | # define YYSIZE_T size_t | |
7093d0f5 | 166 | # endif |
45119af1 PE |
167 | # define YYSTACK_ALLOC malloc |
168 | # define YYSTACK_FREE free | |
7093d0f5 AD |
169 | # endif |
170 | ||
600f9b0c PE |
171 | /* A type that is properly aligned for any stack member. */ |
172 | union yyalloc | |
173 | { | |
2729e106 PE |
174 | short yyss; |
175 | YYSTYPE yyvs; | |
7093d0f5 | 176 | # if YYLSP_NEEDED |
2729e106 | 177 | YYLTYPE yyls; |
7093d0f5 | 178 | # endif |
600f9b0c PE |
179 | }; |
180 | ||
181 | /* The size of the maximum gap between one aligned stack and the next. */ | |
7093d0f5 | 182 | # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) |
600f9b0c PE |
183 | |
184 | /* The size of an array large to enough to hold all stacks, each with | |
185 | N elements. */ | |
7093d0f5 AD |
186 | # if YYLSP_NEEDED |
187 | # define YYSTACK_BYTES(N) \ | |
600f9b0c PE |
188 | ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ |
189 | + 2 * YYSTACK_GAP_MAX) | |
7093d0f5 AD |
190 | # else |
191 | # define YYSTACK_BYTES(N) \ | |
600f9b0c PE |
192 | ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ |
193 | + YYSTACK_GAP_MAX) | |
7093d0f5 | 194 | # endif |
600f9b0c | 195 | |
5b041382 PE |
196 | /* Copy COUNT objects from FROM to TO. The source and destination do |
197 | not overlap. */ | |
198 | # ifndef YYCOPY | |
199 | # if 1 < __GNUC__ | |
200 | # define YYCOPY(To, From, Count) \ | |
201 | __builtin_memcpy (To, From, (Count) * sizeof (*(From))) | |
202 | # else | |
203 | # define YYCOPY(To, From, Count) \ | |
204 | do \ | |
205 | { \ | |
206 | register YYSIZE_T yyi; \ | |
207 | for (yyi = 0; yyi < (Count); yyi++) \ | |
208 | (To)[yyi] = (From)[yyi]; \ | |
209 | } \ | |
210 | while (0) | |
211 | # endif | |
212 | # endif | |
213 | ||
214 | /* Relocate STACK from its old location to the new one. The | |
7093d0f5 | 215 | local variables YYSIZE and YYSTACKSIZE give the old and new number of |
600f9b0c PE |
216 | elements in the stack, and YYPTR gives the new location of the |
217 | stack. Advance YYPTR to a properly aligned location for the next | |
218 | stack. */ | |
5b041382 | 219 | # define YYSTACK_RELOCATE(Stack) \ |
7093d0f5 AD |
220 | do \ |
221 | { \ | |
222 | YYSIZE_T yynewbytes; \ | |
5b041382 | 223 | YYCOPY (&yyptr->Stack, Stack, yysize); \ |
2729e106 | 224 | Stack = &yyptr->Stack; \ |
5b041382 | 225 | yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ |
2729e106 | 226 | yyptr += yynewbytes / sizeof (*yyptr); \ |
7093d0f5 AD |
227 | } \ |
228 | while (0) | |
229 | ||
230 | #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ | |
8850be4b | 231 | |
e8cb70b9 | 232 | /* Tokens. */ |
0d8bed56 | 233 | b4_token_defines(b4_tokens) |
a8289c62 | 234 | |
7742ddeb | 235 | /* YYFINAL -- State number of the termination state. */ |
be2a1a68 AD |
236 | #define YYFINAL b4_final |
237 | #define YYFLAG b4_flag | |
238 | #define YYLAST b4_last | |
7742ddeb AD |
239 | |
240 | /* YYNTOKENS -- Number of terminals. */ | |
be2a1a68 | 241 | #define YYNTOKENS b4_ntokens |
7742ddeb | 242 | /* YYNNTS -- Number of nonterminals. */ |
be2a1a68 | 243 | #define YYNNTS b4_nnts |
7742ddeb | 244 | /* YYNRULES -- Number of rules. */ |
be2a1a68 | 245 | #define YYNRULES b4_nrules |
7742ddeb | 246 | /* YYNRULES -- Number of states. */ |
be2a1a68 AD |
247 | #define YYNSTATES b4_nstates |
248 | #define YYMAXUTOK b4_maxtok | |
7742ddeb AD |
249 | |
250 | /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ | |
be2a1a68 | 251 | #define YYTRANSLATE(x) ((unsigned)(x) <= b4_maxtok ? yytranslate[[x]] : b4_nsym) |
a8289c62 | 252 | |
be2a1a68 AD |
253 | /* YYTRANSLATE[[YYLEX]] -- Bison symbol number corresponding to YYLEX. */ |
254 | static const char yytranslate[[]] = | |
a8289c62 | 255 | { |
be2a1a68 | 256 | b4_translate |
a8289c62 RA |
257 | }; |
258 | ||
259 | #if YYDEBUG | |
be2a1a68 | 260 | /* YYPRHS[[YYN]] -- Index of the first RHS symbol of rule number YYN in |
7742ddeb | 261 | YYRHS. */ |
be2a1a68 | 262 | static const short yyprhs[[]] = |
a8289c62 | 263 | { |
be2a1a68 | 264 | b4_prhs |
a8289c62 RA |
265 | }; |
266 | ||
3db472b9 | 267 | /* YYRHS -- A `-1'-separated list of the rules' RHS. */ |
be2a1a68 | 268 | static const short yyrhs[[]] = |
a8289c62 | 269 | { |
be2a1a68 | 270 | b4_rhs |
a8289c62 RA |
271 | }; |
272 | ||
be2a1a68 AD |
273 | /* YYRLINE[[YYN]] -- source line where rule number YYN was defined. */ |
274 | static const short yyrline[[]] = | |
a8289c62 | 275 | { |
be2a1a68 | 276 | b4_rline |
a8289c62 RA |
277 | }; |
278 | #endif | |
279 | ||
c527b2d4 | 280 | #if (YYDEBUG) || YYERROR_VERBOSE |
be2a1a68 | 281 | /* YYTNME[[SYMBOL-NUM]] -- String name of the symbol SYMBOL-NUM. |
7742ddeb | 282 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
be2a1a68 | 283 | static const char *const yytname[[]] = |
a8289c62 | 284 | { |
be2a1a68 | 285 | b4_tname |
a8289c62 RA |
286 | }; |
287 | #endif | |
288 | ||
be2a1a68 AD |
289 | /* YYTOKNUM[[YYN]] -- Index in YYTNAME corresponding to YYLEX. */ |
290 | static const short yytoknum[[]] = | |
a8289c62 | 291 | { |
be2a1a68 | 292 | b4_toknum |
a8289c62 RA |
293 | }; |
294 | ||
be2a1a68 AD |
295 | /* YYR1[[YYN]] -- Symbol number of symbol that rule YYN derives. */ |
296 | static const short yyr1[[]] = | |
a8289c62 | 297 | { |
be2a1a68 | 298 | b4_r1 |
a8289c62 RA |
299 | }; |
300 | ||
be2a1a68 AD |
301 | /* YYR2[[YYN]] -- Number of symbols composing right hand side of rule YYN. */ |
302 | static const short yyr2[[]] = | |
a8289c62 | 303 | { |
be2a1a68 | 304 | b4_r2 |
a8289c62 RA |
305 | }; |
306 | ||
be2a1a68 | 307 | /* YYDEFACT[[S]] -- default rule to reduce with in state S when YYTABLE |
a8289c62 RA |
308 | doesn't specify something else to do. Zero means the default is an |
309 | error. */ | |
be2a1a68 | 310 | static const short yydefact[[]] = |
a8289c62 | 311 | { |
be2a1a68 | 312 | b4_defact |
a8289c62 RA |
313 | }; |
314 | ||
be2a1a68 AD |
315 | /* YYPGOTO[[NTERM-NUM]]. */ |
316 | static const short yydefgoto[[]] = | |
a8289c62 | 317 | { |
be2a1a68 | 318 | b4_defgoto |
a8289c62 RA |
319 | }; |
320 | ||
be2a1a68 | 321 | /* YYPACT[[STATE-NUM]] -- Index in YYTABLE of the portion describing |
7742ddeb | 322 | STATE-NUM. */ |
be2a1a68 | 323 | static const short yypact[[]] = |
a8289c62 | 324 | { |
be2a1a68 | 325 | b4_pact |
a8289c62 RA |
326 | }; |
327 | ||
be2a1a68 AD |
328 | /* YYPGOTO[[NTERM-NUM]]. */ |
329 | static const short yypgoto[[]] = | |
a8289c62 | 330 | { |
be2a1a68 | 331 | b4_pgoto |
a8289c62 RA |
332 | }; |
333 | ||
be2a1a68 | 334 | /* YYTABLE[[YYPACT[STATE-NUM]]]. What to do in state STATE-NUM. If |
7742ddeb AD |
335 | positive, shift that token. If negative, reduce the rule which |
336 | number is the opposite. If zero, do what YYDEFACT says. */ | |
be2a1a68 | 337 | static const short yytable[[]] = |
a8289c62 | 338 | { |
be2a1a68 | 339 | b4_table |
a8289c62 RA |
340 | }; |
341 | ||
be2a1a68 | 342 | static const short yycheck[[]] = |
a8289c62 | 343 | { |
be2a1a68 | 344 | b4_check |
a8289c62 RA |
345 | }; |
346 | ||
7093d0f5 AD |
347 | |
348 | #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) | |
349 | # define YYSIZE_T __SIZE_TYPE__ | |
350 | #endif | |
351 | #if ! defined (YYSIZE_T) && defined (size_t) | |
352 | # define YYSIZE_T size_t | |
353 | #endif | |
b7575ffe | 354 | #if ! defined (YYSIZE_T) |
45119af1 PE |
355 | # if defined (__STDC__) || defined (__cplusplus) |
356 | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ | |
357 | # define YYSIZE_T size_t | |
b7575ffe | 358 | # endif |
7093d0f5 AD |
359 | #endif |
360 | #if ! defined (YYSIZE_T) | |
361 | # define YYSIZE_T unsigned int | |
362 | #endif | |
363 | ||
10fa2066 | 364 | #define yyerrok (yyerrstatus = 0) |
17da6427 | 365 | #define yyclearin (yychar = YYEMPTY) |
10fa2066 RS |
366 | #define YYEMPTY -2 |
367 | #define YYEOF 0 | |
a8289c62 | 368 | |
70ddf897 | 369 | #define YYACCEPT goto yyacceptlab |
a8289c62 | 370 | #define YYABORT goto yyabortlab |
10fa2066 | 371 | #define YYERROR goto yyerrlab1 |
a8289c62 | 372 | |
71da9eea AD |
373 | /* Like YYERROR except do call yyerror. This remains here temporarily |
374 | to ease the transition to the new meaning of YYERROR, for GCC. | |
10fa2066 | 375 | Once GCC version 2 has supplanted version 1, this can go. */ |
a8289c62 | 376 | |
10fa2066 | 377 | #define YYFAIL goto yyerrlab |
a8289c62 | 378 | |
10fa2066 | 379 | #define YYRECOVERING() (!!yyerrstatus) |
a8289c62 | 380 | |
69b4e0c5 | 381 | #define YYBACKUP(Token, Value) \ |
10fa2066 | 382 | do \ |
17da6427 | 383 | if (yychar == YYEMPTY && yylen == 1) \ |
71da9eea | 384 | { \ |
17da6427 | 385 | yychar = (Token); \ |
7742ddeb | 386 | yylval = (Value); \ |
17da6427 | 387 | yychar1 = YYTRANSLATE (yychar); \ |
10fa2066 RS |
388 | YYPOPSTACK; \ |
389 | goto yybackup; \ | |
390 | } \ | |
391 | else \ | |
71da9eea | 392 | { \ |
7742ddeb | 393 | yyerror ("syntax error: cannot back up"); \ |
71da9eea AD |
394 | YYERROR; \ |
395 | } \ | |
10fa2066 RS |
396 | while (0) |
397 | ||
398 | #define YYTERROR 1 | |
399 | #define YYERRCODE 256 | |
400 | ||
3abcd459 AD |
401 | /* YYLLOC_DEFAULT -- Compute the default location (before the actions |
402 | are run). | |
403 | ||
404 | When YYLLOC_DEFAULT is run, CURRENT is set the location of the | |
405 | first token. By default, to implement support for ranges, extend | |
406 | its range to the last symbol. */ | |
407 | ||
408 | #ifndef YYLLOC_DEFAULT | |
ca96bc2d | 409 | # define YYLLOC_DEFAULT(Current, Rhs, N) \ |
be2a1a68 AD |
410 | Current.last_line = Rhs[[N]].last_line; \ |
411 | Current.last_column = Rhs[[N]].last_column; | |
3abcd459 AD |
412 | #endif |
413 | ||
3abcd459 | 414 | /* YYLEX -- calling `yylex' with the right arguments. */ |
553e2b22 AD |
415 | |
416 | #if YYPURE | |
5af1f549 | 417 | # if YYLSP_NEEDED |
b07b484a | 418 | # ifdef YYLEX_PARAM |
17da6427 | 419 | # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) |
b07b484a | 420 | # else |
17da6427 | 421 | # define YYLEX yylex (&yylval, &yylloc) |
b07b484a | 422 | # endif |
71da9eea | 423 | # else /* !YYLSP_NEEDED */ |
b07b484a | 424 | # ifdef YYLEX_PARAM |
17da6427 | 425 | # define YYLEX yylex (&yylval, YYLEX_PARAM) |
b07b484a | 426 | # else |
17da6427 | 427 | # define YYLEX yylex (&yylval) |
b07b484a | 428 | # endif |
71da9eea | 429 | # endif /* !YYLSP_NEEDED */ |
553e2b22 | 430 | #else /* !YYPURE */ |
17da6427 | 431 | # define YYLEX yylex () |
553e2b22 AD |
432 | #endif /* !YYPURE */ |
433 | ||
5a35a6cb | 434 | /* Enable debugging if requested. */ |
0d533154 | 435 | #if YYDEBUG |
b7575ffe PE |
436 | |
437 | # ifndef YYFPRINTF | |
45119af1 PE |
438 | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ |
439 | # define YYFPRINTF fprintf | |
b7575ffe PE |
440 | # endif |
441 | ||
5a35a6cb AD |
442 | # define YYDPRINTF(Args) \ |
443 | do { \ | |
17da6427 | 444 | if (yydebug) \ |
b7575ffe | 445 | YYFPRINTF Args; \ |
5a35a6cb | 446 | } while (0) |
be2a1a68 AD |
447 | /* Nonzero means print parse trace. Since this is uninitialized, it |
448 | does not stop multiple parsers from coexisting. */ | |
17da6427 | 449 | int yydebug; |
5a35a6cb AD |
450 | #else /* !YYDEBUG */ |
451 | # define YYDPRINTF(Args) | |
452 | #endif /* !YYDEBUG */ | |
453 | ||
454 | /* YYINITDEPTH -- initial size of the parser's stacks. */ | |
10fa2066 | 455 | #ifndef YYINITDEPTH |
be2a1a68 | 456 | # define YYINITDEPTH b4_initdepth |
10fa2066 RS |
457 | #endif |
458 | ||
5a35a6cb | 459 | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
600f9b0c PE |
460 | if the built-in stack extension method is used). |
461 | ||
462 | Do not make this value too large; the results are undefined if | |
463 | SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) | |
464 | evaluated with infinite-precision integer arithmetic. */ | |
465 | ||
10fa2066 | 466 | #if YYMAXDEPTH == 0 |
b07b484a | 467 | # undef YYMAXDEPTH |
10fa2066 RS |
468 | #endif |
469 | ||
470 | #ifndef YYMAXDEPTH | |
be2a1a68 | 471 | # define YYMAXDEPTH b4_maxdepth |
10fa2066 | 472 | #endif |
a8289c62 | 473 | |
10fa2066 | 474 | \f |
a8289c62 | 475 | |
7093d0f5 AD |
476 | #if YYERROR_VERBOSE |
477 | ||
478 | # ifndef yystrlen | |
479 | # if defined (__GLIBC__) && defined (_STRING_H) | |
480 | # define yystrlen strlen | |
481 | # else | |
482 | /* Return the length of YYSTR. */ | |
483 | static YYSIZE_T | |
484 | # if defined (__STDC__) || defined (__cplusplus) | |
485 | yystrlen (const char *yystr) | |
486 | # else | |
487 | yystrlen (yystr) | |
488 | const char *yystr; | |
489 | # endif | |
490 | { | |
491 | register const char *yys = yystr; | |
492 | ||
493 | while (*yys++ != '\0') | |
494 | continue; | |
495 | ||
496 | return yys - yystr - 1; | |
497 | } | |
498 | # endif | |
499 | # endif | |
500 | ||
501 | # ifndef yystpcpy | |
502 | # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) | |
503 | # define yystpcpy stpcpy | |
504 | # else | |
505 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in | |
506 | YYDEST. */ | |
507 | static char * | |
f11966ff PE |
508 | # if defined (__STDC__) || defined (__cplusplus) |
509 | yystpcpy (char *yydest, const char *yysrc) | |
510 | # else | |
7093d0f5 AD |
511 | yystpcpy (yydest, yysrc) |
512 | char *yydest; | |
513 | const char *yysrc; | |
7093d0f5 AD |
514 | # endif |
515 | { | |
516 | register char *yyd = yydest; | |
517 | register const char *yys = yysrc; | |
518 | ||
519 | while ((*yyd++ = *yys++) != '\0') | |
520 | continue; | |
521 | ||
522 | return yyd - 1; | |
523 | } | |
524 | # endif | |
525 | # endif | |
526 | ||
527 | #endif /* !YYERROR_VERBOSE */ | |
528 | ||
10fa2066 | 529 | \f |
a8289c62 | 530 | |
b658bf92 RS |
531 | /* The user can define YYPARSE_PARAM as the name of an argument to be passed |
532 | into yyparse. The argument should have type void *. | |
533 | It should actually point to an object. | |
534 | Grammar actions can access the variable by casting it | |
535 | to the proper pointer type. */ | |
536 | ||
537 | #ifdef YYPARSE_PARAM | |
45119af1 | 538 | # if defined (__STDC__) || defined (__cplusplus) |
b07b484a AD |
539 | # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM |
540 | # define YYPARSE_PARAM_DECL | |
45119af1 | 541 | # else |
b07b484a AD |
542 | # define YYPARSE_PARAM_ARG YYPARSE_PARAM |
543 | # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; | |
45119af1 | 544 | # endif |
71da9eea | 545 | #else /* !YYPARSE_PARAM */ |
b07b484a AD |
546 | # define YYPARSE_PARAM_ARG |
547 | # define YYPARSE_PARAM_DECL | |
71da9eea | 548 | #endif /* !YYPARSE_PARAM */ |
b658bf92 | 549 | |
1b181651 PE |
550 | /* Prevent warning if -Wstrict-prototypes. */ |
551 | #ifdef __GNUC__ | |
b07b484a | 552 | # ifdef YYPARSE_PARAM |
17da6427 | 553 | int yyparse (void *); |
b07b484a | 554 | # else |
17da6427 | 555 | int yyparse (void); |
b07b484a | 556 | # endif |
1b181651 PE |
557 | #endif |
558 | ||
a35f64ea AD |
559 | /* YY_DECL_VARIABLES -- depending whether we use a pure parser, |
560 | variables are global, or local to YYPARSE. */ | |
561 | ||
7093d0f5 | 562 | #define YY_DECL_NON_LSP_VARIABLES \ |
a35f64ea | 563 | /* The lookahead symbol. */ \ |
17da6427 | 564 | int yychar; \ |
a35f64ea | 565 | \ |
e8cb70b9 | 566 | /* The semantic value of the lookahead symbol. */ \ |
17da6427 | 567 | YYSTYPE yylval; \ |
a35f64ea AD |
568 | \ |
569 | /* Number of parse errors so far. */ \ | |
17da6427 | 570 | int yynerrs; |
a35f64ea AD |
571 | |
572 | #if YYLSP_NEEDED | |
573 | # define YY_DECL_VARIABLES \ | |
7093d0f5 | 574 | YY_DECL_NON_LSP_VARIABLES \ |
a35f64ea AD |
575 | \ |
576 | /* Location data for the lookahead symbol. */ \ | |
577 | YYLTYPE yylloc; | |
578 | #else | |
579 | # define YY_DECL_VARIABLES \ | |
7093d0f5 | 580 | YY_DECL_NON_LSP_VARIABLES |
a35f64ea AD |
581 | #endif |
582 | ||
e8cb70b9 | 583 | /* If nonreentrant, generate the variables here. */ |
a35f64ea AD |
584 | |
585 | #if !YYPURE | |
586 | YY_DECL_VARIABLES | |
587 | #endif /* !YYPURE */ | |
588 | ||
10fa2066 | 589 | int |
17da6427 | 590 | yyparse (YYPARSE_PARAM_ARG) |
b658bf92 | 591 | YYPARSE_PARAM_DECL |
be2a1a68 | 592 | {[ |
e8cb70b9 | 593 | /* If reentrant, generate the variables here. */ |
a35f64ea AD |
594 | #if YYPURE |
595 | YY_DECL_VARIABLES | |
596 | #endif /* !YYPURE */ | |
597 | ||
10fa2066 RS |
598 | register int yystate; |
599 | register int yyn; | |
600f9b0c | 600 | int yyresult; |
b07b484a AD |
601 | /* Number of tokens to shift before error messages enabled. */ |
602 | int yyerrstatus; | |
603 | /* Lookahead token as an internal (translated) token number. */ | |
604 | int yychar1 = 0; | |
10fa2066 | 605 | |
bb10be54 AD |
606 | /* Three stacks and their tools: |
607 | `yyss': related to states, | |
e9e4c321 | 608 | `yyvs': related to semantic values, |
bb10be54 AD |
609 | `yyls': related to locations. |
610 | ||
611 | Refer to the stacks thru separate pointers, to allow yyoverflow | |
612 | to reallocate them elsewhere. */ | |
613 | ||
e8cb70b9 | 614 | /* The state stack. */ |
b07b484a | 615 | short yyssa[YYINITDEPTH]; |
bb10be54 AD |
616 | short *yyss = yyssa; |
617 | register short *yyssp; | |
618 | ||
b07b484a AD |
619 | /* The semantic value stack. */ |
620 | YYSTYPE yyvsa[YYINITDEPTH]; | |
b07b484a | 621 | YYSTYPE *yyvs = yyvsa; |
bb10be54 | 622 | register YYSTYPE *yyvsp; |
10fa2066 | 623 | |
5af1f549 | 624 | #if YYLSP_NEEDED |
b07b484a AD |
625 | /* The location stack. */ |
626 | YYLTYPE yylsa[YYINITDEPTH]; | |
10fa2066 RS |
627 | YYLTYPE *yyls = yylsa; |
628 | YYLTYPE *yylsp; | |
bb10be54 | 629 | #endif |
10fa2066 | 630 | |
5af1f549 | 631 | #if YYLSP_NEEDED |
b07b484a | 632 | # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) |
10fa2066 | 633 | #else |
b07b484a | 634 | # define YYPOPSTACK (yyvsp--, yyssp--) |
10fa2066 RS |
635 | #endif |
636 | ||
7093d0f5 | 637 | YYSIZE_T yystacksize = YYINITDEPTH; |
10fa2066 | 638 | |
6666f98f AD |
639 | /* The variables used to return semantic value and location from the |
640 | action routines. */ | |
bb10be54 | 641 | YYSTYPE yyval; |
7093d0f5 | 642 | #if YYLSP_NEEDED |
6666f98f | 643 | YYLTYPE yyloc; |
7093d0f5 | 644 | #endif |
10fa2066 | 645 | |
6666f98f | 646 | /* When reducing, the number of symbols on the RHS of the reduced |
e8cb70b9 | 647 | rule. */ |
10fa2066 RS |
648 | int yylen; |
649 | ||
7ea5e977 | 650 | YYDPRINTF ((stderr, "Starting parse\n")); |
10fa2066 RS |
651 | |
652 | yystate = 0; | |
653 | yyerrstatus = 0; | |
17da6427 PB |
654 | yynerrs = 0; |
655 | yychar = YYEMPTY; /* Cause a token to be read. */ | |
10fa2066 RS |
656 | |
657 | /* Initialize stack pointers. | |
658 | Waste one element of value and location stack | |
659 | so that they stay on the same level as the state stack. | |
660 | The wasted elements are never initialized. */ | |
661 | ||
cbd89906 | 662 | yyssp = yyss; |
10fa2066 | 663 | yyvsp = yyvs; |
5af1f549 | 664 | #if YYLSP_NEEDED |
10fa2066 RS |
665 | yylsp = yyls; |
666 | #endif | |
cbd89906 | 667 | goto yysetstate; |
10fa2066 | 668 | |
71da9eea AD |
669 | /*------------------------------------------------------------. |
670 | | yynewstate -- Push a new state, which is found in yystate. | | |
671 | `------------------------------------------------------------*/ | |
342b8b6e | 672 | yynewstate: |
71da9eea AD |
673 | /* In all cases, when you get here, the value and location stacks |
674 | have just been pushed. so pushing a state here evens the stacks. | |
675 | */ | |
cbd89906 PE |
676 | yyssp++; |
677 | ||
342b8b6e | 678 | yysetstate: |
cbd89906 | 679 | *yyssp = yystate; |
10fa2066 RS |
680 | |
681 | if (yyssp >= yyss + yystacksize - 1) | |
682 | { | |
10fa2066 | 683 | /* Get the current used size of the three stacks, in elements. */ |
7093d0f5 | 684 | YYSIZE_T yysize = yyssp - yyss + 1; |
10fa2066 RS |
685 | |
686 | #ifdef yyoverflow | |
3d76b07d AD |
687 | { |
688 | /* Give user a chance to reallocate the stack. Use copies of | |
689 | these so that the &'s don't force the real ones into | |
690 | memory. */ | |
691 | YYSTYPE *yyvs1 = yyvs; | |
692 | short *yyss1 = yyss; | |
693 | ||
694 | /* Each stack pointer address is followed by the size of the | |
695 | data in use in that stack, in bytes. */ | |
5af1f549 | 696 | # if YYLSP_NEEDED |
3d76b07d AD |
697 | YYLTYPE *yyls1 = yyls; |
698 | /* This used to be a conditional around just the two extra args, | |
699 | but that might be undefined if yyoverflow is a macro. */ | |
700 | yyoverflow ("parser stack overflow", | |
7093d0f5 AD |
701 | &yyss1, yysize * sizeof (*yyssp), |
702 | &yyvs1, yysize * sizeof (*yyvsp), | |
703 | &yyls1, yysize * sizeof (*yylsp), | |
3d76b07d AD |
704 | &yystacksize); |
705 | yyls = yyls1; | |
b07b484a | 706 | # else |
3d76b07d | 707 | yyoverflow ("parser stack overflow", |
7093d0f5 AD |
708 | &yyss1, yysize * sizeof (*yyssp), |
709 | &yyvs1, yysize * sizeof (*yyvsp), | |
3d76b07d | 710 | &yystacksize); |
b07b484a | 711 | # endif |
3d76b07d AD |
712 | yyss = yyss1; |
713 | yyvs = yyvs1; | |
714 | } | |
10fa2066 RS |
715 | #else /* no yyoverflow */ |
716 | /* Extend the stack our own way. */ | |
717 | if (yystacksize >= YYMAXDEPTH) | |
600f9b0c | 718 | goto yyoverflowlab; |
10fa2066 RS |
719 | yystacksize *= 2; |
720 | if (yystacksize > YYMAXDEPTH) | |
721 | yystacksize = YYMAXDEPTH; | |
e9e4c321 | 722 | |
600f9b0c PE |
723 | { |
724 | short *yyss1 = yyss; | |
2729e106 PE |
725 | union yyalloc *yyptr = |
726 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); | |
600f9b0c PE |
727 | if (! yyptr) |
728 | goto yyoverflowlab; | |
5b041382 PE |
729 | YYSTACK_RELOCATE (yyss); |
730 | YYSTACK_RELOCATE (yyvs); | |
5af1f549 | 731 | # if YYLSP_NEEDED |
5b041382 | 732 | YYSTACK_RELOCATE (yyls); |
b07b484a | 733 | # endif |
600f9b0c PE |
734 | # undef YYSTACK_RELOCATE |
735 | if (yyss1 != yyssa) | |
736 | YYSTACK_FREE (yyss1); | |
737 | } | |
10fa2066 RS |
738 | #endif /* no yyoverflow */ |
739 | ||
7093d0f5 AD |
740 | yyssp = yyss + yysize - 1; |
741 | yyvsp = yyvs + yysize - 1; | |
5af1f549 | 742 | #if YYLSP_NEEDED |
7093d0f5 | 743 | yylsp = yyls + yysize - 1; |
10fa2066 RS |
744 | #endif |
745 | ||
7ea5e977 | 746 | YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
600f9b0c | 747 | (unsigned long int) yystacksize)); |
10fa2066 RS |
748 | |
749 | if (yyssp >= yyss + yystacksize - 1) | |
750 | YYABORT; | |
751 | } | |
752 | ||
7ea5e977 | 753 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
10fa2066 RS |
754 | |
755 | goto yybackup; | |
71da9eea | 756 | |
71da9eea AD |
757 | /*-----------. |
758 | | yybackup. | | |
759 | `-----------*/ | |
760 | yybackup: | |
10fa2066 RS |
761 | |
762 | /* Do appropriate processing given the current state. */ | |
763 | /* Read a lookahead token if we need one and don't already have one. */ | |
764 | /* yyresume: */ | |
765 | ||
766 | /* First try to decide what to do without reference to lookahead token. */ | |
767 | ||
768 | yyn = yypact[yystate]; | |
769 | if (yyn == YYFLAG) | |
770 | goto yydefault; | |
771 | ||
772 | /* Not known => get a lookahead token if don't already have one. */ | |
773 | ||
774 | /* yychar is either YYEMPTY or YYEOF | |
775 | or a valid token in external form. */ | |
776 | ||
17da6427 | 777 | if (yychar == YYEMPTY) |
10fa2066 | 778 | { |
7ea5e977 | 779 | YYDPRINTF ((stderr, "Reading a token: ")); |
17da6427 | 780 | yychar = YYLEX; |
10fa2066 RS |
781 | } |
782 | ||
e8cb70b9 | 783 | /* Convert token to internal form (in yychar1) for indexing tables with. */ |
10fa2066 | 784 | |
17da6427 | 785 | if (yychar <= 0) /* This means end of input. */ |
10fa2066 RS |
786 | { |
787 | yychar1 = 0; | |
17da6427 | 788 | yychar = YYEOF; /* Don't call YYLEX any more. */ |
10fa2066 | 789 | |
7ea5e977 | 790 | YYDPRINTF ((stderr, "Now at end of input.\n")); |
10fa2066 RS |
791 | } |
792 | else | |
793 | { | |
17da6427 | 794 | yychar1 = YYTRANSLATE (yychar); |
10fa2066 | 795 | |
0d533154 AD |
796 | #if YYDEBUG |
797 | /* We have to keep this `#if YYDEBUG', since we use variables | |
798 | which are defined only if `YYDEBUG' is set. */ | |
17da6427 | 799 | if (yydebug) |
10fa2066 | 800 | { |
7ea5e977 | 801 | YYFPRINTF (stderr, "Next token is %d (%s", |
b7575ffe | 802 | yychar, yytname[yychar1]); |
0d533154 AD |
803 | /* Give the individual parser a way to print the precise |
804 | meaning of a token, for further debugging info. */ | |
b07b484a | 805 | # ifdef YYPRINT |
7ea5e977 | 806 | YYPRINT (stderr, yychar, yylval); |
b07b484a | 807 | # endif |
7ea5e977 | 808 | YYFPRINTF (stderr, ")\n"); |
10fa2066 | 809 | } |
0d533154 | 810 | #endif |
10fa2066 RS |
811 | } |
812 | ||
813 | yyn += yychar1; | |
814 | if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) | |
815 | goto yydefault; | |
816 | ||
817 | yyn = yytable[yyn]; | |
818 | ||
819 | /* yyn is what to do for this token type in this state. | |
820 | Negative => reduce, -yyn is rule number. | |
821 | Positive => shift, yyn is new state. | |
822 | New state is final state => don't bother to shift, | |
823 | just return success. | |
824 | 0, or most negative number => error. */ | |
825 | ||
826 | if (yyn < 0) | |
827 | { | |
828 | if (yyn == YYFLAG) | |
829 | goto yyerrlab; | |
830 | yyn = -yyn; | |
831 | goto yyreduce; | |
832 | } | |
833 | else if (yyn == 0) | |
834 | goto yyerrlab; | |
835 | ||
836 | if (yyn == YYFINAL) | |
837 | YYACCEPT; | |
838 | ||
839 | /* Shift the lookahead token. */ | |
7ea5e977 | 840 | YYDPRINTF ((stderr, "Shifting token %d (%s), ", |
b7575ffe | 841 | yychar, yytname[yychar1])); |
10fa2066 RS |
842 | |
843 | /* Discard the token being shifted unless it is eof. */ | |
17da6427 PB |
844 | if (yychar != YYEOF) |
845 | yychar = YYEMPTY; | |
10fa2066 | 846 | |
17da6427 | 847 | *++yyvsp = yylval; |
5af1f549 | 848 | #if YYLSP_NEEDED |
10fa2066 RS |
849 | *++yylsp = yylloc; |
850 | #endif | |
851 | ||
71da9eea AD |
852 | /* Count tokens shifted since error; after three, turn off error |
853 | status. */ | |
854 | if (yyerrstatus) | |
855 | yyerrstatus--; | |
10fa2066 RS |
856 | |
857 | yystate = yyn; | |
858 | goto yynewstate; | |
859 | ||
10fa2066 | 860 | |
71da9eea AD |
861 | /*-----------------------------------------------------------. |
862 | | yydefault -- do the default action for the current state. | | |
863 | `-----------------------------------------------------------*/ | |
864 | yydefault: | |
10fa2066 RS |
865 | yyn = yydefact[yystate]; |
866 | if (yyn == 0) | |
867 | goto yyerrlab; | |
71da9eea | 868 | goto yyreduce; |
10fa2066 | 869 | |
71da9eea AD |
870 | |
871 | /*-----------------------------. | |
872 | | yyreduce -- Do a reduction. | | |
873 | `-----------------------------*/ | |
10fa2066 | 874 | yyreduce: |
71da9eea | 875 | /* yyn is the number of a rule to reduce with. */ |
10fa2066 | 876 | yylen = yyr2[yyn]; |
da9abf43 AD |
877 | |
878 | /* If YYLEN is nonzero, implement the default value of the action: | |
573c1d9f | 879 | `$$ = $1'. |
da9abf43 AD |
880 | |
881 | Otherwise, the following line sets YYVAL to the semantic value of | |
882 | the lookahead token. This behavior is undocumented and Bison | |
883 | users should not rely upon it. Assigning to YYVAL | |
884 | unconditionally makes the parser a bit smaller, and it avoids a | |
885 | GCC warning that YYVAL may be used uninitialized. */ | |
886 | yyval = yyvsp[1-yylen]; | |
3abcd459 | 887 | |
5af1f549 | 888 | #if YYLSP_NEEDED |
3abcd459 AD |
889 | /* Similarly for the default location. Let the user run additional |
890 | commands if for instance locations are ranges. */ | |
891 | yyloc = yylsp[1-yylen]; | |
ca96bc2d | 892 | YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); |
6666f98f | 893 | #endif |
10fa2066 | 894 | |
0de741ca AD |
895 | #if YYDEBUG |
896 | /* We have to keep this `#if YYDEBUG', since we use variables which | |
897 | are defined only if `YYDEBUG' is set. */ | |
17da6427 | 898 | if (yydebug) |
10fa2066 | 899 | { |
7093d0f5 | 900 | int yyi; |
10fa2066 | 901 | |
7ea5e977 | 902 | YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", |
3db472b9 | 903 | yyn - 1, yyrline[yyn]); |
10fa2066 RS |
904 | |
905 | /* Print the symbols being reduced, and their result. */ | |
3db472b9 | 906 | for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++) |
7ea5e977 AD |
907 | YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); |
908 | YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); | |
10fa2066 RS |
909 | } |
910 | #endif | |
a8289c62 | 911 | switch (yyn) |
be2a1a68 AD |
912 | ]{ |
913 | b4_actions | |
a8289c62 | 914 | } |
897668ee | 915 | |
be2a1a68 | 916 | /* Line __line__ of __file__. */ |
26b23c1a | 917 | #line __oline__ |
10fa2066 | 918 | \f |
be2a1a68 | 919 | [ yyvsp -= yylen; |
10fa2066 | 920 | yyssp -= yylen; |
5af1f549 | 921 | #if YYLSP_NEEDED |
10fa2066 RS |
922 | yylsp -= yylen; |
923 | #endif | |
924 | ||
5a35a6cb | 925 | #if YYDEBUG |
17da6427 | 926 | if (yydebug) |
10fa2066 | 927 | { |
7093d0f5 | 928 | short *yyssp1 = yyss - 1; |
7ea5e977 | 929 | YYFPRINTF (stderr, "state stack now"); |
7093d0f5 | 930 | while (yyssp1 != yyssp) |
7ea5e977 AD |
931 | YYFPRINTF (stderr, " %d", *++yyssp1); |
932 | YYFPRINTF (stderr, "\n"); | |
10fa2066 | 933 | } |
5a35a6cb | 934 | #endif |
10fa2066 RS |
935 | |
936 | *++yyvsp = yyval; | |
5af1f549 | 937 | #if YYLSP_NEEDED |
6666f98f | 938 | *++yylsp = yyloc; |
10fa2066 RS |
939 | #endif |
940 | ||
41aca2e0 AD |
941 | /* Now `shift' the result of the reduction. Determine what state |
942 | that goes to, based on the state we popped back to and the rule | |
943 | number reduced by. */ | |
10fa2066 RS |
944 | |
945 | yyn = yyr1[yyn]; | |
946 | ||
7742ddeb | 947 | yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; |
10fa2066 RS |
948 | if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) |
949 | yystate = yytable[yystate]; | |
950 | else | |
7742ddeb | 951 | yystate = yydefgoto[yyn - YYNTOKENS]; |
10fa2066 RS |
952 | |
953 | goto yynewstate; | |
954 | ||
10fa2066 | 955 | |
71da9eea AD |
956 | /*------------------------------------. |
957 | | yyerrlab -- here on detecting error | | |
958 | `------------------------------------*/ | |
959 | yyerrlab: | |
960 | /* If not already recovering from an error, report this error. */ | |
961 | if (!yyerrstatus) | |
10fa2066 | 962 | { |
17da6427 | 963 | ++yynerrs; |
10fa2066 | 964 | |
8850be4b | 965 | #if YYERROR_VERBOSE |
10fa2066 RS |
966 | yyn = yypact[yystate]; |
967 | ||
968 | if (yyn > YYFLAG && yyn < YYLAST) | |
969 | { | |
7093d0f5 AD |
970 | YYSIZE_T yysize = 0; |
971 | char *yymsg; | |
972 | int yyx, yycount; | |
10fa2066 | 973 | |
7093d0f5 AD |
974 | yycount = 0; |
975 | /* Start YYX at -YYN if negative to avoid negative indexes in | |
f0473484 | 976 | YYCHECK. */ |
7093d0f5 AD |
977 | for (yyx = yyn < 0 ? -yyn : 0; |
978 | yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) | |
979 | if (yycheck[yyx + yyn] == yyx) | |
980 | yysize += yystrlen (yytname[yyx]) + 15, yycount++; | |
981 | yysize += yystrlen ("parse error, unexpected ") + 1; | |
982 | yysize += yystrlen (yytname[YYTRANSLATE (yychar)]); | |
983 | yymsg = (char *) YYSTACK_ALLOC (yysize); | |
984 | if (yymsg != 0) | |
10fa2066 | 985 | { |
7093d0f5 AD |
986 | char *yyp = yystpcpy (yymsg, "parse error, unexpected "); |
987 | yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]); | |
10fa2066 | 988 | |
7093d0f5 | 989 | if (yycount < 5) |
10fa2066 | 990 | { |
7093d0f5 AD |
991 | yycount = 0; |
992 | for (yyx = yyn < 0 ? -yyn : 0; | |
993 | yyx < (int) (sizeof (yytname) / sizeof (char *)); | |
994 | yyx++) | |
995 | if (yycheck[yyx + yyn] == yyx) | |
10fa2066 | 996 | { |
7093d0f5 AD |
997 | const char *yyq = ! yycount ? ", expecting " : " or "; |
998 | yyp = yystpcpy (yyp, yyq); | |
999 | yyp = yystpcpy (yyp, yytname[yyx]); | |
1000 | yycount++; | |
10fa2066 RS |
1001 | } |
1002 | } | |
7093d0f5 AD |
1003 | yyerror (yymsg); |
1004 | YYSTACK_FREE (yymsg); | |
1005 | } | |
1006 | else | |
1007 | yyerror ("parse error; also virtual memory exhausted"); | |
a8289c62 | 1008 | } |
10fa2066 | 1009 | else |
b7575ffe | 1010 | #endif /* YYERROR_VERBOSE */ |
17da6427 | 1011 | yyerror ("parse error"); |
10fa2066 | 1012 | } |
10fa2066 | 1013 | goto yyerrlab1; |
10fa2066 | 1014 | |
71da9eea | 1015 | |
e8cb70b9 PB |
1016 | /*----------------------------------------------------. |
1017 | | yyerrlab1 -- error raised explicitly by an action. | | |
1018 | `----------------------------------------------------*/ | |
71da9eea | 1019 | yyerrlab1: |
10fa2066 RS |
1020 | if (yyerrstatus == 3) |
1021 | { | |
71da9eea AD |
1022 | /* If just tried and failed to reuse lookahead token after an |
1023 | error, discard it. */ | |
10fa2066 | 1024 | |
e8cb70b9 | 1025 | /* Return failure if at end of input. */ |
17da6427 | 1026 | if (yychar == YYEOF) |
10fa2066 | 1027 | YYABORT; |
7ea5e977 | 1028 | YYDPRINTF ((stderr, "Discarding token %d (%s).\n", |
17da6427 PB |
1029 | yychar, yytname[yychar1])); |
1030 | yychar = YYEMPTY; | |
10fa2066 RS |
1031 | } |
1032 | ||
71da9eea AD |
1033 | /* Else will try to reuse lookahead token after shifting the error |
1034 | token. */ | |
10fa2066 | 1035 | |
e8cb70b9 | 1036 | yyerrstatus = 3; /* Each real token shifted decrements this. */ |
10fa2066 RS |
1037 | |
1038 | goto yyerrhandle; | |
1039 | ||
10fa2066 | 1040 | |
71da9eea AD |
1041 | /*-------------------------------------------------------------------. |
1042 | | yyerrdefault -- current state does not do anything special for the | | |
1043 | | error token. | | |
1044 | `-------------------------------------------------------------------*/ | |
1045 | yyerrdefault: | |
10fa2066 RS |
1046 | #if 0 |
1047 | /* This is wrong; only states that explicitly want error tokens | |
1048 | should shift them. */ | |
71da9eea AD |
1049 | |
1050 | /* If its default is to accept any token, ok. Otherwise pop it. */ | |
1051 | yyn = yydefact[yystate]; | |
1052 | if (yyn) | |
1053 | goto yydefault; | |
10fa2066 RS |
1054 | #endif |
1055 | ||
10fa2066 | 1056 | |
71da9eea AD |
1057 | /*---------------------------------------------------------------. |
1058 | | yyerrpop -- pop the current state because it cannot handle the | | |
e8cb70b9 | 1059 | | error token. | |
71da9eea AD |
1060 | `---------------------------------------------------------------*/ |
1061 | yyerrpop: | |
1062 | if (yyssp == yyss) | |
1063 | YYABORT; | |
10fa2066 RS |
1064 | yyvsp--; |
1065 | yystate = *--yyssp; | |
5af1f549 | 1066 | #if YYLSP_NEEDED |
10fa2066 RS |
1067 | yylsp--; |
1068 | #endif | |
1069 | ||
5a35a6cb | 1070 | #if YYDEBUG |
17da6427 | 1071 | if (yydebug) |
10fa2066 | 1072 | { |
7093d0f5 | 1073 | short *yyssp1 = yyss - 1; |
7ea5e977 | 1074 | YYFPRINTF (stderr, "Error: state stack now"); |
7093d0f5 | 1075 | while (yyssp1 != yyssp) |
7ea5e977 AD |
1076 | YYFPRINTF (stderr, " %d", *++yyssp1); |
1077 | YYFPRINTF (stderr, "\n"); | |
10fa2066 | 1078 | } |
5a35a6cb | 1079 | #endif |
10fa2066 | 1080 | |
71da9eea AD |
1081 | /*--------------. |
1082 | | yyerrhandle. | | |
1083 | `--------------*/ | |
1084 | yyerrhandle: | |
10fa2066 RS |
1085 | yyn = yypact[yystate]; |
1086 | if (yyn == YYFLAG) | |
1087 | goto yyerrdefault; | |
1088 | ||
1089 | yyn += YYTERROR; | |
1090 | if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) | |
1091 | goto yyerrdefault; | |
1092 | ||
1093 | yyn = yytable[yyn]; | |
1094 | if (yyn < 0) | |
1095 | { | |
1096 | if (yyn == YYFLAG) | |
1097 | goto yyerrpop; | |
1098 | yyn = -yyn; | |
1099 | goto yyreduce; | |
1100 | } | |
1101 | else if (yyn == 0) | |
1102 | goto yyerrpop; | |
1103 | ||
1104 | if (yyn == YYFINAL) | |
1105 | YYACCEPT; | |
1106 | ||
7ea5e977 | 1107 | YYDPRINTF ((stderr, "Shifting error token, ")); |
10fa2066 | 1108 | |
17da6427 | 1109 | *++yyvsp = yylval; |
5af1f549 | 1110 | #if YYLSP_NEEDED |
10fa2066 RS |
1111 | *++yylsp = yylloc; |
1112 | #endif | |
1113 | ||
1114 | yystate = yyn; | |
1115 | goto yynewstate; | |
70ddf897 | 1116 | |
71da9eea AD |
1117 | |
1118 | /*-------------------------------------. | |
1119 | | yyacceptlab -- YYACCEPT comes here. | | |
1120 | `-------------------------------------*/ | |
1121 | yyacceptlab: | |
600f9b0c PE |
1122 | yyresult = 0; |
1123 | goto yyreturn; | |
71da9eea AD |
1124 | |
1125 | /*-----------------------------------. | |
1126 | | yyabortlab -- YYABORT comes here. | | |
1127 | `-----------------------------------*/ | |
1128 | yyabortlab: | |
600f9b0c PE |
1129 | yyresult = 1; |
1130 | goto yyreturn; | |
1131 | ||
1132 | /*---------------------------------------------. | |
1133 | | yyoverflowab -- parser overflow comes here. | | |
1134 | `---------------------------------------------*/ | |
1135 | yyoverflowlab: | |
1136 | yyerror ("parser stack overflow"); | |
1137 | yyresult = 2; | |
1138 | /* Fall through. */ | |
1139 | ||
1140 | yyreturn: | |
1141 | #ifndef yyoverflow | |
1142 | if (yyss != yyssa) | |
1143 | YYSTACK_FREE (yyss); | |
70ddf897 | 1144 | #endif |
600f9b0c | 1145 | return yyresult; |
be2a1a68 AD |
1146 | ]} |
1147 | ||
1148 | b4_epilogue | |
1149 | m4_if(b4_defines_flag, 0, [], | |
1150 | [#output "b4_output_header_name" | |
1151 | #ifndef b4_header_guard | |
1152 | # define b4_header_guard | |
1153 | ||
0d8bed56 | 1154 | b4_token_defines(b4_tokens) |
be2a1a68 AD |
1155 | |
1156 | #ifndef YYSTYPE | |
642cb8f8 AD |
1157 | m4_ifdef([b4_stype_line], |
1158 | [#line b4_stype_line "b4_filename" | |
1159 | ])dnl | |
be2a1a68 AD |
1160 | typedef b4_stype |
1161 | yystype; | |
1162 | # define YYSTYPE yystype | |
1163 | #endif | |
1164 | ||
1165 | m4_if(b4_pure, [0], | |
1166 | [extern YYSTYPE b4_prefix[]lval;]) | |
1167 | ||
1168 | m4_if(b4_locations_flag, [0], [], | |
1169 | [#ifndef YYLTYPE | |
1170 | typedef struct yyltype | |
1171 | { | |
1172 | int first_line; | |
1173 | int first_column; | |
1174 | int last_line; | |
1175 | int last_column; | |
1176 | } yyltype; | |
1177 | # define YYLTYPE yyltype | |
1178 | #endif | |
ff48177d | 1179 | |
be2a1a68 AD |
1180 | m4_if(b4_pure, [0], |
1181 | [extern YYLTYPE b4_prefix[]lloc;]) | |
1182 | ]) | |
1183 | #endif /* not b4_header_guard */ | |
1184 | ]) |