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