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