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