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