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