Back to index

courier  0.68.2
plural.c
Go to the documentation of this file.
00001 /* A Bison parser, made by GNU Bison 2.3a.  */
00002 
00003 /* Skeleton implementation for Bison's Yacc-like parsers in C
00004 
00005    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
00006    Free Software Foundation, Inc.
00007 
00008    This program is free software; you can redistribute it and/or modify
00009    it under the terms of the GNU General Public License as published by
00010    the Free Software Foundation; either version 2, or (at your option)
00011    any later version.
00012 
00013    This program is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016    GNU General Public License for more details.
00017 
00018    You should have received a copy of the GNU General Public License
00019    along with this program; if not, write to the Free Software
00020    Foundation, Inc., 51 Franklin Street, Fifth Floor,
00021    Boston, MA 02110-1301, USA.  */
00022 
00023 /* As a special exception, you may create a larger work that contains
00024    part or all of the Bison parser skeleton and distribute that work
00025    under terms of your choice, so long as that work isn't itself a
00026    parser generator using the skeleton or a modified version thereof
00027    as a parser skeleton.  Alternatively, if you modify or redistribute
00028    the parser skeleton itself, you may (at your option) remove this
00029    special exception, which will cause the skeleton and the resulting
00030    Bison output files to be licensed under the GNU General Public
00031    License without this special exception.
00032 
00033    This special exception was added by the Free Software Foundation in
00034    version 2.2 of Bison.  */
00035 
00036 /* C LALR(1) parser skeleton written by Richard Stallman, by
00037    simplifying the original so-called "semantic" parser.  */
00038 
00039 /* All symbols defined below should begin with yy or YY, to avoid
00040    infringing on user name space.  This should be done even for local
00041    variables, as they might otherwise be expanded by user macros.
00042    There are some unavoidable exceptions within include files to
00043    define necessary library symbols; they are noted "INFRINGES ON
00044    USER NAME SPACE" below.  */
00045 
00046 /* Identify Bison output.  */
00047 #define YYBISON 1
00048 
00049 /* Bison version.  */
00050 #define YYBISON_VERSION "2.3a"
00051 
00052 /* Skeleton name.  */
00053 #define YYSKELETON_NAME "yacc.c"
00054 
00055 /* Pure parsers.  */
00056 #define YYPURE 1
00057 
00058 /* Using locations.  */
00059 #define YYLSP_NEEDED 0
00060 
00061 /* Substitute the variable and function names.  */
00062 #define yyparse __gettextparse
00063 #define yylex   __gettextlex
00064 #define yyerror __gettexterror
00065 #define yylval  __gettextlval
00066 #define yychar  __gettextchar
00067 #define yydebug __gettextdebug
00068 #define yynerrs __gettextnerrs
00069 
00070 
00071 /* Copy the first part of user declarations.  */
00072 /* Line 164 of yacc.c.  */
00073 #line 1 "plural.y"
00074 
00075 /* Expression parsing for plural form selection.
00076    Copyright (C) 2000-2001, 2003, 2005-2006 Free Software Foundation, Inc.
00077    Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
00078 
00079    This program is free software; you can redistribute it and/or modify it
00080    under the terms of the GNU Library General Public License as published
00081    by the Free Software Foundation; either version 2, or (at your option)
00082    any later version.
00083 
00084    This program is distributed in the hope that it will be useful,
00085    but WITHOUT ANY WARRANTY; without even the implied warranty of
00086    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00087    Library General Public License for more details.
00088 
00089    You should have received a copy of the GNU Library General Public
00090    License along with this program; if not, write to the Free Software
00091    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
00092    USA.  */
00093 
00094 /* For bison < 2.0, the bison generated parser uses alloca.  AIX 3 forces us
00095    to put this declaration at the beginning of the file.  The declaration in
00096    bison's skeleton file comes too late.  This must come before <config.h>
00097    because <config.h> may include arbitrary system headers.
00098    This can go away once the AM_INTL_SUBDIR macro requires bison >= 2.0.  */
00099 #if defined _AIX && !defined __GNUC__
00100  #pragma alloca
00101 #endif
00102 
00103 #ifdef HAVE_CONFIG_H
00104 # include <config.h>
00105 #endif
00106 
00107 #include <stddef.h>
00108 #include <stdlib.h>
00109 #include <string.h>
00110 #include "plural-exp.h"
00111 
00112 /* The main function generated by the parser is called __gettextparse,
00113    but we want it to be called PLURAL_PARSE.  */
00114 #ifndef _LIBC
00115 # define __gettextparse PLURAL_PARSE
00116 #endif
00117 
00118 #define YYLEX_PARAM  &((struct parse_args *) arg)->cp
00119 #define YYPARSE_PARAM       arg
00120 
00121 
00122 /* Enabling traces.  */
00123 #ifndef YYDEBUG
00124 # define YYDEBUG 0
00125 #endif
00126 
00127 /* Enabling verbose error messages.  */
00128 #ifdef YYERROR_VERBOSE
00129 # undef YYERROR_VERBOSE
00130 # define YYERROR_VERBOSE 1
00131 #else
00132 # define YYERROR_VERBOSE 0
00133 #endif
00134 
00135 /* Enabling the token table.  */
00136 #ifndef YYTOKEN_TABLE
00137 # define YYTOKEN_TABLE 0
00138 #endif
00139 
00140 
00141 /* Tokens.  */
00142 #ifndef YYTOKENTYPE
00143 # define YYTOKENTYPE
00144    /* Put the tokens into the symbol table, so that GDB and other debuggers
00145       know about them.  */
00146    enum yytokentype {
00147      EQUOP2 = 258,
00148      CMPOP2 = 259,
00149      ADDOP2 = 260,
00150      MULOP2 = 261,
00151      NUMBER = 262
00152    };
00153 #endif
00154 /* Tokens.  */
00155 #define EQUOP2 258
00156 #define CMPOP2 259
00157 #define ADDOP2 260
00158 #define MULOP2 261
00159 #define NUMBER 262
00160 
00161 
00162 
00163 
00164 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
00165 typedef union YYSTYPE
00166 {/* Line 191 of yacc.c.  */
00167 #line 51 "plural.y"
00168 
00169   unsigned long int num;
00170   enum expression_operator op;
00171   struct expression *exp;
00172 }
00173 /* Line 191 of yacc.c.  */
00174 #line 175 "plural.c"
00175        YYSTYPE;
00176 # define YYSTYPE_IS_TRIVIAL 1
00177 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
00178 # define YYSTYPE_IS_DECLARED 1
00179 #endif
00180 
00181 
00182 
00183 
00184 /* Copy the second part of user declarations.  */
00185 /* Line 221 of yacc.c.  */
00186 #line 57 "plural.y"
00187 
00188 /* Prototypes for local functions.  */
00189 static int yylex (YYSTYPE *lval, const char **pexp);
00190 static void yyerror (const char *str);
00191 
00192 /* Allocation of expressions.  */
00193 
00194 static struct expression *
00195 new_exp (int nargs, enum expression_operator op,
00196         struct expression * const *args)
00197 {
00198   int i;
00199   struct expression *newp;
00200 
00201   /* If any of the argument could not be malloc'ed, just return NULL.  */
00202   for (i = nargs - 1; i >= 0; i--)
00203     if (args[i] == NULL)
00204       goto fail;
00205 
00206   /* Allocate a new expression.  */
00207   newp = (struct expression *) malloc (sizeof (*newp));
00208   if (newp != NULL)
00209     {
00210       newp->nargs = nargs;
00211       newp->operation = op;
00212       for (i = nargs - 1; i >= 0; i--)
00213        newp->val.args[i] = args[i];
00214       return newp;
00215     }
00216 
00217  fail:
00218   for (i = nargs - 1; i >= 0; i--)
00219     FREE_EXPRESSION (args[i]);
00220 
00221   return NULL;
00222 }
00223 
00224 static inline struct expression *
00225 new_exp_0 (enum expression_operator op)
00226 {
00227   return new_exp (0, op, NULL);
00228 }
00229 
00230 static inline struct expression *
00231 new_exp_1 (enum expression_operator op, struct expression *right)
00232 {
00233   struct expression *args[1];
00234 
00235   args[0] = right;
00236   return new_exp (1, op, args);
00237 }
00238 
00239 static struct expression *
00240 new_exp_2 (enum expression_operator op, struct expression *left,
00241           struct expression *right)
00242 {
00243   struct expression *args[2];
00244 
00245   args[0] = left;
00246   args[1] = right;
00247   return new_exp (2, op, args);
00248 }
00249 
00250 static inline struct expression *
00251 new_exp_3 (enum expression_operator op, struct expression *bexp,
00252           struct expression *tbranch, struct expression *fbranch)
00253 {
00254   struct expression *args[3];
00255 
00256   args[0] = bexp;
00257   args[1] = tbranch;
00258   args[2] = fbranch;
00259   return new_exp (3, op, args);
00260 }
00261 
00262 
00263 /* Line 221 of yacc.c.  */
00264 #line 265 "plural.c"
00265 
00266 #ifdef short
00267 # undef short
00268 #endif
00269 
00270 #ifdef YYTYPE_UINT8
00271 typedef YYTYPE_UINT8 yytype_uint8;
00272 #else
00273 typedef unsigned char yytype_uint8;
00274 #endif
00275 
00276 #ifdef YYTYPE_INT8
00277 typedef YYTYPE_INT8 yytype_int8;
00278 #elif (defined __STDC__ || defined __C99__FUNC__ \
00279      || defined __cplusplus || defined _MSC_VER)
00280 typedef signed char yytype_int8;
00281 #else
00282 typedef short int yytype_int8;
00283 #endif
00284 
00285 #ifdef YYTYPE_UINT16
00286 typedef YYTYPE_UINT16 yytype_uint16;
00287 #else
00288 typedef unsigned short int yytype_uint16;
00289 #endif
00290 
00291 #ifdef YYTYPE_INT16
00292 typedef YYTYPE_INT16 yytype_int16;
00293 #else
00294 typedef short int yytype_int16;
00295 #endif
00296 
00297 #ifndef YYSIZE_T
00298 # ifdef __SIZE_TYPE__
00299 #  define YYSIZE_T __SIZE_TYPE__
00300 # elif defined size_t
00301 #  define YYSIZE_T size_t
00302 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
00303      || defined __cplusplus || defined _MSC_VER)
00304 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
00305 #  define YYSIZE_T size_t
00306 # else
00307 #  define YYSIZE_T unsigned int
00308 # endif
00309 #endif
00310 
00311 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
00312 
00313 #ifndef YY_
00314 # if YYENABLE_NLS
00315 #  if ENABLE_NLS
00316 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
00317 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
00318 #  endif
00319 # endif
00320 # ifndef YY_
00321 #  define YY_(msgid) msgid
00322 # endif
00323 #endif
00324 
00325 /* Suppress unused-variable warnings by "using" E.  */
00326 #if ! defined lint || defined __GNUC__
00327 # define YYUSE(e) ((void) (e))
00328 #else
00329 # define YYUSE(e) /* empty */
00330 #endif
00331 
00332 /* Identity function, used to suppress warnings about constant conditions.  */
00333 #ifndef lint
00334 # define YYID(n) (n)
00335 #else
00336 #if (defined __STDC__ || defined __C99__FUNC__ \
00337      || defined __cplusplus || defined _MSC_VER)
00338 static int
00339 YYID (int yyi)
00340 #else
00341 static int
00342 YYID (yyi)
00343     int yyi;
00344 #endif
00345 {
00346   return yyi;
00347 }
00348 #endif
00349 
00350 #if ! defined yyoverflow || YYERROR_VERBOSE
00351 
00352 /* The parser invokes alloca or malloc; define the necessary symbols.  */
00353 
00354 # ifdef YYSTACK_USE_ALLOCA
00355 #  if YYSTACK_USE_ALLOCA
00356 #   ifdef __GNUC__
00357 #    define YYSTACK_ALLOC __builtin_alloca
00358 #   elif defined __BUILTIN_VA_ARG_INCR
00359 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
00360 #   elif defined _AIX
00361 #    define YYSTACK_ALLOC __alloca
00362 #   elif defined _MSC_VER
00363 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
00364 #    define alloca _alloca
00365 #   else
00366 #    define YYSTACK_ALLOC alloca
00367 #    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00368      || defined __cplusplus || defined _MSC_VER)
00369 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
00370 #     ifndef _STDLIB_H
00371 #      define _STDLIB_H 1
00372 #     endif
00373 #    endif
00374 #   endif
00375 #  endif
00376 # endif
00377 
00378 # ifdef YYSTACK_ALLOC
00379    /* Pacify GCC's `empty if-body' warning.  */
00380 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
00381 #  ifndef YYSTACK_ALLOC_MAXIMUM
00382     /* The OS might guarantee only one guard page at the bottom of the stack,
00383        and a page size can be as small as 4096 bytes.  So we cannot safely
00384        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
00385        to allow for a few compiler-allocated temporary stack slots.  */
00386 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
00387 #  endif
00388 # else
00389 #  define YYSTACK_ALLOC YYMALLOC
00390 #  define YYSTACK_FREE YYFREE
00391 #  ifndef YYSTACK_ALLOC_MAXIMUM
00392 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
00393 #  endif
00394 #  if (defined __cplusplus && ! defined _STDLIB_H \
00395        && ! ((defined YYMALLOC || defined malloc) \
00396             && (defined YYFREE || defined free)))
00397 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
00398 #   ifndef _STDLIB_H
00399 #    define _STDLIB_H 1
00400 #   endif
00401 #  endif
00402 #  ifndef YYMALLOC
00403 #   define YYMALLOC malloc
00404 #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00405      || defined __cplusplus || defined _MSC_VER)
00406 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
00407 #   endif
00408 #  endif
00409 #  ifndef YYFREE
00410 #   define YYFREE free
00411 #   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00412      || defined __cplusplus || defined _MSC_VER)
00413 void free (void *); /* INFRINGES ON USER NAME SPACE */
00414 #   endif
00415 #  endif
00416 # endif
00417 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
00418 
00419 
00420 #if (! defined yyoverflow \
00421      && (! defined __cplusplus \
00422         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
00423 
00424 /* A type that is properly aligned for any stack member.  */
00425 union yyalloc
00426 {
00427   yytype_int16 yyss;
00428   YYSTYPE yyvs;
00429   };
00430 
00431 /* The size of the maximum gap between one aligned stack and the next.  */
00432 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
00433 
00434 /* The size of an array large to enough to hold all stacks, each with
00435    N elements.  */
00436 # define YYSTACK_BYTES(N) \
00437      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
00438       + YYSTACK_GAP_MAXIMUM)
00439 
00440 /* Copy COUNT objects from FROM to TO.  The source and destination do
00441    not overlap.  */
00442 # ifndef YYCOPY
00443 #  if defined __GNUC__ && 1 < __GNUC__
00444 #   define YYCOPY(To, From, Count) \
00445       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
00446 #  else
00447 #   define YYCOPY(To, From, Count)        \
00448       do                                  \
00449        {                                  \
00450          YYSIZE_T yyi;                           \
00451          for (yyi = 0; yyi < (Count); yyi++)     \
00452            (To)[yyi] = (From)[yyi];              \
00453        }                                  \
00454       while (YYID (0))
00455 #  endif
00456 # endif
00457 
00458 /* Relocate STACK from its old location to the new one.  The
00459    local variables YYSIZE and YYSTACKSIZE give the old and new number of
00460    elements in the stack, and YYPTR gives the new location of the
00461    stack.  Advance YYPTR to a properly aligned location for the next
00462    stack.  */
00463 # define YYSTACK_RELOCATE(Stack)                               \
00464     do                                                         \
00465       {                                                               \
00466        YYSIZE_T yynewbytes;                                    \
00467        YYCOPY (&yyptr->Stack, Stack, yysize);                         \
00468        Stack = &yyptr->Stack;                                         \
00469        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
00470        yyptr += yynewbytes / sizeof (*yyptr);                         \
00471       }                                                               \
00472     while (YYID (0))
00473 
00474 #endif
00475 
00476 /* YYFINAL -- State number of the termination state.  */
00477 #define YYFINAL  9
00478 /* YYLAST -- Last index in YYTABLE.  */
00479 #define YYLAST   54
00480 
00481 /* YYNTOKENS -- Number of terminals.  */
00482 #define YYNTOKENS  16
00483 /* YYNNTS -- Number of nonterminals.  */
00484 #define YYNNTS  3
00485 /* YYNRULES -- Number of rules.  */
00486 #define YYNRULES  13
00487 /* YYNRULES -- Number of states.  */
00488 #define YYNSTATES  27
00489 
00490 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
00491 #define YYUNDEFTOK  2
00492 #define YYMAXUTOK   262
00493 
00494 #define YYTRANSLATE(YYX)                                       \
00495   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
00496 
00497 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
00498 static const yytype_uint8 yytranslate[] =
00499 {
00500        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00501        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00502        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00503        2,     2,     2,    10,     2,     2,     2,     2,     5,     2,
00504       14,    15,     2,     2,     2,     2,     2,     2,     2,     2,
00505        2,     2,     2,     2,     2,     2,     2,     2,    12,     2,
00506        2,     2,     2,     3,     2,     2,     2,     2,     2,     2,
00507        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00508        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00509        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00510        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00511       13,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00512        2,     2,     2,     2,     4,     2,     2,     2,     2,     2,
00513        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00514        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00515        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00516        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00517        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00518        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00519        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00520        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00521        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00522        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00523        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00524        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00525        2,     2,     2,     2,     2,     2,     1,     2,     6,     7,
00526        8,     9,    11
00527 };
00528 
00529 #if YYDEBUG
00530 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
00531    YYRHS.  */
00532 static const yytype_uint8 yyprhs[] =
00533 {
00534        0,     0,     3,     5,    11,    15,    19,    23,    27,    31,
00535       35,    38,    40,    42
00536 };
00537 
00538 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
00539 static const yytype_int8 yyrhs[] =
00540 {
00541       17,     0,    -1,    18,    -1,    18,     3,    18,    12,    18,
00542       -1,    18,     4,    18,    -1,    18,     5,    18,    -1,    18,
00543        6,    18,    -1,    18,     7,    18,    -1,    18,     8,    18,
00544       -1,    18,     9,    18,    -1,    10,    18,    -1,    13,    -1,
00545       11,    -1,    14,    18,    15,    -1
00546 };
00547 
00548 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
00549 static const yytype_uint8 yyrline[] =
00550 {
00551        0,   154,   154,   162,   166,   170,   174,   178,   182,   186,
00552      190,   194,   198,   203
00553 };
00554 #endif
00555 
00556 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
00557 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
00558    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
00559 static const char *const yytname[] =
00560 {
00561   "$end", "error", "$undefined", "'?'", "'|'", "'&'", "EQUOP2", "CMPOP2",
00562   "ADDOP2", "MULOP2", "'!'", "NUMBER", "':'", "'n'", "'('", "')'",
00563   "$accept", "start", "exp", 0
00564 };
00565 #endif
00566 
00567 # ifdef YYPRINT
00568 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
00569    token YYLEX-NUM.  */
00570 static const yytype_uint16 yytoknum[] =
00571 {
00572        0,   256,   257,    63,   124,    38,   258,   259,   260,   261,
00573       33,   262,    58,   110,    40,    41
00574 };
00575 # endif
00576 
00577 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
00578 static const yytype_uint8 yyr1[] =
00579 {
00580        0,    16,    17,    18,    18,    18,    18,    18,    18,    18,
00581       18,    18,    18,    18
00582 };
00583 
00584 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
00585 static const yytype_uint8 yyr2[] =
00586 {
00587        0,     2,     1,     5,     3,     3,     3,     3,     3,     3,
00588        2,     1,     1,     3
00589 };
00590 
00591 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
00592    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
00593    means the default is an error.  */
00594 static const yytype_uint8 yydefact[] =
00595 {
00596        0,     0,    12,    11,     0,     0,     2,    10,     0,     1,
00597        0,     0,     0,     0,     0,     0,     0,    13,     0,     4,
00598        5,     6,     7,     8,     9,     0,     3
00599 };
00600 
00601 /* YYDEFGOTO[NTERM-NUM].  */
00602 static const yytype_int8 yydefgoto[] =
00603 {
00604       -1,     5,     6
00605 };
00606 
00607 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
00608    STATE-NUM.  */
00609 #define YYPACT_NINF -10
00610 static const yytype_int8 yypact[] =
00611 {
00612       -9,    -9,   -10,   -10,    -9,     8,    36,   -10,    13,   -10,
00613       -9,    -9,    -9,    -9,    -9,    -9,    -9,   -10,    26,    41,
00614       45,    18,    -2,    14,   -10,    -9,    36
00615 };
00616 
00617 /* YYPGOTO[NTERM-NUM].  */
00618 static const yytype_int8 yypgoto[] =
00619 {
00620      -10,   -10,    -1
00621 };
00622 
00623 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
00624    positive, shift that token.  If negative, reduce the rule which
00625    number is the opposite.  If zero, do what YYDEFACT says.
00626    If YYTABLE_NINF, syntax error.  */
00627 #define YYTABLE_NINF -1
00628 static const yytype_uint8 yytable[] =
00629 {
00630        7,     1,     2,     8,     3,     4,    15,    16,     9,    18,
00631       19,    20,    21,    22,    23,    24,    10,    11,    12,    13,
00632       14,    15,    16,    16,    26,    14,    15,    16,    17,    10,
00633       11,    12,    13,    14,    15,    16,     0,     0,    25,    10,
00634       11,    12,    13,    14,    15,    16,    12,    13,    14,    15,
00635       16,    13,    14,    15,    16
00636 };
00637 
00638 static const yytype_int8 yycheck[] =
00639 {
00640        1,    10,    11,     4,    13,    14,     8,     9,     0,    10,
00641       11,    12,    13,    14,    15,    16,     3,     4,     5,     6,
00642        7,     8,     9,     9,    25,     7,     8,     9,    15,     3,
00643        4,     5,     6,     7,     8,     9,    -1,    -1,    12,     3,
00644        4,     5,     6,     7,     8,     9,     5,     6,     7,     8,
00645        9,     6,     7,     8,     9
00646 };
00647 
00648 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
00649    symbol of state STATE-NUM.  */
00650 static const yytype_uint8 yystos[] =
00651 {
00652        0,    10,    11,    13,    14,    17,    18,    18,    18,     0,
00653        3,     4,     5,     6,     7,     8,     9,    15,    18,    18,
00654       18,    18,    18,    18,    18,    12,    18
00655 };
00656 
00657 #define yyerrok             (yyerrstatus = 0)
00658 #define yyclearin    (yychar = YYEMPTY)
00659 #define YYEMPTY             (-2)
00660 #define YYEOF        0
00661 
00662 #define YYACCEPT     goto yyacceptlab
00663 #define YYABORT             goto yyabortlab
00664 #define YYERROR             goto yyerrorlab
00665 
00666 
00667 /* Like YYERROR except do call yyerror.  This remains here temporarily
00668    to ease the transition to the new meaning of YYERROR, for GCC.
00669    Once GCC version 2 has supplanted version 1, this can go.  */
00670 
00671 #define YYFAIL              goto yyerrlab
00672 
00673 #define YYRECOVERING()  (!!yyerrstatus)
00674 
00675 #define YYBACKUP(Token, Value)                                 \
00676 do                                                      \
00677   if (yychar == YYEMPTY && yylen == 1)                         \
00678     {                                                   \
00679       yychar = (Token);                                        \
00680       yylval = (Value);                                        \
00681       yytoken = YYTRANSLATE (yychar);                          \
00682       YYPOPSTACK (1);                                          \
00683       goto yybackup;                                    \
00684     }                                                   \
00685   else                                                  \
00686     {                                                   \
00687       yyerror (YY_("syntax error: cannot back up")); \
00688       YYERROR;                                                 \
00689     }                                                   \
00690 while (YYID (0))
00691 
00692 
00693 #define YYTERROR     1
00694 #define YYERRCODE    256
00695 
00696 
00697 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
00698    If N is 0, then set CURRENT to the empty location which ends
00699    the previous symbol: RHS[0] (always defined).  */
00700 
00701 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
00702 #ifndef YYLLOC_DEFAULT
00703 # define YYLLOC_DEFAULT(Current, Rhs, N)                       \
00704     do                                                         \
00705       if (YYID (N))                                                    \
00706        {                                                       \
00707          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;       \
00708          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;     \
00709          (Current).last_line    = YYRHSLOC (Rhs, N).last_line;        \
00710          (Current).last_column  = YYRHSLOC (Rhs, N).last_column;      \
00711        }                                                       \
00712       else                                                     \
00713        {                                                       \
00714          (Current).first_line   = (Current).last_line   =             \
00715            YYRHSLOC (Rhs, 0).last_line;                        \
00716          (Current).first_column = (Current).last_column =             \
00717            YYRHSLOC (Rhs, 0).last_column;                      \
00718        }                                                       \
00719     while (YYID (0))
00720 #endif
00721 
00722 
00723 /* YY_LOCATION_PRINT -- Print the location on the stream.
00724    This macro was not mandated originally: define only if we know
00725    we won't break user code: when these are the locations we know.  */
00726 
00727 #ifndef YY_LOCATION_PRINT
00728 # if YYLTYPE_IS_TRIVIAL
00729 #  define YY_LOCATION_PRINT(File, Loc)                  \
00730      fprintf (File, "%d.%d-%d.%d",               \
00731              (Loc).first_line, (Loc).first_column,      \
00732              (Loc).last_line,  (Loc).last_column)
00733 # else
00734 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
00735 # endif
00736 #endif
00737 
00738 
00739 /* YYLEX -- calling `yylex' with the right arguments.  */
00740 
00741 #ifdef YYLEX_PARAM
00742 # define YYLEX yylex (&yylval, YYLEX_PARAM)
00743 #else
00744 # define YYLEX yylex (&yylval)
00745 #endif
00746 
00747 /* Enable debugging if requested.  */
00748 #if YYDEBUG
00749 
00750 # ifndef YYFPRINTF
00751 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
00752 #  define YYFPRINTF fprintf
00753 # endif
00754 
00755 # define YYDPRINTF(Args)                  \
00756 do {                                      \
00757   if (yydebug)                                   \
00758     YYFPRINTF Args;                       \
00759 } while (YYID (0))
00760 
00761 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                  \
00762 do {                                                             \
00763   if (yydebug)                                                          \
00764     {                                                            \
00765       YYFPRINTF (stderr, "%s ", Title);                                 \
00766       yy_symbol_print (stderr,                                          \
00767                 Type, Value); \
00768       YYFPRINTF (stderr, "\n");                                         \
00769     }                                                            \
00770 } while (YYID (0))
00771 
00772 
00773 /*--------------------------------.
00774 | Print this symbol on YYOUTPUT.  |
00775 `--------------------------------*/
00776 
00777 /*ARGSUSED*/
00778 #if (defined __STDC__ || defined __C99__FUNC__ \
00779      || defined __cplusplus || defined _MSC_VER)
00780 static void
00781 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
00782 #else
00783 static void
00784 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
00785     FILE *yyoutput;
00786     int yytype;
00787     YYSTYPE const * const yyvaluep;
00788 #endif
00789 {
00790   if (!yyvaluep)
00791     return;
00792 # ifdef YYPRINT
00793   if (yytype < YYNTOKENS)
00794     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
00795 # else
00796   YYUSE (yyoutput);
00797 # endif
00798   switch (yytype)
00799     {
00800       default:
00801        break;
00802     }
00803 }
00804 
00805 
00806 /*--------------------------------.
00807 | Print this symbol on YYOUTPUT.  |
00808 `--------------------------------*/
00809 
00810 #if (defined __STDC__ || defined __C99__FUNC__ \
00811      || defined __cplusplus || defined _MSC_VER)
00812 static void
00813 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
00814 #else
00815 static void
00816 yy_symbol_print (yyoutput, yytype, yyvaluep)
00817     FILE *yyoutput;
00818     int yytype;
00819     YYSTYPE const * const yyvaluep;
00820 #endif
00821 {
00822   if (yytype < YYNTOKENS)
00823     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
00824   else
00825     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
00826 
00827   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
00828   YYFPRINTF (yyoutput, ")");
00829 }
00830 
00831 /*------------------------------------------------------------------.
00832 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
00833 | TOP (included).                                                   |
00834 `------------------------------------------------------------------*/
00835 
00836 #if (defined __STDC__ || defined __C99__FUNC__ \
00837      || defined __cplusplus || defined _MSC_VER)
00838 static void
00839 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
00840 #else
00841 static void
00842 yy_stack_print (yybottom, yytop)
00843     yytype_int16 *yybottom;
00844     yytype_int16 *yytop;
00845 #endif
00846 {
00847   YYFPRINTF (stderr, "Stack now");
00848   for (; yybottom <= yytop; yybottom++)
00849     {
00850       int yybot = *yybottom;
00851       YYFPRINTF (stderr, " %d", yybot);
00852     }
00853   YYFPRINTF (stderr, "\n");
00854 }
00855 
00856 # define YY_STACK_PRINT(Bottom, Top)                           \
00857 do {                                                    \
00858   if (yydebug)                                                 \
00859     yy_stack_print ((Bottom), (Top));                          \
00860 } while (YYID (0))
00861 
00862 
00863 /*------------------------------------------------.
00864 | Report that the YYRULE is going to be reduced.  |
00865 `------------------------------------------------*/
00866 
00867 #if (defined __STDC__ || defined __C99__FUNC__ \
00868      || defined __cplusplus || defined _MSC_VER)
00869 static void
00870 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
00871 #else
00872 static void
00873 yy_reduce_print (yyvsp, yyrule)
00874     YYSTYPE *yyvsp;
00875     int yyrule;
00876 #endif
00877 {
00878   int yynrhs = yyr2[yyrule];
00879   int yyi;
00880   unsigned long int yylno = yyrline[yyrule];
00881   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
00882             yyrule - 1, yylno);
00883   /* The symbols being reduced.  */
00884   for (yyi = 0; yyi < yynrhs; yyi++)
00885     {
00886       fprintf (stderr, "   $%d = ", yyi + 1);
00887       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
00888                      &(yyvsp[(yyi + 1) - (yynrhs)])
00889                                           );
00890       fprintf (stderr, "\n");
00891     }
00892 }
00893 
00894 # define YY_REDUCE_PRINT(Rule)            \
00895 do {                               \
00896   if (yydebug)                            \
00897     yy_reduce_print (yyvsp, Rule); \
00898 } while (YYID (0))
00899 
00900 /* Nonzero means print parse trace.  It is left uninitialized so that
00901    multiple parsers can coexist.  */
00902 int yydebug;
00903 #else /* !YYDEBUG */
00904 # define YYDPRINTF(Args)
00905 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
00906 # define YY_STACK_PRINT(Bottom, Top)
00907 # define YY_REDUCE_PRINT(Rule)
00908 #endif /* !YYDEBUG */
00909 
00910 
00911 /* YYINITDEPTH -- initial size of the parser's stacks.  */
00912 #ifndef       YYINITDEPTH
00913 # define YYINITDEPTH 200
00914 #endif
00915 
00916 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
00917    if the built-in stack extension method is used).
00918 
00919    Do not make this value too large; the results are undefined if
00920    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
00921    evaluated with infinite-precision integer arithmetic.  */
00922 
00923 #ifndef YYMAXDEPTH
00924 # define YYMAXDEPTH 10000
00925 #endif
00926 
00927 
00928 
00929 #if YYERROR_VERBOSE
00930 
00931 # ifndef yystrlen
00932 #  if defined __GLIBC__ && defined _STRING_H
00933 #   define yystrlen strlen
00934 #  else
00935 /* Return the length of YYSTR.  */
00936 #if (defined __STDC__ || defined __C99__FUNC__ \
00937      || defined __cplusplus || defined _MSC_VER)
00938 static YYSIZE_T
00939 yystrlen (const char *yystr)
00940 #else
00941 static YYSIZE_T
00942 yystrlen (yystr)
00943     const char *yystr;
00944 #endif
00945 {
00946   YYSIZE_T yylen;
00947   for (yylen = 0; yystr[yylen]; yylen++)
00948     continue;
00949   return yylen;
00950 }
00951 #  endif
00952 # endif
00953 
00954 # ifndef yystpcpy
00955 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
00956 #   define yystpcpy stpcpy
00957 #  else
00958 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
00959    YYDEST.  */
00960 #if (defined __STDC__ || defined __C99__FUNC__ \
00961      || defined __cplusplus || defined _MSC_VER)
00962 static char *
00963 yystpcpy (char *yydest, const char *yysrc)
00964 #else
00965 static char *
00966 yystpcpy (yydest, yysrc)
00967     char *yydest;
00968     const char *yysrc;
00969 #endif
00970 {
00971   char *yyd = yydest;
00972   const char *yys = yysrc;
00973 
00974   while ((*yyd++ = *yys++) != '\0')
00975     continue;
00976 
00977   return yyd - 1;
00978 }
00979 #  endif
00980 # endif
00981 
00982 # ifndef yytnamerr
00983 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
00984    quotes and backslashes, so that it's suitable for yyerror.  The
00985    heuristic is that double-quoting is unnecessary unless the string
00986    contains an apostrophe, a comma, or backslash (other than
00987    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
00988    null, do not copy; instead, return the length of what the result
00989    would have been.  */
00990 static YYSIZE_T
00991 yytnamerr (char *yyres, const char *yystr)
00992 {
00993   if (*yystr == '"')
00994     {
00995       YYSIZE_T yyn = 0;
00996       char const *yyp = yystr;
00997 
00998       for (;;)
00999        switch (*++yyp)
01000          {
01001          case '\'':
01002          case ',':
01003            goto do_not_strip_quotes;
01004 
01005          case '\\':
01006            if (*++yyp != '\\')
01007              goto do_not_strip_quotes;
01008            /* Fall through.  */
01009          default:
01010            if (yyres)
01011              yyres[yyn] = *yyp;
01012            yyn++;
01013            break;
01014 
01015          case '"':
01016            if (yyres)
01017              yyres[yyn] = '\0';
01018            return yyn;
01019          }
01020     do_not_strip_quotes: ;
01021     }
01022 
01023   if (! yyres)
01024     return yystrlen (yystr);
01025 
01026   return yystpcpy (yyres, yystr) - yyres;
01027 }
01028 # endif
01029 
01030 /* Copy into YYRESULT an error message about the unexpected token
01031    YYCHAR while in state YYSTATE.  Return the number of bytes copied,
01032    including the terminating null byte.  If YYRESULT is null, do not
01033    copy anything; just return the number of bytes that would be
01034    copied.  As a special case, return 0 if an ordinary "syntax error"
01035    message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
01036    size calculation.  */
01037 static YYSIZE_T
01038 yysyntax_error (char *yyresult, int yystate, int yychar)
01039 {
01040   int yyn = yypact[yystate];
01041 
01042   if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
01043     return 0;
01044   else
01045     {
01046       int yytype = YYTRANSLATE (yychar);
01047       YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
01048       YYSIZE_T yysize = yysize0;
01049       YYSIZE_T yysize1;
01050       int yysize_overflow = 0;
01051       enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
01052       char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
01053       int yyx;
01054 
01055 # if 0
01056       /* This is so xgettext sees the translatable formats that are
01057         constructed on the fly.  */
01058       YY_("syntax error, unexpected %s");
01059       YY_("syntax error, unexpected %s, expecting %s");
01060       YY_("syntax error, unexpected %s, expecting %s or %s");
01061       YY_("syntax error, unexpected %s, expecting %s or %s or %s");
01062       YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
01063 # endif
01064       char *yyfmt;
01065       char const *yyf;
01066       static char const yyunexpected[] = "syntax error, unexpected %s";
01067       static char const yyexpecting[] = ", expecting %s";
01068       static char const yyor[] = " or %s";
01069       char yyformat[sizeof yyunexpected
01070                   + sizeof yyexpecting - 1
01071                   + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
01072                      * (sizeof yyor - 1))];
01073       char const *yyprefix = yyexpecting;
01074 
01075       /* Start YYX at -YYN if negative to avoid negative indexes in
01076         YYCHECK.  */
01077       int yyxbegin = yyn < 0 ? -yyn : 0;
01078 
01079       /* Stay within bounds of both yycheck and yytname.  */
01080       int yychecklim = YYLAST - yyn + 1;
01081       int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
01082       int yycount = 1;
01083 
01084       yyarg[0] = yytname[yytype];
01085       yyfmt = yystpcpy (yyformat, yyunexpected);
01086 
01087       for (yyx = yyxbegin; yyx < yyxend; ++yyx)
01088        if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
01089          {
01090            if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
01091              {
01092               yycount = 1;
01093               yysize = yysize0;
01094               yyformat[sizeof yyunexpected - 1] = '\0';
01095               break;
01096              }
01097            yyarg[yycount++] = yytname[yyx];
01098            yysize1 = yysize + yytnamerr (0, yytname[yyx]);
01099            yysize_overflow |= (yysize1 < yysize);
01100            yysize = yysize1;
01101            yyfmt = yystpcpy (yyfmt, yyprefix);
01102            yyprefix = yyor;
01103          }
01104 
01105       yyf = YY_(yyformat);
01106       yysize1 = yysize + yystrlen (yyf);
01107       yysize_overflow |= (yysize1 < yysize);
01108       yysize = yysize1;
01109 
01110       if (yysize_overflow)
01111        return YYSIZE_MAXIMUM;
01112 
01113       if (yyresult)
01114        {
01115          /* Avoid sprintf, as that infringes on the user's name space.
01116             Don't have undefined behavior even if the translation
01117             produced a string with the wrong number of "%s"s.  */
01118          char *yyp = yyresult;
01119          int yyi = 0;
01120          while ((*yyp = *yyf) != '\0')
01121            {
01122              if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
01123               {
01124                 yyp += yytnamerr (yyp, yyarg[yyi++]);
01125                 yyf += 2;
01126               }
01127              else
01128               {
01129                 yyp++;
01130                 yyf++;
01131               }
01132            }
01133        }
01134       return yysize;
01135     }
01136 }
01137 #endif /* YYERROR_VERBOSE */
01138 
01139 
01140 /*-----------------------------------------------.
01141 | Release the memory associated to this symbol.  |
01142 `-----------------------------------------------*/
01143 
01144 /*ARGSUSED*/
01145 #if (defined __STDC__ || defined __C99__FUNC__ \
01146      || defined __cplusplus || defined _MSC_VER)
01147 static void
01148 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
01149 #else
01150 static void
01151 yydestruct (yymsg, yytype, yyvaluep)
01152     const char *yymsg;
01153     int yytype;
01154     YYSTYPE *yyvaluep;
01155 #endif
01156 {
01157   YYUSE (yyvaluep);
01158 
01159   if (!yymsg)
01160     yymsg = "Deleting";
01161   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
01162 
01163   switch (yytype)
01164     {
01165 
01166       default:
01167        break;
01168     }
01169 }
01170 
01171 
01172 /* Prevent warnings from -Wmissing-prototypes.  */
01173 
01174 #ifdef YYPARSE_PARAM
01175 #if defined __STDC__ || defined __cplusplus
01176 int yyparse (void *YYPARSE_PARAM);
01177 #else
01178 int yyparse ();
01179 #endif
01180 #else /* ! YYPARSE_PARAM */
01181 #if defined __STDC__ || defined __cplusplus
01182 int yyparse (void);
01183 #else
01184 int yyparse ();
01185 #endif
01186 #endif /* ! YYPARSE_PARAM */
01187 
01188 
01189 
01190 
01191 
01192 
01193 /*----------.
01194 | yyparse.  |
01195 `----------*/
01196 
01197 #ifdef YYPARSE_PARAM
01198 #if (defined __STDC__ || defined __C99__FUNC__ \
01199      || defined __cplusplus || defined _MSC_VER)
01200 int
01201 yyparse (void *YYPARSE_PARAM)
01202 #else
01203 int
01204 yyparse (YYPARSE_PARAM)
01205     void *YYPARSE_PARAM;
01206 #endif
01207 #else /* ! YYPARSE_PARAM */
01208 #if (defined __STDC__ || defined __C99__FUNC__ \
01209      || defined __cplusplus || defined _MSC_VER)
01210 int
01211 yyparse (void)
01212 #else
01213 int
01214 yyparse ()
01215 
01216 #endif
01217 #endif
01218 {
01219   /* The lookahead symbol.  */
01220 int yychar;
01221 
01222 /* The semantic value of the lookahead symbol.  */
01223 YYSTYPE yylval;
01224 
01225 /* Number of syntax errors so far.  */
01226 int yynerrs;
01227 
01228   int yystate;
01229   int yyn;
01230   int yyresult;
01231   /* Number of tokens to shift before error messages enabled.  */
01232   int yyerrstatus;
01233   /* Lookahead token as an internal (translated) token number.  */
01234   int yytoken = 0;
01235 #if YYERROR_VERBOSE
01236   /* Buffer for error messages, and its allocated size.  */
01237   char yymsgbuf[128];
01238   char *yymsg = yymsgbuf;
01239   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
01240 #endif
01241 
01242   /* Three stacks and their tools:
01243      `yyss': related to states,
01244      `yyvs': related to semantic values,
01245      `yyls': related to locations.
01246 
01247      Refer to the stacks thru separate pointers, to allow yyoverflow
01248      to reallocate them elsewhere.  */
01249 
01250   /* The state stack.  */
01251   yytype_int16 yyssa[YYINITDEPTH];
01252   yytype_int16 *yyss = yyssa;
01253   yytype_int16 *yyssp;
01254 
01255   /* The semantic value stack.  */
01256   YYSTYPE yyvsa[YYINITDEPTH];
01257   YYSTYPE *yyvs = yyvsa;
01258   YYSTYPE *yyvsp;
01259 
01260 
01261 
01262 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
01263 
01264   YYSIZE_T yystacksize = YYINITDEPTH;
01265 
01266   /* The variables used to return semantic value and location from the
01267      action routines.  */
01268   YYSTYPE yyval;
01269 
01270 
01271   /* The number of symbols on the RHS of the reduced rule.
01272      Keep to zero when no symbol should be popped.  */
01273   int yylen = 0;
01274 
01275   YYDPRINTF ((stderr, "Starting parse\n"));
01276 
01277   yystate = 0;
01278   yyerrstatus = 0;
01279   yynerrs = 0;
01280   yychar = YYEMPTY;         /* Cause a token to be read.  */
01281 
01282   /* Initialize stack pointers.
01283      Waste one element of value and location stack
01284      so that they stay on the same level as the state stack.
01285      The wasted elements are never initialized.  */
01286 
01287   yyssp = yyss;
01288   yyvsp = yyvs;
01289 
01290   goto yysetstate;
01291 
01292 /*------------------------------------------------------------.
01293 | yynewstate -- Push a new state, which is found in yystate.  |
01294 `------------------------------------------------------------*/
01295  yynewstate:
01296   /* In all cases, when you get here, the value and location stacks
01297      have just been pushed.  So pushing a state here evens the stacks.  */
01298   yyssp++;
01299 
01300  yysetstate:
01301   *yyssp = yystate;
01302 
01303   if (yyss + yystacksize - 1 <= yyssp)
01304     {
01305       /* Get the current used size of the three stacks, in elements.  */
01306       YYSIZE_T yysize = yyssp - yyss + 1;
01307 
01308 #ifdef yyoverflow
01309       {
01310        /* Give user a chance to reallocate the stack.  Use copies of
01311           these so that the &'s don't force the real ones into
01312           memory.  */
01313        YYSTYPE *yyvs1 = yyvs;
01314        yytype_int16 *yyss1 = yyss;
01315 
01316 
01317        /* Each stack pointer address is followed by the size of the
01318           data in use in that stack, in bytes.  This used to be a
01319           conditional around just the two extra args, but that might
01320           be undefined if yyoverflow is a macro.  */
01321        yyoverflow (YY_("memory exhausted"),
01322                   &yyss1, yysize * sizeof (*yyssp),
01323                   &yyvs1, yysize * sizeof (*yyvsp),
01324 
01325                   &yystacksize);
01326 
01327        yyss = yyss1;
01328        yyvs = yyvs1;
01329       }
01330 #else /* no yyoverflow */
01331 # ifndef YYSTACK_RELOCATE
01332       goto yyexhaustedlab;
01333 # else
01334       /* Extend the stack our own way.  */
01335       if (YYMAXDEPTH <= yystacksize)
01336        goto yyexhaustedlab;
01337       yystacksize *= 2;
01338       if (YYMAXDEPTH < yystacksize)
01339        yystacksize = YYMAXDEPTH;
01340 
01341       {
01342        yytype_int16 *yyss1 = yyss;
01343        union yyalloc *yyptr =
01344          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
01345        if (! yyptr)
01346          goto yyexhaustedlab;
01347        YYSTACK_RELOCATE (yyss);
01348        YYSTACK_RELOCATE (yyvs);
01349 
01350 #  undef YYSTACK_RELOCATE
01351        if (yyss1 != yyssa)
01352          YYSTACK_FREE (yyss1);
01353       }
01354 # endif
01355 #endif /* no yyoverflow */
01356 
01357       yyssp = yyss + yysize - 1;
01358       yyvsp = yyvs + yysize - 1;
01359 
01360 
01361       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
01362                 (unsigned long int) yystacksize));
01363 
01364       if (yyss + yystacksize - 1 <= yyssp)
01365        YYABORT;
01366     }
01367 
01368   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
01369 
01370   if (yystate == YYFINAL)
01371     YYACCEPT;
01372 
01373   goto yybackup;
01374 
01375 /*-----------.
01376 | yybackup.  |
01377 `-----------*/
01378 yybackup:
01379 
01380   /* Do appropriate processing given the current state.  Read a
01381      lookahead token if we need one and don't already have one.  */
01382 
01383   /* First try to decide what to do without reference to lookahead token.  */
01384   yyn = yypact[yystate];
01385   if (yyn == YYPACT_NINF)
01386     goto yydefault;
01387 
01388   /* Not known => get a lookahead token if don't already have one.  */
01389 
01390   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
01391   if (yychar == YYEMPTY)
01392     {
01393       YYDPRINTF ((stderr, "Reading a token: "));
01394       yychar = YYLEX;
01395     }
01396 
01397   if (yychar <= YYEOF)
01398     {
01399       yychar = yytoken = YYEOF;
01400       YYDPRINTF ((stderr, "Now at end of input.\n"));
01401     }
01402   else
01403     {
01404       yytoken = YYTRANSLATE (yychar);
01405       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
01406     }
01407 
01408   /* If the proper action on seeing token YYTOKEN is to reduce or to
01409      detect an error, take that action.  */
01410   yyn += yytoken;
01411   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
01412     goto yydefault;
01413   yyn = yytable[yyn];
01414   if (yyn <= 0)
01415     {
01416       if (yyn == 0 || yyn == YYTABLE_NINF)
01417        goto yyerrlab;
01418       yyn = -yyn;
01419       goto yyreduce;
01420     }
01421 
01422   /* Count tokens shifted since error; after three, turn off error
01423      status.  */
01424   if (yyerrstatus)
01425     yyerrstatus--;
01426 
01427   /* Shift the lookahead token.  */
01428   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
01429 
01430   /* Discard the shifted token.  */
01431   yychar = YYEMPTY;
01432 
01433   yystate = yyn;
01434   *++yyvsp = yylval;
01435 
01436   goto yynewstate;
01437 
01438 
01439 /*-----------------------------------------------------------.
01440 | yydefault -- do the default action for the current state.  |
01441 `-----------------------------------------------------------*/
01442 yydefault:
01443   yyn = yydefact[yystate];
01444   if (yyn == 0)
01445     goto yyerrlab;
01446   goto yyreduce;
01447 
01448 
01449 /*-----------------------------.
01450 | yyreduce -- Do a reduction.  |
01451 `-----------------------------*/
01452 yyreduce:
01453   /* yyn is the number of a rule to reduce with.  */
01454   yylen = yyr2[yyn];
01455 
01456   /* If YYLEN is nonzero, implement the default value of the action:
01457      `$$ = $1'.
01458 
01459      Otherwise, the following line sets YYVAL to garbage.
01460      This behavior is undocumented and Bison
01461      users should not rely upon it.  Assigning to YYVAL
01462      unconditionally makes the parser a bit smaller, and it avoids a
01463      GCC warning that YYVAL may be used uninitialized.  */
01464   yyval = yyvsp[1-yylen];
01465 
01466 
01467   YY_REDUCE_PRINT (yyn);
01468   switch (yyn)
01469     {
01470         case 2:
01471 /* Line 1269 of yacc.c.  */
01472 #line 155 "plural.y"
01473     {
01474            if ((yyvsp[(1) - (1)].exp) == NULL)
01475              YYABORT;
01476            ((struct parse_args *) arg)->res = (yyvsp[(1) - (1)].exp);
01477          }
01478     break;
01479 
01480   case 3:
01481 /* Line 1269 of yacc.c.  */
01482 #line 163 "plural.y"
01483     {
01484            (yyval.exp) = new_exp_3 (qmop, (yyvsp[(1) - (5)].exp), (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].exp));
01485          }
01486     break;
01487 
01488   case 4:
01489 /* Line 1269 of yacc.c.  */
01490 #line 167 "plural.y"
01491     {
01492            (yyval.exp) = new_exp_2 (lor, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
01493          }
01494     break;
01495 
01496   case 5:
01497 /* Line 1269 of yacc.c.  */
01498 #line 171 "plural.y"
01499     {
01500            (yyval.exp) = new_exp_2 (land, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
01501          }
01502     break;
01503 
01504   case 6:
01505 /* Line 1269 of yacc.c.  */
01506 #line 175 "plural.y"
01507     {
01508            (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
01509          }
01510     break;
01511 
01512   case 7:
01513 /* Line 1269 of yacc.c.  */
01514 #line 179 "plural.y"
01515     {
01516            (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
01517          }
01518     break;
01519 
01520   case 8:
01521 /* Line 1269 of yacc.c.  */
01522 #line 183 "plural.y"
01523     {
01524            (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
01525          }
01526     break;
01527 
01528   case 9:
01529 /* Line 1269 of yacc.c.  */
01530 #line 187 "plural.y"
01531     {
01532            (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
01533          }
01534     break;
01535 
01536   case 10:
01537 /* Line 1269 of yacc.c.  */
01538 #line 191 "plural.y"
01539     {
01540            (yyval.exp) = new_exp_1 (lnot, (yyvsp[(2) - (2)].exp));
01541          }
01542     break;
01543 
01544   case 11:
01545 /* Line 1269 of yacc.c.  */
01546 #line 195 "plural.y"
01547     {
01548            (yyval.exp) = new_exp_0 (var);
01549          }
01550     break;
01551 
01552   case 12:
01553 /* Line 1269 of yacc.c.  */
01554 #line 199 "plural.y"
01555     {
01556            if (((yyval.exp) = new_exp_0 (num)) != NULL)
01557              (yyval.exp)->val.num = (yyvsp[(1) - (1)].num);
01558          }
01559     break;
01560 
01561   case 13:
01562 /* Line 1269 of yacc.c.  */
01563 #line 204 "plural.y"
01564     {
01565            (yyval.exp) = (yyvsp[(2) - (3)].exp);
01566          }
01567     break;
01568 
01569 
01570 /* Line 1269 of yacc.c.  */
01571 #line 1572 "plural.c"
01572       default: break;
01573     }
01574   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
01575 
01576   YYPOPSTACK (yylen);
01577   yylen = 0;
01578   YY_STACK_PRINT (yyss, yyssp);
01579 
01580   *++yyvsp = yyval;
01581 
01582 
01583   /* Now `shift' the result of the reduction.  Determine what state
01584      that goes to, based on the state we popped back to and the rule
01585      number reduced by.  */
01586 
01587   yyn = yyr1[yyn];
01588 
01589   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
01590   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
01591     yystate = yytable[yystate];
01592   else
01593     yystate = yydefgoto[yyn - YYNTOKENS];
01594 
01595   goto yynewstate;
01596 
01597 
01598 /*------------------------------------.
01599 | yyerrlab -- here on detecting error |
01600 `------------------------------------*/
01601 yyerrlab:
01602   /* If not already recovering from an error, report this error.  */
01603   if (!yyerrstatus)
01604     {
01605       ++yynerrs;
01606 #if ! YYERROR_VERBOSE
01607       yyerror (YY_("syntax error"));
01608 #else
01609       {
01610        YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
01611        if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
01612          {
01613            YYSIZE_T yyalloc = 2 * yysize;
01614            if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
01615              yyalloc = YYSTACK_ALLOC_MAXIMUM;
01616            if (yymsg != yymsgbuf)
01617              YYSTACK_FREE (yymsg);
01618            yymsg = (char *) YYSTACK_ALLOC (yyalloc);
01619            if (yymsg)
01620              yymsg_alloc = yyalloc;
01621            else
01622              {
01623               yymsg = yymsgbuf;
01624               yymsg_alloc = sizeof yymsgbuf;
01625              }
01626          }
01627 
01628        if (0 < yysize && yysize <= yymsg_alloc)
01629          {
01630            (void) yysyntax_error (yymsg, yystate, yychar);
01631            yyerror (yymsg);
01632          }
01633        else
01634          {
01635            yyerror (YY_("syntax error"));
01636            if (yysize != 0)
01637              goto yyexhaustedlab;
01638          }
01639       }
01640 #endif
01641     }
01642 
01643 
01644 
01645   if (yyerrstatus == 3)
01646     {
01647       /* If just tried and failed to reuse lookahead token after an
01648         error, discard it.  */
01649 
01650       if (yychar <= YYEOF)
01651        {
01652          /* Return failure if at end of input.  */
01653          if (yychar == YYEOF)
01654            YYABORT;
01655        }
01656       else
01657        {
01658          yydestruct ("Error: discarding",
01659                     yytoken, &yylval);
01660          yychar = YYEMPTY;
01661        }
01662     }
01663 
01664   /* Else will try to reuse lookahead token after shifting the error
01665      token.  */
01666   goto yyerrlab1;
01667 
01668 
01669 /*---------------------------------------------------.
01670 | yyerrorlab -- error raised explicitly by YYERROR.  |
01671 `---------------------------------------------------*/
01672 yyerrorlab:
01673 
01674   /* Pacify compilers like GCC when the user code never invokes
01675      YYERROR and the label yyerrorlab therefore never appears in user
01676      code.  */
01677   if (/*CONSTCOND*/ 0)
01678      goto yyerrorlab;
01679 
01680   /* Do not reclaim the symbols of the rule which action triggered
01681      this YYERROR.  */
01682   YYPOPSTACK (yylen);
01683   yylen = 0;
01684   YY_STACK_PRINT (yyss, yyssp);
01685   yystate = *yyssp;
01686   goto yyerrlab1;
01687 
01688 
01689 /*-------------------------------------------------------------.
01690 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
01691 `-------------------------------------------------------------*/
01692 yyerrlab1:
01693   yyerrstatus = 3;   /* Each real token shifted decrements this.  */
01694 
01695   for (;;)
01696     {
01697       yyn = yypact[yystate];
01698       if (yyn != YYPACT_NINF)
01699        {
01700          yyn += YYTERROR;
01701          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
01702            {
01703              yyn = yytable[yyn];
01704              if (0 < yyn)
01705               break;
01706            }
01707        }
01708 
01709       /* Pop the current state because it cannot handle the error token.  */
01710       if (yyssp == yyss)
01711        YYABORT;
01712 
01713 
01714       yydestruct ("Error: popping",
01715                 yystos[yystate], yyvsp);
01716       YYPOPSTACK (1);
01717       yystate = *yyssp;
01718       YY_STACK_PRINT (yyss, yyssp);
01719     }
01720 
01721   *++yyvsp = yylval;
01722 
01723 
01724   /* Shift the error token.  */
01725   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
01726 
01727   yystate = yyn;
01728   goto yynewstate;
01729 
01730 
01731 /*-------------------------------------.
01732 | yyacceptlab -- YYACCEPT comes here.  |
01733 `-------------------------------------*/
01734 yyacceptlab:
01735   yyresult = 0;
01736   goto yyreturn;
01737 
01738 /*-----------------------------------.
01739 | yyabortlab -- YYABORT comes here.  |
01740 `-----------------------------------*/
01741 yyabortlab:
01742   yyresult = 1;
01743   goto yyreturn;
01744 
01745 #ifndef yyoverflow
01746 /*-------------------------------------------------.
01747 | yyexhaustedlab -- memory exhaustion comes here.  |
01748 `-------------------------------------------------*/
01749 yyexhaustedlab:
01750   yyerror (YY_("memory exhausted"));
01751   yyresult = 2;
01752   /* Fall through.  */
01753 #endif
01754 
01755 yyreturn:
01756   if (yychar != YYEMPTY)
01757      yydestruct ("Cleanup: discarding lookahead",
01758                yytoken, &yylval);
01759   /* Do not reclaim the symbols of the rule which action triggered
01760      this YYABORT or YYACCEPT.  */
01761   YYPOPSTACK (yylen);
01762   YY_STACK_PRINT (yyss, yyssp);
01763   while (yyssp != yyss)
01764     {
01765       yydestruct ("Cleanup: popping",
01766                 yystos[*yyssp], yyvsp);
01767       YYPOPSTACK (1);
01768     }
01769 #ifndef yyoverflow
01770   if (yyss != yyssa)
01771     YYSTACK_FREE (yyss);
01772 #endif
01773 #if YYERROR_VERBOSE
01774   if (yymsg != yymsgbuf)
01775     YYSTACK_FREE (yymsg);
01776 #endif
01777   /* Make sure YYID is used.  */
01778   return YYID (yyresult);
01779 }
01780 
01781 
01782 /* Line 1486 of yacc.c.  */
01783 #line 209 "plural.y"
01784 
01785 
01786 void
01787 internal_function
01788 FREE_EXPRESSION (struct expression *exp)
01789 {
01790   if (exp == NULL)
01791     return;
01792 
01793   /* Handle the recursive case.  */
01794   switch (exp->nargs)
01795     {
01796     case 3:
01797       FREE_EXPRESSION (exp->val.args[2]);
01798       /* FALLTHROUGH */
01799     case 2:
01800       FREE_EXPRESSION (exp->val.args[1]);
01801       /* FALLTHROUGH */
01802     case 1:
01803       FREE_EXPRESSION (exp->val.args[0]);
01804       /* FALLTHROUGH */
01805     default:
01806       break;
01807     }
01808 
01809   free (exp);
01810 }
01811 
01812 
01813 static int
01814 yylex (YYSTYPE *lval, const char **pexp)
01815 {
01816   const char *exp = *pexp;
01817   int result;
01818 
01819   while (1)
01820     {
01821       if (exp[0] == '\0')
01822        {
01823          *pexp = exp;
01824          return YYEOF;
01825        }
01826 
01827       if (exp[0] != ' ' && exp[0] != '\t')
01828        break;
01829 
01830       ++exp;
01831     }
01832 
01833   result = *exp++;
01834   switch (result)
01835     {
01836     case '0': case '1': case '2': case '3': case '4':
01837     case '5': case '6': case '7': case '8': case '9':
01838       {
01839        unsigned long int n = result - '0';
01840        while (exp[0] >= '0' && exp[0] <= '9')
01841          {
01842            n *= 10;
01843            n += exp[0] - '0';
01844            ++exp;
01845          }
01846        lval->num = n;
01847        result = NUMBER;
01848       }
01849       break;
01850 
01851     case '=':
01852       if (exp[0] == '=')
01853        {
01854          ++exp;
01855          lval->op = equal;
01856          result = EQUOP2;
01857        }
01858       else
01859        result = YYERRCODE;
01860       break;
01861 
01862     case '!':
01863       if (exp[0] == '=')
01864        {
01865          ++exp;
01866          lval->op = not_equal;
01867          result = EQUOP2;
01868        }
01869       break;
01870 
01871     case '&':
01872     case '|':
01873       if (exp[0] == result)
01874        ++exp;
01875       else
01876        result = YYERRCODE;
01877       break;
01878 
01879     case '<':
01880       if (exp[0] == '=')
01881        {
01882          ++exp;
01883          lval->op = less_or_equal;
01884        }
01885       else
01886        lval->op = less_than;
01887       result = CMPOP2;
01888       break;
01889 
01890     case '>':
01891       if (exp[0] == '=')
01892        {
01893          ++exp;
01894          lval->op = greater_or_equal;
01895        }
01896       else
01897        lval->op = greater_than;
01898       result = CMPOP2;
01899       break;
01900 
01901     case '*':
01902       lval->op = mult;
01903       result = MULOP2;
01904       break;
01905 
01906     case '/':
01907       lval->op = divide;
01908       result = MULOP2;
01909       break;
01910 
01911     case '%':
01912       lval->op = module;
01913       result = MULOP2;
01914       break;
01915 
01916     case '+':
01917       lval->op = plus;
01918       result = ADDOP2;
01919       break;
01920 
01921     case '-':
01922       lval->op = minus;
01923       result = ADDOP2;
01924       break;
01925 
01926     case 'n':
01927     case '?':
01928     case ':':
01929     case '(':
01930     case ')':
01931       /* Nothing, just return the character.  */
01932       break;
01933 
01934     case ';':
01935     case '\n':
01936     case '\0':
01937       /* Be safe and let the user call this function again.  */
01938       --exp;
01939       result = YYEOF;
01940       break;
01941 
01942     default:
01943       result = YYERRCODE;
01944 #if YYDEBUG != 0
01945       --exp;
01946 #endif
01947       break;
01948     }
01949 
01950   *pexp = exp;
01951 
01952   return result;
01953 }
01954 
01955 
01956 static void
01957 yyerror (const char *str)
01958 {
01959   /* Do nothing.  We don't print error messages here.  */
01960 }
01961