]>
Commit | Line | Data |
---|---|---|
568035b7 | 1 | /* A Bison parser, made by GNU Bison 2.7. */ |
d9b88bce | 2 | |
547b5e30 | 3 | /* Bison implementation for Yacc-like parsers in C |
2ebe9112 | 4 | |
568035b7 | 5 | Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. |
2ebe9112 | 6 | |
d9b88bce UD |
7 | This program is free software: you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation, either version 3 of the License, or | |
10 | (at your option) any later version. | |
2ebe9112 | 11 | |
d9b88bce UD |
12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
2ebe9112 | 16 | |
d9b88bce UD |
17 | You should have received a copy of the GNU General Public License |
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
19 | ||
20 | /* As a special exception, you may create a larger work that contains | |
21 | part or all of the Bison parser skeleton and distribute that work | |
22 | under terms of your choice, so long as that work isn't itself a | |
23 | parser generator using the skeleton or a modified version thereof | |
24 | as a parser skeleton. Alternatively, if you modify or redistribute | |
25 | the parser skeleton itself, you may (at your option) remove this | |
26 | special exception, which will cause the skeleton and the resulting | |
27 | Bison output files to be licensed under the GNU General Public | |
28 | License without this special exception. | |
2ebe9112 | 29 | |
d9b88bce UD |
30 | This special exception was added by the Free Software Foundation in |
31 | version 2.2 of Bison. */ | |
32 | ||
33 | /* C LALR(1) parser skeleton written by Richard Stallman, by | |
34 | simplifying the original so-called "semantic" parser. */ | |
35 | ||
36 | /* All symbols defined below should begin with yy or YY, to avoid | |
37 | infringing on user name space. This should be done even for local | |
38 | variables, as they might otherwise be expanded by user macros. | |
39 | There are some unavoidable exceptions within include files to | |
40 | define necessary library symbols; they are noted "INFRINGES ON | |
41 | USER NAME SPACE" below. */ | |
42 | ||
43 | /* Identify Bison output. */ | |
44 | #define YYBISON 1 | |
45 | ||
46 | /* Bison version. */ | |
568035b7 | 47 | #define YYBISON_VERSION "2.7" |
d9b88bce UD |
48 | |
49 | /* Skeleton name. */ | |
50 | #define YYSKELETON_NAME "yacc.c" | |
51 | ||
52 | /* Pure parsers. */ | |
53 | #define YYPURE 1 | |
54 | ||
55 | /* Push parsers. */ | |
56 | #define YYPUSH 0 | |
57 | ||
58 | /* Pull parsers. */ | |
59 | #define YYPULL 1 | |
60 | ||
d9b88bce UD |
61 | |
62 | /* Substitute the variable and function names. */ | |
63 | #define yyparse __gettextparse | |
64 | #define yylex __gettextlex | |
65 | #define yyerror __gettexterror | |
66 | #define yylval __gettextlval | |
67 | #define yychar __gettextchar | |
68 | #define yydebug __gettextdebug | |
69 | #define yynerrs __gettextnerrs | |
70 | ||
d9b88bce | 71 | /* Copy the first part of user declarations. */ |
568035b7 | 72 | /* Line 371 of yacc.c */ |
abbffdf9 UD |
73 | #line 1 "plural.y" |
74 | ||
75 | /* Expression parsing for plural form selection. | |
d4697bc9 | 76 | Copyright (C) 2000-2014 Free Software Foundation, Inc. |
a1b36134 | 77 | This file is part of the GNU C Library. |
abbffdf9 UD |
78 | Written by Ulrich Drepper <drepper@cygnus.com>, 2000. |
79 | ||
80 | The GNU C Library is free software; you can redistribute it and/or | |
a1b36134 AJ |
81 | modify it under the terms of the GNU Lesser General Public |
82 | License as published by the Free Software Foundation; either | |
83 | version 2.1 of the License, or (at your option) any later version. | |
abbffdf9 UD |
84 | |
85 | The GNU C Library is distributed in the hope that it will be useful, | |
86 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
87 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
a1b36134 | 88 | Lesser General Public License for more details. |
abbffdf9 | 89 | |
a1b36134 | 90 | You should have received a copy of the GNU Lesser General Public |
547b5e30 PE |
91 | License along with the GNU C Library; if not, see |
92 | <http://www.gnu.org/licenses/>. */ | |
abbffdf9 | 93 | |
0555fcce UD |
94 | /* The bison generated parser uses alloca. AIX 3 forces us to put this |
95 | declaration at the beginning of the file. The declaration in bison's | |
96 | skeleton file comes too late. This must come before <config.h> | |
97 | because <config.h> may include arbitrary system headers. */ | |
98 | #if defined _AIX && !defined __GNUC__ | |
99 | #pragma alloca | |
100 | #endif | |
eda6c725 UD |
101 | #ifdef HAVE_CONFIG_H |
102 | # include <config.h> | |
103 | #endif | |
104 | ||
0555fcce | 105 | #include <stddef.h> |
abbffdf9 | 106 | #include <stdlib.h> |
85dd1003 | 107 | #include <string.h> |
0555fcce UD |
108 | #include "plural-exp.h" |
109 | ||
110 | /* The main function generated by the parser is called __gettextparse, | |
111 | but we want it to be called PLURAL_PARSE. */ | |
112 | #ifndef _LIBC | |
113 | # define __gettextparse PLURAL_PARSE | |
4a4d50f3 UD |
114 | #endif |
115 | ||
abbffdf9 UD |
116 | #define YYLEX_PARAM &((struct parse_args *) arg)->cp |
117 | #define YYPARSE_PARAM arg | |
118 | ||
568035b7 JM |
119 | /* Line 371 of yacc.c */ |
120 | #line 121 "plural.c" | |
d9b88bce | 121 | |
568035b7 JM |
122 | # ifndef YY_NULL |
123 | # if defined __cplusplus && 201103L <= __cplusplus | |
124 | # define YY_NULL nullptr | |
125 | # else | |
126 | # define YY_NULL 0 | |
127 | # endif | |
128 | # endif | |
d9b88bce UD |
129 | |
130 | /* Enabling verbose error messages. */ | |
131 | #ifdef YYERROR_VERBOSE | |
132 | # undef YYERROR_VERBOSE | |
133 | # define YYERROR_VERBOSE 1 | |
134 | #else | |
135 | # define YYERROR_VERBOSE 0 | |
136 | #endif | |
137 | ||
d9b88bce | 138 | |
568035b7 JM |
139 | /* Enabling traces. */ |
140 | #ifndef YYDEBUG | |
141 | # define YYDEBUG 0 | |
142 | #endif | |
143 | #if YYDEBUG | |
144 | extern int __gettextdebug; | |
145 | #endif | |
d9b88bce UD |
146 | |
147 | /* Tokens. */ | |
148 | #ifndef YYTOKENTYPE | |
149 | # define YYTOKENTYPE | |
150 | /* Put the tokens into the symbol table, so that GDB and other debuggers | |
151 | know about them. */ | |
152 | enum yytokentype { | |
153 | EQUOP2 = 258, | |
154 | CMPOP2 = 259, | |
155 | ADDOP2 = 260, | |
156 | MULOP2 = 261, | |
157 | NUMBER = 262 | |
158 | }; | |
159 | #endif | |
547b5e30 PE |
160 | /* Tokens. */ |
161 | #define EQUOP2 258 | |
162 | #define CMPOP2 259 | |
163 | #define ADDOP2 260 | |
164 | #define MULOP2 261 | |
165 | #define NUMBER 262 | |
166 | ||
d9b88bce UD |
167 | |
168 | ||
d9b88bce UD |
169 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED |
170 | typedef union YYSTYPE | |
171 | { | |
568035b7 | 172 | /* Line 387 of yacc.c */ |
547b5e30 | 173 | #line 49 "plural.y" |
d9b88bce | 174 | |
abbffdf9 | 175 | unsigned long int num; |
4a4d50f3 | 176 | enum operator op; |
abbffdf9 | 177 | struct expression *exp; |
d9b88bce UD |
178 | |
179 | ||
568035b7 JM |
180 | /* Line 387 of yacc.c */ |
181 | #line 182 "plural.c" | |
d9b88bce | 182 | } YYSTYPE; |
a58b1e65 | 183 | # define YYSTYPE_IS_TRIVIAL 1 |
d9b88bce UD |
184 | # define yystype YYSTYPE /* obsolescent; will be withdrawn */ |
185 | # define YYSTYPE_IS_DECLARED 1 | |
a58b1e65 | 186 | #endif |
d9b88bce UD |
187 | |
188 | ||
568035b7 JM |
189 | #ifdef YYPARSE_PARAM |
190 | #if defined __STDC__ || defined __cplusplus | |
191 | int __gettextparse (void *YYPARSE_PARAM); | |
192 | #else | |
193 | int __gettextparse (); | |
194 | #endif | |
195 | #else /* ! YYPARSE_PARAM */ | |
196 | #if defined __STDC__ || defined __cplusplus | |
197 | int __gettextparse (void); | |
198 | #else | |
199 | int __gettextparse (); | |
200 | #endif | |
201 | #endif /* ! YYPARSE_PARAM */ | |
d9b88bce | 202 | |
568035b7 JM |
203 | |
204 | ||
205 | /* Copy the second part of user declarations. */ | |
206 | /* Line 390 of yacc.c */ | |
547b5e30 | 207 | #line 55 "plural.y" |
abbffdf9 UD |
208 | |
209 | /* Prototypes for local functions. */ | |
4a4d50f3 UD |
210 | static struct expression *new_exp PARAMS ((int nargs, enum operator op, |
211 | struct expression * const *args)); | |
212 | static inline struct expression *new_exp_0 PARAMS ((enum operator op)); | |
213 | static inline struct expression *new_exp_1 PARAMS ((enum operator op, | |
214 | struct expression *right)); | |
215 | static struct expression *new_exp_2 PARAMS ((enum operator op, | |
216 | struct expression *left, | |
217 | struct expression *right)); | |
218 | static inline struct expression *new_exp_3 PARAMS ((enum operator op, | |
219 | struct expression *bexp, | |
220 | struct expression *tbranch, | |
221 | struct expression *fbranch)); | |
222 | static int yylex PARAMS ((YYSTYPE *lval, const char **pexp)); | |
223 | static void yyerror PARAMS ((const char *str)); | |
224 | ||
225 | /* Allocation of expressions. */ | |
226 | ||
227 | static struct expression * | |
228 | new_exp (nargs, op, args) | |
229 | int nargs; | |
230 | enum operator op; | |
231 | struct expression * const *args; | |
232 | { | |
233 | int i; | |
234 | struct expression *newp; | |
235 | ||
236 | /* If any of the argument could not be malloc'ed, just return NULL. */ | |
237 | for (i = nargs - 1; i >= 0; i--) | |
238 | if (args[i] == NULL) | |
239 | goto fail; | |
240 | ||
241 | /* Allocate a new expression. */ | |
242 | newp = (struct expression *) malloc (sizeof (*newp)); | |
243 | if (newp != NULL) | |
244 | { | |
245 | newp->nargs = nargs; | |
246 | newp->operation = op; | |
247 | for (i = nargs - 1; i >= 0; i--) | |
248 | newp->val.args[i] = args[i]; | |
249 | return newp; | |
250 | } | |
251 | ||
252 | fail: | |
253 | for (i = nargs - 1; i >= 0; i--) | |
254 | FREE_EXPRESSION (args[i]); | |
255 | ||
256 | return NULL; | |
257 | } | |
258 | ||
259 | static inline struct expression * | |
260 | new_exp_0 (op) | |
261 | enum operator op; | |
262 | { | |
263 | return new_exp (0, op, NULL); | |
264 | } | |
265 | ||
266 | static inline struct expression * | |
267 | new_exp_1 (op, right) | |
268 | enum operator op; | |
269 | struct expression *right; | |
270 | { | |
271 | struct expression *args[1]; | |
272 | ||
273 | args[0] = right; | |
274 | return new_exp (1, op, args); | |
275 | } | |
276 | ||
277 | static struct expression * | |
278 | new_exp_2 (op, left, right) | |
279 | enum operator op; | |
280 | struct expression *left; | |
281 | struct expression *right; | |
282 | { | |
283 | struct expression *args[2]; | |
284 | ||
285 | args[0] = left; | |
286 | args[1] = right; | |
287 | return new_exp (2, op, args); | |
288 | } | |
289 | ||
290 | static inline struct expression * | |
291 | new_exp_3 (op, bexp, tbranch, fbranch) | |
292 | enum operator op; | |
293 | struct expression *bexp; | |
294 | struct expression *tbranch; | |
295 | struct expression *fbranch; | |
296 | { | |
297 | struct expression *args[3]; | |
298 | ||
299 | args[0] = bexp; | |
300 | args[1] = tbranch; | |
301 | args[2] = fbranch; | |
302 | return new_exp (3, op, args); | |
303 | } | |
304 | ||
abbffdf9 | 305 | |
568035b7 JM |
306 | /* Line 390 of yacc.c */ |
307 | #line 308 "plural.c" | |
abbffdf9 | 308 | |
d9b88bce UD |
309 | #ifdef short |
310 | # undef short | |
abbffdf9 UD |
311 | #endif |
312 | ||
d9b88bce UD |
313 | #ifdef YYTYPE_UINT8 |
314 | typedef YYTYPE_UINT8 yytype_uint8; | |
315 | #else | |
316 | typedef unsigned char yytype_uint8; | |
abbffdf9 UD |
317 | #endif |
318 | ||
d9b88bce UD |
319 | #ifdef YYTYPE_INT8 |
320 | typedef YYTYPE_INT8 yytype_int8; | |
321 | #elif (defined __STDC__ || defined __C99__FUNC__ \ | |
322 | || defined __cplusplus || defined _MSC_VER) | |
323 | typedef signed char yytype_int8; | |
324 | #else | |
325 | typedef short int yytype_int8; | |
abbffdf9 UD |
326 | #endif |
327 | ||
d9b88bce UD |
328 | #ifdef YYTYPE_UINT16 |
329 | typedef YYTYPE_UINT16 yytype_uint16; | |
330 | #else | |
331 | typedef unsigned short int yytype_uint16; | |
332 | #endif | |
abbffdf9 | 333 | |
d9b88bce UD |
334 | #ifdef YYTYPE_INT16 |
335 | typedef YYTYPE_INT16 yytype_int16; | |
336 | #else | |
337 | typedef short int yytype_int16; | |
338 | #endif | |
abbffdf9 | 339 | |
d9b88bce UD |
340 | #ifndef YYSIZE_T |
341 | # ifdef __SIZE_TYPE__ | |
342 | # define YYSIZE_T __SIZE_TYPE__ | |
343 | # elif defined size_t | |
344 | # define YYSIZE_T size_t | |
345 | # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ | |
346 | || defined __cplusplus || defined _MSC_VER) | |
347 | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ | |
348 | # define YYSIZE_T size_t | |
349 | # else | |
350 | # define YYSIZE_T unsigned int | |
351 | # endif | |
352 | #endif | |
abbffdf9 | 353 | |
d9b88bce | 354 | #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
abbffdf9 | 355 | |
d9b88bce UD |
356 | #ifndef YY_ |
357 | # if defined YYENABLE_NLS && YYENABLE_NLS | |
358 | # if ENABLE_NLS | |
359 | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ | |
568035b7 | 360 | # define YY_(Msgid) dgettext ("bison-runtime", Msgid) |
d9b88bce UD |
361 | # endif |
362 | # endif | |
363 | # ifndef YY_ | |
568035b7 | 364 | # define YY_(Msgid) Msgid |
d9b88bce UD |
365 | # endif |
366 | #endif | |
abbffdf9 | 367 | |
d9b88bce UD |
368 | /* Suppress unused-variable warnings by "using" E. */ |
369 | #if ! defined lint || defined __GNUC__ | |
568035b7 | 370 | # define YYUSE(E) ((void) (E)) |
d9b88bce | 371 | #else |
568035b7 | 372 | # define YYUSE(E) /* empty */ |
d9b88bce | 373 | #endif |
abbffdf9 | 374 | |
d9b88bce UD |
375 | /* Identity function, used to suppress warnings about constant conditions. */ |
376 | #ifndef lint | |
568035b7 | 377 | # define YYID(N) (N) |
d9b88bce UD |
378 | #else |
379 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
380 | || defined __cplusplus || defined _MSC_VER) | |
381 | static int | |
382 | YYID (int yyi) | |
383 | #else | |
384 | static int | |
385 | YYID (yyi) | |
386 | int yyi; | |
387 | #endif | |
a58b1e65 | 388 | { |
d9b88bce UD |
389 | return yyi; |
390 | } | |
391 | #endif | |
a58b1e65 | 392 | |
d9b88bce | 393 | #if ! defined yyoverflow || YYERROR_VERBOSE |
a58b1e65 RH |
394 | |
395 | /* The parser invokes alloca or malloc; define the necessary symbols. */ | |
396 | ||
d9b88bce UD |
397 | # ifdef YYSTACK_USE_ALLOCA |
398 | # if YYSTACK_USE_ALLOCA | |
399 | # ifdef __GNUC__ | |
400 | # define YYSTACK_ALLOC __builtin_alloca | |
401 | # elif defined __BUILTIN_VA_ARG_INCR | |
402 | # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ | |
403 | # elif defined _AIX | |
404 | # define YYSTACK_ALLOC __alloca | |
405 | # elif defined _MSC_VER | |
406 | # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ | |
407 | # define alloca _alloca | |
a58b1e65 | 408 | # else |
d9b88bce | 409 | # define YYSTACK_ALLOC alloca |
547b5e30 | 410 | # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
d9b88bce UD |
411 | || defined __cplusplus || defined _MSC_VER) |
412 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ | |
568035b7 | 413 | /* Use EXIT_SUCCESS as a witness for stdlib.h. */ |
547b5e30 PE |
414 | # ifndef EXIT_SUCCESS |
415 | # define EXIT_SUCCESS 0 | |
d9b88bce | 416 | # endif |
a58b1e65 RH |
417 | # endif |
418 | # endif | |
419 | # endif | |
420 | # endif | |
421 | ||
422 | # ifdef YYSTACK_ALLOC | |
d9b88bce UD |
423 | /* Pacify GCC's `empty if-body' warning. */ |
424 | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) | |
425 | # ifndef YYSTACK_ALLOC_MAXIMUM | |
426 | /* The OS might guarantee only one guard page at the bottom of the stack, | |
427 | and a page size can be as small as 4096 bytes. So we cannot safely | |
428 | invoke alloca (N) if N exceeds 4096. Use a slightly smaller number | |
429 | to allow for a few compiler-allocated temporary stack slots. */ | |
430 | # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ | |
431 | # endif | |
a58b1e65 | 432 | # else |
d9b88bce UD |
433 | # define YYSTACK_ALLOC YYMALLOC |
434 | # define YYSTACK_FREE YYFREE | |
435 | # ifndef YYSTACK_ALLOC_MAXIMUM | |
436 | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM | |
437 | # endif | |
547b5e30 | 438 | # if (defined __cplusplus && ! defined EXIT_SUCCESS \ |
d9b88bce UD |
439 | && ! ((defined YYMALLOC || defined malloc) \ |
440 | && (defined YYFREE || defined free))) | |
a58b1e65 | 441 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
547b5e30 PE |
442 | # ifndef EXIT_SUCCESS |
443 | # define EXIT_SUCCESS 0 | |
d9b88bce UD |
444 | # endif |
445 | # endif | |
446 | # ifndef YYMALLOC | |
447 | # define YYMALLOC malloc | |
547b5e30 | 448 | # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
d9b88bce UD |
449 | || defined __cplusplus || defined _MSC_VER) |
450 | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ | |
451 | # endif | |
452 | # endif | |
453 | # ifndef YYFREE | |
454 | # define YYFREE free | |
547b5e30 | 455 | # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
d9b88bce UD |
456 | || defined __cplusplus || defined _MSC_VER) |
457 | void free (void *); /* INFRINGES ON USER NAME SPACE */ | |
458 | # endif | |
a58b1e65 | 459 | # endif |
a58b1e65 | 460 | # endif |
d9b88bce | 461 | #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ |
a58b1e65 RH |
462 | |
463 | ||
d9b88bce UD |
464 | #if (! defined yyoverflow \ |
465 | && (! defined __cplusplus \ | |
466 | || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) | |
a58b1e65 RH |
467 | |
468 | /* A type that is properly aligned for any stack member. */ | |
469 | union yyalloc | |
470 | { | |
d9b88bce UD |
471 | yytype_int16 yyss_alloc; |
472 | YYSTYPE yyvs_alloc; | |
a58b1e65 RH |
473 | }; |
474 | ||
475 | /* The size of the maximum gap between one aligned stack and the next. */ | |
d9b88bce | 476 | # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
a58b1e65 RH |
477 | |
478 | /* The size of an array large to enough to hold all stacks, each with | |
479 | N elements. */ | |
d9b88bce UD |
480 | # define YYSTACK_BYTES(N) \ |
481 | ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ | |
482 | + YYSTACK_GAP_MAXIMUM) | |
a58b1e65 | 483 | |
547b5e30 | 484 | # define YYCOPY_NEEDED 1 |
a58b1e65 RH |
485 | |
486 | /* Relocate STACK from its old location to the new one. The | |
487 | local variables YYSIZE and YYSTACKSIZE give the old and new number of | |
488 | elements in the stack, and YYPTR gives the new location of the | |
489 | stack. Advance YYPTR to a properly aligned location for the next | |
490 | stack. */ | |
d9b88bce | 491 | # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ |
a58b1e65 RH |
492 | do \ |
493 | { \ | |
494 | YYSIZE_T yynewbytes; \ | |
d9b88bce UD |
495 | YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ |
496 | Stack = &yyptr->Stack_alloc; \ | |
497 | yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ | |
a58b1e65 RH |
498 | yyptr += yynewbytes / sizeof (*yyptr); \ |
499 | } \ | |
d9b88bce | 500 | while (YYID (0)) |
abbffdf9 | 501 | |
abbffdf9 | 502 | #endif |
a58b1e65 | 503 | |
547b5e30 | 504 | #if defined YYCOPY_NEEDED && YYCOPY_NEEDED |
568035b7 | 505 | /* Copy COUNT objects from SRC to DST. The source and destination do |
547b5e30 PE |
506 | not overlap. */ |
507 | # ifndef YYCOPY | |
508 | # if defined __GNUC__ && 1 < __GNUC__ | |
568035b7 JM |
509 | # define YYCOPY(Dst, Src, Count) \ |
510 | __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) | |
547b5e30 | 511 | # else |
568035b7 JM |
512 | # define YYCOPY(Dst, Src, Count) \ |
513 | do \ | |
514 | { \ | |
515 | YYSIZE_T yyi; \ | |
516 | for (yyi = 0; yyi < (Count); yyi++) \ | |
517 | (Dst)[yyi] = (Src)[yyi]; \ | |
518 | } \ | |
547b5e30 PE |
519 | while (YYID (0)) |
520 | # endif | |
521 | # endif | |
522 | #endif /* !YYCOPY_NEEDED */ | |
523 | ||
d9b88bce UD |
524 | /* YYFINAL -- State number of the termination state. */ |
525 | #define YYFINAL 9 | |
526 | /* YYLAST -- Last index in YYTABLE. */ | |
527 | #define YYLAST 54 | |
528 | ||
529 | /* YYNTOKENS -- Number of terminals. */ | |
530 | #define YYNTOKENS 16 | |
531 | /* YYNNTS -- Number of nonterminals. */ | |
532 | #define YYNNTS 3 | |
533 | /* YYNRULES -- Number of rules. */ | |
534 | #define YYNRULES 13 | |
535 | /* YYNRULES -- Number of states. */ | |
536 | #define YYNSTATES 27 | |
537 | ||
538 | /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ | |
539 | #define YYUNDEFTOK 2 | |
540 | #define YYMAXUTOK 262 | |
541 | ||
542 | #define YYTRANSLATE(YYX) \ | |
543 | ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) | |
544 | ||
545 | /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ | |
546 | static const yytype_uint8 yytranslate[] = | |
547 | { | |
548 | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
549 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
550 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
551 | 2, 2, 2, 10, 2, 2, 2, 2, 5, 2, | |
552 | 14, 15, 2, 2, 2, 2, 2, 2, 2, 2, | |
553 | 2, 2, 2, 2, 2, 2, 2, 2, 12, 2, | |
554 | 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, | |
555 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
556 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
557 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
558 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
559 | 13, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
560 | 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, | |
561 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
562 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
563 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
564 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
565 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
566 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
567 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
568 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
569 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
570 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
571 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
572 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
573 | 2, 2, 2, 2, 2, 2, 1, 2, 6, 7, | |
574 | 8, 9, 11 | |
575 | }; | |
576 | ||
577 | #if YYDEBUG | |
578 | /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in | |
579 | YYRHS. */ | |
580 | static const yytype_uint8 yyprhs[] = | |
581 | { | |
582 | 0, 0, 3, 5, 11, 15, 19, 23, 27, 31, | |
583 | 35, 38, 40, 42 | |
584 | }; | |
585 | ||
586 | /* YYRHS -- A `-1'-separated list of the rules' RHS. */ | |
587 | static const yytype_int8 yyrhs[] = | |
588 | { | |
589 | 17, 0, -1, 18, -1, 18, 3, 18, 12, 18, | |
590 | -1, 18, 4, 18, -1, 18, 5, 18, -1, 18, | |
591 | 6, 18, -1, 18, 7, 18, -1, 18, 8, 18, | |
592 | -1, 18, 9, 18, -1, 10, 18, -1, 13, -1, | |
593 | 11, -1, 14, 18, 15, -1 | |
594 | }; | |
a58b1e65 | 595 | |
d9b88bce UD |
596 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
597 | static const yytype_uint8 yyrline[] = | |
598 | { | |
547b5e30 PE |
599 | 0, 174, 174, 182, 186, 190, 194, 198, 202, 206, |
600 | 210, 214, 218, 223 | |
d9b88bce | 601 | }; |
abbffdf9 | 602 | #endif |
d9b88bce | 603 | |
568035b7 | 604 | #if YYDEBUG || YYERROR_VERBOSE || 0 |
d9b88bce UD |
605 | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
606 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ | |
607 | static const char *const yytname[] = | |
608 | { | |
609 | "$end", "error", "$undefined", "'?'", "'|'", "'&'", "EQUOP2", "CMPOP2", | |
610 | "ADDOP2", "MULOP2", "'!'", "NUMBER", "':'", "'n'", "'('", "')'", | |
568035b7 | 611 | "$accept", "start", "exp", YY_NULL |
d9b88bce | 612 | }; |
a58b1e65 | 613 | #endif |
d9b88bce UD |
614 | |
615 | # ifdef YYPRINT | |
616 | /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to | |
617 | token YYLEX-NUM. */ | |
618 | static const yytype_uint16 yytoknum[] = | |
619 | { | |
620 | 0, 256, 257, 63, 124, 38, 258, 259, 260, 261, | |
621 | 33, 262, 58, 110, 40, 41 | |
622 | }; | |
a58b1e65 | 623 | # endif |
d9b88bce UD |
624 | |
625 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ | |
626 | static const yytype_uint8 yyr1[] = | |
627 | { | |
628 | 0, 16, 17, 18, 18, 18, 18, 18, 18, 18, | |
629 | 18, 18, 18, 18 | |
630 | }; | |
631 | ||
632 | /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ | |
633 | static const yytype_uint8 yyr2[] = | |
634 | { | |
635 | 0, 2, 1, 5, 3, 3, 3, 3, 3, 3, | |
636 | 2, 1, 1, 3 | |
637 | }; | |
638 | ||
547b5e30 PE |
639 | /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. |
640 | Performed when YYTABLE doesn't specify something else to do. Zero | |
d9b88bce UD |
641 | means the default is an error. */ |
642 | static const yytype_uint8 yydefact[] = | |
643 | { | |
644 | 0, 0, 12, 11, 0, 0, 2, 10, 0, 1, | |
645 | 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, | |
646 | 5, 6, 7, 8, 9, 0, 3 | |
647 | }; | |
648 | ||
649 | /* YYDEFGOTO[NTERM-NUM]. */ | |
650 | static const yytype_int8 yydefgoto[] = | |
651 | { | |
652 | -1, 5, 6 | |
653 | }; | |
654 | ||
655 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing | |
656 | STATE-NUM. */ | |
657 | #define YYPACT_NINF -10 | |
658 | static const yytype_int8 yypact[] = | |
659 | { | |
660 | -9, -9, -10, -10, -9, 8, 36, -10, 13, -10, | |
661 | -9, -9, -9, -9, -9, -9, -9, -10, 26, 41, | |
662 | 45, 18, -2, 14, -10, -9, 36 | |
663 | }; | |
664 | ||
665 | /* YYPGOTO[NTERM-NUM]. */ | |
666 | static const yytype_int8 yypgoto[] = | |
667 | { | |
668 | -10, -10, -1 | |
669 | }; | |
670 | ||
671 | /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If | |
672 | positive, shift that token. If negative, reduce the rule which | |
547b5e30 | 673 | number is the opposite. If YYTABLE_NINF, syntax error. */ |
d9b88bce UD |
674 | #define YYTABLE_NINF -1 |
675 | static const yytype_uint8 yytable[] = | |
676 | { | |
677 | 7, 1, 2, 8, 3, 4, 15, 16, 9, 18, | |
678 | 19, 20, 21, 22, 23, 24, 10, 11, 12, 13, | |
679 | 14, 15, 16, 16, 26, 14, 15, 16, 17, 10, | |
680 | 11, 12, 13, 14, 15, 16, 0, 0, 25, 10, | |
681 | 11, 12, 13, 14, 15, 16, 12, 13, 14, 15, | |
682 | 16, 13, 14, 15, 16 | |
683 | }; | |
684 | ||
568035b7 JM |
685 | #define yypact_value_is_default(Yystate) \ |
686 | (!!((Yystate) == (-10))) | |
547b5e30 | 687 | |
568035b7 | 688 | #define yytable_value_is_error(Yytable_value) \ |
547b5e30 PE |
689 | YYID (0) |
690 | ||
d9b88bce UD |
691 | static const yytype_int8 yycheck[] = |
692 | { | |
693 | 1, 10, 11, 4, 13, 14, 8, 9, 0, 10, | |
694 | 11, 12, 13, 14, 15, 16, 3, 4, 5, 6, | |
695 | 7, 8, 9, 9, 25, 7, 8, 9, 15, 3, | |
696 | 4, 5, 6, 7, 8, 9, -1, -1, 12, 3, | |
697 | 4, 5, 6, 7, 8, 9, 5, 6, 7, 8, | |
698 | 9, 6, 7, 8, 9 | |
699 | }; | |
700 | ||
701 | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing | |
702 | symbol of state STATE-NUM. */ | |
703 | static const yytype_uint8 yystos[] = | |
704 | { | |
705 | 0, 10, 11, 13, 14, 17, 18, 18, 18, 0, | |
706 | 3, 4, 5, 6, 7, 8, 9, 15, 18, 18, | |
707 | 18, 18, 18, 18, 18, 12, 18 | |
708 | }; | |
abbffdf9 UD |
709 | |
710 | #define yyerrok (yyerrstatus = 0) | |
711 | #define yyclearin (yychar = YYEMPTY) | |
d9b88bce | 712 | #define YYEMPTY (-2) |
abbffdf9 | 713 | #define YYEOF 0 |
d9b88bce | 714 | |
abbffdf9 | 715 | #define YYACCEPT goto yyacceptlab |
d9b88bce UD |
716 | #define YYABORT goto yyabortlab |
717 | #define YYERROR goto yyerrorlab | |
718 | ||
719 | ||
a58b1e65 RH |
720 | /* Like YYERROR except do call yyerror. This remains here temporarily |
721 | to ease the transition to the new meaning of YYERROR, for GCC. | |
d9b88bce UD |
722 | Once GCC version 2 has supplanted version 1, this can go. However, |
723 | YYFAIL appears to be in use. Nevertheless, it is formally deprecated | |
724 | in Bison 2.4.2's NEWS entry, where a plan to phase it out is | |
725 | discussed. */ | |
726 | ||
abbffdf9 | 727 | #define YYFAIL goto yyerrlab |
d9b88bce UD |
728 | #if defined YYFAIL |
729 | /* This is here to suppress warnings from the GCC cpp's | |
730 | -Wunused-macros. Normally we don't worry about that warning, but | |
731 | some users do, and we want to make it easy for users to remove | |
732 | YYFAIL uses, which will produce warnings from Bison 2.5. */ | |
733 | #endif | |
734 | ||
abbffdf9 | 735 | #define YYRECOVERING() (!!yyerrstatus) |
d9b88bce | 736 | |
568035b7 JM |
737 | #define YYBACKUP(Token, Value) \ |
738 | do \ | |
739 | if (yychar == YYEMPTY) \ | |
740 | { \ | |
741 | yychar = (Token); \ | |
742 | yylval = (Value); \ | |
743 | YYPOPSTACK (yylen); \ | |
744 | yystate = *yyssp; \ | |
745 | goto yybackup; \ | |
746 | } \ | |
747 | else \ | |
748 | { \ | |
d9b88bce | 749 | yyerror (YY_("syntax error: cannot back up")); \ |
a58b1e65 RH |
750 | YYERROR; \ |
751 | } \ | |
d9b88bce UD |
752 | while (YYID (0)) |
753 | ||
568035b7 | 754 | /* Error token number */ |
abbffdf9 UD |
755 | #define YYTERROR 1 |
756 | #define YYERRCODE 256 | |
757 | ||
abbffdf9 | 758 | |
547b5e30 | 759 | /* This macro is provided for backward compatibility. */ |
d9b88bce | 760 | #ifndef YY_LOCATION_PRINT |
547b5e30 | 761 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) |
d9b88bce UD |
762 | #endif |
763 | ||
764 | ||
765 | /* YYLEX -- calling `yylex' with the right arguments. */ | |
d9b88bce UD |
766 | #ifdef YYLEX_PARAM |
767 | # define YYLEX yylex (&yylval, YYLEX_PARAM) | |
768 | #else | |
769 | # define YYLEX yylex (&yylval) | |
770 | #endif | |
a58b1e65 RH |
771 | |
772 | /* Enable debugging if requested. */ | |
773 | #if YYDEBUG | |
774 | ||
775 | # ifndef YYFPRINTF | |
776 | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ | |
777 | # define YYFPRINTF fprintf | |
778 | # endif | |
779 | ||
780 | # define YYDPRINTF(Args) \ | |
781 | do { \ | |
782 | if (yydebug) \ | |
783 | YYFPRINTF Args; \ | |
d9b88bce UD |
784 | } while (YYID (0)) |
785 | ||
786 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ | |
787 | do { \ | |
788 | if (yydebug) \ | |
789 | { \ | |
790 | YYFPRINTF (stderr, "%s ", Title); \ | |
791 | yy_symbol_print (stderr, \ | |
792 | Type, Value); \ | |
793 | YYFPRINTF (stderr, "\n"); \ | |
794 | } \ | |
795 | } while (YYID (0)) | |
796 | ||
797 | ||
798 | /*--------------------------------. | |
799 | | Print this symbol on YYOUTPUT. | | |
800 | `--------------------------------*/ | |
801 | ||
802 | /*ARGSUSED*/ | |
803 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
804 | || defined __cplusplus || defined _MSC_VER) | |
805 | static void | |
806 | yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) | |
807 | #else | |
808 | static void | |
809 | yy_symbol_value_print (yyoutput, yytype, yyvaluep) | |
810 | FILE *yyoutput; | |
811 | int yytype; | |
812 | YYSTYPE const * const yyvaluep; | |
813 | #endif | |
814 | { | |
568035b7 JM |
815 | FILE *yyo = yyoutput; |
816 | YYUSE (yyo); | |
d9b88bce UD |
817 | if (!yyvaluep) |
818 | return; | |
819 | # ifdef YYPRINT | |
820 | if (yytype < YYNTOKENS) | |
821 | YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); | |
822 | # else | |
823 | YYUSE (yyoutput); | |
824 | # endif | |
825 | switch (yytype) | |
826 | { | |
827 | default: | |
568035b7 | 828 | break; |
d9b88bce UD |
829 | } |
830 | } | |
831 | ||
832 | ||
833 | /*--------------------------------. | |
834 | | Print this symbol on YYOUTPUT. | | |
835 | `--------------------------------*/ | |
836 | ||
837 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
838 | || defined __cplusplus || defined _MSC_VER) | |
839 | static void | |
840 | yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) | |
841 | #else | |
842 | static void | |
843 | yy_symbol_print (yyoutput, yytype, yyvaluep) | |
844 | FILE *yyoutput; | |
845 | int yytype; | |
846 | YYSTYPE const * const yyvaluep; | |
847 | #endif | |
848 | { | |
849 | if (yytype < YYNTOKENS) | |
850 | YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); | |
851 | else | |
852 | YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); | |
853 | ||
854 | yy_symbol_value_print (yyoutput, yytype, yyvaluep); | |
855 | YYFPRINTF (yyoutput, ")"); | |
856 | } | |
857 | ||
858 | /*------------------------------------------------------------------. | |
859 | | yy_stack_print -- Print the state stack from its BOTTOM up to its | | |
860 | | TOP (included). | | |
861 | `------------------------------------------------------------------*/ | |
862 | ||
863 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
864 | || defined __cplusplus || defined _MSC_VER) | |
865 | static void | |
866 | yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) | |
867 | #else | |
868 | static void | |
869 | yy_stack_print (yybottom, yytop) | |
870 | yytype_int16 *yybottom; | |
871 | yytype_int16 *yytop; | |
872 | #endif | |
873 | { | |
874 | YYFPRINTF (stderr, "Stack now"); | |
875 | for (; yybottom <= yytop; yybottom++) | |
876 | { | |
877 | int yybot = *yybottom; | |
878 | YYFPRINTF (stderr, " %d", yybot); | |
879 | } | |
880 | YYFPRINTF (stderr, "\n"); | |
881 | } | |
882 | ||
883 | # define YY_STACK_PRINT(Bottom, Top) \ | |
884 | do { \ | |
885 | if (yydebug) \ | |
886 | yy_stack_print ((Bottom), (Top)); \ | |
887 | } while (YYID (0)) | |
888 | ||
889 | ||
890 | /*------------------------------------------------. | |
891 | | Report that the YYRULE is going to be reduced. | | |
892 | `------------------------------------------------*/ | |
893 | ||
894 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
895 | || defined __cplusplus || defined _MSC_VER) | |
896 | static void | |
897 | yy_reduce_print (YYSTYPE *yyvsp, int yyrule) | |
898 | #else | |
899 | static void | |
900 | yy_reduce_print (yyvsp, yyrule) | |
901 | YYSTYPE *yyvsp; | |
902 | int yyrule; | |
903 | #endif | |
904 | { | |
905 | int yynrhs = yyr2[yyrule]; | |
906 | int yyi; | |
907 | unsigned long int yylno = yyrline[yyrule]; | |
908 | YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", | |
909 | yyrule - 1, yylno); | |
910 | /* The symbols being reduced. */ | |
911 | for (yyi = 0; yyi < yynrhs; yyi++) | |
912 | { | |
913 | YYFPRINTF (stderr, " $%d = ", yyi + 1); | |
914 | yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], | |
915 | &(yyvsp[(yyi + 1) - (yynrhs)]) | |
6ddf460f | 916 | ); |
d9b88bce UD |
917 | YYFPRINTF (stderr, "\n"); |
918 | } | |
919 | } | |
920 | ||
921 | # define YY_REDUCE_PRINT(Rule) \ | |
922 | do { \ | |
923 | if (yydebug) \ | |
924 | yy_reduce_print (yyvsp, Rule); \ | |
925 | } while (YYID (0)) | |
926 | ||
a58b1e65 RH |
927 | /* Nonzero means print parse trace. It is left uninitialized so that |
928 | multiple parsers can coexist. */ | |
929 | int yydebug; | |
930 | #else /* !YYDEBUG */ | |
931 | # define YYDPRINTF(Args) | |
d9b88bce UD |
932 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) |
933 | # define YY_STACK_PRINT(Bottom, Top) | |
934 | # define YY_REDUCE_PRINT(Rule) | |
a58b1e65 RH |
935 | #endif /* !YYDEBUG */ |
936 | ||
d9b88bce | 937 | |
a58b1e65 | 938 | /* YYINITDEPTH -- initial size of the parser's stacks. */ |
abbffdf9 | 939 | #ifndef YYINITDEPTH |
a58b1e65 | 940 | # define YYINITDEPTH 200 |
abbffdf9 UD |
941 | #endif |
942 | ||
a58b1e65 RH |
943 | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
944 | if the built-in stack extension method is used). | |
945 | ||
946 | Do not make this value too large; the results are undefined if | |
d9b88bce | 947 | YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) |
a58b1e65 | 948 | evaluated with infinite-precision integer arithmetic. */ |
abbffdf9 | 949 | |
abbffdf9 | 950 | #ifndef YYMAXDEPTH |
a58b1e65 | 951 | # define YYMAXDEPTH 10000 |
abbffdf9 | 952 | #endif |
d9b88bce | 953 | |
d9b88bce UD |
954 | |
955 | #if YYERROR_VERBOSE | |
abbffdf9 | 956 | |
a58b1e65 | 957 | # ifndef yystrlen |
d9b88bce | 958 | # if defined __GLIBC__ && defined _STRING_H |
a58b1e65 RH |
959 | # define yystrlen strlen |
960 | # else | |
961 | /* Return the length of YYSTR. */ | |
d9b88bce UD |
962 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
963 | || defined __cplusplus || defined _MSC_VER) | |
a58b1e65 | 964 | static YYSIZE_T |
a58b1e65 | 965 | yystrlen (const char *yystr) |
d9b88bce UD |
966 | #else |
967 | static YYSIZE_T | |
a58b1e65 | 968 | yystrlen (yystr) |
d9b88bce UD |
969 | const char *yystr; |
970 | #endif | |
a58b1e65 | 971 | { |
d9b88bce UD |
972 | YYSIZE_T yylen; |
973 | for (yylen = 0; yystr[yylen]; yylen++) | |
974 | continue; | |
975 | return yylen; | |
976 | } | |
977 | # endif | |
978 | # endif | |
979 | ||
980 | # ifndef yystpcpy | |
981 | # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE | |
982 | # define yystpcpy stpcpy | |
983 | # else | |
984 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in | |
985 | YYDEST. */ | |
986 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
987 | || defined __cplusplus || defined _MSC_VER) | |
988 | static char * | |
989 | yystpcpy (char *yydest, const char *yysrc) | |
990 | #else | |
991 | static char * | |
992 | yystpcpy (yydest, yysrc) | |
993 | char *yydest; | |
994 | const char *yysrc; | |
995 | #endif | |
996 | { | |
997 | char *yyd = yydest; | |
998 | const char *yys = yysrc; | |
999 | ||
1000 | while ((*yyd++ = *yys++) != '\0') | |
1001 | continue; | |
1002 | ||
1003 | return yyd - 1; | |
1004 | } | |
1005 | # endif | |
1006 | # endif | |
1007 | ||
1008 | # ifndef yytnamerr | |
1009 | /* Copy to YYRES the contents of YYSTR after stripping away unnecessary | |
1010 | quotes and backslashes, so that it's suitable for yyerror. The | |
1011 | heuristic is that double-quoting is unnecessary unless the string | |
1012 | contains an apostrophe, a comma, or backslash (other than | |
1013 | backslash-backslash). YYSTR is taken from yytname. If YYRES is | |
1014 | null, do not copy; instead, return the length of what the result | |
1015 | would have been. */ | |
1016 | static YYSIZE_T | |
1017 | yytnamerr (char *yyres, const char *yystr) | |
1018 | { | |
1019 | if (*yystr == '"') | |
1020 | { | |
1021 | YYSIZE_T yyn = 0; | |
1022 | char const *yyp = yystr; | |
1023 | ||
1024 | for (;;) | |
1025 | switch (*++yyp) | |
1026 | { | |
1027 | case '\'': | |
1028 | case ',': | |
1029 | goto do_not_strip_quotes; | |
1030 | ||
1031 | case '\\': | |
1032 | if (*++yyp != '\\') | |
1033 | goto do_not_strip_quotes; | |
1034 | /* Fall through. */ | |
1035 | default: | |
1036 | if (yyres) | |
1037 | yyres[yyn] = *yyp; | |
1038 | yyn++; | |
1039 | break; | |
1040 | ||
1041 | case '"': | |
1042 | if (yyres) | |
1043 | yyres[yyn] = '\0'; | |
1044 | return yyn; | |
1045 | } | |
1046 | do_not_strip_quotes: ; | |
1047 | } | |
1048 | ||
1049 | if (! yyres) | |
1050 | return yystrlen (yystr); | |
1051 | ||
1052 | return yystpcpy (yyres, yystr) - yyres; | |
1053 | } | |
1054 | # endif | |
1055 | ||
547b5e30 PE |
1056 | /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message |
1057 | about the unexpected token YYTOKEN for the state stack whose top is | |
1058 | YYSSP. | |
d9b88bce | 1059 | |
547b5e30 PE |
1060 | Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is |
1061 | not large enough to hold the message. In that case, also set | |
1062 | *YYMSG_ALLOC to the required number of bytes. Return 2 if the | |
1063 | required number of bytes is too large to store. */ | |
1064 | static int | |
1065 | yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | |
1066 | yytype_int16 *yyssp, int yytoken) | |
1067 | { | |
568035b7 | 1068 | YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); |
547b5e30 | 1069 | YYSIZE_T yysize = yysize0; |
547b5e30 PE |
1070 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; |
1071 | /* Internationalized format string. */ | |
568035b7 | 1072 | const char *yyformat = YY_NULL; |
547b5e30 PE |
1073 | /* Arguments of yyformat. */ |
1074 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; | |
1075 | /* Number of reported tokens (one for the "unexpected", one per | |
1076 | "expected"). */ | |
1077 | int yycount = 0; | |
1078 | ||
1079 | /* There are many possibilities here to consider: | |
1080 | - Assume YYFAIL is not used. It's too flawed to consider. See | |
1081 | <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> | |
1082 | for details. YYERROR is fine as it does not invoke this | |
1083 | function. | |
1084 | - If this state is a consistent state with a default action, then | |
1085 | the only way this function was invoked is if the default action | |
1086 | is an error action. In that case, don't check for expected | |
1087 | tokens because there are none. | |
1088 | - The only way there can be no lookahead present (in yychar) is if | |
1089 | this state is a consistent state with a default action. Thus, | |
1090 | detecting the absence of a lookahead is sufficient to determine | |
1091 | that there is no unexpected or expected token to report. In that | |
1092 | case, just report a simple "syntax error". | |
1093 | - Don't assume there isn't a lookahead just because this state is a | |
1094 | consistent state with a default action. There might have been a | |
1095 | previous inconsistent state, consistent state with a non-default | |
1096 | action, or user semantic action that manipulated yychar. | |
1097 | - Of course, the expected token list depends on states to have | |
1098 | correct lookahead information, and it depends on the parser not | |
1099 | to perform extra reductions after fetching a lookahead from the | |
1100 | scanner and before detecting a syntax error. Thus, state merging | |
1101 | (from LALR or IELR) and default reductions corrupt the expected | |
1102 | token list. However, the list is correct for canonical LR with | |
1103 | one exception: it will still contain any token that will not be | |
1104 | accepted due to an error action in a later state. | |
1105 | */ | |
1106 | if (yytoken != YYEMPTY) | |
d9b88bce | 1107 | { |
547b5e30 PE |
1108 | int yyn = yypact[*yyssp]; |
1109 | yyarg[yycount++] = yytname[yytoken]; | |
1110 | if (!yypact_value_is_default (yyn)) | |
1111 | { | |
1112 | /* Start YYX at -YYN if negative to avoid negative indexes in | |
1113 | YYCHECK. In other words, skip the first -YYN actions for | |
1114 | this state because they are default actions. */ | |
1115 | int yyxbegin = yyn < 0 ? -yyn : 0; | |
1116 | /* Stay within bounds of both yycheck and yytname. */ | |
1117 | int yychecklim = YYLAST - yyn + 1; | |
1118 | int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; | |
1119 | int yyx; | |
1120 | ||
1121 | for (yyx = yyxbegin; yyx < yyxend; ++yyx) | |
1122 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR | |
1123 | && !yytable_value_is_error (yytable[yyx + yyn])) | |
1124 | { | |
1125 | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) | |
1126 | { | |
1127 | yycount = 1; | |
1128 | yysize = yysize0; | |
1129 | break; | |
1130 | } | |
1131 | yyarg[yycount++] = yytname[yyx]; | |
568035b7 JM |
1132 | { |
1133 | YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); | |
1134 | if (! (yysize <= yysize1 | |
1135 | && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | |
1136 | return 2; | |
1137 | yysize = yysize1; | |
1138 | } | |
547b5e30 PE |
1139 | } |
1140 | } | |
1141 | } | |
d9b88bce | 1142 | |
547b5e30 PE |
1143 | switch (yycount) |
1144 | { | |
1145 | # define YYCASE_(N, S) \ | |
1146 | case N: \ | |
1147 | yyformat = S; \ | |
1148 | break | |
1149 | YYCASE_(0, YY_("syntax error")); | |
1150 | YYCASE_(1, YY_("syntax error, unexpected %s")); | |
1151 | YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); | |
1152 | YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); | |
1153 | YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); | |
1154 | YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); | |
1155 | # undef YYCASE_ | |
1156 | } | |
abbffdf9 | 1157 | |
568035b7 JM |
1158 | { |
1159 | YYSIZE_T yysize1 = yysize + yystrlen (yyformat); | |
1160 | if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | |
1161 | return 2; | |
1162 | yysize = yysize1; | |
1163 | } | |
abbffdf9 | 1164 | |
547b5e30 PE |
1165 | if (*yymsg_alloc < yysize) |
1166 | { | |
1167 | *yymsg_alloc = 2 * yysize; | |
1168 | if (! (yysize <= *yymsg_alloc | |
1169 | && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) | |
1170 | *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; | |
1171 | return 1; | |
d9b88bce | 1172 | } |
547b5e30 PE |
1173 | |
1174 | /* Avoid sprintf, as that infringes on the user's name space. | |
1175 | Don't have undefined behavior even if the translation | |
1176 | produced a string with the wrong number of "%s"s. */ | |
1177 | { | |
1178 | char *yyp = *yymsg; | |
1179 | int yyi = 0; | |
1180 | while ((*yyp = *yyformat) != '\0') | |
1181 | if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) | |
1182 | { | |
1183 | yyp += yytnamerr (yyp, yyarg[yyi++]); | |
1184 | yyformat += 2; | |
1185 | } | |
1186 | else | |
1187 | { | |
1188 | yyp++; | |
1189 | yyformat++; | |
1190 | } | |
1191 | } | |
1192 | return 0; | |
a58b1e65 | 1193 | } |
d9b88bce | 1194 | #endif /* YYERROR_VERBOSE */ |
a58b1e65 | 1195 | |
d9b88bce UD |
1196 | /*-----------------------------------------------. |
1197 | | Release the memory associated to this symbol. | | |
1198 | `-----------------------------------------------*/ | |
1199 | ||
1200 | /*ARGSUSED*/ | |
1201 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
1202 | || defined __cplusplus || defined _MSC_VER) | |
1203 | static void | |
1204 | yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) | |
1205 | #else | |
1206 | static void | |
1207 | yydestruct (yymsg, yytype, yyvaluep) | |
1208 | const char *yymsg; | |
1209 | int yytype; | |
1210 | YYSTYPE *yyvaluep; | |
1211 | #endif | |
abbffdf9 | 1212 | { |
d9b88bce | 1213 | YYUSE (yyvaluep); |
abbffdf9 | 1214 | |
d9b88bce UD |
1215 | if (!yymsg) |
1216 | yymsg = "Deleting"; | |
1217 | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); | |
abbffdf9 | 1218 | |
d9b88bce UD |
1219 | switch (yytype) |
1220 | { | |
1221 | ||
1222 | default: | |
568035b7 | 1223 | break; |
d9b88bce | 1224 | } |
a58b1e65 | 1225 | } |
d9b88bce | 1226 | |
547b5e30 | 1227 | |
a58b1e65 | 1228 | |
abbffdf9 | 1229 | |
547b5e30 PE |
1230 | /*----------. |
1231 | | yyparse. | | |
1232 | `----------*/ | |
abbffdf9 UD |
1233 | |
1234 | #ifdef YYPARSE_PARAM | |
d9b88bce UD |
1235 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
1236 | || defined __cplusplus || defined _MSC_VER) | |
1237 | int | |
1238 | yyparse (void *YYPARSE_PARAM) | |
1239 | #else | |
1240 | int | |
1241 | yyparse (YYPARSE_PARAM) | |
1242 | void *YYPARSE_PARAM; | |
abbffdf9 | 1243 | #endif |
d9b88bce UD |
1244 | #else /* ! YYPARSE_PARAM */ |
1245 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
1246 | || defined __cplusplus || defined _MSC_VER) | |
1247 | int | |
1248 | yyparse (void) | |
a58b1e65 | 1249 | #else |
d9b88bce UD |
1250 | int |
1251 | yyparse () | |
1252 | ||
1253 | #endif | |
abbffdf9 | 1254 | #endif |
d9b88bce UD |
1255 | { |
1256 | /* The lookahead symbol. */ | |
1257 | int yychar; | |
abbffdf9 | 1258 | |
568035b7 JM |
1259 | |
1260 | #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ | |
1261 | /* Suppress an incorrect diagnostic about yylval being uninitialized. */ | |
1262 | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ | |
1263 | _Pragma ("GCC diagnostic push") \ | |
1264 | _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ | |
1265 | _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") | |
1266 | # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ | |
1267 | _Pragma ("GCC diagnostic pop") | |
1268 | #else | |
1269 | /* Default value used for initialization, for pacifying older GCCs | |
1270 | or non-GCC compilers. */ | |
1271 | static YYSTYPE yyval_default; | |
1272 | # define YY_INITIAL_VALUE(Value) = Value | |
1273 | #endif | |
1274 | #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN | |
1275 | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN | |
1276 | # define YY_IGNORE_MAYBE_UNINITIALIZED_END | |
1277 | #endif | |
1278 | #ifndef YY_INITIAL_VALUE | |
1279 | # define YY_INITIAL_VALUE(Value) /* Nothing. */ | |
1280 | #endif | |
1281 | ||
d9b88bce | 1282 | /* The semantic value of the lookahead symbol. */ |
568035b7 | 1283 | YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); |
a58b1e65 | 1284 | |
d9b88bce UD |
1285 | /* Number of syntax errors so far. */ |
1286 | int yynerrs; | |
a58b1e65 | 1287 | |
d9b88bce UD |
1288 | int yystate; |
1289 | /* Number of tokens to shift before error messages enabled. */ | |
1290 | int yyerrstatus; | |
a58b1e65 | 1291 | |
d9b88bce UD |
1292 | /* The stacks and their tools: |
1293 | `yyss': related to states. | |
1294 | `yyvs': related to semantic values. | |
a58b1e65 | 1295 | |
568035b7 | 1296 | Refer to the stacks through separate pointers, to allow yyoverflow |
d9b88bce | 1297 | to reallocate them elsewhere. */ |
abbffdf9 | 1298 | |
d9b88bce UD |
1299 | /* The state stack. */ |
1300 | yytype_int16 yyssa[YYINITDEPTH]; | |
1301 | yytype_int16 *yyss; | |
1302 | yytype_int16 *yyssp; | |
abbffdf9 | 1303 | |
d9b88bce UD |
1304 | /* The semantic value stack. */ |
1305 | YYSTYPE yyvsa[YYINITDEPTH]; | |
1306 | YYSTYPE *yyvs; | |
1307 | YYSTYPE *yyvsp; | |
abbffdf9 | 1308 | |
d9b88bce | 1309 | YYSIZE_T yystacksize; |
abbffdf9 | 1310 | |
d9b88bce UD |
1311 | int yyn; |
1312 | int yyresult; | |
1313 | /* Lookahead token as an internal (translated) token number. */ | |
568035b7 | 1314 | int yytoken = 0; |
a58b1e65 RH |
1315 | /* The variables used to return semantic value and location from the |
1316 | action routines. */ | |
1317 | YYSTYPE yyval; | |
d9b88bce UD |
1318 | |
1319 | #if YYERROR_VERBOSE | |
1320 | /* Buffer for error messages, and its allocated size. */ | |
1321 | char yymsgbuf[128]; | |
1322 | char *yymsg = yymsgbuf; | |
1323 | YYSIZE_T yymsg_alloc = sizeof yymsgbuf; | |
a58b1e65 | 1324 | #endif |
abbffdf9 | 1325 | |
d9b88bce UD |
1326 | #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) |
1327 | ||
1328 | /* The number of symbols on the RHS of the reduced rule. | |
1329 | Keep to zero when no symbol should be popped. */ | |
1330 | int yylen = 0; | |
1331 | ||
568035b7 JM |
1332 | yyssp = yyss = yyssa; |
1333 | yyvsp = yyvs = yyvsa; | |
d9b88bce | 1334 | yystacksize = YYINITDEPTH; |
abbffdf9 | 1335 | |
a58b1e65 | 1336 | YYDPRINTF ((stderr, "Starting parse\n")); |
abbffdf9 UD |
1337 | |
1338 | yystate = 0; | |
1339 | yyerrstatus = 0; | |
1340 | yynerrs = 0; | |
d9b88bce | 1341 | yychar = YYEMPTY; /* Cause a token to be read. */ |
a58b1e65 | 1342 | goto yysetstate; |
abbffdf9 | 1343 | |
a58b1e65 RH |
1344 | /*------------------------------------------------------------. |
1345 | | yynewstate -- Push a new state, which is found in yystate. | | |
1346 | `------------------------------------------------------------*/ | |
1347 | yynewstate: | |
1348 | /* In all cases, when you get here, the value and location stacks | |
d9b88bce | 1349 | have just been pushed. So pushing a state here evens the stacks. */ |
a58b1e65 | 1350 | yyssp++; |
abbffdf9 | 1351 | |
a58b1e65 RH |
1352 | yysetstate: |
1353 | *yyssp = yystate; | |
abbffdf9 | 1354 | |
d9b88bce | 1355 | if (yyss + yystacksize - 1 <= yyssp) |
abbffdf9 | 1356 | { |
abbffdf9 | 1357 | /* Get the current used size of the three stacks, in elements. */ |
a58b1e65 | 1358 | YYSIZE_T yysize = yyssp - yyss + 1; |
abbffdf9 UD |
1359 | |
1360 | #ifdef yyoverflow | |
a58b1e65 | 1361 | { |
d9b88bce | 1362 | /* Give user a chance to reallocate the stack. Use copies of |
a58b1e65 RH |
1363 | these so that the &'s don't force the real ones into |
1364 | memory. */ | |
1365 | YYSTYPE *yyvs1 = yyvs; | |
d9b88bce | 1366 | yytype_int16 *yyss1 = yyss; |
a58b1e65 RH |
1367 | |
1368 | /* Each stack pointer address is followed by the size of the | |
d9b88bce UD |
1369 | data in use in that stack, in bytes. This used to be a |
1370 | conditional around just the two extra args, but that might | |
1371 | be undefined if yyoverflow is a macro. */ | |
1372 | yyoverflow (YY_("memory exhausted"), | |
a58b1e65 RH |
1373 | &yyss1, yysize * sizeof (*yyssp), |
1374 | &yyvs1, yysize * sizeof (*yyvsp), | |
1375 | &yystacksize); | |
d9b88bce | 1376 | |
a58b1e65 RH |
1377 | yyss = yyss1; |
1378 | yyvs = yyvs1; | |
1379 | } | |
abbffdf9 | 1380 | #else /* no yyoverflow */ |
a58b1e65 | 1381 | # ifndef YYSTACK_RELOCATE |
d9b88bce | 1382 | goto yyexhaustedlab; |
a58b1e65 | 1383 | # else |
abbffdf9 | 1384 | /* Extend the stack our own way. */ |
d9b88bce UD |
1385 | if (YYMAXDEPTH <= yystacksize) |
1386 | goto yyexhaustedlab; | |
abbffdf9 | 1387 | yystacksize *= 2; |
d9b88bce | 1388 | if (YYMAXDEPTH < yystacksize) |
abbffdf9 | 1389 | yystacksize = YYMAXDEPTH; |
a58b1e65 RH |
1390 | |
1391 | { | |
d9b88bce | 1392 | yytype_int16 *yyss1 = yyss; |
a58b1e65 RH |
1393 | union yyalloc *yyptr = |
1394 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); | |
1395 | if (! yyptr) | |
d9b88bce UD |
1396 | goto yyexhaustedlab; |
1397 | YYSTACK_RELOCATE (yyss_alloc, yyss); | |
1398 | YYSTACK_RELOCATE (yyvs_alloc, yyvs); | |
1399 | # undef YYSTACK_RELOCATE | |
a58b1e65 RH |
1400 | if (yyss1 != yyssa) |
1401 | YYSTACK_FREE (yyss1); | |
1402 | } | |
1403 | # endif | |
abbffdf9 UD |
1404 | #endif /* no yyoverflow */ |
1405 | ||
a58b1e65 RH |
1406 | yyssp = yyss + yysize - 1; |
1407 | yyvsp = yyvs + yysize - 1; | |
abbffdf9 | 1408 | |
a58b1e65 RH |
1409 | YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
1410 | (unsigned long int) yystacksize)); | |
abbffdf9 | 1411 | |
d9b88bce | 1412 | if (yyss + yystacksize - 1 <= yyssp) |
abbffdf9 UD |
1413 | YYABORT; |
1414 | } | |
1415 | ||
a58b1e65 | 1416 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
abbffdf9 | 1417 | |
d9b88bce UD |
1418 | if (yystate == YYFINAL) |
1419 | YYACCEPT; | |
a58b1e65 | 1420 | |
d9b88bce | 1421 | goto yybackup; |
a58b1e65 RH |
1422 | |
1423 | /*-----------. | |
1424 | | yybackup. | | |
1425 | `-----------*/ | |
1426 | yybackup: | |
abbffdf9 | 1427 | |
d9b88bce UD |
1428 | /* Do appropriate processing given the current state. Read a |
1429 | lookahead token if we need one and don't already have one. */ | |
abbffdf9 UD |
1430 | |
1431 | /* First try to decide what to do without reference to lookahead token. */ | |
abbffdf9 | 1432 | yyn = yypact[yystate]; |
547b5e30 | 1433 | if (yypact_value_is_default (yyn)) |
abbffdf9 UD |
1434 | goto yydefault; |
1435 | ||
1436 | /* Not known => get a lookahead token if don't already have one. */ | |
1437 | ||
d9b88bce | 1438 | /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ |
abbffdf9 UD |
1439 | if (yychar == YYEMPTY) |
1440 | { | |
a58b1e65 | 1441 | YYDPRINTF ((stderr, "Reading a token: ")); |
abbffdf9 UD |
1442 | yychar = YYLEX; |
1443 | } | |
1444 | ||
d9b88bce | 1445 | if (yychar <= YYEOF) |
abbffdf9 | 1446 | { |
d9b88bce | 1447 | yychar = yytoken = YYEOF; |
a58b1e65 | 1448 | YYDPRINTF ((stderr, "Now at end of input.\n")); |
abbffdf9 UD |
1449 | } |
1450 | else | |
1451 | { | |
d9b88bce UD |
1452 | yytoken = YYTRANSLATE (yychar); |
1453 | YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); | |
abbffdf9 UD |
1454 | } |
1455 | ||
d9b88bce UD |
1456 | /* If the proper action on seeing token YYTOKEN is to reduce or to |
1457 | detect an error, take that action. */ | |
1458 | yyn += yytoken; | |
1459 | if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) | |
abbffdf9 | 1460 | goto yydefault; |
abbffdf9 | 1461 | yyn = yytable[yyn]; |
d9b88bce | 1462 | if (yyn <= 0) |
abbffdf9 | 1463 | { |
547b5e30 PE |
1464 | if (yytable_value_is_error (yyn)) |
1465 | goto yyerrlab; | |
abbffdf9 UD |
1466 | yyn = -yyn; |
1467 | goto yyreduce; | |
1468 | } | |
abbffdf9 | 1469 | |
a58b1e65 RH |
1470 | /* Count tokens shifted since error; after three, turn off error |
1471 | status. */ | |
1472 | if (yyerrstatus) | |
1473 | yyerrstatus--; | |
abbffdf9 | 1474 | |
d9b88bce UD |
1475 | /* Shift the lookahead token. */ |
1476 | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); | |
1477 | ||
1478 | /* Discard the shifted token. */ | |
1479 | yychar = YYEMPTY; | |
1480 | ||
abbffdf9 | 1481 | yystate = yyn; |
568035b7 | 1482 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
d9b88bce | 1483 | *++yyvsp = yylval; |
568035b7 | 1484 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
d9b88bce | 1485 | |
abbffdf9 UD |
1486 | goto yynewstate; |
1487 | ||
abbffdf9 | 1488 | |
a58b1e65 RH |
1489 | /*-----------------------------------------------------------. |
1490 | | yydefault -- do the default action for the current state. | | |
1491 | `-----------------------------------------------------------*/ | |
1492 | yydefault: | |
abbffdf9 UD |
1493 | yyn = yydefact[yystate]; |
1494 | if (yyn == 0) | |
1495 | goto yyerrlab; | |
a58b1e65 RH |
1496 | goto yyreduce; |
1497 | ||
abbffdf9 | 1498 | |
a58b1e65 RH |
1499 | /*-----------------------------. |
1500 | | yyreduce -- Do a reduction. | | |
1501 | `-----------------------------*/ | |
abbffdf9 | 1502 | yyreduce: |
a58b1e65 | 1503 | /* yyn is the number of a rule to reduce with. */ |
abbffdf9 | 1504 | yylen = yyr2[yyn]; |
abbffdf9 | 1505 | |
a58b1e65 RH |
1506 | /* If YYLEN is nonzero, implement the default value of the action: |
1507 | `$$ = $1'. | |
1508 | ||
d9b88bce UD |
1509 | Otherwise, the following line sets YYVAL to garbage. |
1510 | This behavior is undocumented and Bison | |
a58b1e65 RH |
1511 | users should not rely upon it. Assigning to YYVAL |
1512 | unconditionally makes the parser a bit smaller, and it avoids a | |
1513 | GCC warning that YYVAL may be used uninitialized. */ | |
1514 | yyval = yyvsp[1-yylen]; | |
1515 | ||
a58b1e65 | 1516 | |
d9b88bce UD |
1517 | YY_REDUCE_PRINT (yyn); |
1518 | switch (yyn) | |
abbffdf9 | 1519 | { |
547b5e30 | 1520 | case 2: |
568035b7 | 1521 | /* Line 1792 of yacc.c */ |
547b5e30 | 1522 | #line 175 "plural.y" |
d9b88bce UD |
1523 | { |
1524 | if ((yyvsp[(1) - (1)].exp) == NULL) | |
4a4d50f3 | 1525 | YYABORT; |
d9b88bce | 1526 | ((struct parse_args *) arg)->res = (yyvsp[(1) - (1)].exp); |
547b5e30 | 1527 | } |
a58b1e65 | 1528 | break; |
d9b88bce UD |
1529 | |
1530 | case 3: | |
568035b7 | 1531 | /* Line 1792 of yacc.c */ |
547b5e30 | 1532 | #line 183 "plural.y" |
d9b88bce UD |
1533 | { |
1534 | (yyval.exp) = new_exp_3 (qmop, (yyvsp[(1) - (5)].exp), (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].exp)); | |
547b5e30 | 1535 | } |
a58b1e65 | 1536 | break; |
d9b88bce UD |
1537 | |
1538 | case 4: | |
568035b7 | 1539 | /* Line 1792 of yacc.c */ |
547b5e30 | 1540 | #line 187 "plural.y" |
d9b88bce UD |
1541 | { |
1542 | (yyval.exp) = new_exp_2 (lor, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); | |
547b5e30 | 1543 | } |
a58b1e65 | 1544 | break; |
d9b88bce UD |
1545 | |
1546 | case 5: | |
568035b7 | 1547 | /* Line 1792 of yacc.c */ |
547b5e30 | 1548 | #line 191 "plural.y" |
d9b88bce UD |
1549 | { |
1550 | (yyval.exp) = new_exp_2 (land, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); | |
547b5e30 | 1551 | } |
a58b1e65 | 1552 | break; |
d9b88bce UD |
1553 | |
1554 | case 6: | |
568035b7 | 1555 | /* Line 1792 of yacc.c */ |
547b5e30 | 1556 | #line 195 "plural.y" |
d9b88bce UD |
1557 | { |
1558 | (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); | |
547b5e30 | 1559 | } |
a58b1e65 | 1560 | break; |
d9b88bce UD |
1561 | |
1562 | case 7: | |
568035b7 | 1563 | /* Line 1792 of yacc.c */ |
547b5e30 | 1564 | #line 199 "plural.y" |
d9b88bce UD |
1565 | { |
1566 | (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); | |
547b5e30 | 1567 | } |
a58b1e65 | 1568 | break; |
d9b88bce UD |
1569 | |
1570 | case 8: | |
568035b7 | 1571 | /* Line 1792 of yacc.c */ |
547b5e30 | 1572 | #line 203 "plural.y" |
d9b88bce UD |
1573 | { |
1574 | (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); | |
547b5e30 | 1575 | } |
a58b1e65 | 1576 | break; |
d9b88bce UD |
1577 | |
1578 | case 9: | |
568035b7 | 1579 | /* Line 1792 of yacc.c */ |
547b5e30 | 1580 | #line 207 "plural.y" |
d9b88bce UD |
1581 | { |
1582 | (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); | |
547b5e30 | 1583 | } |
a58b1e65 | 1584 | break; |
d9b88bce UD |
1585 | |
1586 | case 10: | |
568035b7 | 1587 | /* Line 1792 of yacc.c */ |
547b5e30 | 1588 | #line 211 "plural.y" |
d9b88bce UD |
1589 | { |
1590 | (yyval.exp) = new_exp_1 (lnot, (yyvsp[(2) - (2)].exp)); | |
547b5e30 | 1591 | } |
a58b1e65 | 1592 | break; |
d9b88bce UD |
1593 | |
1594 | case 11: | |
568035b7 | 1595 | /* Line 1792 of yacc.c */ |
547b5e30 | 1596 | #line 215 "plural.y" |
d9b88bce UD |
1597 | { |
1598 | (yyval.exp) = new_exp_0 (var); | |
547b5e30 | 1599 | } |
a58b1e65 | 1600 | break; |
d9b88bce UD |
1601 | |
1602 | case 12: | |
568035b7 | 1603 | /* Line 1792 of yacc.c */ |
547b5e30 | 1604 | #line 219 "plural.y" |
d9b88bce UD |
1605 | { |
1606 | if (((yyval.exp) = new_exp_0 (num)) != NULL) | |
1607 | (yyval.exp)->val.num = (yyvsp[(1) - (1)].num); | |
547b5e30 | 1608 | } |
a58b1e65 | 1609 | break; |
d9b88bce UD |
1610 | |
1611 | case 13: | |
568035b7 | 1612 | /* Line 1792 of yacc.c */ |
547b5e30 | 1613 | #line 224 "plural.y" |
d9b88bce UD |
1614 | { |
1615 | (yyval.exp) = (yyvsp[(2) - (3)].exp); | |
547b5e30 | 1616 | } |
a58b1e65 | 1617 | break; |
a58b1e65 | 1618 | |
a58b1e65 | 1619 | |
568035b7 JM |
1620 | /* Line 1792 of yacc.c */ |
1621 | #line 1622 "plural.c" | |
d9b88bce | 1622 | default: break; |
abbffdf9 | 1623 | } |
547b5e30 PE |
1624 | /* User semantic actions sometimes alter yychar, and that requires |
1625 | that yytoken be updated with the new translation. We take the | |
1626 | approach of translating immediately before every use of yytoken. | |
1627 | One alternative is translating here after every semantic action, | |
1628 | but that translation would be missed if the semantic action invokes | |
1629 | YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or | |
1630 | if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an | |
1631 | incorrect destructor might then be invoked immediately. In the | |
1632 | case of YYERROR or YYBACKUP, subsequent parser actions might lead | |
1633 | to an incorrect destructor call or verbose syntax error message | |
1634 | before the lookahead is translated. */ | |
d9b88bce UD |
1635 | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
1636 | ||
1637 | YYPOPSTACK (yylen); | |
1638 | yylen = 0; | |
1639 | YY_STACK_PRINT (yyss, yyssp); | |
abbffdf9 UD |
1640 | |
1641 | *++yyvsp = yyval; | |
abbffdf9 | 1642 | |
a58b1e65 RH |
1643 | /* Now `shift' the result of the reduction. Determine what state |
1644 | that goes to, based on the state we popped back to and the rule | |
1645 | number reduced by. */ | |
abbffdf9 UD |
1646 | |
1647 | yyn = yyr1[yyn]; | |
1648 | ||
d9b88bce UD |
1649 | yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; |
1650 | if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) | |
abbffdf9 UD |
1651 | yystate = yytable[yystate]; |
1652 | else | |
d9b88bce | 1653 | yystate = yydefgoto[yyn - YYNTOKENS]; |
abbffdf9 UD |
1654 | |
1655 | goto yynewstate; | |
1656 | ||
abbffdf9 | 1657 | |
a58b1e65 RH |
1658 | /*------------------------------------. |
1659 | | yyerrlab -- here on detecting error | | |
1660 | `------------------------------------*/ | |
1661 | yyerrlab: | |
547b5e30 PE |
1662 | /* Make sure we have latest lookahead translation. See comments at |
1663 | user semantic actions for why this is necessary. */ | |
1664 | yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); | |
1665 | ||
a58b1e65 RH |
1666 | /* If not already recovering from an error, report this error. */ |
1667 | if (!yyerrstatus) | |
abbffdf9 UD |
1668 | { |
1669 | ++yynerrs; | |
d9b88bce UD |
1670 | #if ! YYERROR_VERBOSE |
1671 | yyerror (YY_("syntax error")); | |
1672 | #else | |
547b5e30 PE |
1673 | # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ |
1674 | yyssp, yytoken) | |
d9b88bce | 1675 | { |
547b5e30 PE |
1676 | char const *yymsgp = YY_("syntax error"); |
1677 | int yysyntax_error_status; | |
1678 | yysyntax_error_status = YYSYNTAX_ERROR; | |
1679 | if (yysyntax_error_status == 0) | |
1680 | yymsgp = yymsg; | |
1681 | else if (yysyntax_error_status == 1) | |
1682 | { | |
1683 | if (yymsg != yymsgbuf) | |
1684 | YYSTACK_FREE (yymsg); | |
1685 | yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); | |
1686 | if (!yymsg) | |
1687 | { | |
1688 | yymsg = yymsgbuf; | |
1689 | yymsg_alloc = sizeof yymsgbuf; | |
1690 | yysyntax_error_status = 2; | |
1691 | } | |
1692 | else | |
1693 | { | |
1694 | yysyntax_error_status = YYSYNTAX_ERROR; | |
1695 | yymsgp = yymsg; | |
1696 | } | |
1697 | } | |
1698 | yyerror (yymsgp); | |
1699 | if (yysyntax_error_status == 2) | |
1700 | goto yyexhaustedlab; | |
d9b88bce | 1701 | } |
547b5e30 | 1702 | # undef YYSYNTAX_ERROR |
d9b88bce | 1703 | #endif |
abbffdf9 | 1704 | } |
abbffdf9 | 1705 | |
a58b1e65 | 1706 | |
d9b88bce | 1707 | |
abbffdf9 UD |
1708 | if (yyerrstatus == 3) |
1709 | { | |
a58b1e65 RH |
1710 | /* If just tried and failed to reuse lookahead token after an |
1711 | error, discard it. */ | |
abbffdf9 | 1712 | |
d9b88bce UD |
1713 | if (yychar <= YYEOF) |
1714 | { | |
1715 | /* Return failure if at end of input. */ | |
1716 | if (yychar == YYEOF) | |
1717 | YYABORT; | |
1718 | } | |
1719 | else | |
1720 | { | |
1721 | yydestruct ("Error: discarding", | |
1722 | yytoken, &yylval); | |
1723 | yychar = YYEMPTY; | |
1724 | } | |
abbffdf9 UD |
1725 | } |
1726 | ||
a58b1e65 RH |
1727 | /* Else will try to reuse lookahead token after shifting the error |
1728 | token. */ | |
d9b88bce | 1729 | goto yyerrlab1; |
abbffdf9 | 1730 | |
abbffdf9 | 1731 | |
d9b88bce UD |
1732 | /*---------------------------------------------------. |
1733 | | yyerrorlab -- error raised explicitly by YYERROR. | | |
1734 | `---------------------------------------------------*/ | |
1735 | yyerrorlab: | |
abbffdf9 | 1736 | |
d9b88bce UD |
1737 | /* Pacify compilers like GCC when the user code never invokes |
1738 | YYERROR and the label yyerrorlab therefore never appears in user | |
1739 | code. */ | |
1740 | if (/*CONSTCOND*/ 0) | |
1741 | goto yyerrorlab; | |
a58b1e65 | 1742 | |
d9b88bce UD |
1743 | /* Do not reclaim the symbols of the rule which action triggered |
1744 | this YYERROR. */ | |
1745 | YYPOPSTACK (yylen); | |
1746 | yylen = 0; | |
1747 | YY_STACK_PRINT (yyss, yyssp); | |
1748 | yystate = *yyssp; | |
1749 | goto yyerrlab1; | |
abbffdf9 | 1750 | |
abbffdf9 | 1751 | |
d9b88bce UD |
1752 | /*-------------------------------------------------------------. |
1753 | | yyerrlab1 -- common code for both syntax error and YYERROR. | | |
1754 | `-------------------------------------------------------------*/ | |
1755 | yyerrlab1: | |
1756 | yyerrstatus = 3; /* Each real token shifted decrements this. */ | |
abbffdf9 | 1757 | |
d9b88bce | 1758 | for (;;) |
abbffdf9 | 1759 | { |
d9b88bce | 1760 | yyn = yypact[yystate]; |
547b5e30 | 1761 | if (!yypact_value_is_default (yyn)) |
d9b88bce UD |
1762 | { |
1763 | yyn += YYTERROR; | |
1764 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) | |
1765 | { | |
1766 | yyn = yytable[yyn]; | |
1767 | if (0 < yyn) | |
1768 | break; | |
1769 | } | |
1770 | } | |
abbffdf9 | 1771 | |
d9b88bce UD |
1772 | /* Pop the current state because it cannot handle the error token. */ |
1773 | if (yyssp == yyss) | |
1774 | YYABORT; | |
abbffdf9 | 1775 | |
abbffdf9 | 1776 | |
d9b88bce UD |
1777 | yydestruct ("Error: popping", |
1778 | yystos[yystate], yyvsp); | |
1779 | YYPOPSTACK (1); | |
1780 | yystate = *yyssp; | |
1781 | YY_STACK_PRINT (yyss, yyssp); | |
abbffdf9 | 1782 | } |
abbffdf9 | 1783 | |
568035b7 | 1784 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
d9b88bce | 1785 | *++yyvsp = yylval; |
568035b7 | 1786 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
abbffdf9 | 1787 | |
abbffdf9 | 1788 | |
d9b88bce UD |
1789 | /* Shift the error token. */ |
1790 | YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); | |
abbffdf9 UD |
1791 | |
1792 | yystate = yyn; | |
1793 | goto yynewstate; | |
1794 | ||
abbffdf9 | 1795 | |
a58b1e65 RH |
1796 | /*-------------------------------------. |
1797 | | yyacceptlab -- YYACCEPT comes here. | | |
1798 | `-------------------------------------*/ | |
1799 | yyacceptlab: | |
1800 | yyresult = 0; | |
1801 | goto yyreturn; | |
1802 | ||
1803 | /*-----------------------------------. | |
1804 | | yyabortlab -- YYABORT comes here. | | |
1805 | `-----------------------------------*/ | |
1806 | yyabortlab: | |
1807 | yyresult = 1; | |
1808 | goto yyreturn; | |
1809 | ||
568035b7 | 1810 | #if !defined yyoverflow || YYERROR_VERBOSE |
d9b88bce UD |
1811 | /*-------------------------------------------------. |
1812 | | yyexhaustedlab -- memory exhaustion comes here. | | |
1813 | `-------------------------------------------------*/ | |
1814 | yyexhaustedlab: | |
1815 | yyerror (YY_("memory exhausted")); | |
a58b1e65 RH |
1816 | yyresult = 2; |
1817 | /* Fall through. */ | |
d9b88bce | 1818 | #endif |
a58b1e65 RH |
1819 | |
1820 | yyreturn: | |
d9b88bce | 1821 | if (yychar != YYEMPTY) |
547b5e30 PE |
1822 | { |
1823 | /* Make sure we have latest lookahead translation. See comments at | |
1824 | user semantic actions for why this is necessary. */ | |
1825 | yytoken = YYTRANSLATE (yychar); | |
1826 | yydestruct ("Cleanup: discarding lookahead", | |
1827 | yytoken, &yylval); | |
1828 | } | |
d9b88bce UD |
1829 | /* Do not reclaim the symbols of the rule which action triggered |
1830 | this YYABORT or YYACCEPT. */ | |
1831 | YYPOPSTACK (yylen); | |
1832 | YY_STACK_PRINT (yyss, yyssp); | |
1833 | while (yyssp != yyss) | |
1834 | { | |
1835 | yydestruct ("Cleanup: popping", | |
1836 | yystos[*yyssp], yyvsp); | |
1837 | YYPOPSTACK (1); | |
1838 | } | |
a58b1e65 RH |
1839 | #ifndef yyoverflow |
1840 | if (yyss != yyssa) | |
1841 | YYSTACK_FREE (yyss); | |
abbffdf9 | 1842 | #endif |
d9b88bce UD |
1843 | #if YYERROR_VERBOSE |
1844 | if (yymsg != yymsgbuf) | |
1845 | YYSTACK_FREE (yymsg); | |
1846 | #endif | |
1847 | /* Make sure YYID is used. */ | |
1848 | return YYID (yyresult); | |
abbffdf9 | 1849 | } |
d9b88bce UD |
1850 | |
1851 | ||
568035b7 | 1852 | /* Line 2055 of yacc.c */ |
547b5e30 | 1853 | #line 229 "plural.y" |
abbffdf9 | 1854 | |
abbffdf9 UD |
1855 | |
1856 | void | |
1857 | internal_function | |
4a4d50f3 UD |
1858 | FREE_EXPRESSION (exp) |
1859 | struct expression *exp; | |
abbffdf9 UD |
1860 | { |
1861 | if (exp == NULL) | |
1862 | return; | |
1863 | ||
1864 | /* Handle the recursive case. */ | |
4a4d50f3 | 1865 | switch (exp->nargs) |
abbffdf9 | 1866 | { |
4a4d50f3 UD |
1867 | case 3: |
1868 | FREE_EXPRESSION (exp->val.args[2]); | |
1869 | /* FALLTHROUGH */ | |
1870 | case 2: | |
1871 | FREE_EXPRESSION (exp->val.args[1]); | |
1872 | /* FALLTHROUGH */ | |
1873 | case 1: | |
1874 | FREE_EXPRESSION (exp->val.args[0]); | |
abbffdf9 | 1875 | /* FALLTHROUGH */ |
abbffdf9 UD |
1876 | default: |
1877 | break; | |
1878 | } | |
1879 | ||
1880 | free (exp); | |
1881 | } | |
1882 | ||
1883 | ||
1884 | static int | |
4a4d50f3 UD |
1885 | yylex (lval, pexp) |
1886 | YYSTYPE *lval; | |
1887 | const char **pexp; | |
abbffdf9 UD |
1888 | { |
1889 | const char *exp = *pexp; | |
1890 | int result; | |
1891 | ||
1892 | while (1) | |
1893 | { | |
2f599545 UD |
1894 | if (exp[0] == '\0') |
1895 | { | |
1896 | *pexp = exp; | |
1897 | return YYEOF; | |
1898 | } | |
1899 | ||
1900 | if (exp[0] != ' ' && exp[0] != '\t') | |
abbffdf9 UD |
1901 | break; |
1902 | ||
1903 | ++exp; | |
1904 | } | |
1905 | ||
1906 | result = *exp++; | |
1907 | switch (result) | |
1908 | { | |
eda6c725 UD |
1909 | case '0': case '1': case '2': case '3': case '4': |
1910 | case '5': case '6': case '7': case '8': case '9': | |
abbffdf9 | 1911 | { |
eda6c725 | 1912 | unsigned long int n = result - '0'; |
abbffdf9 UD |
1913 | while (exp[0] >= '0' && exp[0] <= '9') |
1914 | { | |
1915 | n *= 10; | |
1916 | n += exp[0] - '0'; | |
1917 | ++exp; | |
1918 | } | |
1919 | lval->num = n; | |
1920 | result = NUMBER; | |
1921 | } | |
1922 | break; | |
1923 | ||
1924 | case '=': | |
abbffdf9 | 1925 | if (exp[0] == '=') |
4a4d50f3 UD |
1926 | { |
1927 | ++exp; | |
1928 | lval->op = equal; | |
1929 | result = EQUOP2; | |
1930 | } | |
abbffdf9 UD |
1931 | else |
1932 | result = YYERRCODE; | |
1933 | break; | |
1934 | ||
4a4d50f3 UD |
1935 | case '!': |
1936 | if (exp[0] == '=') | |
1937 | { | |
1938 | ++exp; | |
1939 | lval->op = not_equal; | |
1940 | result = EQUOP2; | |
1941 | } | |
1942 | break; | |
1943 | ||
abbffdf9 UD |
1944 | case '&': |
1945 | case '|': | |
1946 | if (exp[0] == result) | |
1947 | ++exp; | |
1948 | else | |
1949 | result = YYERRCODE; | |
1950 | break; | |
1951 | ||
4a4d50f3 UD |
1952 | case '<': |
1953 | if (exp[0] == '=') | |
1954 | { | |
1955 | ++exp; | |
1956 | lval->op = less_or_equal; | |
1957 | } | |
1958 | else | |
1959 | lval->op = less_than; | |
1960 | result = CMPOP2; | |
1961 | break; | |
1962 | ||
1963 | case '>': | |
1964 | if (exp[0] == '=') | |
1965 | { | |
1966 | ++exp; | |
1967 | lval->op = greater_or_equal; | |
1968 | } | |
1969 | else | |
1970 | lval->op = greater_than; | |
1971 | result = CMPOP2; | |
1972 | break; | |
1973 | ||
abbffdf9 | 1974 | case '*': |
4a4d50f3 UD |
1975 | lval->op = mult; |
1976 | result = MULOP2; | |
1977 | break; | |
1978 | ||
abbffdf9 | 1979 | case '/': |
4a4d50f3 UD |
1980 | lval->op = divide; |
1981 | result = MULOP2; | |
1982 | break; | |
1983 | ||
abbffdf9 | 1984 | case '%': |
4a4d50f3 UD |
1985 | lval->op = module; |
1986 | result = MULOP2; | |
1987 | break; | |
1988 | ||
abbffdf9 | 1989 | case '+': |
4a4d50f3 UD |
1990 | lval->op = plus; |
1991 | result = ADDOP2; | |
1992 | break; | |
1993 | ||
abbffdf9 | 1994 | case '-': |
4a4d50f3 UD |
1995 | lval->op = minus; |
1996 | result = ADDOP2; | |
1997 | break; | |
1998 | ||
1999 | case 'n': | |
abbffdf9 UD |
2000 | case '?': |
2001 | case ':': | |
2002 | case '(': | |
2003 | case ')': | |
2004 | /* Nothing, just return the character. */ | |
2005 | break; | |
2006 | ||
2f599545 | 2007 | case ';': |
abbffdf9 UD |
2008 | case '\n': |
2009 | case '\0': | |
2010 | /* Be safe and let the user call this function again. */ | |
2011 | --exp; | |
2012 | result = YYEOF; | |
2013 | break; | |
2014 | ||
2015 | default: | |
2016 | result = YYERRCODE; | |
2017 | #if YYDEBUG != 0 | |
2018 | --exp; | |
2019 | #endif | |
2020 | break; | |
2021 | } | |
2022 | ||
2023 | *pexp = exp; | |
2024 | ||
2025 | return result; | |
2026 | } | |
2027 | ||
2028 | ||
2029 | static void | |
4a4d50f3 UD |
2030 | yyerror (str) |
2031 | const char *str; | |
abbffdf9 UD |
2032 | { |
2033 | /* Do nothing. We don't print error messages here. */ | |
2034 | } |