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