Back to index

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