1f8dd34f6Sespie /* A Bison parser, made from plural.y
2*a1acfa9bSespie by GNU bison 1.35. */
3f8dd34f6Sespie
4f8dd34f6Sespie #define YYBISON 1 /* Identify Bison output. */
5f8dd34f6Sespie
6f8dd34f6Sespie #define yyparse __gettextparse
7f8dd34f6Sespie #define yylex __gettextlex
8f8dd34f6Sespie #define yyerror __gettexterror
9f8dd34f6Sespie #define yylval __gettextlval
10f8dd34f6Sespie #define yychar __gettextchar
11f8dd34f6Sespie #define yydebug __gettextdebug
12f8dd34f6Sespie #define yynerrs __gettextnerrs
13f8dd34f6Sespie # define EQUOP2 257
14f8dd34f6Sespie # define CMPOP2 258
15f8dd34f6Sespie # define ADDOP2 259
16f8dd34f6Sespie # define MULOP2 260
17f8dd34f6Sespie # define NUMBER 261
18f8dd34f6Sespie
19f8dd34f6Sespie #line 1 "plural.y"
20f8dd34f6Sespie
21f8dd34f6Sespie /* Expression parsing for plural form selection.
22*a1acfa9bSespie Copyright (C) 2000-2001, 2003 Free Software Foundation, Inc.
23f8dd34f6Sespie Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
24f8dd34f6Sespie
25f8dd34f6Sespie This program is free software; you can redistribute it and/or modify it
26f8dd34f6Sespie under the terms of the GNU Library General Public License as published
27f8dd34f6Sespie by the Free Software Foundation; either version 2, or (at your option)
28f8dd34f6Sespie any later version.
29f8dd34f6Sespie
30f8dd34f6Sespie This program is distributed in the hope that it will be useful,
31f8dd34f6Sespie but WITHOUT ANY WARRANTY; without even the implied warranty of
32f8dd34f6Sespie MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
33f8dd34f6Sespie Library General Public License for more details.
34f8dd34f6Sespie
35f8dd34f6Sespie You should have received a copy of the GNU Library General Public
36f8dd34f6Sespie License along with this program; if not, write to the Free Software
37f8dd34f6Sespie Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
38f8dd34f6Sespie USA. */
39f8dd34f6Sespie
40f8dd34f6Sespie /* The bison generated parser uses alloca. AIX 3 forces us to put this
41f8dd34f6Sespie declaration at the beginning of the file. The declaration in bison's
42f8dd34f6Sespie skeleton file comes too late. This must come before <config.h>
43f8dd34f6Sespie because <config.h> may include arbitrary system headers. */
44f8dd34f6Sespie #if defined _AIX && !defined __GNUC__
45f8dd34f6Sespie #pragma alloca
46f8dd34f6Sespie #endif
47f8dd34f6Sespie
48f8dd34f6Sespie #ifdef HAVE_CONFIG_H
49f8dd34f6Sespie # include <config.h>
50f8dd34f6Sespie #endif
51f8dd34f6Sespie
52f8dd34f6Sespie #include <stddef.h>
53f8dd34f6Sespie #include <stdlib.h>
54f8dd34f6Sespie #include "plural-exp.h"
55f8dd34f6Sespie
56f8dd34f6Sespie /* The main function generated by the parser is called __gettextparse,
57f8dd34f6Sespie but we want it to be called PLURAL_PARSE. */
58f8dd34f6Sespie #ifndef _LIBC
59f8dd34f6Sespie # define __gettextparse PLURAL_PARSE
60f8dd34f6Sespie #endif
61f8dd34f6Sespie
62f8dd34f6Sespie #define YYLEX_PARAM &((struct parse_args *) arg)->cp
63f8dd34f6Sespie #define YYPARSE_PARAM arg
64f8dd34f6Sespie
65f8dd34f6Sespie #line 49 "plural.y"
66*a1acfa9bSespie #ifndef YYSTYPE
67f8dd34f6Sespie typedef union {
68f8dd34f6Sespie unsigned long int num;
69f8dd34f6Sespie enum operator op;
70f8dd34f6Sespie struct expression *exp;
71*a1acfa9bSespie } yystype;
72*a1acfa9bSespie # define YYSTYPE yystype
73*a1acfa9bSespie # define YYSTYPE_IS_TRIVIAL 1
74*a1acfa9bSespie #endif
75f8dd34f6Sespie #line 55 "plural.y"
76f8dd34f6Sespie
77f8dd34f6Sespie /* Prototypes for local functions. */
78*a1acfa9bSespie static int yylex (YYSTYPE *lval, const char **pexp);
79*a1acfa9bSespie static void yyerror (const char *str);
80f8dd34f6Sespie
81f8dd34f6Sespie /* Allocation of expressions. */
82f8dd34f6Sespie
83f8dd34f6Sespie static struct expression *
new_exp(int nargs,enum operator op,struct expression * const * args)84*a1acfa9bSespie new_exp (int nargs, enum operator op, struct expression * const *args)
85f8dd34f6Sespie {
86f8dd34f6Sespie int i;
87f8dd34f6Sespie struct expression *newp;
88f8dd34f6Sespie
89f8dd34f6Sespie /* If any of the argument could not be malloc'ed, just return NULL. */
90f8dd34f6Sespie for (i = nargs - 1; i >= 0; i--)
91f8dd34f6Sespie if (args[i] == NULL)
92f8dd34f6Sespie goto fail;
93f8dd34f6Sespie
94f8dd34f6Sespie /* Allocate a new expression. */
95f8dd34f6Sespie newp = (struct expression *) malloc (sizeof (*newp));
96f8dd34f6Sespie if (newp != NULL)
97f8dd34f6Sespie {
98f8dd34f6Sespie newp->nargs = nargs;
99f8dd34f6Sespie newp->operation = op;
100f8dd34f6Sespie for (i = nargs - 1; i >= 0; i--)
101f8dd34f6Sespie newp->val.args[i] = args[i];
102f8dd34f6Sespie return newp;
103f8dd34f6Sespie }
104f8dd34f6Sespie
105f8dd34f6Sespie fail:
106f8dd34f6Sespie for (i = nargs - 1; i >= 0; i--)
107f8dd34f6Sespie FREE_EXPRESSION (args[i]);
108f8dd34f6Sespie
109f8dd34f6Sespie return NULL;
110f8dd34f6Sespie }
111f8dd34f6Sespie
112f8dd34f6Sespie static inline struct expression *
new_exp_0(enum operator op)113*a1acfa9bSespie new_exp_0 (enum operator op)
114f8dd34f6Sespie {
115f8dd34f6Sespie return new_exp (0, op, NULL);
116f8dd34f6Sespie }
117f8dd34f6Sespie
118f8dd34f6Sespie static inline struct expression *
new_exp_1(enum operator op,struct expression * right)119*a1acfa9bSespie new_exp_1 (enum operator op, struct expression *right)
120f8dd34f6Sespie {
121f8dd34f6Sespie struct expression *args[1];
122f8dd34f6Sespie
123f8dd34f6Sespie args[0] = right;
124f8dd34f6Sespie return new_exp (1, op, args);
125f8dd34f6Sespie }
126f8dd34f6Sespie
127f8dd34f6Sespie static struct expression *
new_exp_2(enum operator op,struct expression * left,struct expression * right)128*a1acfa9bSespie new_exp_2 (enum operator op, struct expression *left, struct expression *right)
129f8dd34f6Sespie {
130f8dd34f6Sespie struct expression *args[2];
131f8dd34f6Sespie
132f8dd34f6Sespie args[0] = left;
133f8dd34f6Sespie args[1] = right;
134f8dd34f6Sespie return new_exp (2, op, args);
135f8dd34f6Sespie }
136f8dd34f6Sespie
137f8dd34f6Sespie static inline struct expression *
new_exp_3(enum operator op,struct expression * bexp,struct expression * tbranch,struct expression * fbranch)138*a1acfa9bSespie new_exp_3 (enum operator op, struct expression *bexp,
139*a1acfa9bSespie struct expression *tbranch, struct expression *fbranch)
140f8dd34f6Sespie {
141f8dd34f6Sespie struct expression *args[3];
142f8dd34f6Sespie
143f8dd34f6Sespie args[0] = bexp;
144f8dd34f6Sespie args[1] = tbranch;
145f8dd34f6Sespie args[2] = fbranch;
146f8dd34f6Sespie return new_exp (3, op, args);
147f8dd34f6Sespie }
148f8dd34f6Sespie
149*a1acfa9bSespie #ifndef YYDEBUG
150*a1acfa9bSespie # define YYDEBUG 0
151f8dd34f6Sespie #endif
152f8dd34f6Sespie
153f8dd34f6Sespie
154f8dd34f6Sespie
155f8dd34f6Sespie #define YYFINAL 27
156f8dd34f6Sespie #define YYFLAG -32768
157f8dd34f6Sespie #define YYNTBASE 16
158f8dd34f6Sespie
159*a1acfa9bSespie /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
160f8dd34f6Sespie #define YYTRANSLATE(x) ((unsigned)(x) <= 261 ? yytranslate[x] : 18)
161f8dd34f6Sespie
162*a1acfa9bSespie /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
163*a1acfa9bSespie static const char yytranslate[] =
164*a1acfa9bSespie {
165*a1acfa9bSespie 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
166*a1acfa9bSespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
167*a1acfa9bSespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
168*a1acfa9bSespie 2, 2, 2, 10, 2, 2, 2, 2, 5, 2,
169*a1acfa9bSespie 14, 15, 2, 2, 2, 2, 2, 2, 2, 2,
170*a1acfa9bSespie 2, 2, 2, 2, 2, 2, 2, 2, 12, 2,
171*a1acfa9bSespie 2, 2, 2, 3, 2, 2, 2, 2, 2, 2,
172f8dd34f6Sespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
173f8dd34f6Sespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
174f8dd34f6Sespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
175f8dd34f6Sespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
176*a1acfa9bSespie 13, 2, 2, 2, 2, 2, 2, 2, 2, 2,
177*a1acfa9bSespie 2, 2, 2, 2, 4, 2, 2, 2, 2, 2,
178f8dd34f6Sespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
179f8dd34f6Sespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
180f8dd34f6Sespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
181f8dd34f6Sespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
182f8dd34f6Sespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
183f8dd34f6Sespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
184f8dd34f6Sespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
185f8dd34f6Sespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
186f8dd34f6Sespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
187f8dd34f6Sespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
188f8dd34f6Sespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
189f8dd34f6Sespie 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
190*a1acfa9bSespie 2, 2, 2, 2, 2, 2, 1, 6, 7, 8,
191*a1acfa9bSespie 9, 11
192f8dd34f6Sespie };
193f8dd34f6Sespie
194*a1acfa9bSespie #if YYDEBUG
195*a1acfa9bSespie static const short yyprhs[] =
196*a1acfa9bSespie {
197*a1acfa9bSespie 0, 0, 2, 8, 12, 16, 20, 24, 28, 32,
198*a1acfa9bSespie 35, 37, 39
199f8dd34f6Sespie };
200*a1acfa9bSespie static const short yyrhs[] =
201*a1acfa9bSespie {
202*a1acfa9bSespie 17, 0, 17, 3, 17, 12, 17, 0, 17, 4,
203*a1acfa9bSespie 17, 0, 17, 5, 17, 0, 17, 6, 17, 0,
204*a1acfa9bSespie 17, 7, 17, 0, 17, 8, 17, 0, 17, 9,
205*a1acfa9bSespie 17, 0, 10, 17, 0, 13, 0, 11, 0, 14,
206*a1acfa9bSespie 17, 15, 0
207f8dd34f6Sespie };
208f8dd34f6Sespie
209f8dd34f6Sespie #endif
210f8dd34f6Sespie
211*a1acfa9bSespie #if YYDEBUG
212*a1acfa9bSespie /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
213*a1acfa9bSespie static const short yyrline[] =
214*a1acfa9bSespie {
215*a1acfa9bSespie 0, 150, 158, 162, 166, 170, 174, 178, 182, 186,
216*a1acfa9bSespie 190, 194, 199
217f8dd34f6Sespie };
218f8dd34f6Sespie #endif
219f8dd34f6Sespie
220f8dd34f6Sespie
221*a1acfa9bSespie #if (YYDEBUG) || defined YYERROR_VERBOSE
222f8dd34f6Sespie
223*a1acfa9bSespie /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
224*a1acfa9bSespie static const char *const yytname[] =
225*a1acfa9bSespie {
226*a1acfa9bSespie "$", "error", "$undefined.", "'?'", "'|'", "'&'", "EQUOP2", "CMPOP2",
227*a1acfa9bSespie "ADDOP2", "MULOP2", "'!'", "NUMBER", "':'", "'n'", "'('", "')'",
228*a1acfa9bSespie "start", "exp", 0
229f8dd34f6Sespie };
230f8dd34f6Sespie #endif
231f8dd34f6Sespie
232*a1acfa9bSespie /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
233*a1acfa9bSespie static const short yyr1[] =
234*a1acfa9bSespie {
235*a1acfa9bSespie 0, 16, 17, 17, 17, 17, 17, 17, 17, 17,
236*a1acfa9bSespie 17, 17, 17
237f8dd34f6Sespie };
238f8dd34f6Sespie
239*a1acfa9bSespie /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
240*a1acfa9bSespie static const short yyr2[] =
241*a1acfa9bSespie {
242*a1acfa9bSespie 0, 1, 5, 3, 3, 3, 3, 3, 3, 2,
243*a1acfa9bSespie 1, 1, 3
244f8dd34f6Sespie };
245f8dd34f6Sespie
246*a1acfa9bSespie /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
247*a1acfa9bSespie doesn't specify something else to do. Zero means the default is an
248*a1acfa9bSespie error. */
249*a1acfa9bSespie static const short yydefact[] =
250*a1acfa9bSespie {
251*a1acfa9bSespie 0, 0, 11, 10, 0, 1, 9, 0, 0, 0,
252*a1acfa9bSespie 0, 0, 0, 0, 0, 12, 0, 3, 4, 5,
253*a1acfa9bSespie 6, 7, 8, 0, 2, 0, 0, 0
254f8dd34f6Sespie };
255f8dd34f6Sespie
256*a1acfa9bSespie static const short yydefgoto[] =
257*a1acfa9bSespie {
258*a1acfa9bSespie 25, 5
259f8dd34f6Sespie };
260f8dd34f6Sespie
261*a1acfa9bSespie static const short yypact[] =
262*a1acfa9bSespie {
263*a1acfa9bSespie -9, -9,-32768,-32768, -9, 34,-32768, 11, -9, -9,
264*a1acfa9bSespie -9, -9, -9, -9, -9,-32768, 24, 39, 43, 16,
265*a1acfa9bSespie 26, -3,-32768, -9, 34, 21, 53,-32768
266f8dd34f6Sespie };
267f8dd34f6Sespie
268*a1acfa9bSespie static const short yypgoto[] =
269*a1acfa9bSespie {
270*a1acfa9bSespie -32768, -1
271f8dd34f6Sespie };
272f8dd34f6Sespie
273f8dd34f6Sespie
274f8dd34f6Sespie #define YYLAST 53
275f8dd34f6Sespie
276f8dd34f6Sespie
277*a1acfa9bSespie static const short yytable[] =
278*a1acfa9bSespie {
279*a1acfa9bSespie 6, 1, 2, 7, 3, 4, 14, 16, 17, 18,
280*a1acfa9bSespie 19, 20, 21, 22, 8, 9, 10, 11, 12, 13,
281*a1acfa9bSespie 14, 26, 24, 12, 13, 14, 15, 8, 9, 10,
282*a1acfa9bSespie 11, 12, 13, 14, 13, 14, 23, 8, 9, 10,
283*a1acfa9bSespie 11, 12, 13, 14, 10, 11, 12, 13, 14, 11,
284*a1acfa9bSespie 12, 13, 14, 27
285f8dd34f6Sespie };
286f8dd34f6Sespie
287*a1acfa9bSespie static const short yycheck[] =
288*a1acfa9bSespie {
289*a1acfa9bSespie 1, 10, 11, 4, 13, 14, 9, 8, 9, 10,
290*a1acfa9bSespie 11, 12, 13, 14, 3, 4, 5, 6, 7, 8,
291*a1acfa9bSespie 9, 0, 23, 7, 8, 9, 15, 3, 4, 5,
292*a1acfa9bSespie 6, 7, 8, 9, 8, 9, 12, 3, 4, 5,
293*a1acfa9bSespie 6, 7, 8, 9, 5, 6, 7, 8, 9, 6,
294*a1acfa9bSespie 7, 8, 9, 0
295f8dd34f6Sespie };
296f8dd34f6Sespie #define YYPURE 1
297f8dd34f6Sespie
298f8dd34f6Sespie /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
299*a1acfa9bSespie #line 3 "/usr/local/share/bison/bison.simple"
300f8dd34f6Sespie
301f8dd34f6Sespie /* Skeleton output parser for bison,
302*a1acfa9bSespie
303*a1acfa9bSespie Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
304*a1acfa9bSespie Foundation, Inc.
305f8dd34f6Sespie
306f8dd34f6Sespie This program is free software; you can redistribute it and/or modify
307f8dd34f6Sespie it under the terms of the GNU General Public License as published by
308f8dd34f6Sespie the Free Software Foundation; either version 2, or (at your option)
309f8dd34f6Sespie any later version.
310f8dd34f6Sespie
311f8dd34f6Sespie This program is distributed in the hope that it will be useful,
312f8dd34f6Sespie but WITHOUT ANY WARRANTY; without even the implied warranty of
313f8dd34f6Sespie MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
314f8dd34f6Sespie GNU General Public License for more details.
315f8dd34f6Sespie
316f8dd34f6Sespie You should have received a copy of the GNU General Public License
317f8dd34f6Sespie along with this program; if not, write to the Free Software
318f8dd34f6Sespie Foundation, Inc., 59 Temple Place - Suite 330,
319f8dd34f6Sespie Boston, MA 02111-1307, USA. */
320f8dd34f6Sespie
321f8dd34f6Sespie /* As a special exception, when this file is copied by Bison into a
322f8dd34f6Sespie Bison output file, you may use that output file without restriction.
323f8dd34f6Sespie This special exception was added by the Free Software Foundation
324f8dd34f6Sespie in version 1.24 of Bison. */
325f8dd34f6Sespie
326*a1acfa9bSespie /* This is the parser code that is written into each bison parser when
327*a1acfa9bSespie the %semantic_parser declaration is not specified in the grammar.
328f8dd34f6Sespie It was written by Richard Stallman by simplifying the hairy parser
329f8dd34f6Sespie used when %semantic_parser is specified. */
330f8dd34f6Sespie
331*a1acfa9bSespie /* All symbols defined below should begin with yy or YY, to avoid
332*a1acfa9bSespie infringing on user name space. This should be done even for local
333*a1acfa9bSespie variables, as they might otherwise be expanded by user macros.
334*a1acfa9bSespie There are some unavoidable exceptions within include files to
335*a1acfa9bSespie define necessary library symbols; they are noted "INFRINGES ON
336*a1acfa9bSespie USER NAME SPACE" below. */
337f8dd34f6Sespie
338*a1acfa9bSespie #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
339*a1acfa9bSespie
340*a1acfa9bSespie /* The parser invokes alloca or malloc; define the necessary symbols. */
341*a1acfa9bSespie
342*a1acfa9bSespie # if YYSTACK_USE_ALLOCA
343f8dd34f6Sespie # define YYSTACK_ALLOC alloca
344f8dd34f6Sespie # else
345*a1acfa9bSespie # ifndef YYSTACK_USE_ALLOCA
346*a1acfa9bSespie # if defined (alloca) || defined (_ALLOCA_H)
347*a1acfa9bSespie # define YYSTACK_ALLOC alloca
348*a1acfa9bSespie # else
349*a1acfa9bSespie # ifdef __GNUC__
350*a1acfa9bSespie # define YYSTACK_ALLOC __builtin_alloca
351*a1acfa9bSespie # endif
352*a1acfa9bSespie # endif
353*a1acfa9bSespie # endif
354f8dd34f6Sespie # endif
355f8dd34f6Sespie
356*a1acfa9bSespie # ifdef YYSTACK_ALLOC
357*a1acfa9bSespie /* Pacify GCC's `empty if-body' warning. */
358*a1acfa9bSespie # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
359*a1acfa9bSespie # else
360*a1acfa9bSespie # if defined (__STDC__) || defined (__cplusplus)
361*a1acfa9bSespie # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
362*a1acfa9bSespie # define YYSIZE_T size_t
363*a1acfa9bSespie # endif
364*a1acfa9bSespie # define YYSTACK_ALLOC malloc
365*a1acfa9bSespie # define YYSTACK_FREE free
366*a1acfa9bSespie # endif
367*a1acfa9bSespie #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
368*a1acfa9bSespie
369*a1acfa9bSespie
370*a1acfa9bSespie #if (! defined (yyoverflow) \
371*a1acfa9bSespie && (! defined (__cplusplus) \
372*a1acfa9bSespie || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
373*a1acfa9bSespie
374*a1acfa9bSespie /* A type that is properly aligned for any stack member. */
375*a1acfa9bSespie union yyalloc
376*a1acfa9bSespie {
377*a1acfa9bSespie short yyss;
378*a1acfa9bSespie YYSTYPE yyvs;
379*a1acfa9bSespie # if YYLSP_NEEDED
380*a1acfa9bSespie YYLTYPE yyls;
381*a1acfa9bSespie # endif
382*a1acfa9bSespie };
383*a1acfa9bSespie
384*a1acfa9bSespie /* The size of the maximum gap between one aligned stack and the next. */
385*a1acfa9bSespie # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
386*a1acfa9bSespie
387*a1acfa9bSespie /* The size of an array large to enough to hold all stacks, each with
388*a1acfa9bSespie N elements. */
389*a1acfa9bSespie # if YYLSP_NEEDED
390*a1acfa9bSespie # define YYSTACK_BYTES(N) \
391*a1acfa9bSespie ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
392*a1acfa9bSespie + 2 * YYSTACK_GAP_MAX)
393*a1acfa9bSespie # else
394*a1acfa9bSespie # define YYSTACK_BYTES(N) \
395*a1acfa9bSespie ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
396*a1acfa9bSespie + YYSTACK_GAP_MAX)
397*a1acfa9bSespie # endif
398*a1acfa9bSespie
399*a1acfa9bSespie /* Copy COUNT objects from FROM to TO. The source and destination do
400*a1acfa9bSespie not overlap. */
401*a1acfa9bSespie # ifndef YYCOPY
402*a1acfa9bSespie # if 1 < __GNUC__
403*a1acfa9bSespie # define YYCOPY(To, From, Count) \
404*a1acfa9bSespie __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
405*a1acfa9bSespie # else
406*a1acfa9bSespie # define YYCOPY(To, From, Count) \
407*a1acfa9bSespie do \
408*a1acfa9bSespie { \
409*a1acfa9bSespie register YYSIZE_T yyi; \
410*a1acfa9bSespie for (yyi = 0; yyi < (Count); yyi++) \
411*a1acfa9bSespie (To)[yyi] = (From)[yyi]; \
412*a1acfa9bSespie } \
413*a1acfa9bSespie while (0)
414*a1acfa9bSespie # endif
415*a1acfa9bSespie # endif
416*a1acfa9bSespie
417*a1acfa9bSespie /* Relocate STACK from its old location to the new one. The
418*a1acfa9bSespie local variables YYSIZE and YYSTACKSIZE give the old and new number of
419*a1acfa9bSespie elements in the stack, and YYPTR gives the new location of the
420*a1acfa9bSespie stack. Advance YYPTR to a properly aligned location for the next
421*a1acfa9bSespie stack. */
422*a1acfa9bSespie # define YYSTACK_RELOCATE(Stack) \
423*a1acfa9bSespie do \
424*a1acfa9bSespie { \
425*a1acfa9bSespie YYSIZE_T yynewbytes; \
426*a1acfa9bSespie YYCOPY (&yyptr->Stack, Stack, yysize); \
427*a1acfa9bSespie Stack = &yyptr->Stack; \
428*a1acfa9bSespie yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
429*a1acfa9bSespie yyptr += yynewbytes / sizeof (*yyptr); \
430*a1acfa9bSespie } \
431*a1acfa9bSespie while (0)
432*a1acfa9bSespie
433*a1acfa9bSespie #endif
434*a1acfa9bSespie
435*a1acfa9bSespie
436*a1acfa9bSespie #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
437*a1acfa9bSespie # define YYSIZE_T __SIZE_TYPE__
438*a1acfa9bSespie #endif
439*a1acfa9bSespie #if ! defined (YYSIZE_T) && defined (size_t)
440*a1acfa9bSespie # define YYSIZE_T size_t
441*a1acfa9bSespie #endif
442*a1acfa9bSespie #if ! defined (YYSIZE_T)
443*a1acfa9bSespie # if defined (__STDC__) || defined (__cplusplus)
444*a1acfa9bSespie # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
445*a1acfa9bSespie # define YYSIZE_T size_t
446*a1acfa9bSespie # endif
447*a1acfa9bSespie #endif
448*a1acfa9bSespie #if ! defined (YYSIZE_T)
449*a1acfa9bSespie # define YYSIZE_T unsigned int
450*a1acfa9bSespie #endif
451f8dd34f6Sespie
452f8dd34f6Sespie #define yyerrok (yyerrstatus = 0)
453f8dd34f6Sespie #define yyclearin (yychar = YYEMPTY)
454f8dd34f6Sespie #define YYEMPTY -2
455f8dd34f6Sespie #define YYEOF 0
456f8dd34f6Sespie #define YYACCEPT goto yyacceptlab
457f8dd34f6Sespie #define YYABORT goto yyabortlab
458f8dd34f6Sespie #define YYERROR goto yyerrlab1
459*a1acfa9bSespie /* Like YYERROR except do call yyerror. This remains here temporarily
460*a1acfa9bSespie to ease the transition to the new meaning of YYERROR, for GCC.
461f8dd34f6Sespie Once GCC version 2 has supplanted version 1, this can go. */
462f8dd34f6Sespie #define YYFAIL goto yyerrlab
463f8dd34f6Sespie #define YYRECOVERING() (!!yyerrstatus)
464*a1acfa9bSespie #define YYBACKUP(Token, Value) \
465f8dd34f6Sespie do \
466f8dd34f6Sespie if (yychar == YYEMPTY && yylen == 1) \
467*a1acfa9bSespie { \
468*a1acfa9bSespie yychar = (Token); \
469*a1acfa9bSespie yylval = (Value); \
470f8dd34f6Sespie yychar1 = YYTRANSLATE (yychar); \
471f8dd34f6Sespie YYPOPSTACK; \
472f8dd34f6Sespie goto yybackup; \
473f8dd34f6Sespie } \
474f8dd34f6Sespie else \
475*a1acfa9bSespie { \
476*a1acfa9bSespie yyerror ("syntax error: cannot back up"); \
477*a1acfa9bSespie YYERROR; \
478*a1acfa9bSespie } \
479f8dd34f6Sespie while (0)
480f8dd34f6Sespie
481f8dd34f6Sespie #define YYTERROR 1
482f8dd34f6Sespie #define YYERRCODE 256
483f8dd34f6Sespie
484*a1acfa9bSespie
485*a1acfa9bSespie /* YYLLOC_DEFAULT -- Compute the default location (before the actions
486*a1acfa9bSespie are run).
487*a1acfa9bSespie
488*a1acfa9bSespie When YYLLOC_DEFAULT is run, CURRENT is set the location of the
489*a1acfa9bSespie first token. By default, to implement support for ranges, extend
490*a1acfa9bSespie its range to the last symbol. */
491*a1acfa9bSespie
492*a1acfa9bSespie #ifndef YYLLOC_DEFAULT
493*a1acfa9bSespie # define YYLLOC_DEFAULT(Current, Rhs, N) \
494*a1acfa9bSespie Current.last_line = Rhs[N].last_line; \
495*a1acfa9bSespie Current.last_column = Rhs[N].last_column;
496f8dd34f6Sespie #endif
497f8dd34f6Sespie
498*a1acfa9bSespie
499*a1acfa9bSespie /* YYLEX -- calling `yylex' with the right arguments. */
500*a1acfa9bSespie
501*a1acfa9bSespie #if YYPURE
502*a1acfa9bSespie # if YYLSP_NEEDED
503f8dd34f6Sespie # ifdef YYLEX_PARAM
504f8dd34f6Sespie # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
505f8dd34f6Sespie # else
506f8dd34f6Sespie # define YYLEX yylex (&yylval, &yylloc)
507f8dd34f6Sespie # endif
508*a1acfa9bSespie # else /* !YYLSP_NEEDED */
509f8dd34f6Sespie # ifdef YYLEX_PARAM
510f8dd34f6Sespie # define YYLEX yylex (&yylval, YYLEX_PARAM)
511f8dd34f6Sespie # else
512f8dd34f6Sespie # define YYLEX yylex (&yylval)
513f8dd34f6Sespie # endif
514*a1acfa9bSespie # endif /* !YYLSP_NEEDED */
515*a1acfa9bSespie #else /* !YYPURE */
516*a1acfa9bSespie # define YYLEX yylex ()
517*a1acfa9bSespie #endif /* !YYPURE */
518*a1acfa9bSespie
519*a1acfa9bSespie
520*a1acfa9bSespie /* Enable debugging if requested. */
521*a1acfa9bSespie #if YYDEBUG
522*a1acfa9bSespie
523*a1acfa9bSespie # ifndef YYFPRINTF
524*a1acfa9bSespie # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
525*a1acfa9bSespie # define YYFPRINTF fprintf
526f8dd34f6Sespie # endif
527f8dd34f6Sespie
528*a1acfa9bSespie # define YYDPRINTF(Args) \
529*a1acfa9bSespie do { \
530*a1acfa9bSespie if (yydebug) \
531*a1acfa9bSespie YYFPRINTF Args; \
532*a1acfa9bSespie } while (0)
533*a1acfa9bSespie /* Nonzero means print parse trace. It is left uninitialized so that
534*a1acfa9bSespie multiple parsers can coexist. */
535*a1acfa9bSespie int yydebug;
536*a1acfa9bSespie #else /* !YYDEBUG */
537*a1acfa9bSespie # define YYDPRINTF(Args)
538*a1acfa9bSespie #endif /* !YYDEBUG */
539f8dd34f6Sespie
540*a1acfa9bSespie /* YYINITDEPTH -- initial size of the parser's stacks. */
541f8dd34f6Sespie #ifndef YYINITDEPTH
542f8dd34f6Sespie # define YYINITDEPTH 200
543f8dd34f6Sespie #endif
544f8dd34f6Sespie
545*a1acfa9bSespie /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
546*a1acfa9bSespie if the built-in stack extension method is used).
547*a1acfa9bSespie
548*a1acfa9bSespie Do not make this value too large; the results are undefined if
549*a1acfa9bSespie SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
550*a1acfa9bSespie evaluated with infinite-precision integer arithmetic. */
551f8dd34f6Sespie
552f8dd34f6Sespie #if YYMAXDEPTH == 0
553f8dd34f6Sespie # undef YYMAXDEPTH
554f8dd34f6Sespie #endif
555f8dd34f6Sespie
556f8dd34f6Sespie #ifndef YYMAXDEPTH
557f8dd34f6Sespie # define YYMAXDEPTH 10000
558f8dd34f6Sespie #endif
559f8dd34f6Sespie
560*a1acfa9bSespie #ifdef YYERROR_VERBOSE
561f8dd34f6Sespie
562*a1acfa9bSespie # ifndef yystrlen
563*a1acfa9bSespie # if defined (__GLIBC__) && defined (_STRING_H)
564*a1acfa9bSespie # define yystrlen strlen
565*a1acfa9bSespie # else
566*a1acfa9bSespie /* Return the length of YYSTR. */
567*a1acfa9bSespie static YYSIZE_T
568*a1acfa9bSespie # if defined (__STDC__) || defined (__cplusplus)
yystrlen(const char * yystr)569*a1acfa9bSespie yystrlen (const char *yystr)
570*a1acfa9bSespie # else
571*a1acfa9bSespie yystrlen (yystr)
572*a1acfa9bSespie const char *yystr;
573*a1acfa9bSespie # endif
574f8dd34f6Sespie {
575*a1acfa9bSespie register const char *yys = yystr;
576f8dd34f6Sespie
577*a1acfa9bSespie while (*yys++ != '\0')
578*a1acfa9bSespie continue;
579*a1acfa9bSespie
580*a1acfa9bSespie return yys - yystr - 1;
581f8dd34f6Sespie }
582*a1acfa9bSespie # endif
583*a1acfa9bSespie # endif
584f8dd34f6Sespie
585*a1acfa9bSespie # ifndef yystpcpy
586*a1acfa9bSespie # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
587*a1acfa9bSespie # define yystpcpy stpcpy
588*a1acfa9bSespie # else
589*a1acfa9bSespie /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
590*a1acfa9bSespie YYDEST. */
591*a1acfa9bSespie static char *
592*a1acfa9bSespie # if defined (__STDC__) || defined (__cplusplus)
yystpcpy(char * yydest,const char * yysrc)593*a1acfa9bSespie yystpcpy (char *yydest, const char *yysrc)
594*a1acfa9bSespie # else
595*a1acfa9bSespie yystpcpy (yydest, yysrc)
596*a1acfa9bSespie char *yydest;
597*a1acfa9bSespie const char *yysrc;
598*a1acfa9bSespie # endif
599f8dd34f6Sespie {
600*a1acfa9bSespie register char *yyd = yydest;
601*a1acfa9bSespie register const char *yys = yysrc;
602f8dd34f6Sespie
603*a1acfa9bSespie while ((*yyd++ = *yys++) != '\0')
604*a1acfa9bSespie continue;
605*a1acfa9bSespie
606*a1acfa9bSespie return yyd - 1;
607f8dd34f6Sespie }
608*a1acfa9bSespie # endif
609f8dd34f6Sespie # endif
610f8dd34f6Sespie #endif
611f8dd34f6Sespie
612*a1acfa9bSespie #line 315 "/usr/local/share/bison/bison.simple"
613*a1acfa9bSespie
614f8dd34f6Sespie
615f8dd34f6Sespie /* The user can define YYPARSE_PARAM as the name of an argument to be passed
616f8dd34f6Sespie into yyparse. The argument should have type void *.
617f8dd34f6Sespie It should actually point to an object.
618f8dd34f6Sespie Grammar actions can access the variable by casting it
619f8dd34f6Sespie to the proper pointer type. */
620f8dd34f6Sespie
621f8dd34f6Sespie #ifdef YYPARSE_PARAM
622*a1acfa9bSespie # if defined (__STDC__) || defined (__cplusplus)
623f8dd34f6Sespie # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
624f8dd34f6Sespie # define YYPARSE_PARAM_DECL
625*a1acfa9bSespie # else
626f8dd34f6Sespie # define YYPARSE_PARAM_ARG YYPARSE_PARAM
627f8dd34f6Sespie # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
628*a1acfa9bSespie # endif
629*a1acfa9bSespie #else /* !YYPARSE_PARAM */
630f8dd34f6Sespie # define YYPARSE_PARAM_ARG
631f8dd34f6Sespie # define YYPARSE_PARAM_DECL
632*a1acfa9bSespie #endif /* !YYPARSE_PARAM */
633f8dd34f6Sespie
634f8dd34f6Sespie /* Prevent warning if -Wstrict-prototypes. */
635f8dd34f6Sespie #ifdef __GNUC__
636f8dd34f6Sespie # ifdef YYPARSE_PARAM
637f8dd34f6Sespie int yyparse (void *);
638f8dd34f6Sespie # else
639f8dd34f6Sespie int yyparse (void);
640f8dd34f6Sespie # endif
641f8dd34f6Sespie #endif
642f8dd34f6Sespie
643*a1acfa9bSespie /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
644*a1acfa9bSespie variables are global, or local to YYPARSE. */
645*a1acfa9bSespie
646*a1acfa9bSespie #define YY_DECL_NON_LSP_VARIABLES \
647*a1acfa9bSespie /* The lookahead symbol. */ \
648*a1acfa9bSespie int yychar; \
649*a1acfa9bSespie \
650*a1acfa9bSespie /* The semantic value of the lookahead symbol. */ \
651*a1acfa9bSespie YYSTYPE yylval; \
652*a1acfa9bSespie \
653*a1acfa9bSespie /* Number of parse errors so far. */ \
654*a1acfa9bSespie int yynerrs;
655*a1acfa9bSespie
656*a1acfa9bSespie #if YYLSP_NEEDED
657*a1acfa9bSespie # define YY_DECL_VARIABLES \
658*a1acfa9bSespie YY_DECL_NON_LSP_VARIABLES \
659*a1acfa9bSespie \
660*a1acfa9bSespie /* Location data for the lookahead symbol. */ \
661*a1acfa9bSespie YYLTYPE yylloc;
662*a1acfa9bSespie #else
663*a1acfa9bSespie # define YY_DECL_VARIABLES \
664*a1acfa9bSespie YY_DECL_NON_LSP_VARIABLES
665*a1acfa9bSespie #endif
666*a1acfa9bSespie
667*a1acfa9bSespie
668*a1acfa9bSespie /* If nonreentrant, generate the variables here. */
669*a1acfa9bSespie
670*a1acfa9bSespie #if !YYPURE
671*a1acfa9bSespie YY_DECL_VARIABLES
672*a1acfa9bSespie #endif /* !YYPURE */
673*a1acfa9bSespie
674f8dd34f6Sespie int
yyparse(YYPARSE_PARAM_ARG)675f8dd34f6Sespie yyparse (YYPARSE_PARAM_ARG)
676f8dd34f6Sespie YYPARSE_PARAM_DECL
677f8dd34f6Sespie {
678*a1acfa9bSespie /* If reentrant, generate the variables here. */
679*a1acfa9bSespie #if YYPURE
680*a1acfa9bSespie YY_DECL_VARIABLES
681*a1acfa9bSespie #endif /* !YYPURE */
682*a1acfa9bSespie
683f8dd34f6Sespie register int yystate;
684f8dd34f6Sespie register int yyn;
685*a1acfa9bSespie int yyresult;
686*a1acfa9bSespie /* Number of tokens to shift before error messages enabled. */
687*a1acfa9bSespie int yyerrstatus;
688*a1acfa9bSespie /* Lookahead token as an internal (translated) token number. */
689*a1acfa9bSespie int yychar1 = 0;
690*a1acfa9bSespie
691*a1acfa9bSespie /* Three stacks and their tools:
692*a1acfa9bSespie `yyss': related to states,
693*a1acfa9bSespie `yyvs': related to semantic values,
694*a1acfa9bSespie `yyls': related to locations.
695*a1acfa9bSespie
696*a1acfa9bSespie Refer to the stacks thru separate pointers, to allow yyoverflow
697*a1acfa9bSespie to reallocate them elsewhere. */
698*a1acfa9bSespie
699*a1acfa9bSespie /* The state stack. */
700*a1acfa9bSespie short yyssa[YYINITDEPTH];
701*a1acfa9bSespie short *yyss = yyssa;
702f8dd34f6Sespie register short *yyssp;
703*a1acfa9bSespie
704*a1acfa9bSespie /* The semantic value stack. */
705*a1acfa9bSespie YYSTYPE yyvsa[YYINITDEPTH];
706*a1acfa9bSespie YYSTYPE *yyvs = yyvsa;
707f8dd34f6Sespie register YYSTYPE *yyvsp;
708f8dd34f6Sespie
709*a1acfa9bSespie #if YYLSP_NEEDED
710*a1acfa9bSespie /* The location stack. */
711*a1acfa9bSespie YYLTYPE yylsa[YYINITDEPTH];
712f8dd34f6Sespie YYLTYPE *yyls = yylsa;
713f8dd34f6Sespie YYLTYPE *yylsp;
714*a1acfa9bSespie #endif
715f8dd34f6Sespie
716*a1acfa9bSespie #if YYLSP_NEEDED
717f8dd34f6Sespie # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
718f8dd34f6Sespie #else
719f8dd34f6Sespie # define YYPOPSTACK (yyvsp--, yyssp--)
720f8dd34f6Sespie #endif
721f8dd34f6Sespie
722*a1acfa9bSespie YYSIZE_T yystacksize = YYINITDEPTH;
723f8dd34f6Sespie
724*a1acfa9bSespie
725*a1acfa9bSespie /* The variables used to return semantic value and location from the
726*a1acfa9bSespie action routines. */
727*a1acfa9bSespie YYSTYPE yyval;
728*a1acfa9bSespie #if YYLSP_NEEDED
729*a1acfa9bSespie YYLTYPE yyloc;
730f8dd34f6Sespie #endif
731f8dd34f6Sespie
732*a1acfa9bSespie /* When reducing, the number of symbols on the RHS of the reduced
733*a1acfa9bSespie rule. */
734f8dd34f6Sespie int yylen;
735f8dd34f6Sespie
736*a1acfa9bSespie YYDPRINTF ((stderr, "Starting parse\n"));
737f8dd34f6Sespie
738f8dd34f6Sespie yystate = 0;
739f8dd34f6Sespie yyerrstatus = 0;
740f8dd34f6Sespie yynerrs = 0;
741f8dd34f6Sespie yychar = YYEMPTY; /* Cause a token to be read. */
742f8dd34f6Sespie
743f8dd34f6Sespie /* Initialize stack pointers.
744f8dd34f6Sespie Waste one element of value and location stack
745f8dd34f6Sespie so that they stay on the same level as the state stack.
746f8dd34f6Sespie The wasted elements are never initialized. */
747f8dd34f6Sespie
748*a1acfa9bSespie yyssp = yyss;
749f8dd34f6Sespie yyvsp = yyvs;
750*a1acfa9bSespie #if YYLSP_NEEDED
751f8dd34f6Sespie yylsp = yyls;
752f8dd34f6Sespie #endif
753*a1acfa9bSespie goto yysetstate;
754f8dd34f6Sespie
755*a1acfa9bSespie /*------------------------------------------------------------.
756*a1acfa9bSespie | yynewstate -- Push a new state, which is found in yystate. |
757*a1acfa9bSespie `------------------------------------------------------------*/
758f8dd34f6Sespie yynewstate:
759*a1acfa9bSespie /* In all cases, when you get here, the value and location stacks
760*a1acfa9bSespie have just been pushed. so pushing a state here evens the stacks.
761*a1acfa9bSespie */
762*a1acfa9bSespie yyssp++;
763f8dd34f6Sespie
764*a1acfa9bSespie yysetstate:
765*a1acfa9bSespie *yyssp = yystate;
766f8dd34f6Sespie
767f8dd34f6Sespie if (yyssp >= yyss + yystacksize - 1)
768f8dd34f6Sespie {
769f8dd34f6Sespie /* Get the current used size of the three stacks, in elements. */
770*a1acfa9bSespie YYSIZE_T yysize = yyssp - yyss + 1;
771f8dd34f6Sespie
772f8dd34f6Sespie #ifdef yyoverflow
773*a1acfa9bSespie {
774*a1acfa9bSespie /* Give user a chance to reallocate the stack. Use copies of
775*a1acfa9bSespie these so that the &'s don't force the real ones into
776*a1acfa9bSespie memory. */
777*a1acfa9bSespie YYSTYPE *yyvs1 = yyvs;
778*a1acfa9bSespie short *yyss1 = yyss;
779*a1acfa9bSespie
780*a1acfa9bSespie /* Each stack pointer address is followed by the size of the
781*a1acfa9bSespie data in use in that stack, in bytes. */
782*a1acfa9bSespie # if YYLSP_NEEDED
783*a1acfa9bSespie YYLTYPE *yyls1 = yyls;
784f8dd34f6Sespie /* This used to be a conditional around just the two extra args,
785f8dd34f6Sespie but that might be undefined if yyoverflow is a macro. */
786f8dd34f6Sespie yyoverflow ("parser stack overflow",
787*a1acfa9bSespie &yyss1, yysize * sizeof (*yyssp),
788*a1acfa9bSespie &yyvs1, yysize * sizeof (*yyvsp),
789*a1acfa9bSespie &yyls1, yysize * sizeof (*yylsp),
790f8dd34f6Sespie &yystacksize);
791*a1acfa9bSespie yyls = yyls1;
792f8dd34f6Sespie # else
793f8dd34f6Sespie yyoverflow ("parser stack overflow",
794*a1acfa9bSespie &yyss1, yysize * sizeof (*yyssp),
795*a1acfa9bSespie &yyvs1, yysize * sizeof (*yyvsp),
796f8dd34f6Sespie &yystacksize);
797f8dd34f6Sespie # endif
798*a1acfa9bSespie yyss = yyss1;
799*a1acfa9bSespie yyvs = yyvs1;
800*a1acfa9bSespie }
801f8dd34f6Sespie #else /* no yyoverflow */
802*a1acfa9bSespie # ifndef YYSTACK_RELOCATE
803*a1acfa9bSespie goto yyoverflowlab;
804*a1acfa9bSespie # else
805f8dd34f6Sespie /* Extend the stack our own way. */
806f8dd34f6Sespie if (yystacksize >= YYMAXDEPTH)
807*a1acfa9bSespie goto yyoverflowlab;
808f8dd34f6Sespie yystacksize *= 2;
809f8dd34f6Sespie if (yystacksize > YYMAXDEPTH)
810f8dd34f6Sespie yystacksize = YYMAXDEPTH;
811*a1acfa9bSespie
812*a1acfa9bSespie {
813*a1acfa9bSespie short *yyss1 = yyss;
814*a1acfa9bSespie union yyalloc *yyptr =
815*a1acfa9bSespie (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
816*a1acfa9bSespie if (! yyptr)
817*a1acfa9bSespie goto yyoverflowlab;
818*a1acfa9bSespie YYSTACK_RELOCATE (yyss);
819*a1acfa9bSespie YYSTACK_RELOCATE (yyvs);
820*a1acfa9bSespie # if YYLSP_NEEDED
821*a1acfa9bSespie YYSTACK_RELOCATE (yyls);
822f8dd34f6Sespie # endif
823*a1acfa9bSespie # undef YYSTACK_RELOCATE
824*a1acfa9bSespie if (yyss1 != yyssa)
825*a1acfa9bSespie YYSTACK_FREE (yyss1);
826*a1acfa9bSespie }
827f8dd34f6Sespie # endif
828f8dd34f6Sespie #endif /* no yyoverflow */
829f8dd34f6Sespie
830*a1acfa9bSespie yyssp = yyss + yysize - 1;
831*a1acfa9bSespie yyvsp = yyvs + yysize - 1;
832*a1acfa9bSespie #if YYLSP_NEEDED
833*a1acfa9bSespie yylsp = yyls + yysize - 1;
834f8dd34f6Sespie #endif
835f8dd34f6Sespie
836*a1acfa9bSespie YYDPRINTF ((stderr, "Stack size increased to %lu\n",
837*a1acfa9bSespie (unsigned long int) yystacksize));
838f8dd34f6Sespie
839f8dd34f6Sespie if (yyssp >= yyss + yystacksize - 1)
840f8dd34f6Sespie YYABORT;
841f8dd34f6Sespie }
842f8dd34f6Sespie
843*a1acfa9bSespie YYDPRINTF ((stderr, "Entering state %d\n", yystate));
844f8dd34f6Sespie
845f8dd34f6Sespie goto yybackup;
846*a1acfa9bSespie
847*a1acfa9bSespie
848*a1acfa9bSespie /*-----------.
849*a1acfa9bSespie | yybackup. |
850*a1acfa9bSespie `-----------*/
851f8dd34f6Sespie yybackup:
852f8dd34f6Sespie
853f8dd34f6Sespie /* Do appropriate processing given the current state. */
854f8dd34f6Sespie /* Read a lookahead token if we need one and don't already have one. */
855f8dd34f6Sespie /* yyresume: */
856f8dd34f6Sespie
857f8dd34f6Sespie /* First try to decide what to do without reference to lookahead token. */
858f8dd34f6Sespie
859f8dd34f6Sespie yyn = yypact[yystate];
860f8dd34f6Sespie if (yyn == YYFLAG)
861f8dd34f6Sespie goto yydefault;
862f8dd34f6Sespie
863f8dd34f6Sespie /* Not known => get a lookahead token if don't already have one. */
864f8dd34f6Sespie
865f8dd34f6Sespie /* yychar is either YYEMPTY or YYEOF
866f8dd34f6Sespie or a valid token in external form. */
867f8dd34f6Sespie
868f8dd34f6Sespie if (yychar == YYEMPTY)
869f8dd34f6Sespie {
870*a1acfa9bSespie YYDPRINTF ((stderr, "Reading a token: "));
871f8dd34f6Sespie yychar = YYLEX;
872f8dd34f6Sespie }
873f8dd34f6Sespie
874f8dd34f6Sespie /* Convert token to internal form (in yychar1) for indexing tables with */
875f8dd34f6Sespie
876f8dd34f6Sespie if (yychar <= 0) /* This means end of input. */
877f8dd34f6Sespie {
878f8dd34f6Sespie yychar1 = 0;
879f8dd34f6Sespie yychar = YYEOF; /* Don't call YYLEX any more */
880f8dd34f6Sespie
881*a1acfa9bSespie YYDPRINTF ((stderr, "Now at end of input.\n"));
882f8dd34f6Sespie }
883f8dd34f6Sespie else
884f8dd34f6Sespie {
885f8dd34f6Sespie yychar1 = YYTRANSLATE (yychar);
886f8dd34f6Sespie
887*a1acfa9bSespie #if YYDEBUG
888*a1acfa9bSespie /* We have to keep this `#if YYDEBUG', since we use variables
889*a1acfa9bSespie which are defined only if `YYDEBUG' is set. */
890f8dd34f6Sespie if (yydebug)
891f8dd34f6Sespie {
892*a1acfa9bSespie YYFPRINTF (stderr, "Next token is %d (%s",
893*a1acfa9bSespie yychar, yytname[yychar1]);
894*a1acfa9bSespie /* Give the individual parser a way to print the precise
895*a1acfa9bSespie meaning of a token, for further debugging info. */
896f8dd34f6Sespie # ifdef YYPRINT
897f8dd34f6Sespie YYPRINT (stderr, yychar, yylval);
898f8dd34f6Sespie # endif
899*a1acfa9bSespie YYFPRINTF (stderr, ")\n");
900f8dd34f6Sespie }
901f8dd34f6Sespie #endif
902f8dd34f6Sespie }
903f8dd34f6Sespie
904f8dd34f6Sespie yyn += yychar1;
905f8dd34f6Sespie if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
906f8dd34f6Sespie goto yydefault;
907f8dd34f6Sespie
908f8dd34f6Sespie yyn = yytable[yyn];
909f8dd34f6Sespie
910f8dd34f6Sespie /* yyn is what to do for this token type in this state.
911f8dd34f6Sespie Negative => reduce, -yyn is rule number.
912f8dd34f6Sespie Positive => shift, yyn is new state.
913f8dd34f6Sespie New state is final state => don't bother to shift,
914f8dd34f6Sespie just return success.
915f8dd34f6Sespie 0, or most negative number => error. */
916f8dd34f6Sespie
917f8dd34f6Sespie if (yyn < 0)
918f8dd34f6Sespie {
919f8dd34f6Sespie if (yyn == YYFLAG)
920f8dd34f6Sespie goto yyerrlab;
921f8dd34f6Sespie yyn = -yyn;
922f8dd34f6Sespie goto yyreduce;
923f8dd34f6Sespie }
924f8dd34f6Sespie else if (yyn == 0)
925f8dd34f6Sespie goto yyerrlab;
926f8dd34f6Sespie
927f8dd34f6Sespie if (yyn == YYFINAL)
928f8dd34f6Sespie YYACCEPT;
929f8dd34f6Sespie
930f8dd34f6Sespie /* Shift the lookahead token. */
931*a1acfa9bSespie YYDPRINTF ((stderr, "Shifting token %d (%s), ",
932*a1acfa9bSespie yychar, yytname[yychar1]));
933f8dd34f6Sespie
934f8dd34f6Sespie /* Discard the token being shifted unless it is eof. */
935f8dd34f6Sespie if (yychar != YYEOF)
936f8dd34f6Sespie yychar = YYEMPTY;
937f8dd34f6Sespie
938f8dd34f6Sespie *++yyvsp = yylval;
939*a1acfa9bSespie #if YYLSP_NEEDED
940f8dd34f6Sespie *++yylsp = yylloc;
941f8dd34f6Sespie #endif
942f8dd34f6Sespie
943*a1acfa9bSespie /* Count tokens shifted since error; after three, turn off error
944*a1acfa9bSespie status. */
945*a1acfa9bSespie if (yyerrstatus)
946*a1acfa9bSespie yyerrstatus--;
947f8dd34f6Sespie
948f8dd34f6Sespie yystate = yyn;
949f8dd34f6Sespie goto yynewstate;
950f8dd34f6Sespie
951f8dd34f6Sespie
952*a1acfa9bSespie /*-----------------------------------------------------------.
953*a1acfa9bSespie | yydefault -- do the default action for the current state. |
954*a1acfa9bSespie `-----------------------------------------------------------*/
955*a1acfa9bSespie yydefault:
956f8dd34f6Sespie yyn = yydefact[yystate];
957f8dd34f6Sespie if (yyn == 0)
958f8dd34f6Sespie goto yyerrlab;
959*a1acfa9bSespie goto yyreduce;
960f8dd34f6Sespie
961*a1acfa9bSespie
962*a1acfa9bSespie /*-----------------------------.
963*a1acfa9bSespie | yyreduce -- Do a reduction. |
964*a1acfa9bSespie `-----------------------------*/
965f8dd34f6Sespie yyreduce:
966*a1acfa9bSespie /* yyn is the number of a rule to reduce with. */
967f8dd34f6Sespie yylen = yyr2[yyn];
968f8dd34f6Sespie
969*a1acfa9bSespie /* If YYLEN is nonzero, implement the default value of the action:
970*a1acfa9bSespie `$$ = $1'.
971*a1acfa9bSespie
972*a1acfa9bSespie Otherwise, the following line sets YYVAL to the semantic value of
973*a1acfa9bSespie the lookahead token. This behavior is undocumented and Bison
974*a1acfa9bSespie users should not rely upon it. Assigning to YYVAL
975*a1acfa9bSespie unconditionally makes the parser a bit smaller, and it avoids a
976*a1acfa9bSespie GCC warning that YYVAL may be used uninitialized. */
977*a1acfa9bSespie yyval = yyvsp[1-yylen];
978*a1acfa9bSespie
979*a1acfa9bSespie #if YYLSP_NEEDED
980*a1acfa9bSespie /* Similarly for the default location. Let the user run additional
981*a1acfa9bSespie commands if for instance locations are ranges. */
982*a1acfa9bSespie yyloc = yylsp[1-yylen];
983*a1acfa9bSespie YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
984*a1acfa9bSespie #endif
985*a1acfa9bSespie
986*a1acfa9bSespie #if YYDEBUG
987*a1acfa9bSespie /* We have to keep this `#if YYDEBUG', since we use variables which
988*a1acfa9bSespie are defined only if `YYDEBUG' is set. */
989f8dd34f6Sespie if (yydebug)
990f8dd34f6Sespie {
991*a1acfa9bSespie int yyi;
992f8dd34f6Sespie
993*a1acfa9bSespie YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
994f8dd34f6Sespie yyn, yyrline[yyn]);
995f8dd34f6Sespie
996f8dd34f6Sespie /* Print the symbols being reduced, and their result. */
997*a1acfa9bSespie for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
998*a1acfa9bSespie YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
999*a1acfa9bSespie YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1000f8dd34f6Sespie }
1001f8dd34f6Sespie #endif
1002f8dd34f6Sespie
1003f8dd34f6Sespie switch (yyn) {
1004f8dd34f6Sespie
1005f8dd34f6Sespie case 1:
1006*a1acfa9bSespie #line 151 "plural.y"
1007f8dd34f6Sespie {
1008f8dd34f6Sespie if (yyvsp[0].exp == NULL)
1009f8dd34f6Sespie YYABORT;
1010f8dd34f6Sespie ((struct parse_args *) arg)->res = yyvsp[0].exp;
1011*a1acfa9bSespie }
1012*a1acfa9bSespie break;
1013f8dd34f6Sespie case 2:
1014*a1acfa9bSespie #line 159 "plural.y"
1015f8dd34f6Sespie {
1016f8dd34f6Sespie yyval.exp = new_exp_3 (qmop, yyvsp[-4].exp, yyvsp[-2].exp, yyvsp[0].exp);
1017*a1acfa9bSespie }
1018*a1acfa9bSespie break;
1019f8dd34f6Sespie case 3:
1020*a1acfa9bSespie #line 163 "plural.y"
1021f8dd34f6Sespie {
1022f8dd34f6Sespie yyval.exp = new_exp_2 (lor, yyvsp[-2].exp, yyvsp[0].exp);
1023*a1acfa9bSespie }
1024*a1acfa9bSespie break;
1025f8dd34f6Sespie case 4:
1026*a1acfa9bSespie #line 167 "plural.y"
1027f8dd34f6Sespie {
1028f8dd34f6Sespie yyval.exp = new_exp_2 (land, yyvsp[-2].exp, yyvsp[0].exp);
1029*a1acfa9bSespie }
1030*a1acfa9bSespie break;
1031f8dd34f6Sespie case 5:
1032*a1acfa9bSespie #line 171 "plural.y"
1033f8dd34f6Sespie {
1034f8dd34f6Sespie yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
1035*a1acfa9bSespie }
1036*a1acfa9bSespie break;
1037f8dd34f6Sespie case 6:
1038*a1acfa9bSespie #line 175 "plural.y"
1039f8dd34f6Sespie {
1040f8dd34f6Sespie yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
1041*a1acfa9bSespie }
1042*a1acfa9bSespie break;
1043f8dd34f6Sespie case 7:
1044*a1acfa9bSespie #line 179 "plural.y"
1045f8dd34f6Sespie {
1046f8dd34f6Sespie yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
1047*a1acfa9bSespie }
1048*a1acfa9bSespie break;
1049f8dd34f6Sespie case 8:
1050*a1acfa9bSespie #line 183 "plural.y"
1051f8dd34f6Sespie {
1052f8dd34f6Sespie yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
1053*a1acfa9bSespie }
1054*a1acfa9bSespie break;
1055f8dd34f6Sespie case 9:
1056*a1acfa9bSespie #line 187 "plural.y"
1057f8dd34f6Sespie {
1058f8dd34f6Sespie yyval.exp = new_exp_1 (lnot, yyvsp[0].exp);
1059*a1acfa9bSespie }
1060*a1acfa9bSespie break;
1061f8dd34f6Sespie case 10:
1062*a1acfa9bSespie #line 191 "plural.y"
1063f8dd34f6Sespie {
1064f8dd34f6Sespie yyval.exp = new_exp_0 (var);
1065*a1acfa9bSespie }
1066*a1acfa9bSespie break;
1067f8dd34f6Sespie case 11:
1068*a1acfa9bSespie #line 195 "plural.y"
1069f8dd34f6Sespie {
1070f8dd34f6Sespie if ((yyval.exp = new_exp_0 (num)) != NULL)
1071f8dd34f6Sespie yyval.exp->val.num = yyvsp[0].num;
1072*a1acfa9bSespie }
1073*a1acfa9bSespie break;
1074f8dd34f6Sespie case 12:
1075*a1acfa9bSespie #line 200 "plural.y"
1076f8dd34f6Sespie {
1077f8dd34f6Sespie yyval.exp = yyvsp[-1].exp;
1078f8dd34f6Sespie }
1079*a1acfa9bSespie break;
1080*a1acfa9bSespie }
1081*a1acfa9bSespie
1082*a1acfa9bSespie #line 705 "/usr/local/share/bison/bison.simple"
1083*a1acfa9bSespie
1084f8dd34f6Sespie
1085f8dd34f6Sespie yyvsp -= yylen;
1086f8dd34f6Sespie yyssp -= yylen;
1087*a1acfa9bSespie #if YYLSP_NEEDED
1088f8dd34f6Sespie yylsp -= yylen;
1089f8dd34f6Sespie #endif
1090f8dd34f6Sespie
1091*a1acfa9bSespie #if YYDEBUG
1092f8dd34f6Sespie if (yydebug)
1093f8dd34f6Sespie {
1094*a1acfa9bSespie short *yyssp1 = yyss - 1;
1095*a1acfa9bSespie YYFPRINTF (stderr, "state stack now");
1096*a1acfa9bSespie while (yyssp1 != yyssp)
1097*a1acfa9bSespie YYFPRINTF (stderr, " %d", *++yyssp1);
1098*a1acfa9bSespie YYFPRINTF (stderr, "\n");
1099f8dd34f6Sespie }
1100f8dd34f6Sespie #endif
1101f8dd34f6Sespie
1102f8dd34f6Sespie *++yyvsp = yyval;
1103*a1acfa9bSespie #if YYLSP_NEEDED
1104*a1acfa9bSespie *++yylsp = yyloc;
1105f8dd34f6Sespie #endif
1106f8dd34f6Sespie
1107*a1acfa9bSespie /* Now `shift' the result of the reduction. Determine what state
1108*a1acfa9bSespie that goes to, based on the state we popped back to and the rule
1109*a1acfa9bSespie number reduced by. */
1110f8dd34f6Sespie
1111f8dd34f6Sespie yyn = yyr1[yyn];
1112f8dd34f6Sespie
1113f8dd34f6Sespie yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1114f8dd34f6Sespie if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1115f8dd34f6Sespie yystate = yytable[yystate];
1116f8dd34f6Sespie else
1117f8dd34f6Sespie yystate = yydefgoto[yyn - YYNTBASE];
1118f8dd34f6Sespie
1119f8dd34f6Sespie goto yynewstate;
1120f8dd34f6Sespie
1121f8dd34f6Sespie
1122*a1acfa9bSespie /*------------------------------------.
1123*a1acfa9bSespie | yyerrlab -- here on detecting error |
1124*a1acfa9bSespie `------------------------------------*/
1125*a1acfa9bSespie yyerrlab:
1126f8dd34f6Sespie /* If not already recovering from an error, report this error. */
1127*a1acfa9bSespie if (!yyerrstatus)
1128f8dd34f6Sespie {
1129f8dd34f6Sespie ++yynerrs;
1130f8dd34f6Sespie
1131f8dd34f6Sespie #ifdef YYERROR_VERBOSE
1132f8dd34f6Sespie yyn = yypact[yystate];
1133f8dd34f6Sespie
1134f8dd34f6Sespie if (yyn > YYFLAG && yyn < YYLAST)
1135f8dd34f6Sespie {
1136*a1acfa9bSespie YYSIZE_T yysize = 0;
1137*a1acfa9bSespie char *yymsg;
1138*a1acfa9bSespie int yyx, yycount;
1139f8dd34f6Sespie
1140*a1acfa9bSespie yycount = 0;
1141*a1acfa9bSespie /* Start YYX at -YYN if negative to avoid negative indexes in
1142*a1acfa9bSespie YYCHECK. */
1143*a1acfa9bSespie for (yyx = yyn < 0 ? -yyn : 0;
1144*a1acfa9bSespie yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1145*a1acfa9bSespie if (yycheck[yyx + yyn] == yyx)
1146*a1acfa9bSespie yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1147*a1acfa9bSespie yysize += yystrlen ("parse error, unexpected ") + 1;
1148*a1acfa9bSespie yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1149*a1acfa9bSespie yymsg = (char *) YYSTACK_ALLOC (yysize);
1150*a1acfa9bSespie if (yymsg != 0)
1151f8dd34f6Sespie {
1152*a1acfa9bSespie char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1153*a1acfa9bSespie yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
1154f8dd34f6Sespie
1155*a1acfa9bSespie if (yycount < 5)
1156f8dd34f6Sespie {
1157*a1acfa9bSespie yycount = 0;
1158*a1acfa9bSespie for (yyx = yyn < 0 ? -yyn : 0;
1159*a1acfa9bSespie yyx < (int) (sizeof (yytname) / sizeof (char *));
1160*a1acfa9bSespie yyx++)
1161*a1acfa9bSespie if (yycheck[yyx + yyn] == yyx)
1162f8dd34f6Sespie {
1163*a1acfa9bSespie const char *yyq = ! yycount ? ", expecting " : " or ";
1164*a1acfa9bSespie yyp = yystpcpy (yyp, yyq);
1165*a1acfa9bSespie yyp = yystpcpy (yyp, yytname[yyx]);
1166*a1acfa9bSespie yycount++;
1167f8dd34f6Sespie }
1168f8dd34f6Sespie }
1169*a1acfa9bSespie yyerror (yymsg);
1170*a1acfa9bSespie YYSTACK_FREE (yymsg);
1171f8dd34f6Sespie }
1172f8dd34f6Sespie else
1173*a1acfa9bSespie yyerror ("parse error; also virtual memory exhausted");
1174f8dd34f6Sespie }
1175f8dd34f6Sespie else
1176*a1acfa9bSespie #endif /* defined (YYERROR_VERBOSE) */
1177f8dd34f6Sespie yyerror ("parse error");
1178f8dd34f6Sespie }
1179f8dd34f6Sespie goto yyerrlab1;
1180f8dd34f6Sespie
1181*a1acfa9bSespie
1182*a1acfa9bSespie /*--------------------------------------------------.
1183*a1acfa9bSespie | yyerrlab1 -- error raised explicitly by an action |
1184*a1acfa9bSespie `--------------------------------------------------*/
1185*a1acfa9bSespie yyerrlab1:
1186f8dd34f6Sespie if (yyerrstatus == 3)
1187f8dd34f6Sespie {
1188*a1acfa9bSespie /* If just tried and failed to reuse lookahead token after an
1189*a1acfa9bSespie error, discard it. */
1190f8dd34f6Sespie
1191f8dd34f6Sespie /* return failure if at end of input */
1192f8dd34f6Sespie if (yychar == YYEOF)
1193f8dd34f6Sespie YYABORT;
1194*a1acfa9bSespie YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1195*a1acfa9bSespie yychar, yytname[yychar1]));
1196f8dd34f6Sespie yychar = YYEMPTY;
1197f8dd34f6Sespie }
1198f8dd34f6Sespie
1199*a1acfa9bSespie /* Else will try to reuse lookahead token after shifting the error
1200*a1acfa9bSespie token. */
1201f8dd34f6Sespie
1202f8dd34f6Sespie yyerrstatus = 3; /* Each real token shifted decrements this */
1203f8dd34f6Sespie
1204f8dd34f6Sespie goto yyerrhandle;
1205f8dd34f6Sespie
1206f8dd34f6Sespie
1207*a1acfa9bSespie /*-------------------------------------------------------------------.
1208*a1acfa9bSespie | yyerrdefault -- current state does not do anything special for the |
1209*a1acfa9bSespie | error token. |
1210*a1acfa9bSespie `-------------------------------------------------------------------*/
1211*a1acfa9bSespie yyerrdefault:
1212f8dd34f6Sespie #if 0
1213f8dd34f6Sespie /* This is wrong; only states that explicitly want error tokens
1214f8dd34f6Sespie should shift them. */
1215*a1acfa9bSespie
1216*a1acfa9bSespie /* If its default is to accept any token, ok. Otherwise pop it. */
1217*a1acfa9bSespie yyn = yydefact[yystate];
1218*a1acfa9bSespie if (yyn)
1219*a1acfa9bSespie goto yydefault;
1220f8dd34f6Sespie #endif
1221f8dd34f6Sespie
1222f8dd34f6Sespie
1223*a1acfa9bSespie /*---------------------------------------------------------------.
1224*a1acfa9bSespie | yyerrpop -- pop the current state because it cannot handle the |
1225*a1acfa9bSespie | error token |
1226*a1acfa9bSespie `---------------------------------------------------------------*/
1227*a1acfa9bSespie yyerrpop:
1228*a1acfa9bSespie if (yyssp == yyss)
1229*a1acfa9bSespie YYABORT;
1230f8dd34f6Sespie yyvsp--;
1231f8dd34f6Sespie yystate = *--yyssp;
1232*a1acfa9bSespie #if YYLSP_NEEDED
1233f8dd34f6Sespie yylsp--;
1234f8dd34f6Sespie #endif
1235f8dd34f6Sespie
1236*a1acfa9bSespie #if YYDEBUG
1237f8dd34f6Sespie if (yydebug)
1238f8dd34f6Sespie {
1239*a1acfa9bSespie short *yyssp1 = yyss - 1;
1240*a1acfa9bSespie YYFPRINTF (stderr, "Error: state stack now");
1241*a1acfa9bSespie while (yyssp1 != yyssp)
1242*a1acfa9bSespie YYFPRINTF (stderr, " %d", *++yyssp1);
1243*a1acfa9bSespie YYFPRINTF (stderr, "\n");
1244f8dd34f6Sespie }
1245f8dd34f6Sespie #endif
1246f8dd34f6Sespie
1247*a1acfa9bSespie /*--------------.
1248*a1acfa9bSespie | yyerrhandle. |
1249*a1acfa9bSespie `--------------*/
1250f8dd34f6Sespie yyerrhandle:
1251f8dd34f6Sespie yyn = yypact[yystate];
1252f8dd34f6Sespie if (yyn == YYFLAG)
1253f8dd34f6Sespie goto yyerrdefault;
1254f8dd34f6Sespie
1255f8dd34f6Sespie yyn += YYTERROR;
1256f8dd34f6Sespie if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1257f8dd34f6Sespie goto yyerrdefault;
1258f8dd34f6Sespie
1259f8dd34f6Sespie yyn = yytable[yyn];
1260f8dd34f6Sespie if (yyn < 0)
1261f8dd34f6Sespie {
1262f8dd34f6Sespie if (yyn == YYFLAG)
1263f8dd34f6Sespie goto yyerrpop;
1264f8dd34f6Sespie yyn = -yyn;
1265f8dd34f6Sespie goto yyreduce;
1266f8dd34f6Sespie }
1267f8dd34f6Sespie else if (yyn == 0)
1268f8dd34f6Sespie goto yyerrpop;
1269f8dd34f6Sespie
1270f8dd34f6Sespie if (yyn == YYFINAL)
1271f8dd34f6Sespie YYACCEPT;
1272f8dd34f6Sespie
1273*a1acfa9bSespie YYDPRINTF ((stderr, "Shifting error token, "));
1274f8dd34f6Sespie
1275f8dd34f6Sespie *++yyvsp = yylval;
1276*a1acfa9bSespie #if YYLSP_NEEDED
1277f8dd34f6Sespie *++yylsp = yylloc;
1278f8dd34f6Sespie #endif
1279f8dd34f6Sespie
1280f8dd34f6Sespie yystate = yyn;
1281f8dd34f6Sespie goto yynewstate;
1282f8dd34f6Sespie
1283f8dd34f6Sespie
1284*a1acfa9bSespie /*-------------------------------------.
1285*a1acfa9bSespie | yyacceptlab -- YYACCEPT comes here. |
1286*a1acfa9bSespie `-------------------------------------*/
1287*a1acfa9bSespie yyacceptlab:
1288*a1acfa9bSespie yyresult = 0;
1289*a1acfa9bSespie goto yyreturn;
1290*a1acfa9bSespie
1291*a1acfa9bSespie /*-----------------------------------.
1292*a1acfa9bSespie | yyabortlab -- YYABORT comes here. |
1293*a1acfa9bSespie `-----------------------------------*/
1294f8dd34f6Sespie yyabortlab:
1295*a1acfa9bSespie yyresult = 1;
1296*a1acfa9bSespie goto yyreturn;
1297*a1acfa9bSespie
1298*a1acfa9bSespie /*---------------------------------------------.
1299*a1acfa9bSespie | yyoverflowab -- parser overflow comes here. |
1300*a1acfa9bSespie `---------------------------------------------*/
1301*a1acfa9bSespie yyoverflowlab:
1302*a1acfa9bSespie yyerror ("parser stack overflow");
1303*a1acfa9bSespie yyresult = 2;
1304*a1acfa9bSespie /* Fall through. */
1305*a1acfa9bSespie
1306*a1acfa9bSespie yyreturn:
1307*a1acfa9bSespie #ifndef yyoverflow
1308*a1acfa9bSespie if (yyss != yyssa)
1309*a1acfa9bSespie YYSTACK_FREE (yyss);
1310f8dd34f6Sespie #endif
1311*a1acfa9bSespie return yyresult;
1312f8dd34f6Sespie }
1313*a1acfa9bSespie #line 205 "plural.y"
1314f8dd34f6Sespie
1315f8dd34f6Sespie
1316f8dd34f6Sespie void
1317f8dd34f6Sespie internal_function
FREE_EXPRESSION(struct expression * exp)1318*a1acfa9bSespie FREE_EXPRESSION (struct expression *exp)
1319f8dd34f6Sespie {
1320f8dd34f6Sespie if (exp == NULL)
1321f8dd34f6Sespie return;
1322f8dd34f6Sespie
1323f8dd34f6Sespie /* Handle the recursive case. */
1324f8dd34f6Sespie switch (exp->nargs)
1325f8dd34f6Sespie {
1326f8dd34f6Sespie case 3:
1327f8dd34f6Sespie FREE_EXPRESSION (exp->val.args[2]);
1328f8dd34f6Sespie /* FALLTHROUGH */
1329f8dd34f6Sespie case 2:
1330f8dd34f6Sespie FREE_EXPRESSION (exp->val.args[1]);
1331f8dd34f6Sespie /* FALLTHROUGH */
1332f8dd34f6Sespie case 1:
1333f8dd34f6Sespie FREE_EXPRESSION (exp->val.args[0]);
1334f8dd34f6Sespie /* FALLTHROUGH */
1335f8dd34f6Sespie default:
1336f8dd34f6Sespie break;
1337f8dd34f6Sespie }
1338f8dd34f6Sespie
1339f8dd34f6Sespie free (exp);
1340f8dd34f6Sespie }
1341f8dd34f6Sespie
1342f8dd34f6Sespie
1343f8dd34f6Sespie static int
yylex(YYSTYPE * lval,const char ** pexp)1344*a1acfa9bSespie yylex (YYSTYPE *lval, const char **pexp)
1345f8dd34f6Sespie {
1346f8dd34f6Sespie const char *exp = *pexp;
1347f8dd34f6Sespie int result;
1348f8dd34f6Sespie
1349f8dd34f6Sespie while (1)
1350f8dd34f6Sespie {
1351f8dd34f6Sespie if (exp[0] == '\0')
1352f8dd34f6Sespie {
1353f8dd34f6Sespie *pexp = exp;
1354f8dd34f6Sespie return YYEOF;
1355f8dd34f6Sespie }
1356f8dd34f6Sespie
1357f8dd34f6Sespie if (exp[0] != ' ' && exp[0] != '\t')
1358f8dd34f6Sespie break;
1359f8dd34f6Sespie
1360f8dd34f6Sespie ++exp;
1361f8dd34f6Sespie }
1362f8dd34f6Sespie
1363f8dd34f6Sespie result = *exp++;
1364f8dd34f6Sespie switch (result)
1365f8dd34f6Sespie {
1366f8dd34f6Sespie case '0': case '1': case '2': case '3': case '4':
1367f8dd34f6Sespie case '5': case '6': case '7': case '8': case '9':
1368f8dd34f6Sespie {
1369f8dd34f6Sespie unsigned long int n = result - '0';
1370f8dd34f6Sespie while (exp[0] >= '0' && exp[0] <= '9')
1371f8dd34f6Sespie {
1372f8dd34f6Sespie n *= 10;
1373f8dd34f6Sespie n += exp[0] - '0';
1374f8dd34f6Sespie ++exp;
1375f8dd34f6Sespie }
1376f8dd34f6Sespie lval->num = n;
1377f8dd34f6Sespie result = NUMBER;
1378f8dd34f6Sespie }
1379f8dd34f6Sespie break;
1380f8dd34f6Sespie
1381f8dd34f6Sespie case '=':
1382f8dd34f6Sespie if (exp[0] == '=')
1383f8dd34f6Sespie {
1384f8dd34f6Sespie ++exp;
1385f8dd34f6Sespie lval->op = equal;
1386f8dd34f6Sespie result = EQUOP2;
1387f8dd34f6Sespie }
1388f8dd34f6Sespie else
1389f8dd34f6Sespie result = YYERRCODE;
1390f8dd34f6Sespie break;
1391f8dd34f6Sespie
1392f8dd34f6Sespie case '!':
1393f8dd34f6Sespie if (exp[0] == '=')
1394f8dd34f6Sespie {
1395f8dd34f6Sespie ++exp;
1396f8dd34f6Sespie lval->op = not_equal;
1397f8dd34f6Sespie result = EQUOP2;
1398f8dd34f6Sespie }
1399f8dd34f6Sespie break;
1400f8dd34f6Sespie
1401f8dd34f6Sespie case '&':
1402f8dd34f6Sespie case '|':
1403f8dd34f6Sespie if (exp[0] == result)
1404f8dd34f6Sespie ++exp;
1405f8dd34f6Sespie else
1406f8dd34f6Sespie result = YYERRCODE;
1407f8dd34f6Sespie break;
1408f8dd34f6Sespie
1409f8dd34f6Sespie case '<':
1410f8dd34f6Sespie if (exp[0] == '=')
1411f8dd34f6Sespie {
1412f8dd34f6Sespie ++exp;
1413f8dd34f6Sespie lval->op = less_or_equal;
1414f8dd34f6Sespie }
1415f8dd34f6Sespie else
1416f8dd34f6Sespie lval->op = less_than;
1417f8dd34f6Sespie result = CMPOP2;
1418f8dd34f6Sespie break;
1419f8dd34f6Sespie
1420f8dd34f6Sespie case '>':
1421f8dd34f6Sespie if (exp[0] == '=')
1422f8dd34f6Sespie {
1423f8dd34f6Sespie ++exp;
1424f8dd34f6Sespie lval->op = greater_or_equal;
1425f8dd34f6Sespie }
1426f8dd34f6Sespie else
1427f8dd34f6Sespie lval->op = greater_than;
1428f8dd34f6Sespie result = CMPOP2;
1429f8dd34f6Sespie break;
1430f8dd34f6Sespie
1431f8dd34f6Sespie case '*':
1432f8dd34f6Sespie lval->op = mult;
1433f8dd34f6Sespie result = MULOP2;
1434f8dd34f6Sespie break;
1435f8dd34f6Sespie
1436f8dd34f6Sespie case '/':
1437f8dd34f6Sespie lval->op = divide;
1438f8dd34f6Sespie result = MULOP2;
1439f8dd34f6Sespie break;
1440f8dd34f6Sespie
1441f8dd34f6Sespie case '%':
1442f8dd34f6Sespie lval->op = module;
1443f8dd34f6Sespie result = MULOP2;
1444f8dd34f6Sespie break;
1445f8dd34f6Sespie
1446f8dd34f6Sespie case '+':
1447f8dd34f6Sespie lval->op = plus;
1448f8dd34f6Sespie result = ADDOP2;
1449f8dd34f6Sespie break;
1450f8dd34f6Sespie
1451f8dd34f6Sespie case '-':
1452f8dd34f6Sespie lval->op = minus;
1453f8dd34f6Sespie result = ADDOP2;
1454f8dd34f6Sespie break;
1455f8dd34f6Sespie
1456f8dd34f6Sespie case 'n':
1457f8dd34f6Sespie case '?':
1458f8dd34f6Sespie case ':':
1459f8dd34f6Sespie case '(':
1460f8dd34f6Sespie case ')':
1461f8dd34f6Sespie /* Nothing, just return the character. */
1462f8dd34f6Sespie break;
1463f8dd34f6Sespie
1464f8dd34f6Sespie case ';':
1465f8dd34f6Sespie case '\n':
1466f8dd34f6Sespie case '\0':
1467f8dd34f6Sespie /* Be safe and let the user call this function again. */
1468f8dd34f6Sespie --exp;
1469f8dd34f6Sespie result = YYEOF;
1470f8dd34f6Sespie break;
1471f8dd34f6Sespie
1472f8dd34f6Sespie default:
1473f8dd34f6Sespie result = YYERRCODE;
1474f8dd34f6Sespie #if YYDEBUG != 0
1475f8dd34f6Sespie --exp;
1476f8dd34f6Sespie #endif
1477f8dd34f6Sespie break;
1478f8dd34f6Sespie }
1479f8dd34f6Sespie
1480f8dd34f6Sespie *pexp = exp;
1481f8dd34f6Sespie
1482f8dd34f6Sespie return result;
1483f8dd34f6Sespie }
1484f8dd34f6Sespie
1485f8dd34f6Sespie
1486f8dd34f6Sespie static void
yyerror(const char * str)1487*a1acfa9bSespie yyerror (const char *str)
1488f8dd34f6Sespie {
1489f8dd34f6Sespie /* Do nothing. We don't print error messages here. */
1490f8dd34f6Sespie }
1491