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