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