Back to index

cell-binutils  2.17cvs20070401
plural.c
Go to the documentation of this file.
00001 /* A Bison parser, made from plural.y
00002    by GNU bison 1.35.  */
00003 
00004 #define YYBISON 1  /* Identify Bison output.  */
00005 
00006 #define yyparse __gettextparse
00007 #define yylex __gettextlex
00008 #define yyerror __gettexterror
00009 #define yylval __gettextlval
00010 #define yychar __gettextchar
00011 #define yydebug __gettextdebug
00012 #define yynerrs __gettextnerrs
00013 # define      EQUOP2 257
00014 # define      CMPOP2 258
00015 # define      ADDOP2 259
00016 # define      MULOP2 260
00017 # define      NUMBER 261
00018 
00019 #line 1 "plural.y"
00020 
00021 /* Expression parsing for plural form selection.
00022    Copyright (C) 2000, 2001 Free Software Foundation, Inc.
00023    Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
00024 
00025    This program is free software; you can redistribute it and/or modify it
00026    under the terms of the GNU Library General Public License as published
00027    by the Free Software Foundation; either version 2, or (at your option)
00028    any later version.
00029 
00030    This program is distributed in the hope that it will be useful,
00031    but WITHOUT ANY WARRANTY; without even the implied warranty of
00032    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00033    Library General Public License for more details.
00034 
00035    You should have received a copy of the GNU Library General Public
00036    License along with this program; if not, write to the Free Software
00037    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301,
00038    USA.  */
00039 
00040 /* The bison generated parser uses alloca.  AIX 3 forces us to put this
00041    declaration at the beginning of the file.  The declaration in bison's
00042    skeleton file comes too late.  This must come before <config.h>
00043    because <config.h> may include arbitrary system headers.  */
00044 #if defined _AIX && !defined __GNUC__
00045  #pragma alloca
00046 #endif
00047 
00048 #ifdef HAVE_CONFIG_H
00049 # include <config.h>
00050 #endif
00051 
00052 #include <stddef.h>
00053 #include <stdlib.h>
00054 #include "plural-exp.h"
00055 
00056 /* The main function generated by the parser is called __gettextparse,
00057    but we want it to be called PLURAL_PARSE.  */
00058 #ifndef _LIBC
00059 # define __gettextparse PLURAL_PARSE
00060 #endif
00061 
00062 #define YYLEX_PARAM  &((struct parse_args *) arg)->cp
00063 #define YYPARSE_PARAM       arg
00064 
00065 #line 49 "plural.y"
00066 #ifndef YYSTYPE
00067 typedef union {
00068   unsigned long int num;
00069   enum operator op;
00070   struct expression *exp;
00071 } yystype;
00072 # define YYSTYPE yystype
00073 # define YYSTYPE_IS_TRIVIAL 1
00074 #endif
00075 #line 55 "plural.y"
00076 
00077 /* Prototypes for local functions.  */
00078 static struct expression *new_exp PARAMS ((int nargs, enum operator op,
00079                                       struct expression * const *args));
00080 static inline struct expression *new_exp_0 PARAMS ((enum operator op));
00081 static inline struct expression *new_exp_1 PARAMS ((enum operator op,
00082                                              struct expression *right));
00083 static struct expression *new_exp_2 PARAMS ((enum operator op,
00084                                         struct expression *left,
00085                                         struct expression *right));
00086 static inline struct expression *new_exp_3 PARAMS ((enum operator op,
00087                                              struct expression *bexp,
00088                                              struct expression *tbranch,
00089                                              struct expression *fbranch));
00090 static int yylex PARAMS ((YYSTYPE *lval, const char **pexp));
00091 static void yyerror PARAMS ((const char *str));
00092 
00093 /* Allocation of expressions.  */
00094 
00095 static struct expression *
00096 new_exp (nargs, op, args)
00097      int nargs;
00098      enum operator op;
00099      struct expression * const *args;
00100 {
00101   int i;
00102   struct expression *newp;
00103 
00104   /* If any of the argument could not be malloc'ed, just return NULL.  */
00105   for (i = nargs - 1; i >= 0; i--)
00106     if (args[i] == NULL)
00107       goto fail;
00108 
00109   /* Allocate a new expression.  */
00110   newp = (struct expression *) malloc (sizeof (*newp));
00111   if (newp != NULL)
00112     {
00113       newp->nargs = nargs;
00114       newp->operation = op;
00115       for (i = nargs - 1; i >= 0; i--)
00116        newp->val.args[i] = args[i];
00117       return newp;
00118     }
00119 
00120  fail:
00121   for (i = nargs - 1; i >= 0; i--)
00122     FREE_EXPRESSION (args[i]);
00123 
00124   return NULL;
00125 }
00126 
00127 static inline struct expression *
00128 new_exp_0 (op)
00129      enum operator op;
00130 {
00131   return new_exp (0, op, NULL);
00132 }
00133 
00134 static inline struct expression *
00135 new_exp_1 (op, right)
00136      enum operator op;
00137      struct expression *right;
00138 {
00139   struct expression *args[1];
00140 
00141   args[0] = right;
00142   return new_exp (1, op, args);
00143 }
00144 
00145 static struct expression *
00146 new_exp_2 (op, left, right)
00147      enum operator op;
00148      struct expression *left;
00149      struct expression *right;
00150 {
00151   struct expression *args[2];
00152 
00153   args[0] = left;
00154   args[1] = right;
00155   return new_exp (2, op, args);
00156 }
00157 
00158 static inline struct expression *
00159 new_exp_3 (op, bexp, tbranch, fbranch)
00160      enum operator op;
00161      struct expression *bexp;
00162      struct expression *tbranch;
00163      struct expression *fbranch;
00164 {
00165   struct expression *args[3];
00166 
00167   args[0] = bexp;
00168   args[1] = tbranch;
00169   args[2] = fbranch;
00170   return new_exp (3, op, args);
00171 }
00172 
00173 #ifndef YYDEBUG
00174 # define YYDEBUG 0
00175 #endif
00176 
00177 
00178 
00179 #define       YYFINAL              27
00180 #define       YYFLAG        -32768
00181 #define       YYNTBASE      16
00182 
00183 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
00184 #define YYTRANSLATE(x) ((unsigned)(x) <= 261 ? yytranslate[x] : 18)
00185 
00186 /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
00187 static const char yytranslate[] =
00188 {
00189        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00190        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00191        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00192        2,     2,     2,    10,     2,     2,     2,     2,     5,     2,
00193       14,    15,     2,     2,     2,     2,     2,     2,     2,     2,
00194        2,     2,     2,     2,     2,     2,     2,     2,    12,     2,
00195        2,     2,     2,     3,     2,     2,     2,     2,     2,     2,
00196        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00197        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00198        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00199        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00200       13,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00201        2,     2,     2,     2,     4,     2,     2,     2,     2,     2,
00202        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00203        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00204        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00205        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00206        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00207        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00208        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00209        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00210        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00211        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00212        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00213        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00214        2,     2,     2,     2,     2,     2,     1,     6,     7,     8,
00215        9,    11
00216 };
00217 
00218 #if YYDEBUG
00219 static const short yyprhs[] =
00220 {
00221        0,     0,     2,     8,    12,    16,    20,    24,    28,    32,
00222       35,    37,    39
00223 };
00224 static const short yyrhs[] =
00225 {
00226       17,     0,    17,     3,    17,    12,    17,     0,    17,     4,
00227       17,     0,    17,     5,    17,     0,    17,     6,    17,     0,
00228       17,     7,    17,     0,    17,     8,    17,     0,    17,     9,
00229       17,     0,    10,    17,     0,    13,     0,    11,     0,    14,
00230       17,    15,     0
00231 };
00232 
00233 #endif
00234 
00235 #if YYDEBUG
00236 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
00237 static const short yyrline[] =
00238 {
00239        0,   174,   182,   186,   190,   194,   198,   202,   206,   210,
00240      214,   218,   223
00241 };
00242 #endif
00243 
00244 
00245 #if (YYDEBUG) || defined YYERROR_VERBOSE
00246 
00247 /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
00248 static const char *const yytname[] =
00249 {
00250   "$", "error", "$undefined.", "'?'", "'|'", "'&'", "EQUOP2", "CMPOP2", 
00251   "ADDOP2", "MULOP2", "'!'", "NUMBER", "':'", "'n'", "'('", "')'", 
00252   "start", "exp", 0
00253 };
00254 #endif
00255 
00256 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
00257 static const short yyr1[] =
00258 {
00259        0,    16,    17,    17,    17,    17,    17,    17,    17,    17,
00260       17,    17,    17
00261 };
00262 
00263 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
00264 static const short yyr2[] =
00265 {
00266        0,     1,     5,     3,     3,     3,     3,     3,     3,     2,
00267        1,     1,     3
00268 };
00269 
00270 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
00271    doesn't specify something else to do.  Zero means the default is an
00272    error. */
00273 static const short yydefact[] =
00274 {
00275        0,     0,    11,    10,     0,     1,     9,     0,     0,     0,
00276        0,     0,     0,     0,     0,    12,     0,     3,     4,     5,
00277        6,     7,     8,     0,     2,     0,     0,     0
00278 };
00279 
00280 static const short yydefgoto[] =
00281 {
00282       25,     5
00283 };
00284 
00285 static const short yypact[] =
00286 {
00287       -9,    -9,-32768,-32768,    -9,    34,-32768,    11,    -9,    -9,
00288       -9,    -9,    -9,    -9,    -9,-32768,    24,    39,    43,    16,
00289       26,    -3,-32768,    -9,    34,    21,    53,-32768
00290 };
00291 
00292 static const short yypgoto[] =
00293 {
00294   -32768,    -1
00295 };
00296 
00297 
00298 #define       YYLAST        53
00299 
00300 
00301 static const short yytable[] =
00302 {
00303        6,     1,     2,     7,     3,     4,    14,    16,    17,    18,
00304       19,    20,    21,    22,     8,     9,    10,    11,    12,    13,
00305       14,    26,    24,    12,    13,    14,    15,     8,     9,    10,
00306       11,    12,    13,    14,    13,    14,    23,     8,     9,    10,
00307       11,    12,    13,    14,    10,    11,    12,    13,    14,    11,
00308       12,    13,    14,    27
00309 };
00310 
00311 static const short yycheck[] =
00312 {
00313        1,    10,    11,     4,    13,    14,     9,     8,     9,    10,
00314       11,    12,    13,    14,     3,     4,     5,     6,     7,     8,
00315        9,     0,    23,     7,     8,     9,    15,     3,     4,     5,
00316        6,     7,     8,     9,     8,     9,    12,     3,     4,     5,
00317        6,     7,     8,     9,     5,     6,     7,     8,     9,     6,
00318        7,     8,     9,     0
00319 };
00320 #define YYPURE 1
00321 
00322 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
00323 #line 3 "/usr/local/share/bison/bison.simple"
00324 
00325 /* Skeleton output parser for bison,
00326 
00327    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
00328    Foundation, Inc.
00329 
00330    This program is free software; you can redistribute it and/or modify
00331    it under the terms of the GNU General Public License as published by
00332    the Free Software Foundation; either version 2, or (at your option)
00333    any later version.
00334 
00335    This program is distributed in the hope that it will be useful,
00336    but WITHOUT ANY WARRANTY; without even the implied warranty of
00337    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00338    GNU General Public License for more details.
00339 
00340    You should have received a copy of the GNU General Public License
00341    along with this program; if not, write to the Free Software
00342    Foundation, Inc., 51 Franklin Street - Fifth Floor,
00343    Boston, MA 02110-1301, USA.  */
00344 
00345 /* As a special exception, when this file is copied by Bison into a
00346    Bison output file, you may use that output file without restriction.
00347    This special exception was added by the Free Software Foundation
00348    in version 1.24 of Bison.  */
00349 
00350 /* This is the parser code that is written into each bison parser when
00351    the %semantic_parser declaration is not specified in the grammar.
00352    It was written by Richard Stallman by simplifying the hairy parser
00353    used when %semantic_parser is specified.  */
00354 
00355 /* All symbols defined below should begin with yy or YY, to avoid
00356    infringing on user name space.  This should be done even for local
00357    variables, as they might otherwise be expanded by user macros.
00358    There are some unavoidable exceptions within include files to
00359    define necessary library symbols; they are noted "INFRINGES ON
00360    USER NAME SPACE" below.  */
00361 
00362 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
00363 
00364 /* The parser invokes alloca or malloc; define the necessary symbols.  */
00365 
00366 # if YYSTACK_USE_ALLOCA
00367 #  define YYSTACK_ALLOC alloca
00368 # else
00369 #  ifndef YYSTACK_USE_ALLOCA
00370 #   if defined (alloca) || defined (_ALLOCA_H)
00371 #    define YYSTACK_ALLOC alloca
00372 #   else
00373 #    ifdef __GNUC__
00374 #     define YYSTACK_ALLOC __builtin_alloca
00375 #    endif
00376 #   endif
00377 #  endif
00378 # endif
00379 
00380 # ifdef YYSTACK_ALLOC
00381    /* Pacify GCC's `empty if-body' warning. */
00382 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
00383 # else
00384 #  if defined (__STDC__) || defined (__cplusplus)
00385 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
00386 #   define YYSIZE_T size_t
00387 #  endif
00388 #  define YYSTACK_ALLOC malloc
00389 #  define YYSTACK_FREE free
00390 # endif
00391 #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
00392 
00393 
00394 #if (! defined (yyoverflow) \
00395      && (! defined (__cplusplus) \
00396         || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
00397 
00398 /* A type that is properly aligned for any stack member.  */
00399 union yyalloc
00400 {
00401   short yyss;
00402   YYSTYPE yyvs;
00403 # if YYLSP_NEEDED
00404   YYLTYPE yyls;
00405 # endif
00406 };
00407 
00408 /* The size of the maximum gap between one aligned stack and the next.  */
00409 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
00410 
00411 /* The size of an array large to enough to hold all stacks, each with
00412    N elements.  */
00413 # if YYLSP_NEEDED
00414 #  define YYSTACK_BYTES(N) \
00415      ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE))    \
00416       + 2 * YYSTACK_GAP_MAX)
00417 # else
00418 #  define YYSTACK_BYTES(N) \
00419      ((N) * (sizeof (short) + sizeof (YYSTYPE))                       \
00420       + YYSTACK_GAP_MAX)
00421 # endif
00422 
00423 /* Copy COUNT objects from FROM to TO.  The source and destination do
00424    not overlap.  */
00425 # ifndef YYCOPY
00426 #  if 1 < __GNUC__
00427 #   define YYCOPY(To, From, Count) \
00428       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
00429 #  else
00430 #   define YYCOPY(To, From, Count)        \
00431       do                                  \
00432        {                                  \
00433          register YYSIZE_T yyi;           \
00434          for (yyi = 0; yyi < (Count); yyi++)     \
00435            (To)[yyi] = (From)[yyi];              \
00436        }                                  \
00437       while (0)
00438 #  endif
00439 # endif
00440 
00441 /* Relocate STACK from its old location to the new one.  The
00442    local variables YYSIZE and YYSTACKSIZE give the old and new number of
00443    elements in the stack, and YYPTR gives the new location of the
00444    stack.  Advance YYPTR to a properly aligned location for the next
00445    stack.  */
00446 # define YYSTACK_RELOCATE(Stack)                               \
00447     do                                                         \
00448       {                                                               \
00449        YYSIZE_T yynewbytes;                                    \
00450        YYCOPY (&yyptr->Stack, Stack, yysize);                         \
00451        Stack = &yyptr->Stack;                                         \
00452        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX;  \
00453        yyptr += yynewbytes / sizeof (*yyptr);                         \
00454       }                                                               \
00455     while (0)
00456 
00457 #endif
00458 
00459 
00460 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
00461 # define YYSIZE_T __SIZE_TYPE__
00462 #endif
00463 #if ! defined (YYSIZE_T) && defined (size_t)
00464 # define YYSIZE_T size_t
00465 #endif
00466 #if ! defined (YYSIZE_T)
00467 # if defined (__STDC__) || defined (__cplusplus)
00468 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
00469 #  define YYSIZE_T size_t
00470 # endif
00471 #endif
00472 #if ! defined (YYSIZE_T)
00473 # define YYSIZE_T unsigned int
00474 #endif
00475 
00476 #define yyerrok             (yyerrstatus = 0)
00477 #define yyclearin    (yychar = YYEMPTY)
00478 #define YYEMPTY             -2
00479 #define YYEOF        0
00480 #define YYACCEPT     goto yyacceptlab
00481 #define YYABORT      goto yyabortlab
00482 #define YYERROR             goto yyerrlab1
00483 /* Like YYERROR except do call yyerror.  This remains here temporarily
00484    to ease the transition to the new meaning of YYERROR, for GCC.
00485    Once GCC version 2 has supplanted version 1, this can go.  */
00486 #define YYFAIL              goto yyerrlab
00487 #define YYRECOVERING()  (!!yyerrstatus)
00488 #define YYBACKUP(Token, Value)                                 \
00489 do                                                      \
00490   if (yychar == YYEMPTY && yylen == 1)                         \
00491     {                                                   \
00492       yychar = (Token);                                        \
00493       yylval = (Value);                                        \
00494       yychar1 = YYTRANSLATE (yychar);                          \
00495       YYPOPSTACK;                                       \
00496       goto yybackup;                                    \
00497     }                                                   \
00498   else                                                  \
00499     {                                                   \
00500       yyerror ("syntax error: cannot back up");                \
00501       YYERROR;                                                 \
00502     }                                                   \
00503 while (0)
00504 
00505 #define YYTERROR     1
00506 #define YYERRCODE    256
00507 
00508 
00509 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
00510    are run).
00511 
00512    When YYLLOC_DEFAULT is run, CURRENT is set the location of the
00513    first token.  By default, to implement support for ranges, extend
00514    its range to the last symbol.  */
00515 
00516 #ifndef YYLLOC_DEFAULT
00517 # define YYLLOC_DEFAULT(Current, Rhs, N)         \
00518    Current.last_line   = Rhs[N].last_line;       \
00519    Current.last_column = Rhs[N].last_column;
00520 #endif
00521 
00522 
00523 /* YYLEX -- calling `yylex' with the right arguments.  */
00524 
00525 #if YYPURE
00526 # if YYLSP_NEEDED
00527 #  ifdef YYLEX_PARAM
00528 #   define YYLEX            yylex (&yylval, &yylloc, YYLEX_PARAM)
00529 #  else
00530 #   define YYLEX            yylex (&yylval, &yylloc)
00531 #  endif
00532 # else /* !YYLSP_NEEDED */
00533 #  ifdef YYLEX_PARAM
00534 #   define YYLEX            yylex (&yylval, YYLEX_PARAM)
00535 #  else
00536 #   define YYLEX            yylex (&yylval)
00537 #  endif
00538 # endif /* !YYLSP_NEEDED */
00539 #else /* !YYPURE */
00540 # define YYLEX                     yylex ()
00541 #endif /* !YYPURE */
00542 
00543 
00544 /* Enable debugging if requested.  */
00545 #if YYDEBUG
00546 
00547 # ifndef YYFPRINTF
00548 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
00549 #  define YYFPRINTF fprintf
00550 # endif
00551 
00552 # define YYDPRINTF(Args)                  \
00553 do {                                      \
00554   if (yydebug)                                   \
00555     YYFPRINTF Args;                       \
00556 } while (0)
00557 /* Nonzero means print parse trace.  It is left uninitialized so that
00558    multiple parsers can coexist.  */
00559 int yydebug;
00560 #else /* !YYDEBUG */
00561 # define YYDPRINTF(Args)
00562 #endif /* !YYDEBUG */
00563 
00564 /* YYINITDEPTH -- initial size of the parser's stacks.  */
00565 #ifndef       YYINITDEPTH
00566 # define YYINITDEPTH 200
00567 #endif
00568 
00569 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
00570    if the built-in stack extension method is used).
00571 
00572    Do not make this value too large; the results are undefined if
00573    SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
00574    evaluated with infinite-precision integer arithmetic.  */
00575 
00576 #if YYMAXDEPTH == 0
00577 # undef YYMAXDEPTH
00578 #endif
00579 
00580 #ifndef YYMAXDEPTH
00581 # define YYMAXDEPTH 10000
00582 #endif
00583 
00584 #ifdef YYERROR_VERBOSE
00585 
00586 # ifndef yystrlen
00587 #  if defined (__GLIBC__) && defined (_STRING_H)
00588 #   define yystrlen strlen
00589 #  else
00590 /* Return the length of YYSTR.  */
00591 static YYSIZE_T
00592 #   if defined (__STDC__) || defined (__cplusplus)
00593 yystrlen (const char *yystr)
00594 #   else
00595 yystrlen (yystr)
00596      const char *yystr;
00597 #   endif
00598 {
00599   register const char *yys = yystr;
00600 
00601   while (*yys++ != '\0')
00602     continue;
00603 
00604   return yys - yystr - 1;
00605 }
00606 #  endif
00607 # endif
00608 
00609 # ifndef yystpcpy
00610 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
00611 #   define yystpcpy stpcpy
00612 #  else
00613 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
00614    YYDEST.  */
00615 static char *
00616 #   if defined (__STDC__) || defined (__cplusplus)
00617 yystpcpy (char *yydest, const char *yysrc)
00618 #   else
00619 yystpcpy (yydest, yysrc)
00620      char *yydest;
00621      const char *yysrc;
00622 #   endif
00623 {
00624   register char *yyd = yydest;
00625   register const char *yys = yysrc;
00626 
00627   while ((*yyd++ = *yys++) != '\0')
00628     continue;
00629 
00630   return yyd - 1;
00631 }
00632 #  endif
00633 # endif
00634 #endif
00635 
00636 #line 315 "/usr/local/share/bison/bison.simple"
00637 
00638 
00639 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
00640    into yyparse.  The argument should have type void *.
00641    It should actually point to an object.
00642    Grammar actions can access the variable by casting it
00643    to the proper pointer type.  */
00644 
00645 #ifdef YYPARSE_PARAM
00646 # if defined (__STDC__) || defined (__cplusplus)
00647 #  define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
00648 #  define YYPARSE_PARAM_DECL
00649 # else
00650 #  define YYPARSE_PARAM_ARG YYPARSE_PARAM
00651 #  define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
00652 # endif
00653 #else /* !YYPARSE_PARAM */
00654 # define YYPARSE_PARAM_ARG
00655 # define YYPARSE_PARAM_DECL
00656 #endif /* !YYPARSE_PARAM */
00657 
00658 /* Prevent warning if -Wstrict-prototypes.  */
00659 #ifdef __GNUC__
00660 # ifdef YYPARSE_PARAM
00661 int yyparse (void *);
00662 # else
00663 int yyparse (void);
00664 # endif
00665 #endif
00666 
00667 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
00668    variables are global, or local to YYPARSE.  */
00669 
00670 #define YY_DECL_NON_LSP_VARIABLES                \
00671 /* The lookahead symbol.  */                            \
00672 int yychar;                                      \
00673                                                  \
00674 /* The semantic value of the lookahead symbol. */       \
00675 YYSTYPE yylval;                                         \
00676                                                  \
00677 /* Number of parse errors so far.  */                   \
00678 int yynerrs;
00679 
00680 #if YYLSP_NEEDED
00681 # define YY_DECL_VARIABLES                \
00682 YY_DECL_NON_LSP_VARIABLES                 \
00683                                           \
00684 /* Location data for the lookahead symbol.  */   \
00685 YYLTYPE yylloc;
00686 #else
00687 # define YY_DECL_VARIABLES                \
00688 YY_DECL_NON_LSP_VARIABLES
00689 #endif
00690 
00691 
00692 /* If nonreentrant, generate the variables here. */
00693 
00694 #if !YYPURE
00695 YY_DECL_VARIABLES
00696 #endif  /* !YYPURE */
00697 
00698 int
00699 yyparse (YYPARSE_PARAM_ARG)
00700      YYPARSE_PARAM_DECL
00701 {
00702   /* If reentrant, generate the variables here. */
00703 #if YYPURE
00704   YY_DECL_VARIABLES
00705 #endif  /* !YYPURE */
00706 
00707   register int yystate;
00708   register int yyn;
00709   int yyresult;
00710   /* Number of tokens to shift before error messages enabled.  */
00711   int yyerrstatus;
00712   /* Lookahead token as an internal (translated) token number.  */
00713   int yychar1 = 0;
00714 
00715   /* Three stacks and their tools:
00716      `yyss': related to states,
00717      `yyvs': related to semantic values,
00718      `yyls': related to locations.
00719 
00720      Refer to the stacks thru separate pointers, to allow yyoverflow
00721      to reallocate them elsewhere.  */
00722 
00723   /* The state stack. */
00724   short       yyssa[YYINITDEPTH];
00725   short *yyss = yyssa;
00726   register short *yyssp;
00727 
00728   /* The semantic value stack.  */
00729   YYSTYPE yyvsa[YYINITDEPTH];
00730   YYSTYPE *yyvs = yyvsa;
00731   register YYSTYPE *yyvsp;
00732 
00733 #if YYLSP_NEEDED
00734   /* The location stack.  */
00735   YYLTYPE yylsa[YYINITDEPTH];
00736   YYLTYPE *yyls = yylsa;
00737   YYLTYPE *yylsp;
00738 #endif
00739 
00740 #if YYLSP_NEEDED
00741 # define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
00742 #else
00743 # define YYPOPSTACK   (yyvsp--, yyssp--)
00744 #endif
00745 
00746   YYSIZE_T yystacksize = YYINITDEPTH;
00747 
00748 
00749   /* The variables used to return semantic value and location from the
00750      action routines.  */
00751   YYSTYPE yyval;
00752 #if YYLSP_NEEDED
00753   YYLTYPE yyloc;
00754 #endif
00755 
00756   /* When reducing, the number of symbols on the RHS of the reduced
00757      rule. */
00758   int yylen;
00759 
00760   YYDPRINTF ((stderr, "Starting parse\n"));
00761 
00762   yystate = 0;
00763   yyerrstatus = 0;
00764   yynerrs = 0;
00765   yychar = YYEMPTY;         /* Cause a token to be read.  */
00766 
00767   /* Initialize stack pointers.
00768      Waste one element of value and location stack
00769      so that they stay on the same level as the state stack.
00770      The wasted elements are never initialized.  */
00771 
00772   yyssp = yyss;
00773   yyvsp = yyvs;
00774 #if YYLSP_NEEDED
00775   yylsp = yyls;
00776 #endif
00777   goto yysetstate;
00778 
00779 /*------------------------------------------------------------.
00780 | yynewstate -- Push a new state, which is found in yystate.  |
00781 `------------------------------------------------------------*/
00782  yynewstate:
00783   /* In all cases, when you get here, the value and location stacks
00784      have just been pushed. so pushing a state here evens the stacks.
00785      */
00786   yyssp++;
00787 
00788  yysetstate:
00789   *yyssp = yystate;
00790 
00791   if (yyssp >= yyss + yystacksize - 1)
00792     {
00793       /* Get the current used size of the three stacks, in elements.  */
00794       YYSIZE_T yysize = yyssp - yyss + 1;
00795 
00796 #ifdef yyoverflow
00797       {
00798        /* Give user a chance to reallocate the stack. Use copies of
00799           these so that the &'s don't force the real ones into
00800           memory.  */
00801        YYSTYPE *yyvs1 = yyvs;
00802        short *yyss1 = yyss;
00803 
00804        /* Each stack pointer address is followed by the size of the
00805           data in use in that stack, in bytes.  */
00806 # if YYLSP_NEEDED
00807        YYLTYPE *yyls1 = yyls;
00808        /* This used to be a conditional around just the two extra args,
00809           but that might be undefined if yyoverflow is a macro.  */
00810        yyoverflow ("parser stack overflow",
00811                   &yyss1, yysize * sizeof (*yyssp),
00812                   &yyvs1, yysize * sizeof (*yyvsp),
00813                   &yyls1, yysize * sizeof (*yylsp),
00814                   &yystacksize);
00815        yyls = yyls1;
00816 # else
00817        yyoverflow ("parser stack overflow",
00818                   &yyss1, yysize * sizeof (*yyssp),
00819                   &yyvs1, yysize * sizeof (*yyvsp),
00820                   &yystacksize);
00821 # endif
00822        yyss = yyss1;
00823        yyvs = yyvs1;
00824       }
00825 #else /* no yyoverflow */
00826 # ifndef YYSTACK_RELOCATE
00827       goto yyoverflowlab;
00828 # else
00829       /* Extend the stack our own way.  */
00830       if (yystacksize >= YYMAXDEPTH)
00831        goto yyoverflowlab;
00832       yystacksize *= 2;
00833       if (yystacksize > YYMAXDEPTH)
00834        yystacksize = YYMAXDEPTH;
00835 
00836       {
00837        short *yyss1 = yyss;
00838        union yyalloc *yyptr =
00839          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
00840        if (! yyptr)
00841          goto yyoverflowlab;
00842        YYSTACK_RELOCATE (yyss);
00843        YYSTACK_RELOCATE (yyvs);
00844 # if YYLSP_NEEDED
00845        YYSTACK_RELOCATE (yyls);
00846 # endif
00847 # undef YYSTACK_RELOCATE
00848        if (yyss1 != yyssa)
00849          YYSTACK_FREE (yyss1);
00850       }
00851 # endif
00852 #endif /* no yyoverflow */
00853 
00854       yyssp = yyss + yysize - 1;
00855       yyvsp = yyvs + yysize - 1;
00856 #if YYLSP_NEEDED
00857       yylsp = yyls + yysize - 1;
00858 #endif
00859 
00860       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
00861                 (unsigned long int) yystacksize));
00862 
00863       if (yyssp >= yyss + yystacksize - 1)
00864        YYABORT;
00865     }
00866 
00867   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
00868 
00869   goto yybackup;
00870 
00871 
00872 /*-----------.
00873 | yybackup.  |
00874 `-----------*/
00875 yybackup:
00876 
00877 /* Do appropriate processing given the current state.  */
00878 /* Read a lookahead token if we need one and don't already have one.  */
00879 /* yyresume: */
00880 
00881   /* First try to decide what to do without reference to lookahead token.  */
00882 
00883   yyn = yypact[yystate];
00884   if (yyn == YYFLAG)
00885     goto yydefault;
00886 
00887   /* Not known => get a lookahead token if don't already have one.  */
00888 
00889   /* yychar is either YYEMPTY or YYEOF
00890      or a valid token in external form.  */
00891 
00892   if (yychar == YYEMPTY)
00893     {
00894       YYDPRINTF ((stderr, "Reading a token: "));
00895       yychar = YYLEX;
00896     }
00897 
00898   /* Convert token to internal form (in yychar1) for indexing tables with */
00899 
00900   if (yychar <= 0)          /* This means end of input. */
00901     {
00902       yychar1 = 0;
00903       yychar = YYEOF;              /* Don't call YYLEX any more */
00904 
00905       YYDPRINTF ((stderr, "Now at end of input.\n"));
00906     }
00907   else
00908     {
00909       yychar1 = YYTRANSLATE (yychar);
00910 
00911 #if YYDEBUG
00912      /* We have to keep this `#if YYDEBUG', since we use variables
00913        which are defined only if `YYDEBUG' is set.  */
00914       if (yydebug)
00915        {
00916          YYFPRINTF (stderr, "Next token is %d (%s",
00917                    yychar, yytname[yychar1]);
00918          /* Give the individual parser a way to print the precise
00919             meaning of a token, for further debugging info.  */
00920 # ifdef YYPRINT
00921          YYPRINT (stderr, yychar, yylval);
00922 # endif
00923          YYFPRINTF (stderr, ")\n");
00924        }
00925 #endif
00926     }
00927 
00928   yyn += yychar1;
00929   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
00930     goto yydefault;
00931 
00932   yyn = yytable[yyn];
00933 
00934   /* yyn is what to do for this token type in this state.
00935      Negative => reduce, -yyn is rule number.
00936      Positive => shift, yyn is new state.
00937        New state is final state => don't bother to shift,
00938        just return success.
00939      0, or most negative number => error.  */
00940 
00941   if (yyn < 0)
00942     {
00943       if (yyn == YYFLAG)
00944        goto yyerrlab;
00945       yyn = -yyn;
00946       goto yyreduce;
00947     }
00948   else if (yyn == 0)
00949     goto yyerrlab;
00950 
00951   if (yyn == YYFINAL)
00952     YYACCEPT;
00953 
00954   /* Shift the lookahead token.  */
00955   YYDPRINTF ((stderr, "Shifting token %d (%s), ",
00956              yychar, yytname[yychar1]));
00957 
00958   /* Discard the token being shifted unless it is eof.  */
00959   if (yychar != YYEOF)
00960     yychar = YYEMPTY;
00961 
00962   *++yyvsp = yylval;
00963 #if YYLSP_NEEDED
00964   *++yylsp = yylloc;
00965 #endif
00966 
00967   /* Count tokens shifted since error; after three, turn off error
00968      status.  */
00969   if (yyerrstatus)
00970     yyerrstatus--;
00971 
00972   yystate = yyn;
00973   goto yynewstate;
00974 
00975 
00976 /*-----------------------------------------------------------.
00977 | yydefault -- do the default action for the current state.  |
00978 `-----------------------------------------------------------*/
00979 yydefault:
00980   yyn = yydefact[yystate];
00981   if (yyn == 0)
00982     goto yyerrlab;
00983   goto yyreduce;
00984 
00985 
00986 /*-----------------------------.
00987 | yyreduce -- Do a reduction.  |
00988 `-----------------------------*/
00989 yyreduce:
00990   /* yyn is the number of a rule to reduce with.  */
00991   yylen = yyr2[yyn];
00992 
00993   /* If YYLEN is nonzero, implement the default value of the action:
00994      `$$ = $1'.
00995 
00996      Otherwise, the following line sets YYVAL to the semantic value of
00997      the lookahead token.  This behavior is undocumented and Bison
00998      users should not rely upon it.  Assigning to YYVAL
00999      unconditionally makes the parser a bit smaller, and it avoids a
01000      GCC warning that YYVAL may be used uninitialized.  */
01001   yyval = yyvsp[1-yylen];
01002 
01003 #if YYLSP_NEEDED
01004   /* Similarly for the default location.  Let the user run additional
01005      commands if for instance locations are ranges.  */
01006   yyloc = yylsp[1-yylen];
01007   YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
01008 #endif
01009 
01010 #if YYDEBUG
01011   /* We have to keep this `#if YYDEBUG', since we use variables which
01012      are defined only if `YYDEBUG' is set.  */
01013   if (yydebug)
01014     {
01015       int yyi;
01016 
01017       YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
01018                yyn, yyrline[yyn]);
01019 
01020       /* Print the symbols being reduced, and their result.  */
01021       for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
01022        YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
01023       YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
01024     }
01025 #endif
01026 
01027   switch (yyn) {
01028 
01029 case 1:
01030 #line 175 "plural.y"
01031 {
01032            if (yyvsp[0].exp == NULL)
01033              YYABORT;
01034            ((struct parse_args *) arg)->res = yyvsp[0].exp;
01035          }
01036     break;
01037 case 2:
01038 #line 183 "plural.y"
01039 {
01040            yyval.exp = new_exp_3 (qmop, yyvsp[-4].exp, yyvsp[-2].exp, yyvsp[0].exp);
01041          }
01042     break;
01043 case 3:
01044 #line 187 "plural.y"
01045 {
01046            yyval.exp = new_exp_2 (lor, yyvsp[-2].exp, yyvsp[0].exp);
01047          }
01048     break;
01049 case 4:
01050 #line 191 "plural.y"
01051 {
01052            yyval.exp = new_exp_2 (land, yyvsp[-2].exp, yyvsp[0].exp);
01053          }
01054     break;
01055 case 5:
01056 #line 195 "plural.y"
01057 {
01058            yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
01059          }
01060     break;
01061 case 6:
01062 #line 199 "plural.y"
01063 {
01064            yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
01065          }
01066     break;
01067 case 7:
01068 #line 203 "plural.y"
01069 {
01070            yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
01071          }
01072     break;
01073 case 8:
01074 #line 207 "plural.y"
01075 {
01076            yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
01077          }
01078     break;
01079 case 9:
01080 #line 211 "plural.y"
01081 {
01082            yyval.exp = new_exp_1 (lnot, yyvsp[0].exp);
01083          }
01084     break;
01085 case 10:
01086 #line 215 "plural.y"
01087 {
01088            yyval.exp = new_exp_0 (var);
01089          }
01090     break;
01091 case 11:
01092 #line 219 "plural.y"
01093 {
01094            if ((yyval.exp = new_exp_0 (num)) != NULL)
01095              yyval.exp->val.num = yyvsp[0].num;
01096          }
01097     break;
01098 case 12:
01099 #line 224 "plural.y"
01100 {
01101            yyval.exp = yyvsp[-1].exp;
01102          }
01103     break;
01104 }
01105 
01106 #line 705 "/usr/local/share/bison/bison.simple"
01107 
01108 
01109   yyvsp -= yylen;
01110   yyssp -= yylen;
01111 #if YYLSP_NEEDED
01112   yylsp -= yylen;
01113 #endif
01114 
01115 #if YYDEBUG
01116   if (yydebug)
01117     {
01118       short *yyssp1 = yyss - 1;
01119       YYFPRINTF (stderr, "state stack now");
01120       while (yyssp1 != yyssp)
01121        YYFPRINTF (stderr, " %d", *++yyssp1);
01122       YYFPRINTF (stderr, "\n");
01123     }
01124 #endif
01125 
01126   *++yyvsp = yyval;
01127 #if YYLSP_NEEDED
01128   *++yylsp = yyloc;
01129 #endif
01130 
01131   /* Now `shift' the result of the reduction.  Determine what state
01132      that goes to, based on the state we popped back to and the rule
01133      number reduced by.  */
01134 
01135   yyn = yyr1[yyn];
01136 
01137   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
01138   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
01139     yystate = yytable[yystate];
01140   else
01141     yystate = yydefgoto[yyn - YYNTBASE];
01142 
01143   goto yynewstate;
01144 
01145 
01146 /*------------------------------------.
01147 | yyerrlab -- here on detecting error |
01148 `------------------------------------*/
01149 yyerrlab:
01150   /* If not already recovering from an error, report this error.  */
01151   if (!yyerrstatus)
01152     {
01153       ++yynerrs;
01154 
01155 #ifdef YYERROR_VERBOSE
01156       yyn = yypact[yystate];
01157 
01158       if (yyn > YYFLAG && yyn < YYLAST)
01159        {
01160          YYSIZE_T yysize = 0;
01161          char *yymsg;
01162          int yyx, yycount;
01163 
01164          yycount = 0;
01165          /* Start YYX at -YYN if negative to avoid negative indexes in
01166             YYCHECK.  */
01167          for (yyx = yyn < 0 ? -yyn : 0;
01168               yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
01169            if (yycheck[yyx + yyn] == yyx)
01170              yysize += yystrlen (yytname[yyx]) + 15, yycount++;
01171          yysize += yystrlen ("parse error, unexpected ") + 1;
01172          yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
01173          yymsg = (char *) YYSTACK_ALLOC (yysize);
01174          if (yymsg != 0)
01175            {
01176              char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
01177              yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
01178 
01179              if (yycount < 5)
01180               {
01181                 yycount = 0;
01182                 for (yyx = yyn < 0 ? -yyn : 0;
01183                      yyx < (int) (sizeof (yytname) / sizeof (char *));
01184                      yyx++)
01185                   if (yycheck[yyx + yyn] == yyx)
01186                     {
01187                      const char *yyq = ! yycount ? ", expecting " : " or ";
01188                      yyp = yystpcpy (yyp, yyq);
01189                      yyp = yystpcpy (yyp, yytname[yyx]);
01190                      yycount++;
01191                     }
01192               }
01193              yyerror (yymsg);
01194              YYSTACK_FREE (yymsg);
01195            }
01196          else
01197            yyerror ("parse error; also virtual memory exhausted");
01198        }
01199       else
01200 #endif /* defined (YYERROR_VERBOSE) */
01201        yyerror ("parse error");
01202     }
01203   goto yyerrlab1;
01204 
01205 
01206 /*--------------------------------------------------.
01207 | yyerrlab1 -- error raised explicitly by an action |
01208 `--------------------------------------------------*/
01209 yyerrlab1:
01210   if (yyerrstatus == 3)
01211     {
01212       /* If just tried and failed to reuse lookahead token after an
01213         error, discard it.  */
01214 
01215       /* return failure if at end of input */
01216       if (yychar == YYEOF)
01217        YYABORT;
01218       YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
01219                 yychar, yytname[yychar1]));
01220       yychar = YYEMPTY;
01221     }
01222 
01223   /* Else will try to reuse lookahead token after shifting the error
01224      token.  */
01225 
01226   yyerrstatus = 3;          /* Each real token shifted decrements this */
01227 
01228   goto yyerrhandle;
01229 
01230 
01231 /*-------------------------------------------------------------------.
01232 | yyerrdefault -- current state does not do anything special for the |
01233 | error token.                                                       |
01234 `-------------------------------------------------------------------*/
01235 yyerrdefault:
01236 #if 0
01237   /* This is wrong; only states that explicitly want error tokens
01238      should shift them.  */
01239 
01240   /* If its default is to accept any token, ok.  Otherwise pop it.  */
01241   yyn = yydefact[yystate];
01242   if (yyn)
01243     goto yydefault;
01244 #endif
01245 
01246 
01247 /*---------------------------------------------------------------.
01248 | yyerrpop -- pop the current state because it cannot handle the |
01249 | error token                                                    |
01250 `---------------------------------------------------------------*/
01251 yyerrpop:
01252   if (yyssp == yyss)
01253     YYABORT;
01254   yyvsp--;
01255   yystate = *--yyssp;
01256 #if YYLSP_NEEDED
01257   yylsp--;
01258 #endif
01259 
01260 #if YYDEBUG
01261   if (yydebug)
01262     {
01263       short *yyssp1 = yyss - 1;
01264       YYFPRINTF (stderr, "Error: state stack now");
01265       while (yyssp1 != yyssp)
01266        YYFPRINTF (stderr, " %d", *++yyssp1);
01267       YYFPRINTF (stderr, "\n");
01268     }
01269 #endif
01270 
01271 /*--------------.
01272 | yyerrhandle.  |
01273 `--------------*/
01274 yyerrhandle:
01275   yyn = yypact[yystate];
01276   if (yyn == YYFLAG)
01277     goto yyerrdefault;
01278 
01279   yyn += YYTERROR;
01280   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
01281     goto yyerrdefault;
01282 
01283   yyn = yytable[yyn];
01284   if (yyn < 0)
01285     {
01286       if (yyn == YYFLAG)
01287        goto yyerrpop;
01288       yyn = -yyn;
01289       goto yyreduce;
01290     }
01291   else if (yyn == 0)
01292     goto yyerrpop;
01293 
01294   if (yyn == YYFINAL)
01295     YYACCEPT;
01296 
01297   YYDPRINTF ((stderr, "Shifting error token, "));
01298 
01299   *++yyvsp = yylval;
01300 #if YYLSP_NEEDED
01301   *++yylsp = yylloc;
01302 #endif
01303 
01304   yystate = yyn;
01305   goto yynewstate;
01306 
01307 
01308 /*-------------------------------------.
01309 | yyacceptlab -- YYACCEPT comes here.  |
01310 `-------------------------------------*/
01311 yyacceptlab:
01312   yyresult = 0;
01313   goto yyreturn;
01314 
01315 /*-----------------------------------.
01316 | yyabortlab -- YYABORT comes here.  |
01317 `-----------------------------------*/
01318 yyabortlab:
01319   yyresult = 1;
01320   goto yyreturn;
01321 
01322 /*---------------------------------------------.
01323 | yyoverflowab -- parser overflow comes here.  |
01324 `---------------------------------------------*/
01325 yyoverflowlab:
01326   yyerror ("parser stack overflow");
01327   yyresult = 2;
01328   /* Fall through.  */
01329 
01330 yyreturn:
01331 #ifndef yyoverflow
01332   if (yyss != yyssa)
01333     YYSTACK_FREE (yyss);
01334 #endif
01335   return yyresult;
01336 }
01337 #line 229 "plural.y"
01338 
01339 
01340 void
01341 internal_function
01342 FREE_EXPRESSION (exp)
01343      struct expression *exp;
01344 {
01345   if (exp == NULL)
01346     return;
01347 
01348   /* Handle the recursive case.  */
01349   switch (exp->nargs)
01350     {
01351     case 3:
01352       FREE_EXPRESSION (exp->val.args[2]);
01353       /* FALLTHROUGH */
01354     case 2:
01355       FREE_EXPRESSION (exp->val.args[1]);
01356       /* FALLTHROUGH */
01357     case 1:
01358       FREE_EXPRESSION (exp->val.args[0]);
01359       /* FALLTHROUGH */
01360     default:
01361       break;
01362     }
01363 
01364   free (exp);
01365 }
01366 
01367 
01368 static int
01369 yylex (lval, pexp)
01370      YYSTYPE *lval;
01371      const char **pexp;
01372 {
01373   const char *exp = *pexp;
01374   int result;
01375 
01376   while (1)
01377     {
01378       if (exp[0] == '\0')
01379        {
01380          *pexp = exp;
01381          return YYEOF;
01382        }
01383 
01384       if (exp[0] != ' ' && exp[0] != '\t')
01385        break;
01386 
01387       ++exp;
01388     }
01389 
01390   result = *exp++;
01391   switch (result)
01392     {
01393     case '0': case '1': case '2': case '3': case '4':
01394     case '5': case '6': case '7': case '8': case '9':
01395       {
01396        unsigned long int n = result - '0';
01397        while (exp[0] >= '0' && exp[0] <= '9')
01398          {
01399            n *= 10;
01400            n += exp[0] - '0';
01401            ++exp;
01402          }
01403        lval->num = n;
01404        result = NUMBER;
01405       }
01406       break;
01407 
01408     case '=':
01409       if (exp[0] == '=')
01410        {
01411          ++exp;
01412          lval->op = equal;
01413          result = EQUOP2;
01414        }
01415       else
01416        result = YYERRCODE;
01417       break;
01418 
01419     case '!':
01420       if (exp[0] == '=')
01421        {
01422          ++exp;
01423          lval->op = not_equal;
01424          result = EQUOP2;
01425        }
01426       break;
01427 
01428     case '&':
01429     case '|':
01430       if (exp[0] == result)
01431        ++exp;
01432       else
01433        result = YYERRCODE;
01434       break;
01435 
01436     case '<':
01437       if (exp[0] == '=')
01438        {
01439          ++exp;
01440          lval->op = less_or_equal;
01441        }
01442       else
01443        lval->op = less_than;
01444       result = CMPOP2;
01445       break;
01446 
01447     case '>':
01448       if (exp[0] == '=')
01449        {
01450          ++exp;
01451          lval->op = greater_or_equal;
01452        }
01453       else
01454        lval->op = greater_than;
01455       result = CMPOP2;
01456       break;
01457 
01458     case '*':
01459       lval->op = mult;
01460       result = MULOP2;
01461       break;
01462 
01463     case '/':
01464       lval->op = divide;
01465       result = MULOP2;
01466       break;
01467 
01468     case '%':
01469       lval->op = module;
01470       result = MULOP2;
01471       break;
01472 
01473     case '+':
01474       lval->op = plus;
01475       result = ADDOP2;
01476       break;
01477 
01478     case '-':
01479       lval->op = minus;
01480       result = ADDOP2;
01481       break;
01482 
01483     case 'n':
01484     case '?':
01485     case ':':
01486     case '(':
01487     case ')':
01488       /* Nothing, just return the character.  */
01489       break;
01490 
01491     case ';':
01492     case '\n':
01493     case '\0':
01494       /* Be safe and let the user call this function again.  */
01495       --exp;
01496       result = YYEOF;
01497       break;
01498 
01499     default:
01500       result = YYERRCODE;
01501 #if YYDEBUG != 0
01502       --exp;
01503 #endif
01504       break;
01505     }
01506 
01507   *pexp = exp;
01508 
01509   return result;
01510 }
01511 
01512 
01513 static void
01514 yyerror (str)
01515      const char *str;
01516 {
01517   /* Do nothing.  We don't print error messages here.  */
01518 }