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-2015 Free Software Foundation, Inc.
77 Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
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.
84 This program is distributed in the hope that it will be useful,
85 but WITHOUT ANY WARRANTY; without even the implied warranty of
86 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
87 GNU Lesser General Public License for more details.
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/>. */
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. */
97 #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
117 /* Line 371 of yacc.c */
121 # if defined __cplusplus && 201103L <= __cplusplus
122 # define YY_NULL nullptr
128 /* Enabling verbose error messages. */
129 #ifdef YYERROR_VERBOSE
130 # undef YYERROR_VERBOSE
131 # define YYERROR_VERBOSE 1
133 # define YYERROR_VERBOSE 0
137 /* Enabling traces. */
142 extern int __gettextdebug
;
148 /* Put the tokens into the symbol table, so that GDB and other debuggers
167 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
168 typedef union YYSTYPE
170 /* Line 387 of yacc.c */
173 unsigned long int num
;
174 enum expression_operator op
;
175 struct expression
*exp
;
178 /* Line 387 of yacc.c */
181 # define YYSTYPE_IS_TRIVIAL 1
182 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
183 # define YYSTYPE_IS_DECLARED 1
188 #if defined __STDC__ || defined __cplusplus
189 int __gettextparse (void *YYPARSE_PARAM
);
191 int __gettextparse ();
193 #else /* ! YYPARSE_PARAM */
194 #if defined __STDC__ || defined __cplusplus
195 int __gettextparse (struct parse_args
*arg
);
197 int __gettextparse ();
199 #endif /* ! YYPARSE_PARAM */
203 /* Copy the second part of user declarations. */
204 /* Line 390 of yacc.c */
207 /* Prototypes for local functions. */
208 static int yylex (YYSTYPE
*lval
, struct parse_args
*arg
);
209 static void yyerror (struct parse_args
*arg
, const char *str
);
211 /* Allocation of expressions. */
213 static struct expression
*
214 new_exp (int nargs
, enum expression_operator op
,
215 struct expression
* const *args
)
218 struct expression
*newp
;
220 /* If any of the argument could not be malloc'ed, just return NULL. */
221 for (i
= nargs
- 1; i
>= 0; i
--)
225 /* Allocate a new expression. */
226 newp
= (struct expression
*) malloc (sizeof (*newp
));
230 newp
->operation
= op
;
231 for (i
= nargs
- 1; i
>= 0; i
--)
232 newp
->val
.args
[i
] = args
[i
];
237 for (i
= nargs
- 1; i
>= 0; i
--)
238 FREE_EXPRESSION (args
[i
]);
243 static inline struct expression
*
244 new_exp_0 (enum expression_operator op
)
246 return new_exp (0, op
, NULL
);
249 static inline struct expression
*
250 new_exp_1 (enum expression_operator op
, struct expression
*right
)
252 struct expression
*args
[1];
255 return new_exp (1, op
, args
);
258 static struct expression
*
259 new_exp_2 (enum expression_operator op
, struct expression
*left
,
260 struct expression
*right
)
262 struct expression
*args
[2];
266 return new_exp (2, op
, args
);
269 static inline struct expression
*
270 new_exp_3 (enum expression_operator op
, struct expression
*bexp
,
271 struct expression
*tbranch
, struct expression
*fbranch
)
273 struct expression
*args
[3];
278 return new_exp (3, op
, args
);
282 /* Line 390 of yacc.c */
290 typedef YYTYPE_UINT8 yytype_uint8
;
292 typedef unsigned char yytype_uint8
;
296 typedef YYTYPE_INT8 yytype_int8
;
297 #elif (defined __STDC__ || defined __C99__FUNC__ \
298 || defined __cplusplus || defined _MSC_VER)
299 typedef signed char yytype_int8
;
301 typedef short int yytype_int8
;
305 typedef YYTYPE_UINT16 yytype_uint16
;
307 typedef unsigned short int yytype_uint16
;
311 typedef YYTYPE_INT16 yytype_int16
;
313 typedef short int yytype_int16
;
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
326 # define YYSIZE_T unsigned int
330 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
333 # if defined YYENABLE_NLS && YYENABLE_NLS
335 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
336 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
340 # define YY_(Msgid) Msgid
344 /* Suppress unused-variable warnings by "using" E. */
345 #if ! defined lint || defined __GNUC__
346 # define YYUSE(E) ((void) (E))
348 # define YYUSE(E) /* empty */
351 /* Identity function, used to suppress warnings about constant conditions. */
355 #if (defined __STDC__ || defined __C99__FUNC__ \
356 || defined __cplusplus || defined _MSC_VER)
369 #if ! defined yyoverflow || YYERROR_VERBOSE
371 /* The parser invokes alloca or malloc; define the necessary symbols. */
373 # ifdef YYSTACK_USE_ALLOCA
374 # if YYSTACK_USE_ALLOCA
376 # define YYSTACK_ALLOC __builtin_alloca
377 # elif defined __BUILTIN_VA_ARG_INCR
378 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
380 # define YYSTACK_ALLOC __alloca
381 # elif defined _MSC_VER
382 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
383 # define alloca _alloca
385 # define YYSTACK_ALLOC alloca
386 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
387 || defined __cplusplus || defined _MSC_VER)
388 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
389 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
390 # ifndef EXIT_SUCCESS
391 # define EXIT_SUCCESS 0
398 # ifdef YYSTACK_ALLOC
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 */
409 # define YYSTACK_ALLOC YYMALLOC
410 # define YYSTACK_FREE YYFREE
411 # ifndef YYSTACK_ALLOC_MAXIMUM
412 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
414 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
415 && ! ((defined YYMALLOC || defined malloc) \
416 && (defined YYFREE || defined free)))
417 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
418 # ifndef EXIT_SUCCESS
419 # define EXIT_SUCCESS 0
423 # define YYMALLOC malloc
424 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
425 || defined __cplusplus || defined _MSC_VER)
426 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
431 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
432 || defined __cplusplus || defined _MSC_VER)
433 void free (void *); /* INFRINGES ON USER NAME SPACE */
437 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
440 #if (! defined yyoverflow \
441 && (! defined __cplusplus \
442 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
444 /* A type that is properly aligned for any stack member. */
447 yytype_int16 yyss_alloc
;
451 /* The size of the maximum gap between one aligned stack and the next. */
452 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
454 /* The size of an array large to enough to hold all stacks, each with
456 # define YYSTACK_BYTES(N) \
457 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
458 + YYSTACK_GAP_MAXIMUM)
460 # define YYCOPY_NEEDED 1
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
467 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
470 YYSIZE_T yynewbytes; \
471 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
472 Stack = &yyptr->Stack_alloc; \
473 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
474 yyptr += yynewbytes / sizeof (*yyptr); \
480 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
481 /* Copy COUNT objects from SRC to DST. The source and destination do
484 # if defined __GNUC__ && 1 < __GNUC__
485 # define YYCOPY(Dst, Src, Count) \
486 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
488 # define YYCOPY(Dst, Src, Count) \
492 for (yyi = 0; yyi < (Count); yyi++) \
493 (Dst)[yyi] = (Src)[yyi]; \
498 #endif /* !YYCOPY_NEEDED */
500 /* YYFINAL -- State number of the termination state. */
502 /* YYLAST -- Last index in YYTABLE. */
505 /* YYNTOKENS -- Number of terminals. */
507 /* YYNNTS -- Number of nonterminals. */
509 /* YYNRULES -- Number of rules. */
511 /* YYNRULES -- Number of states. */
514 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
516 #define YYMAXUTOK 262
518 #define YYTRANSLATE(YYX) \
519 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
521 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
522 static const yytype_uint8 yytranslate
[] =
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,
554 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
556 static const yytype_uint8 yyprhs
[] =
558 0, 0, 3, 5, 11, 15, 19, 23, 27, 31,
562 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
563 static const yytype_int8 yyrhs
[] =
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
572 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
573 static const yytype_uint8 yyrline
[] =
575 0, 152, 152, 160, 164, 168, 172, 176, 180, 184,
580 #if YYDEBUG || YYERROR_VERBOSE || 0
581 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
582 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
583 static const char *const yytname
[] =
585 "$end", "error", "$undefined", "'?'", "'|'", "'&'", "EQUOP2", "CMPOP2",
586 "ADDOP2", "MULOP2", "'!'", "NUMBER", "':'", "'n'", "'('", "')'",
587 "$accept", "start", "exp", YY_NULL
592 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
594 static const yytype_uint16 yytoknum
[] =
596 0, 256, 257, 63, 124, 38, 258, 259, 260, 261,
597 33, 262, 58, 110, 40, 41
601 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
602 static const yytype_uint8 yyr1
[] =
604 0, 16, 17, 18, 18, 18, 18, 18, 18, 18,
608 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
609 static const yytype_uint8 yyr2
[] =
611 0, 2, 1, 5, 3, 3, 3, 3, 3, 3,
615 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
616 Performed when YYTABLE doesn't specify something else to do. Zero
617 means the default is an error. */
618 static const yytype_uint8 yydefact
[] =
620 0, 0, 12, 11, 0, 0, 2, 10, 0, 1,
621 0, 0, 0, 0, 0, 0, 0, 13, 0, 4,
625 /* YYDEFGOTO[NTERM-NUM]. */
626 static const yytype_int8 yydefgoto
[] =
631 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
633 #define YYPACT_NINF -10
634 static const yytype_int8 yypact
[] =
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
641 /* YYPGOTO[NTERM-NUM]. */
642 static const yytype_int8 yypgoto
[] =
647 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
648 positive, shift that token. If negative, reduce the rule which
649 number is the opposite. If YYTABLE_NINF, syntax error. */
650 #define YYTABLE_NINF -1
651 static const yytype_uint8 yytable
[] =
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,
661 #define yypact_value_is_default(Yystate) \
662 (!!((Yystate) == (-10)))
664 #define yytable_value_is_error(Yytable_value) \
667 static const yytype_int8 yycheck
[] =
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,
677 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
678 symbol of state STATE-NUM. */
679 static const yytype_uint8 yystos
[] =
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
686 #define yyerrok (yyerrstatus = 0)
687 #define yyclearin (yychar = YYEMPTY)
691 #define YYACCEPT goto yyacceptlab
692 #define YYABORT goto yyabortlab
693 #define YYERROR goto yyerrorlab
696 /* Like YYERROR except do call yyerror. This remains here temporarily
697 to ease the transition to the new meaning of YYERROR, for GCC.
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
703 #define YYFAIL goto yyerrlab
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. */
711 #define YYRECOVERING() (!!yyerrstatus)
713 #define YYBACKUP(Token, Value) \
715 if (yychar == YYEMPTY) \
719 YYPOPSTACK (yylen); \
725 yyerror (arg, YY_("syntax error: cannot back up")); \
730 /* Error token number */
732 #define YYERRCODE 256
735 /* This macro is provided for backward compatibility. */
736 #ifndef YY_LOCATION_PRINT
737 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
741 /* YYLEX -- calling `yylex' with the right arguments. */
743 # define YYLEX yylex (&yylval, YYLEX_PARAM)
745 # define YYLEX yylex (&yylval, arg)
748 /* Enable debugging if requested. */
752 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
753 # define YYFPRINTF fprintf
756 # define YYDPRINTF(Args) \
762 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
766 YYFPRINTF (stderr, "%s ", Title); \
767 yy_symbol_print (stderr, \
769 YYFPRINTF (stderr, "\n"); \
774 /*--------------------------------.
775 | Print this symbol on YYOUTPUT. |
776 `--------------------------------*/
779 #if (defined __STDC__ || defined __C99__FUNC__ \
780 || defined __cplusplus || defined _MSC_VER)
782 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, struct parse_args
*arg
)
785 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, arg
)
788 YYSTYPE
const * const yyvaluep
;
789 struct parse_args
*arg
;
792 FILE *yyo
= yyoutput
;
798 if (yytype
< YYNTOKENS
)
799 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
811 /*--------------------------------.
812 | Print this symbol on YYOUTPUT. |
813 `--------------------------------*/
815 #if (defined __STDC__ || defined __C99__FUNC__ \
816 || defined __cplusplus || defined _MSC_VER)
818 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, struct parse_args
*arg
)
821 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, arg
)
824 YYSTYPE
const * const yyvaluep
;
825 struct parse_args
*arg
;
828 if (yytype
< YYNTOKENS
)
829 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
831 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
833 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, arg
);
834 YYFPRINTF (yyoutput
, ")");
837 /*------------------------------------------------------------------.
838 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
840 `------------------------------------------------------------------*/
842 #if (defined __STDC__ || defined __C99__FUNC__ \
843 || defined __cplusplus || defined _MSC_VER)
845 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
848 yy_stack_print (yybottom
, yytop
)
849 yytype_int16
*yybottom
;
853 YYFPRINTF (stderr
, "Stack now");
854 for (; yybottom
<= yytop
; yybottom
++)
856 int yybot
= *yybottom
;
857 YYFPRINTF (stderr
, " %d", yybot
);
859 YYFPRINTF (stderr
, "\n");
862 # define YY_STACK_PRINT(Bottom, Top) \
865 yy_stack_print ((Bottom), (Top)); \
869 /*------------------------------------------------.
870 | Report that the YYRULE is going to be reduced. |
871 `------------------------------------------------*/
873 #if (defined __STDC__ || defined __C99__FUNC__ \
874 || defined __cplusplus || defined _MSC_VER)
876 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
, struct parse_args
*arg
)
879 yy_reduce_print (yyvsp
, yyrule
, arg
)
882 struct parse_args
*arg
;
885 int yynrhs
= yyr2
[yyrule
];
887 unsigned long int yylno
= yyrline
[yyrule
];
888 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
890 /* The symbols being reduced. */
891 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
893 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
894 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
895 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
897 YYFPRINTF (stderr
, "\n");
901 # define YY_REDUCE_PRINT(Rule) \
904 yy_reduce_print (yyvsp, Rule, arg); \
907 /* Nonzero means print parse trace. It is left uninitialized so that
908 multiple parsers can coexist. */
911 # define YYDPRINTF(Args)
912 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
913 # define YY_STACK_PRINT(Bottom, Top)
914 # define YY_REDUCE_PRINT(Rule)
915 #endif /* !YYDEBUG */
918 /* YYINITDEPTH -- initial size of the parser's stacks. */
920 # define YYINITDEPTH 200
923 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
924 if the built-in stack extension method is used).
926 Do not make this value too large; the results are undefined if
927 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
928 evaluated with infinite-precision integer arithmetic. */
931 # define YYMAXDEPTH 10000
938 # if defined __GLIBC__ && defined _STRING_H
939 # define yystrlen strlen
941 /* Return the length of YYSTR. */
942 #if (defined __STDC__ || defined __C99__FUNC__ \
943 || defined __cplusplus || defined _MSC_VER)
945 yystrlen (const char *yystr
)
953 for (yylen
= 0; yystr
[yylen
]; yylen
++)
961 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
962 # define yystpcpy stpcpy
964 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
966 #if (defined __STDC__ || defined __C99__FUNC__ \
967 || defined __cplusplus || defined _MSC_VER)
969 yystpcpy (char *yydest
, const char *yysrc
)
972 yystpcpy (yydest
, yysrc
)
978 const char *yys
= yysrc
;
980 while ((*yyd
++ = *yys
++) != '\0')
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
997 yytnamerr (char *yyres
, const char *yystr
)
1002 char const *yyp
= yystr
;
1009 goto do_not_strip_quotes
;
1013 goto do_not_strip_quotes
;
1026 do_not_strip_quotes
: ;
1030 return yystrlen (yystr
);
1032 return yystpcpy (yyres
, yystr
) - yyres
;
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
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. */
1045 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1046 yytype_int16
*yyssp
, int yytoken
)
1048 YYSIZE_T yysize0
= yytnamerr (YY_NULL
, yytname
[yytoken
]);
1049 YYSIZE_T yysize
= yysize0
;
1050 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1051 /* Internationalized format string. */
1052 const char *yyformat
= YY_NULL
;
1053 /* Arguments of yyformat. */
1054 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1055 /* Number of reported tokens (one for the "unexpected", one per
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
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.
1086 if (yytoken
!= YYEMPTY
)
1088 int yyn
= yypact
[*yyssp
];
1089 yyarg
[yycount
++] = yytname
[yytoken
];
1090 if (!yypact_value_is_default (yyn
))
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
;
1101 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1102 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
1103 && !yytable_value_is_error (yytable
[yyx
+ yyn
]))
1105 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1111 yyarg
[yycount
++] = yytname
[yyx
];
1113 YYSIZE_T yysize1
= yysize
+ yytnamerr (YY_NULL
, yytname
[yyx
]);
1114 if (! (yysize
<= yysize1
1115 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1125 # define YYCASE_(N, S) \
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"));
1139 YYSIZE_T yysize1
= yysize
+ yystrlen (yyformat
);
1140 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1145 if (*yymsg_alloc
< yysize
)
1147 *yymsg_alloc
= 2 * yysize
;
1148 if (! (yysize
<= *yymsg_alloc
1149 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1150 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
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. */
1160 while ((*yyp
= *yyformat
) != '\0')
1161 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1163 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1174 #endif /* YYERROR_VERBOSE */
1176 /*-----------------------------------------------.
1177 | Release the memory associated to this symbol. |
1178 `-----------------------------------------------*/
1181 #if (defined __STDC__ || defined __C99__FUNC__ \
1182 || defined __cplusplus || defined _MSC_VER)
1184 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, struct parse_args
*arg
)
1187 yydestruct (yymsg
, yytype
, yyvaluep
, arg
)
1191 struct parse_args
*arg
;
1199 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1216 #ifdef YYPARSE_PARAM
1217 #if (defined __STDC__ || defined __C99__FUNC__ \
1218 || defined __cplusplus || defined _MSC_VER)
1220 yyparse (void *YYPARSE_PARAM
)
1223 yyparse (YYPARSE_PARAM
)
1224 void *YYPARSE_PARAM
;
1226 #else /* ! YYPARSE_PARAM */
1227 #if (defined __STDC__ || defined __C99__FUNC__ \
1228 || defined __cplusplus || defined _MSC_VER)
1230 yyparse (struct parse_args
*arg
)
1234 struct parse_args
*arg
;
1238 /* The lookahead symbol. */
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")
1251 /* Default value used for initialization, for pacifying older GCCs
1252 or non-GCC compilers. */
1253 static YYSTYPE yyval_default
;
1254 # define YY_INITIAL_VALUE(Value) = Value
1256 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1257 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1258 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
1260 #ifndef YY_INITIAL_VALUE
1261 # define YY_INITIAL_VALUE(Value) /* Nothing. */
1264 /* The semantic value of the lookahead symbol. */
1265 YYSTYPE yylval
YY_INITIAL_VALUE(yyval_default
);
1267 /* Number of syntax errors so far. */
1271 /* Number of tokens to shift before error messages enabled. */
1274 /* The stacks and their tools:
1275 `yyss': related to states.
1276 `yyvs': related to semantic values.
1278 Refer to the stacks through separate pointers, to allow yyoverflow
1279 to reallocate them elsewhere. */
1281 /* The state stack. */
1282 yytype_int16 yyssa
[YYINITDEPTH
];
1284 yytype_int16
*yyssp
;
1286 /* The semantic value stack. */
1287 YYSTYPE yyvsa
[YYINITDEPTH
];
1291 YYSIZE_T yystacksize
;
1295 /* Lookahead token as an internal (translated) token number. */
1297 /* The variables used to return semantic value and location from the
1302 /* Buffer for error messages, and its allocated size. */
1304 char *yymsg
= yymsgbuf
;
1305 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1308 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1310 /* The number of symbols on the RHS of the reduced rule.
1311 Keep to zero when no symbol should be popped. */
1314 yyssp
= yyss
= yyssa
;
1315 yyvsp
= yyvs
= yyvsa
;
1316 yystacksize
= YYINITDEPTH
;
1318 YYDPRINTF ((stderr
, "Starting parse\n"));
1323 yychar
= YYEMPTY
; /* Cause a token to be read. */
1326 /*------------------------------------------------------------.
1327 | yynewstate -- Push a new state, which is found in yystate. |
1328 `------------------------------------------------------------*/
1330 /* In all cases, when you get here, the value and location stacks
1331 have just been pushed. So pushing a state here evens the stacks. */
1337 if (yyss
+ yystacksize
- 1 <= yyssp
)
1339 /* Get the current used size of the three stacks, in elements. */
1340 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1344 /* Give user a chance to reallocate the stack. Use copies of
1345 these so that the &'s don't force the real ones into
1347 YYSTYPE
*yyvs1
= yyvs
;
1348 yytype_int16
*yyss1
= yyss
;
1350 /* Each stack pointer address is followed by the size of the
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"),
1355 &yyss1
, yysize
* sizeof (*yyssp
),
1356 &yyvs1
, yysize
* sizeof (*yyvsp
),
1362 #else /* no yyoverflow */
1363 # ifndef YYSTACK_RELOCATE
1364 goto yyexhaustedlab
;
1366 /* Extend the stack our own way. */
1367 if (YYMAXDEPTH
<= yystacksize
)
1368 goto yyexhaustedlab
;
1370 if (YYMAXDEPTH
< yystacksize
)
1371 yystacksize
= YYMAXDEPTH
;
1374 yytype_int16
*yyss1
= yyss
;
1375 union yyalloc
*yyptr
=
1376 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1378 goto yyexhaustedlab
;
1379 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1380 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1381 # undef YYSTACK_RELOCATE
1383 YYSTACK_FREE (yyss1
);
1386 #endif /* no yyoverflow */
1388 yyssp
= yyss
+ yysize
- 1;
1389 yyvsp
= yyvs
+ yysize
- 1;
1391 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1392 (unsigned long int) yystacksize
));
1394 if (yyss
+ yystacksize
- 1 <= yyssp
)
1398 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1400 if (yystate
== YYFINAL
)
1410 /* Do appropriate processing given the current state. Read a
1411 lookahead token if we need one and don't already have one. */
1413 /* First try to decide what to do without reference to lookahead token. */
1414 yyn
= yypact
[yystate
];
1415 if (yypact_value_is_default (yyn
))
1418 /* Not known => get a lookahead token if don't already have one. */
1420 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1421 if (yychar
== YYEMPTY
)
1423 YYDPRINTF ((stderr
, "Reading a token: "));
1427 if (yychar
<= YYEOF
)
1429 yychar
= yytoken
= YYEOF
;
1430 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1434 yytoken
= YYTRANSLATE (yychar
);
1435 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1438 /* If the proper action on seeing token YYTOKEN is to reduce or to
1439 detect an error, take that action. */
1441 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1446 if (yytable_value_is_error (yyn
))
1452 /* Count tokens shifted since error; after three, turn off error
1457 /* Shift the lookahead token. */
1458 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1460 /* Discard the shifted token. */
1464 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1466 YY_IGNORE_MAYBE_UNINITIALIZED_END
1471 /*-----------------------------------------------------------.
1472 | yydefault -- do the default action for the current state. |
1473 `-----------------------------------------------------------*/
1475 yyn
= yydefact
[yystate
];
1481 /*-----------------------------.
1482 | yyreduce -- Do a reduction. |
1483 `-----------------------------*/
1485 /* yyn is the number of a rule to reduce with. */
1488 /* If YYLEN is nonzero, implement the default value of the action:
1491 Otherwise, the following line sets YYVAL to garbage.
1492 This behavior is undocumented and Bison
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
];
1499 YY_REDUCE_PRINT (yyn
);
1503 /* Line 1792 of yacc.c */
1504 #line 153 "plural.y"
1506 if ((yyvsp
[(1) - (1)].exp
) == NULL
)
1508 arg
->res
= (yyvsp
[(1) - (1)].exp
);
1513 /* Line 1792 of yacc.c */
1514 #line 161 "plural.y"
1516 (yyval
.exp
) = new_exp_3 (qmop
, (yyvsp
[(1) - (5)].exp
), (yyvsp
[(3) - (5)].exp
), (yyvsp
[(5) - (5)].exp
));
1521 /* Line 1792 of yacc.c */
1522 #line 165 "plural.y"
1524 (yyval
.exp
) = new_exp_2 (lor
, (yyvsp
[(1) - (3)].exp
), (yyvsp
[(3) - (3)].exp
));
1529 /* Line 1792 of yacc.c */
1530 #line 169 "plural.y"
1532 (yyval
.exp
) = new_exp_2 (land
, (yyvsp
[(1) - (3)].exp
), (yyvsp
[(3) - (3)].exp
));
1537 /* Line 1792 of yacc.c */
1538 #line 173 "plural.y"
1540 (yyval
.exp
) = new_exp_2 ((yyvsp
[(2) - (3)].op
), (yyvsp
[(1) - (3)].exp
), (yyvsp
[(3) - (3)].exp
));
1545 /* Line 1792 of yacc.c */
1546 #line 177 "plural.y"
1548 (yyval
.exp
) = new_exp_2 ((yyvsp
[(2) - (3)].op
), (yyvsp
[(1) - (3)].exp
), (yyvsp
[(3) - (3)].exp
));
1553 /* Line 1792 of yacc.c */
1554 #line 181 "plural.y"
1556 (yyval
.exp
) = new_exp_2 ((yyvsp
[(2) - (3)].op
), (yyvsp
[(1) - (3)].exp
), (yyvsp
[(3) - (3)].exp
));
1561 /* Line 1792 of yacc.c */
1562 #line 185 "plural.y"
1564 (yyval
.exp
) = new_exp_2 ((yyvsp
[(2) - (3)].op
), (yyvsp
[(1) - (3)].exp
), (yyvsp
[(3) - (3)].exp
));
1569 /* Line 1792 of yacc.c */
1570 #line 189 "plural.y"
1572 (yyval
.exp
) = new_exp_1 (lnot
, (yyvsp
[(2) - (2)].exp
));
1577 /* Line 1792 of yacc.c */
1578 #line 193 "plural.y"
1580 (yyval
.exp
) = new_exp_0 (var
);
1585 /* Line 1792 of yacc.c */
1586 #line 197 "plural.y"
1588 if (((yyval
.exp
) = new_exp_0 (num
)) != NULL
)
1589 (yyval
.exp
)->val
.num
= (yyvsp
[(1) - (1)].num
);
1594 /* Line 1792 of yacc.c */
1595 #line 202 "plural.y"
1597 (yyval
.exp
) = (yyvsp
[(2) - (3)].exp
);
1602 /* Line 1792 of yacc.c */
1603 #line 1604 "plural.c"
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. */
1617 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
1621 YY_STACK_PRINT (yyss
, yyssp
);
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. */
1631 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
1632 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1633 yystate
= yytable
[yystate
];
1635 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
1640 /*------------------------------------.
1641 | yyerrlab -- here on detecting error |
1642 `------------------------------------*/
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
);
1648 /* If not already recovering from an error, report this error. */
1652 #if ! YYERROR_VERBOSE
1653 yyerror (arg
, YY_("syntax error"));
1655 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1658 char const *yymsgp
= YY_("syntax error");
1659 int yysyntax_error_status
;
1660 yysyntax_error_status
= YYSYNTAX_ERROR
;
1661 if (yysyntax_error_status
== 0)
1663 else if (yysyntax_error_status
== 1)
1665 if (yymsg
!= yymsgbuf
)
1666 YYSTACK_FREE (yymsg
);
1667 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
1671 yymsg_alloc
= sizeof yymsgbuf
;
1672 yysyntax_error_status
= 2;
1676 yysyntax_error_status
= YYSYNTAX_ERROR
;
1680 yyerror (arg
, yymsgp
);
1681 if (yysyntax_error_status
== 2)
1682 goto yyexhaustedlab
;
1684 # undef YYSYNTAX_ERROR
1690 if (yyerrstatus
== 3)
1692 /* If just tried and failed to reuse lookahead token after an
1693 error, discard it. */
1695 if (yychar
<= YYEOF
)
1697 /* Return failure if at end of input. */
1698 if (yychar
== YYEOF
)
1703 yydestruct ("Error: discarding",
1704 yytoken
, &yylval
, arg
);
1709 /* Else will try to reuse lookahead token after shifting the error
1714 /*---------------------------------------------------.
1715 | yyerrorlab -- error raised explicitly by YYERROR. |
1716 `---------------------------------------------------*/
1719 /* Pacify compilers like GCC when the user code never invokes
1720 YYERROR and the label yyerrorlab therefore never appears in user
1722 if (/*CONSTCOND*/ 0)
1725 /* Do not reclaim the symbols of the rule which action triggered
1729 YY_STACK_PRINT (yyss
, yyssp
);
1734 /*-------------------------------------------------------------.
1735 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1736 `-------------------------------------------------------------*/
1738 yyerrstatus
= 3; /* Each real token shifted decrements this. */
1742 yyn
= yypact
[yystate
];
1743 if (!yypact_value_is_default (yyn
))
1746 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
1754 /* Pop the current state because it cannot handle the error token. */
1759 yydestruct ("Error: popping",
1760 yystos
[yystate
], yyvsp
, arg
);
1763 YY_STACK_PRINT (yyss
, yyssp
);
1766 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1768 YY_IGNORE_MAYBE_UNINITIALIZED_END
1771 /* Shift the error token. */
1772 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
1778 /*-------------------------------------.
1779 | yyacceptlab -- YYACCEPT comes here. |
1780 `-------------------------------------*/
1785 /*-----------------------------------.
1786 | yyabortlab -- YYABORT comes here. |
1787 `-----------------------------------*/
1792 #if !defined yyoverflow || YYERROR_VERBOSE
1793 /*-------------------------------------------------.
1794 | yyexhaustedlab -- memory exhaustion comes here. |
1795 `-------------------------------------------------*/
1797 yyerror (arg
, YY_("memory exhausted"));
1803 if (yychar
!= YYEMPTY
)
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",
1809 yytoken
, &yylval
, arg
);
1811 /* Do not reclaim the symbols of the rule which action triggered
1812 this YYABORT or YYACCEPT. */
1814 YY_STACK_PRINT (yyss
, yyssp
);
1815 while (yyssp
!= yyss
)
1817 yydestruct ("Cleanup: popping",
1818 yystos
[*yyssp
], yyvsp
, arg
);
1823 YYSTACK_FREE (yyss
);
1826 if (yymsg
!= yymsgbuf
)
1827 YYSTACK_FREE (yymsg
);
1829 /* Make sure YYID is used. */
1830 return YYID (yyresult
);
1834 /* Line 2055 of yacc.c */
1835 #line 207 "plural.y"
1840 FREE_EXPRESSION (struct expression
*exp
)
1845 /* Handle the recursive case. */
1849 FREE_EXPRESSION (exp
->val
.args
[2]);
1852 FREE_EXPRESSION (exp
->val
.args
[1]);
1855 FREE_EXPRESSION (exp
->val
.args
[0]);
1866 yylex (YYSTYPE
*lval
, struct parse_args
*arg
)
1868 const char *exp
= arg
->cp
;
1879 if (exp
[0] != ' ' && exp
[0] != '\t')
1888 case '0': case '1': case '2': case '3': case '4':
1889 case '5': case '6': case '7': case '8': case '9':
1891 unsigned long int n
= result
- '0';
1892 while (exp
[0] >= '0' && exp
[0] <= '9')
1918 lval
->op
= not_equal
;
1925 if (exp
[0] == result
)
1935 lval
->op
= less_or_equal
;
1938 lval
->op
= less_than
;
1946 lval
->op
= greater_or_equal
;
1949 lval
->op
= greater_than
;
1983 /* Nothing, just return the character. */
1989 /* Be safe and let the user call this function again. */
2009 yyerror (struct parse_args
*arg
, const char *str
)
2011 /* Do nothing. We don't print error messages here. */