1 /* A Bison parser, made by GNU Bison 2.7. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
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.
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.
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/>. */
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.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
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. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "2.7"
50 #define YYSKELETON_NAME "yacc.c"
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
71 /* Copy the first part of user declarations. */
72 /* Line 371 of yacc.c */
75 /* Expression parsing for plural form selection.
76 Copyright (C) 2000-2014 Free Software Foundation, Inc.
77 This file is part of the GNU C Library.
78 Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
80 The GNU C Library is free software; you can redistribute it and/or
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.
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
88 Lesser General Public License for more details.
90 You should have received a copy of the GNU Lesser General Public
91 License along with the GNU C Library; if not, see
92 <http://www.gnu.org/licenses/>. */
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__
108 #include "plural-exp.h"
110 /* The main function generated by the parser is called __gettextparse,
111 but we want it to be called PLURAL_PARSE. */
113 # define __gettextparse PLURAL_PARSE
116 #define YYLEX_PARAM &((struct parse_args *) arg)->cp
117 #define YYPARSE_PARAM arg
119 /* Line 371 of yacc.c */
123 # if defined __cplusplus && 201103L <= __cplusplus
124 # define YY_NULL nullptr
130 /* Enabling verbose error messages. */
131 #ifdef YYERROR_VERBOSE
132 # undef YYERROR_VERBOSE
133 # define YYERROR_VERBOSE 1
135 # define YYERROR_VERBOSE 0
139 /* Enabling traces. */
144 extern int __gettextdebug
;
150 /* Put the tokens into the symbol table, so that GDB and other debuggers
169 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
170 typedef union YYSTYPE
172 /* Line 387 of yacc.c */
175 unsigned long int num
;
177 struct expression
*exp
;
180 /* Line 387 of yacc.c */
183 # define YYSTYPE_IS_TRIVIAL 1
184 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
185 # define YYSTYPE_IS_DECLARED 1
190 #if defined __STDC__ || defined __cplusplus
191 int __gettextparse (void *YYPARSE_PARAM
);
193 int __gettextparse ();
195 #else /* ! YYPARSE_PARAM */
196 #if defined __STDC__ || defined __cplusplus
197 int __gettextparse (void);
199 int __gettextparse ();
201 #endif /* ! YYPARSE_PARAM */
205 /* Copy the second part of user declarations. */
206 /* Line 390 of yacc.c */
209 /* Prototypes for local functions. */
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
));
225 /* Allocation of expressions. */
227 static struct expression
*
228 new_exp (nargs
, op
, args
)
231 struct expression
* const *args
;
234 struct expression
*newp
;
236 /* If any of the argument could not be malloc'ed, just return NULL. */
237 for (i
= nargs
- 1; i
>= 0; i
--)
241 /* Allocate a new expression. */
242 newp
= (struct expression
*) malloc (sizeof (*newp
));
246 newp
->operation
= op
;
247 for (i
= nargs
- 1; i
>= 0; i
--)
248 newp
->val
.args
[i
] = args
[i
];
253 for (i
= nargs
- 1; i
>= 0; i
--)
254 FREE_EXPRESSION (args
[i
]);
259 static inline struct expression
*
263 return new_exp (0, op
, NULL
);
266 static inline struct expression
*
267 new_exp_1 (op
, right
)
269 struct expression
*right
;
271 struct expression
*args
[1];
274 return new_exp (1, op
, args
);
277 static struct expression
*
278 new_exp_2 (op
, left
, right
)
280 struct expression
*left
;
281 struct expression
*right
;
283 struct expression
*args
[2];
287 return new_exp (2, op
, args
);
290 static inline struct expression
*
291 new_exp_3 (op
, bexp
, tbranch
, fbranch
)
293 struct expression
*bexp
;
294 struct expression
*tbranch
;
295 struct expression
*fbranch
;
297 struct expression
*args
[3];
302 return new_exp (3, op
, args
);
306 /* Line 390 of yacc.c */
314 typedef YYTYPE_UINT8 yytype_uint8
;
316 typedef unsigned char yytype_uint8
;
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
;
325 typedef short int yytype_int8
;
329 typedef YYTYPE_UINT16 yytype_uint16
;
331 typedef unsigned short int yytype_uint16
;
335 typedef YYTYPE_INT16 yytype_int16
;
337 typedef short int yytype_int16
;
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
350 # define YYSIZE_T unsigned int
354 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
357 # if defined YYENABLE_NLS && YYENABLE_NLS
359 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
360 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
364 # define YY_(Msgid) Msgid
368 /* Suppress unused-variable warnings by "using" E. */
369 #if ! defined lint || defined __GNUC__
370 # define YYUSE(E) ((void) (E))
372 # define YYUSE(E) /* empty */
375 /* Identity function, used to suppress warnings about constant conditions. */
379 #if (defined __STDC__ || defined __C99__FUNC__ \
380 || defined __cplusplus || defined _MSC_VER)
393 #if ! defined yyoverflow || YYERROR_VERBOSE
395 /* The parser invokes alloca or malloc; define the necessary symbols. */
397 # ifdef YYSTACK_USE_ALLOCA
398 # if YYSTACK_USE_ALLOCA
400 # define YYSTACK_ALLOC __builtin_alloca
401 # elif defined __BUILTIN_VA_ARG_INCR
402 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
404 # define YYSTACK_ALLOC __alloca
405 # elif defined _MSC_VER
406 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
407 # define alloca _alloca
409 # define YYSTACK_ALLOC alloca
410 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
411 || defined __cplusplus || defined _MSC_VER)
412 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
413 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
414 # ifndef EXIT_SUCCESS
415 # define EXIT_SUCCESS 0
422 # ifdef YYSTACK_ALLOC
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 */
433 # define YYSTACK_ALLOC YYMALLOC
434 # define YYSTACK_FREE YYFREE
435 # ifndef YYSTACK_ALLOC_MAXIMUM
436 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
438 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
439 && ! ((defined YYMALLOC || defined malloc) \
440 && (defined YYFREE || defined free)))
441 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
442 # ifndef EXIT_SUCCESS
443 # define EXIT_SUCCESS 0
447 # define YYMALLOC malloc
448 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
449 || defined __cplusplus || defined _MSC_VER)
450 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
455 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
456 || defined __cplusplus || defined _MSC_VER)
457 void free (void *); /* INFRINGES ON USER NAME SPACE */
461 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
464 #if (! defined yyoverflow \
465 && (! defined __cplusplus \
466 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
468 /* A type that is properly aligned for any stack member. */
471 yytype_int16 yyss_alloc
;
475 /* The size of the maximum gap between one aligned stack and the next. */
476 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
478 /* The size of an array large to enough to hold all stacks, each with
480 # define YYSTACK_BYTES(N) \
481 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
482 + YYSTACK_GAP_MAXIMUM)
484 # define YYCOPY_NEEDED 1
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
491 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
494 YYSIZE_T yynewbytes; \
495 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
496 Stack = &yyptr->Stack_alloc; \
497 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
498 yyptr += yynewbytes / sizeof (*yyptr); \
504 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
505 /* Copy COUNT objects from SRC to DST. The source and destination do
508 # if defined __GNUC__ && 1 < __GNUC__
509 # define YYCOPY(Dst, Src, Count) \
510 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
512 # define YYCOPY(Dst, Src, Count) \
516 for (yyi = 0; yyi < (Count); yyi++) \
517 (Dst)[yyi] = (Src)[yyi]; \
522 #endif /* !YYCOPY_NEEDED */
524 /* YYFINAL -- State number of the termination state. */
526 /* YYLAST -- Last index in YYTABLE. */
529 /* YYNTOKENS -- Number of terminals. */
531 /* YYNNTS -- Number of nonterminals. */
533 /* YYNRULES -- Number of rules. */
535 /* YYNRULES -- Number of states. */
538 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
540 #define YYMAXUTOK 262
542 #define YYTRANSLATE(YYX) \
543 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
545 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
546 static const yytype_uint8 yytranslate
[] =
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,
578 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
580 static const yytype_uint8 yyprhs
[] =
582 0, 0, 3, 5, 11, 15, 19, 23, 27, 31,
586 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
587 static const yytype_int8 yyrhs
[] =
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
596 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
597 static const yytype_uint8 yyrline
[] =
599 0, 174, 174, 182, 186, 190, 194, 198, 202, 206,
604 #if YYDEBUG || YYERROR_VERBOSE || 0
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
[] =
609 "$end", "error", "$undefined", "'?'", "'|'", "'&'", "EQUOP2", "CMPOP2",
610 "ADDOP2", "MULOP2", "'!'", "NUMBER", "':'", "'n'", "'('", "')'",
611 "$accept", "start", "exp", YY_NULL
616 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
618 static const yytype_uint16 yytoknum
[] =
620 0, 256, 257, 63, 124, 38, 258, 259, 260, 261,
621 33, 262, 58, 110, 40, 41
625 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
626 static const yytype_uint8 yyr1
[] =
628 0, 16, 17, 18, 18, 18, 18, 18, 18, 18,
632 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
633 static const yytype_uint8 yyr2
[] =
635 0, 2, 1, 5, 3, 3, 3, 3, 3, 3,
639 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
640 Performed when YYTABLE doesn't specify something else to do. Zero
641 means the default is an error. */
642 static const yytype_uint8 yydefact
[] =
644 0, 0, 12, 11, 0, 0, 2, 10, 0, 1,
645 0, 0, 0, 0, 0, 0, 0, 13, 0, 4,
649 /* YYDEFGOTO[NTERM-NUM]. */
650 static const yytype_int8 yydefgoto
[] =
655 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
657 #define YYPACT_NINF -10
658 static const yytype_int8 yypact
[] =
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
665 /* YYPGOTO[NTERM-NUM]. */
666 static const yytype_int8 yypgoto
[] =
671 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
672 positive, shift that token. If negative, reduce the rule which
673 number is the opposite. If YYTABLE_NINF, syntax error. */
674 #define YYTABLE_NINF -1
675 static const yytype_uint8 yytable
[] =
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,
685 #define yypact_value_is_default(Yystate) \
686 (!!((Yystate) == (-10)))
688 #define yytable_value_is_error(Yytable_value) \
691 static const yytype_int8 yycheck
[] =
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,
701 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
702 symbol of state STATE-NUM. */
703 static const yytype_uint8 yystos
[] =
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
710 #define yyerrok (yyerrstatus = 0)
711 #define yyclearin (yychar = YYEMPTY)
715 #define YYACCEPT goto yyacceptlab
716 #define YYABORT goto yyabortlab
717 #define YYERROR goto yyerrorlab
720 /* Like YYERROR except do call yyerror. This remains here temporarily
721 to ease the transition to the new meaning of YYERROR, for GCC.
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
727 #define YYFAIL goto yyerrlab
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. */
735 #define YYRECOVERING() (!!yyerrstatus)
737 #define YYBACKUP(Token, Value) \
739 if (yychar == YYEMPTY) \
743 YYPOPSTACK (yylen); \
749 yyerror (YY_("syntax error: cannot back up")); \
754 /* Error token number */
756 #define YYERRCODE 256
759 /* This macro is provided for backward compatibility. */
760 #ifndef YY_LOCATION_PRINT
761 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
765 /* YYLEX -- calling `yylex' with the right arguments. */
767 # define YYLEX yylex (&yylval, YYLEX_PARAM)
769 # define YYLEX yylex (&yylval)
772 /* Enable debugging if requested. */
776 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
777 # define YYFPRINTF fprintf
780 # define YYDPRINTF(Args) \
786 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
790 YYFPRINTF (stderr, "%s ", Title); \
791 yy_symbol_print (stderr, \
793 YYFPRINTF (stderr, "\n"); \
798 /*--------------------------------.
799 | Print this symbol on YYOUTPUT. |
800 `--------------------------------*/
803 #if (defined __STDC__ || defined __C99__FUNC__ \
804 || defined __cplusplus || defined _MSC_VER)
806 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
809 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
)
812 YYSTYPE
const * const yyvaluep
;
815 FILE *yyo
= yyoutput
;
820 if (yytype
< YYNTOKENS
)
821 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
833 /*--------------------------------.
834 | Print this symbol on YYOUTPUT. |
835 `--------------------------------*/
837 #if (defined __STDC__ || defined __C99__FUNC__ \
838 || defined __cplusplus || defined _MSC_VER)
840 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
843 yy_symbol_print (yyoutput
, yytype
, yyvaluep
)
846 YYSTYPE
const * const yyvaluep
;
849 if (yytype
< YYNTOKENS
)
850 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
852 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
854 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
);
855 YYFPRINTF (yyoutput
, ")");
858 /*------------------------------------------------------------------.
859 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
861 `------------------------------------------------------------------*/
863 #if (defined __STDC__ || defined __C99__FUNC__ \
864 || defined __cplusplus || defined _MSC_VER)
866 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
869 yy_stack_print (yybottom
, yytop
)
870 yytype_int16
*yybottom
;
874 YYFPRINTF (stderr
, "Stack now");
875 for (; yybottom
<= yytop
; yybottom
++)
877 int yybot
= *yybottom
;
878 YYFPRINTF (stderr
, " %d", yybot
);
880 YYFPRINTF (stderr
, "\n");
883 # define YY_STACK_PRINT(Bottom, Top) \
886 yy_stack_print ((Bottom), (Top)); \
890 /*------------------------------------------------.
891 | Report that the YYRULE is going to be reduced. |
892 `------------------------------------------------*/
894 #if (defined __STDC__ || defined __C99__FUNC__ \
895 || defined __cplusplus || defined _MSC_VER)
897 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
)
900 yy_reduce_print (yyvsp
, yyrule
)
905 int yynrhs
= yyr2
[yyrule
];
907 unsigned long int yylno
= yyrline
[yyrule
];
908 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
910 /* The symbols being reduced. */
911 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
913 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
914 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
915 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
917 YYFPRINTF (stderr
, "\n");
921 # define YY_REDUCE_PRINT(Rule) \
924 yy_reduce_print (yyvsp, Rule); \
927 /* Nonzero means print parse trace. It is left uninitialized so that
928 multiple parsers can coexist. */
931 # define YYDPRINTF(Args)
932 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
933 # define YY_STACK_PRINT(Bottom, Top)
934 # define YY_REDUCE_PRINT(Rule)
935 #endif /* !YYDEBUG */
938 /* YYINITDEPTH -- initial size of the parser's stacks. */
940 # define YYINITDEPTH 200
943 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
944 if the built-in stack extension method is used).
946 Do not make this value too large; the results are undefined if
947 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
948 evaluated with infinite-precision integer arithmetic. */
951 # define YYMAXDEPTH 10000
958 # if defined __GLIBC__ && defined _STRING_H
959 # define yystrlen strlen
961 /* Return the length of YYSTR. */
962 #if (defined __STDC__ || defined __C99__FUNC__ \
963 || defined __cplusplus || defined _MSC_VER)
965 yystrlen (const char *yystr
)
973 for (yylen
= 0; yystr
[yylen
]; yylen
++)
981 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
982 # define yystpcpy stpcpy
984 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
986 #if (defined __STDC__ || defined __C99__FUNC__ \
987 || defined __cplusplus || defined _MSC_VER)
989 yystpcpy (char *yydest
, const char *yysrc
)
992 yystpcpy (yydest
, yysrc
)
998 const char *yys
= yysrc
;
1000 while ((*yyd
++ = *yys
++) != '\0')
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
1017 yytnamerr (char *yyres
, const char *yystr
)
1022 char const *yyp
= yystr
;
1029 goto do_not_strip_quotes
;
1033 goto do_not_strip_quotes
;
1046 do_not_strip_quotes
: ;
1050 return yystrlen (yystr
);
1052 return yystpcpy (yyres
, yystr
) - yyres
;
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
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. */
1065 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1066 yytype_int16
*yyssp
, int yytoken
)
1068 YYSIZE_T yysize0
= yytnamerr (YY_NULL
, yytname
[yytoken
]);
1069 YYSIZE_T yysize
= yysize0
;
1070 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1071 /* Internationalized format string. */
1072 const char *yyformat
= YY_NULL
;
1073 /* Arguments of yyformat. */
1074 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1075 /* Number of reported tokens (one for the "unexpected", one per
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
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.
1106 if (yytoken
!= YYEMPTY
)
1108 int yyn
= yypact
[*yyssp
];
1109 yyarg
[yycount
++] = yytname
[yytoken
];
1110 if (!yypact_value_is_default (yyn
))
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
;
1121 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1122 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
1123 && !yytable_value_is_error (yytable
[yyx
+ yyn
]))
1125 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1131 yyarg
[yycount
++] = yytname
[yyx
];
1133 YYSIZE_T yysize1
= yysize
+ yytnamerr (YY_NULL
, yytname
[yyx
]);
1134 if (! (yysize
<= yysize1
1135 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1145 # define YYCASE_(N, S) \
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"));
1159 YYSIZE_T yysize1
= yysize
+ yystrlen (yyformat
);
1160 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1165 if (*yymsg_alloc
< yysize
)
1167 *yymsg_alloc
= 2 * yysize
;
1168 if (! (yysize
<= *yymsg_alloc
1169 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1170 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
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. */
1180 while ((*yyp
= *yyformat
) != '\0')
1181 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1183 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1194 #endif /* YYERROR_VERBOSE */
1196 /*-----------------------------------------------.
1197 | Release the memory associated to this symbol. |
1198 `-----------------------------------------------*/
1201 #if (defined __STDC__ || defined __C99__FUNC__ \
1202 || defined __cplusplus || defined _MSC_VER)
1204 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
1207 yydestruct (yymsg
, yytype
, yyvaluep
)
1217 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1234 #ifdef YYPARSE_PARAM
1235 #if (defined __STDC__ || defined __C99__FUNC__ \
1236 || defined __cplusplus || defined _MSC_VER)
1238 yyparse (void *YYPARSE_PARAM
)
1241 yyparse (YYPARSE_PARAM
)
1242 void *YYPARSE_PARAM
;
1244 #else /* ! YYPARSE_PARAM */
1245 #if (defined __STDC__ || defined __C99__FUNC__ \
1246 || defined __cplusplus || defined _MSC_VER)
1256 /* The lookahead symbol. */
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")
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
1274 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1275 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1276 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
1278 #ifndef YY_INITIAL_VALUE
1279 # define YY_INITIAL_VALUE(Value) /* Nothing. */
1282 /* The semantic value of the lookahead symbol. */
1283 YYSTYPE yylval
YY_INITIAL_VALUE(yyval_default
);
1285 /* Number of syntax errors so far. */
1289 /* Number of tokens to shift before error messages enabled. */
1292 /* The stacks and their tools:
1293 `yyss': related to states.
1294 `yyvs': related to semantic values.
1296 Refer to the stacks through separate pointers, to allow yyoverflow
1297 to reallocate them elsewhere. */
1299 /* The state stack. */
1300 yytype_int16 yyssa
[YYINITDEPTH
];
1302 yytype_int16
*yyssp
;
1304 /* The semantic value stack. */
1305 YYSTYPE yyvsa
[YYINITDEPTH
];
1309 YYSIZE_T yystacksize
;
1313 /* Lookahead token as an internal (translated) token number. */
1315 /* The variables used to return semantic value and location from the
1320 /* Buffer for error messages, and its allocated size. */
1322 char *yymsg
= yymsgbuf
;
1323 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1326 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1328 /* The number of symbols on the RHS of the reduced rule.
1329 Keep to zero when no symbol should be popped. */
1332 yyssp
= yyss
= yyssa
;
1333 yyvsp
= yyvs
= yyvsa
;
1334 yystacksize
= YYINITDEPTH
;
1336 YYDPRINTF ((stderr
, "Starting parse\n"));
1341 yychar
= YYEMPTY
; /* Cause a token to be read. */
1344 /*------------------------------------------------------------.
1345 | yynewstate -- Push a new state, which is found in yystate. |
1346 `------------------------------------------------------------*/
1348 /* In all cases, when you get here, the value and location stacks
1349 have just been pushed. So pushing a state here evens the stacks. */
1355 if (yyss
+ yystacksize
- 1 <= yyssp
)
1357 /* Get the current used size of the three stacks, in elements. */
1358 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1362 /* Give user a chance to reallocate the stack. Use copies of
1363 these so that the &'s don't force the real ones into
1365 YYSTYPE
*yyvs1
= yyvs
;
1366 yytype_int16
*yyss1
= yyss
;
1368 /* Each stack pointer address is followed by the size of the
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"),
1373 &yyss1
, yysize
* sizeof (*yyssp
),
1374 &yyvs1
, yysize
* sizeof (*yyvsp
),
1380 #else /* no yyoverflow */
1381 # ifndef YYSTACK_RELOCATE
1382 goto yyexhaustedlab
;
1384 /* Extend the stack our own way. */
1385 if (YYMAXDEPTH
<= yystacksize
)
1386 goto yyexhaustedlab
;
1388 if (YYMAXDEPTH
< yystacksize
)
1389 yystacksize
= YYMAXDEPTH
;
1392 yytype_int16
*yyss1
= yyss
;
1393 union yyalloc
*yyptr
=
1394 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1396 goto yyexhaustedlab
;
1397 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1398 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1399 # undef YYSTACK_RELOCATE
1401 YYSTACK_FREE (yyss1
);
1404 #endif /* no yyoverflow */
1406 yyssp
= yyss
+ yysize
- 1;
1407 yyvsp
= yyvs
+ yysize
- 1;
1409 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1410 (unsigned long int) yystacksize
));
1412 if (yyss
+ yystacksize
- 1 <= yyssp
)
1416 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1418 if (yystate
== YYFINAL
)
1428 /* Do appropriate processing given the current state. Read a
1429 lookahead token if we need one and don't already have one. */
1431 /* First try to decide what to do without reference to lookahead token. */
1432 yyn
= yypact
[yystate
];
1433 if (yypact_value_is_default (yyn
))
1436 /* Not known => get a lookahead token if don't already have one. */
1438 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1439 if (yychar
== YYEMPTY
)
1441 YYDPRINTF ((stderr
, "Reading a token: "));
1445 if (yychar
<= YYEOF
)
1447 yychar
= yytoken
= YYEOF
;
1448 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1452 yytoken
= YYTRANSLATE (yychar
);
1453 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1456 /* If the proper action on seeing token YYTOKEN is to reduce or to
1457 detect an error, take that action. */
1459 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1464 if (yytable_value_is_error (yyn
))
1470 /* Count tokens shifted since error; after three, turn off error
1475 /* Shift the lookahead token. */
1476 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1478 /* Discard the shifted token. */
1482 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1484 YY_IGNORE_MAYBE_UNINITIALIZED_END
1489 /*-----------------------------------------------------------.
1490 | yydefault -- do the default action for the current state. |
1491 `-----------------------------------------------------------*/
1493 yyn
= yydefact
[yystate
];
1499 /*-----------------------------.
1500 | yyreduce -- Do a reduction. |
1501 `-----------------------------*/
1503 /* yyn is the number of a rule to reduce with. */
1506 /* If YYLEN is nonzero, implement the default value of the action:
1509 Otherwise, the following line sets YYVAL to garbage.
1510 This behavior is undocumented and Bison
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
];
1517 YY_REDUCE_PRINT (yyn
);
1521 /* Line 1792 of yacc.c */
1522 #line 175 "plural.y"
1524 if ((yyvsp
[(1) - (1)].exp
) == NULL
)
1526 ((struct parse_args
*) arg
)->res
= (yyvsp
[(1) - (1)].exp
);
1531 /* Line 1792 of yacc.c */
1532 #line 183 "plural.y"
1534 (yyval
.exp
) = new_exp_3 (qmop
, (yyvsp
[(1) - (5)].exp
), (yyvsp
[(3) - (5)].exp
), (yyvsp
[(5) - (5)].exp
));
1539 /* Line 1792 of yacc.c */
1540 #line 187 "plural.y"
1542 (yyval
.exp
) = new_exp_2 (lor
, (yyvsp
[(1) - (3)].exp
), (yyvsp
[(3) - (3)].exp
));
1547 /* Line 1792 of yacc.c */
1548 #line 191 "plural.y"
1550 (yyval
.exp
) = new_exp_2 (land
, (yyvsp
[(1) - (3)].exp
), (yyvsp
[(3) - (3)].exp
));
1555 /* Line 1792 of yacc.c */
1556 #line 195 "plural.y"
1558 (yyval
.exp
) = new_exp_2 ((yyvsp
[(2) - (3)].op
), (yyvsp
[(1) - (3)].exp
), (yyvsp
[(3) - (3)].exp
));
1563 /* Line 1792 of yacc.c */
1564 #line 199 "plural.y"
1566 (yyval
.exp
) = new_exp_2 ((yyvsp
[(2) - (3)].op
), (yyvsp
[(1) - (3)].exp
), (yyvsp
[(3) - (3)].exp
));
1571 /* Line 1792 of yacc.c */
1572 #line 203 "plural.y"
1574 (yyval
.exp
) = new_exp_2 ((yyvsp
[(2) - (3)].op
), (yyvsp
[(1) - (3)].exp
), (yyvsp
[(3) - (3)].exp
));
1579 /* Line 1792 of yacc.c */
1580 #line 207 "plural.y"
1582 (yyval
.exp
) = new_exp_2 ((yyvsp
[(2) - (3)].op
), (yyvsp
[(1) - (3)].exp
), (yyvsp
[(3) - (3)].exp
));
1587 /* Line 1792 of yacc.c */
1588 #line 211 "plural.y"
1590 (yyval
.exp
) = new_exp_1 (lnot
, (yyvsp
[(2) - (2)].exp
));
1595 /* Line 1792 of yacc.c */
1596 #line 215 "plural.y"
1598 (yyval
.exp
) = new_exp_0 (var
);
1603 /* Line 1792 of yacc.c */
1604 #line 219 "plural.y"
1606 if (((yyval
.exp
) = new_exp_0 (num
)) != NULL
)
1607 (yyval
.exp
)->val
.num
= (yyvsp
[(1) - (1)].num
);
1612 /* Line 1792 of yacc.c */
1613 #line 224 "plural.y"
1615 (yyval
.exp
) = (yyvsp
[(2) - (3)].exp
);
1620 /* Line 1792 of yacc.c */
1621 #line 1622 "plural.c"
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. */
1635 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
1639 YY_STACK_PRINT (yyss
, yyssp
);
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. */
1649 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
1650 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1651 yystate
= yytable
[yystate
];
1653 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
1658 /*------------------------------------.
1659 | yyerrlab -- here on detecting error |
1660 `------------------------------------*/
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
);
1666 /* If not already recovering from an error, report this error. */
1670 #if ! YYERROR_VERBOSE
1671 yyerror (YY_("syntax error"));
1673 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1676 char const *yymsgp
= YY_("syntax error");
1677 int yysyntax_error_status
;
1678 yysyntax_error_status
= YYSYNTAX_ERROR
;
1679 if (yysyntax_error_status
== 0)
1681 else if (yysyntax_error_status
== 1)
1683 if (yymsg
!= yymsgbuf
)
1684 YYSTACK_FREE (yymsg
);
1685 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
1689 yymsg_alloc
= sizeof yymsgbuf
;
1690 yysyntax_error_status
= 2;
1694 yysyntax_error_status
= YYSYNTAX_ERROR
;
1699 if (yysyntax_error_status
== 2)
1700 goto yyexhaustedlab
;
1702 # undef YYSYNTAX_ERROR
1708 if (yyerrstatus
== 3)
1710 /* If just tried and failed to reuse lookahead token after an
1711 error, discard it. */
1713 if (yychar
<= YYEOF
)
1715 /* Return failure if at end of input. */
1716 if (yychar
== YYEOF
)
1721 yydestruct ("Error: discarding",
1727 /* Else will try to reuse lookahead token after shifting the error
1732 /*---------------------------------------------------.
1733 | yyerrorlab -- error raised explicitly by YYERROR. |
1734 `---------------------------------------------------*/
1737 /* Pacify compilers like GCC when the user code never invokes
1738 YYERROR and the label yyerrorlab therefore never appears in user
1740 if (/*CONSTCOND*/ 0)
1743 /* Do not reclaim the symbols of the rule which action triggered
1747 YY_STACK_PRINT (yyss
, yyssp
);
1752 /*-------------------------------------------------------------.
1753 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1754 `-------------------------------------------------------------*/
1756 yyerrstatus
= 3; /* Each real token shifted decrements this. */
1760 yyn
= yypact
[yystate
];
1761 if (!yypact_value_is_default (yyn
))
1764 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
1772 /* Pop the current state because it cannot handle the error token. */
1777 yydestruct ("Error: popping",
1778 yystos
[yystate
], yyvsp
);
1781 YY_STACK_PRINT (yyss
, yyssp
);
1784 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1786 YY_IGNORE_MAYBE_UNINITIALIZED_END
1789 /* Shift the error token. */
1790 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
1796 /*-------------------------------------.
1797 | yyacceptlab -- YYACCEPT comes here. |
1798 `-------------------------------------*/
1803 /*-----------------------------------.
1804 | yyabortlab -- YYABORT comes here. |
1805 `-----------------------------------*/
1810 #if !defined yyoverflow || YYERROR_VERBOSE
1811 /*-------------------------------------------------.
1812 | yyexhaustedlab -- memory exhaustion comes here. |
1813 `-------------------------------------------------*/
1815 yyerror (YY_("memory exhausted"));
1821 if (yychar
!= YYEMPTY
)
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",
1829 /* Do not reclaim the symbols of the rule which action triggered
1830 this YYABORT or YYACCEPT. */
1832 YY_STACK_PRINT (yyss
, yyssp
);
1833 while (yyssp
!= yyss
)
1835 yydestruct ("Cleanup: popping",
1836 yystos
[*yyssp
], yyvsp
);
1841 YYSTACK_FREE (yyss
);
1844 if (yymsg
!= yymsgbuf
)
1845 YYSTACK_FREE (yymsg
);
1847 /* Make sure YYID is used. */
1848 return YYID (yyresult
);
1852 /* Line 2055 of yacc.c */
1853 #line 229 "plural.y"
1858 FREE_EXPRESSION (exp
)
1859 struct expression
*exp
;
1864 /* Handle the recursive case. */
1868 FREE_EXPRESSION (exp
->val
.args
[2]);
1871 FREE_EXPRESSION (exp
->val
.args
[1]);
1874 FREE_EXPRESSION (exp
->val
.args
[0]);
1889 const char *exp
= *pexp
;
1900 if (exp
[0] != ' ' && exp
[0] != '\t')
1909 case '0': case '1': case '2': case '3': case '4':
1910 case '5': case '6': case '7': case '8': case '9':
1912 unsigned long int n
= result
- '0';
1913 while (exp
[0] >= '0' && exp
[0] <= '9')
1939 lval
->op
= not_equal
;
1946 if (exp
[0] == result
)
1956 lval
->op
= less_or_equal
;
1959 lval
->op
= less_than
;
1967 lval
->op
= greater_or_equal
;
1970 lval
->op
= greater_than
;
2004 /* Nothing, just return the character. */
2010 /* Be safe and let the user call this function again. */
2033 /* Do nothing. We don't print error messages here. */