5f415ce12bdda1f71006cecba7e83b9b331ee3c6
[apps/madmutt.git] / intl / plural.c
1 /* A Bison parser, made from plural.y
2    by GNU bison 1.35.  */
3
4 #define YYBISON 1  /* Identify Bison output.  */
5
6 #define yyparse __gettextparse
7 #define yylex __gettextlex
8 #define yyerror __gettexterror
9 #define yylval __gettextlval
10 #define yychar __gettextchar
11 #define yydebug __gettextdebug
12 #define yynerrs __gettextnerrs
13 # define        EQUOP2  257
14 # define        CMPOP2  258
15 # define        ADDOP2  259
16 # define        MULOP2  260
17 # define        NUMBER  261
18
19 #line 1 "plural.y"
20
21 /* Expression parsing for plural form selection.
22    Copyright (C) 2000, 2001 Free Software Foundation, Inc.
23    Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
24
25    This program is free software; you can redistribute it and/or modify it
26    under the terms of the GNU Library General Public License as published
27    by the Free Software Foundation; either version 2, or (at your option)
28    any later version.
29
30    This program is distributed in the hope that it will be useful,
31    but WITHOUT ANY WARRANTY; without even the implied warranty of
32    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
33    Library General Public License for more details.
34
35    You should have received a copy of the GNU Library General Public
36    License along with this program; if not, write to the Free Software
37    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
38    USA.  */
39
40 /* The bison generated parser uses alloca.  AIX 3 forces us to put this
41    declaration at the beginning of the file.  The declaration in bison's
42    skeleton file comes too late.  This must come before <config.h>
43    because <config.h> may include arbitrary system headers.  */
44 #if defined _AIX && !defined __GNUC__
45  #pragma alloca
46 #endif
47
48 #ifdef HAVE_CONFIG_H
49 # include <config.h>
50 #endif
51
52 #include <stdlib.h>
53 #include "gettextP.h"
54
55 /* Names for the libintl functions are a problem.  They must not clash
56    with existing names and they should follow ANSI C.  But this source
57    code is also used in GNU C Library where the names have a __
58    prefix.  So we have to make a difference here.  */
59 #ifdef _LIBC
60 # define FREE_EXPRESSION __gettext_free_exp
61 #else
62 # define FREE_EXPRESSION gettext_free_exp__
63 # define __gettextparse gettextparse__
64 #endif
65
66 #define YYLEX_PARAM     &((struct parse_args *) arg)->cp
67 #define YYPARSE_PARAM   arg
68
69 #line 53 "plural.y"
70 #ifndef YYSTYPE
71 typedef union {
72   unsigned long int num;
73   enum operator op;
74   struct expression *exp;
75 } yystype;
76 # define YYSTYPE yystype
77 # define YYSTYPE_IS_TRIVIAL 1
78 #endif
79 #line 59 "plural.y"
80
81 /* Prototypes for local functions.  */
82 static struct expression *new_exp PARAMS ((int nargs, enum operator op,
83                                            struct expression * const *args));
84 static inline struct expression *new_exp_0 PARAMS ((enum operator op));
85 static inline struct expression *new_exp_1 PARAMS ((enum operator op,
86                                                    struct expression *right));
87 static struct expression *new_exp_2 PARAMS ((enum operator op,
88                                              struct expression *left,
89                                              struct expression *right));
90 static inline struct expression *new_exp_3 PARAMS ((enum operator op,
91                                                    struct expression *bexp,
92                                                    struct expression *tbranch,
93                                                    struct expression *fbranch));
94 static int yylex PARAMS ((YYSTYPE *lval, const char **pexp));
95 static void yyerror PARAMS ((const char *str));
96
97 /* Allocation of expressions.  */
98
99 static struct expression *
100 new_exp (nargs, op, args)
101      int nargs;
102      enum operator op;
103      struct expression * const *args;
104 {
105   int i;
106   struct expression *newp;
107
108   /* If any of the argument could not be malloc'ed, just return NULL.  */
109   for (i = nargs - 1; i >= 0; i--)
110     if (args[i] == NULL)
111       goto fail;
112
113   /* Allocate a new expression.  */
114   newp = (struct expression *) malloc (sizeof (*newp));
115   if (newp != NULL)
116     {
117       newp->nargs = nargs;
118       newp->operation = op;
119       for (i = nargs - 1; i >= 0; i--)
120         newp->val.args[i] = args[i];
121       return newp;
122     }
123
124  fail:
125   for (i = nargs - 1; i >= 0; i--)
126     FREE_EXPRESSION (args[i]);
127
128   return NULL;
129 }
130
131 static inline struct expression *
132 new_exp_0 (op)
133      enum operator op;
134 {
135   return new_exp (0, op, NULL);
136 }
137
138 static inline struct expression *
139 new_exp_1 (op, right)
140      enum operator op;
141      struct expression *right;
142 {
143   struct expression *args[1];
144
145   args[0] = right;
146   return new_exp (1, op, args);
147 }
148
149 static struct expression *
150 new_exp_2 (op, left, right)
151      enum operator op;
152      struct expression *left;
153      struct expression *right;
154 {
155   struct expression *args[2];
156
157   args[0] = left;
158   args[1] = right;
159   return new_exp (2, op, args);
160 }
161
162 static inline struct expression *
163 new_exp_3 (op, bexp, tbranch, fbranch)
164      enum operator op;
165      struct expression *bexp;
166      struct expression *tbranch;
167      struct expression *fbranch;
168 {
169   struct expression *args[3];
170
171   args[0] = bexp;
172   args[1] = tbranch;
173   args[2] = fbranch;
174   return new_exp (3, op, args);
175 }
176
177 #ifndef YYDEBUG
178 # define YYDEBUG 0
179 #endif
180
181
182
183 #define YYFINAL         27
184 #define YYFLAG          -32768
185 #define YYNTBASE        16
186
187 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
188 #define YYTRANSLATE(x) ((unsigned)(x) <= 261 ? yytranslate[x] : 18)
189
190 /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
191 static const char yytranslate[] =
192 {
193        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
194        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
195        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
196        2,     2,     2,    10,     2,     2,     2,     2,     5,     2,
197       14,    15,     2,     2,     2,     2,     2,     2,     2,     2,
198        2,     2,     2,     2,     2,     2,     2,     2,    12,     2,
199        2,     2,     2,     3,     2,     2,     2,     2,     2,     2,
200        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
201        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
202        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
203        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
204       13,     2,     2,     2,     2,     2,     2,     2,     2,     2,
205        2,     2,     2,     2,     4,     2,     2,     2,     2,     2,
206        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
207        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
208        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
209        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
210        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
211        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
212        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
213        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
214        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
215        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
216        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
217        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
218        2,     2,     2,     2,     2,     2,     1,     6,     7,     8,
219        9,    11
220 };
221
222 #if YYDEBUG
223 static const short yyprhs[] =
224 {
225        0,     0,     2,     8,    12,    16,    20,    24,    28,    32,
226       35,    37,    39
227 };
228 static const short yyrhs[] =
229 {
230       17,     0,    17,     3,    17,    12,    17,     0,    17,     4,
231       17,     0,    17,     5,    17,     0,    17,     6,    17,     0,
232       17,     7,    17,     0,    17,     8,    17,     0,    17,     9,
233       17,     0,    10,    17,     0,    13,     0,    11,     0,    14,
234       17,    15,     0
235 };
236
237 #endif
238
239 #if YYDEBUG
240 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
241 static const short yyrline[] =
242 {
243        0,   178,   186,   190,   194,   198,   202,   206,   210,   214,
244      218,   222,   227
245 };
246 #endif
247
248
249 #if (YYDEBUG) || defined YYERROR_VERBOSE
250
251 /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
252 static const char *const yytname[] =
253 {
254   "$", "error", "$undefined.", "'?'", "'|'", "'&'", "EQUOP2", "CMPOP2", 
255   "ADDOP2", "MULOP2", "'!'", "NUMBER", "':'", "'n'", "'('", "')'", 
256   "start", "exp", 0
257 };
258 #endif
259
260 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
261 static const short yyr1[] =
262 {
263        0,    16,    17,    17,    17,    17,    17,    17,    17,    17,
264       17,    17,    17
265 };
266
267 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
268 static const short yyr2[] =
269 {
270        0,     1,     5,     3,     3,     3,     3,     3,     3,     2,
271        1,     1,     3
272 };
273
274 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
275    doesn't specify something else to do.  Zero means the default is an
276    error. */
277 static const short yydefact[] =
278 {
279        0,     0,    11,    10,     0,     1,     9,     0,     0,     0,
280        0,     0,     0,     0,     0,    12,     0,     3,     4,     5,
281        6,     7,     8,     0,     2,     0,     0,     0
282 };
283
284 static const short yydefgoto[] =
285 {
286       25,     5
287 };
288
289 static const short yypact[] =
290 {
291       -9,    -9,-32768,-32768,    -9,    34,-32768,    11,    -9,    -9,
292       -9,    -9,    -9,    -9,    -9,-32768,    24,    39,    43,    16,
293       26,    -3,-32768,    -9,    34,    21,    53,-32768
294 };
295
296 static const short yypgoto[] =
297 {
298   -32768,    -1
299 };
300
301
302 #define YYLAST          53
303
304
305 static const short yytable[] =
306 {
307        6,     1,     2,     7,     3,     4,    14,    16,    17,    18,
308       19,    20,    21,    22,     8,     9,    10,    11,    12,    13,
309       14,    26,    24,    12,    13,    14,    15,     8,     9,    10,
310       11,    12,    13,    14,    13,    14,    23,     8,     9,    10,
311       11,    12,    13,    14,    10,    11,    12,    13,    14,    11,
312       12,    13,    14,    27
313 };
314
315 static const short yycheck[] =
316 {
317        1,    10,    11,     4,    13,    14,     9,     8,     9,    10,
318       11,    12,    13,    14,     3,     4,     5,     6,     7,     8,
319        9,     0,    23,     7,     8,     9,    15,     3,     4,     5,
320        6,     7,     8,     9,     8,     9,    12,     3,     4,     5,
321        6,     7,     8,     9,     5,     6,     7,     8,     9,     6,
322        7,     8,     9,     0
323 };
324 #define YYPURE 1
325
326 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
327 #line 3 "/sw/share/bison/bison.simple"
328
329 /* Skeleton output parser for bison,
330
331    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
332    Foundation, Inc.
333
334    This program is free software; you can redistribute it and/or modify
335    it under the terms of the GNU General Public License as published by
336    the Free Software Foundation; either version 2, or (at your option)
337    any later version.
338
339    This program is distributed in the hope that it will be useful,
340    but WITHOUT ANY WARRANTY; without even the implied warranty of
341    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
342    GNU General Public License for more details.
343
344    You should have received a copy of the GNU General Public License
345    along with this program; if not, write to the Free Software
346    Foundation, Inc., 59 Temple Place - Suite 330,
347    Boston, MA 02111-1307, USA.  */
348
349 /* As a special exception, when this file is copied by Bison into a
350    Bison output file, you may use that output file without restriction.
351    This special exception was added by the Free Software Foundation
352    in version 1.24 of Bison.  */
353
354 /* This is the parser code that is written into each bison parser when
355    the %semantic_parser declaration is not specified in the grammar.
356    It was written by Richard Stallman by simplifying the hairy parser
357    used when %semantic_parser is specified.  */
358
359 /* All symbols defined below should begin with yy or YY, to avoid
360    infringing on user name space.  This should be done even for local
361    variables, as they might otherwise be expanded by user macros.
362    There are some unavoidable exceptions within include files to
363    define necessary library symbols; they are noted "INFRINGES ON
364    USER NAME SPACE" below.  */
365
366 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
367
368 /* The parser invokes alloca or malloc; define the necessary symbols.  */
369
370 # if YYSTACK_USE_ALLOCA
371 #  define YYSTACK_ALLOC alloca
372 # else
373 #  ifndef YYSTACK_USE_ALLOCA
374 #   if defined (alloca) || defined (_ALLOCA_H)
375 #    define YYSTACK_ALLOC alloca
376 #   else
377 #    ifdef __GNUC__
378 #     define YYSTACK_ALLOC __builtin_alloca
379 #    endif
380 #   endif
381 #  endif
382 # endif
383
384 # ifdef YYSTACK_ALLOC
385    /* Pacify GCC's `empty if-body' warning. */
386 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
387 # else
388 #  if defined (__STDC__) || defined (__cplusplus)
389 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
390 #   define YYSIZE_T size_t
391 #  endif
392 #  define YYSTACK_ALLOC malloc
393 #  define YYSTACK_FREE free
394 # endif
395 #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
396
397
398 #if (! defined (yyoverflow) \
399      && (! defined (__cplusplus) \
400          || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
401
402 /* A type that is properly aligned for any stack member.  */
403 union yyalloc
404 {
405   short yyss;
406   YYSTYPE yyvs;
407 # if YYLSP_NEEDED
408   YYLTYPE yyls;
409 # endif
410 };
411
412 /* The size of the maximum gap between one aligned stack and the next.  */
413 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
414
415 /* The size of an array large to enough to hold all stacks, each with
416    N elements.  */
417 # if YYLSP_NEEDED
418 #  define YYSTACK_BYTES(N) \
419      ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE))      \
420       + 2 * YYSTACK_GAP_MAX)
421 # else
422 #  define YYSTACK_BYTES(N) \
423      ((N) * (sizeof (short) + sizeof (YYSTYPE))                         \
424       + YYSTACK_GAP_MAX)
425 # endif
426
427 /* Copy COUNT objects from FROM to TO.  The source and destination do
428    not overlap.  */
429 # ifndef YYCOPY
430 #  if 1 < __GNUC__
431 #   define YYCOPY(To, From, Count) \
432       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
433 #  else
434 #   define YYCOPY(To, From, Count)              \
435       do                                        \
436         {                                       \
437           register YYSIZE_T yyi;                \
438           for (yyi = 0; yyi < (Count); yyi++)   \
439             (To)[yyi] = (From)[yyi];            \
440         }                                       \
441       while (0)
442 #  endif
443 # endif
444
445 /* Relocate STACK from its old location to the new one.  The
446    local variables YYSIZE and YYSTACKSIZE give the old and new number of
447    elements in the stack, and YYPTR gives the new location of the
448    stack.  Advance YYPTR to a properly aligned location for the next
449    stack.  */
450 # define YYSTACK_RELOCATE(Stack)                                        \
451     do                                                                  \
452       {                                                                 \
453         YYSIZE_T yynewbytes;                                            \
454         YYCOPY (&yyptr->Stack, Stack, yysize);                          \
455         Stack = &yyptr->Stack;                                          \
456         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX;   \
457         yyptr += yynewbytes / sizeof (*yyptr);                          \
458       }                                                                 \
459     while (0)
460
461 #endif
462
463
464 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
465 # define YYSIZE_T __SIZE_TYPE__
466 #endif
467 #if ! defined (YYSIZE_T) && defined (size_t)
468 # define YYSIZE_T size_t
469 #endif
470 #if ! defined (YYSIZE_T)
471 # if defined (__STDC__) || defined (__cplusplus)
472 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
473 #  define YYSIZE_T size_t
474 # endif
475 #endif
476 #if ! defined (YYSIZE_T)
477 # define YYSIZE_T unsigned int
478 #endif
479
480 #define yyerrok         (yyerrstatus = 0)
481 #define yyclearin       (yychar = YYEMPTY)
482 #define YYEMPTY         -2
483 #define YYEOF           0
484 #define YYACCEPT        goto yyacceptlab
485 #define YYABORT         goto yyabortlab
486 #define YYERROR         goto yyerrlab1
487 /* Like YYERROR except do call yyerror.  This remains here temporarily
488    to ease the transition to the new meaning of YYERROR, for GCC.
489    Once GCC version 2 has supplanted version 1, this can go.  */
490 #define YYFAIL          goto yyerrlab
491 #define YYRECOVERING()  (!!yyerrstatus)
492 #define YYBACKUP(Token, Value)                                  \
493 do                                                              \
494   if (yychar == YYEMPTY && yylen == 1)                          \
495     {                                                           \
496       yychar = (Token);                                         \
497       yylval = (Value);                                         \
498       yychar1 = YYTRANSLATE (yychar);                           \
499       YYPOPSTACK;                                               \
500       goto yybackup;                                            \
501     }                                                           \
502   else                                                          \
503     {                                                           \
504       yyerror ("syntax error: cannot back up");                 \
505       YYERROR;                                                  \
506     }                                                           \
507 while (0)
508
509 #define YYTERROR        1
510 #define YYERRCODE       256
511
512
513 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
514    are run).
515
516    When YYLLOC_DEFAULT is run, CURRENT is set the location of the
517    first token.  By default, to implement support for ranges, extend
518    its range to the last symbol.  */
519
520 #ifndef YYLLOC_DEFAULT
521 # define YYLLOC_DEFAULT(Current, Rhs, N)        \
522    Current.last_line   = Rhs[N].last_line;      \
523    Current.last_column = Rhs[N].last_column;
524 #endif
525
526
527 /* YYLEX -- calling `yylex' with the right arguments.  */
528
529 #if YYPURE
530 # if YYLSP_NEEDED
531 #  ifdef YYLEX_PARAM
532 #   define YYLEX                yylex (&yylval, &yylloc, YYLEX_PARAM)
533 #  else
534 #   define YYLEX                yylex (&yylval, &yylloc)
535 #  endif
536 # else /* !YYLSP_NEEDED */
537 #  ifdef YYLEX_PARAM
538 #   define YYLEX                yylex (&yylval, YYLEX_PARAM)
539 #  else
540 #   define YYLEX                yylex (&yylval)
541 #  endif
542 # endif /* !YYLSP_NEEDED */
543 #else /* !YYPURE */
544 # define YYLEX                  yylex ()
545 #endif /* !YYPURE */
546
547
548 /* Enable debugging if requested.  */
549 #if YYDEBUG
550
551 # ifndef YYFPRINTF
552 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
553 #  define YYFPRINTF fprintf
554 # endif
555
556 # define YYDPRINTF(Args)                        \
557 do {                                            \
558   if (yydebug)                                  \
559     YYFPRINTF Args;                             \
560 } while (0)
561 /* Nonzero means print parse trace.  It is left uninitialized so that
562    multiple parsers can coexist.  */
563 int yydebug;
564 #else /* !YYDEBUG */
565 # define YYDPRINTF(Args)
566 #endif /* !YYDEBUG */
567
568 /* YYINITDEPTH -- initial size of the parser's stacks.  */
569 #ifndef YYINITDEPTH
570 # define YYINITDEPTH 200
571 #endif
572
573 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
574    if the built-in stack extension method is used).
575
576    Do not make this value too large; the results are undefined if
577    SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
578    evaluated with infinite-precision integer arithmetic.  */
579
580 #if YYMAXDEPTH == 0
581 # undef YYMAXDEPTH
582 #endif
583
584 #ifndef YYMAXDEPTH
585 # define YYMAXDEPTH 10000
586 #endif
587 \f
588 #ifdef YYERROR_VERBOSE
589
590 # ifndef yystrlen
591 #  if defined (__GLIBC__) && defined (_STRING_H)
592 #   define yystrlen strlen
593 #  else
594 /* Return the length of YYSTR.  */
595 static YYSIZE_T
596 #   if defined (__STDC__) || defined (__cplusplus)
597 yystrlen (const char *yystr)
598 #   else
599 yystrlen (yystr)
600      const char *yystr;
601 #   endif
602 {
603   register const char *yys = yystr;
604
605   while (*yys++ != '\0')
606     continue;
607
608   return yys - yystr - 1;
609 }
610 #  endif
611 # endif
612
613 # ifndef yystpcpy
614 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
615 #   define yystpcpy stpcpy
616 #  else
617 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
618    YYDEST.  */
619 static char *
620 #   if defined (__STDC__) || defined (__cplusplus)
621 yystpcpy (char *yydest, const char *yysrc)
622 #   else
623 yystpcpy (yydest, yysrc)
624      char *yydest;
625      const char *yysrc;
626 #   endif
627 {
628   register char *yyd = yydest;
629   register const char *yys = yysrc;
630
631   while ((*yyd++ = *yys++) != '\0')
632     continue;
633
634   return yyd - 1;
635 }
636 #  endif
637 # endif
638 #endif
639 \f
640 #line 315 "/sw/share/bison/bison.simple"
641
642
643 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
644    into yyparse.  The argument should have type void *.
645    It should actually point to an object.
646    Grammar actions can access the variable by casting it
647    to the proper pointer type.  */
648
649 #ifdef YYPARSE_PARAM
650 # if defined (__STDC__) || defined (__cplusplus)
651 #  define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
652 #  define YYPARSE_PARAM_DECL
653 # else
654 #  define YYPARSE_PARAM_ARG YYPARSE_PARAM
655 #  define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
656 # endif
657 #else /* !YYPARSE_PARAM */
658 # define YYPARSE_PARAM_ARG
659 # define YYPARSE_PARAM_DECL
660 #endif /* !YYPARSE_PARAM */
661
662 /* Prevent warning if -Wstrict-prototypes.  */
663 #ifdef __GNUC__
664 # ifdef YYPARSE_PARAM
665 int yyparse (void *);
666 # else
667 int yyparse (void);
668 # endif
669 #endif
670
671 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
672    variables are global, or local to YYPARSE.  */
673
674 #define YY_DECL_NON_LSP_VARIABLES                       \
675 /* The lookahead symbol.  */                            \
676 int yychar;                                             \
677                                                         \
678 /* The semantic value of the lookahead symbol. */       \
679 YYSTYPE yylval;                                         \
680                                                         \
681 /* Number of parse errors so far.  */                   \
682 int yynerrs;
683
684 #if YYLSP_NEEDED
685 # define YY_DECL_VARIABLES                      \
686 YY_DECL_NON_LSP_VARIABLES                       \
687                                                 \
688 /* Location data for the lookahead symbol.  */  \
689 YYLTYPE yylloc;
690 #else
691 # define YY_DECL_VARIABLES                      \
692 YY_DECL_NON_LSP_VARIABLES
693 #endif
694
695
696 /* If nonreentrant, generate the variables here. */
697
698 #if !YYPURE
699 YY_DECL_VARIABLES
700 #endif  /* !YYPURE */
701
702 int
703 yyparse (YYPARSE_PARAM_ARG)
704      YYPARSE_PARAM_DECL
705 {
706   /* If reentrant, generate the variables here. */
707 #if YYPURE
708   YY_DECL_VARIABLES
709 #endif  /* !YYPURE */
710
711   register int yystate;
712   register int yyn;
713   int yyresult;
714   /* Number of tokens to shift before error messages enabled.  */
715   int yyerrstatus;
716   /* Lookahead token as an internal (translated) token number.  */
717   int yychar1 = 0;
718
719   /* Three stacks and their tools:
720      `yyss': related to states,
721      `yyvs': related to semantic values,
722      `yyls': related to locations.
723
724      Refer to the stacks thru separate pointers, to allow yyoverflow
725      to reallocate them elsewhere.  */
726
727   /* The state stack. */
728   short yyssa[YYINITDEPTH];
729   short *yyss = yyssa;
730   register short *yyssp;
731
732   /* The semantic value stack.  */
733   YYSTYPE yyvsa[YYINITDEPTH];
734   YYSTYPE *yyvs = yyvsa;
735   register YYSTYPE *yyvsp;
736
737 #if YYLSP_NEEDED
738   /* The location stack.  */
739   YYLTYPE yylsa[YYINITDEPTH];
740   YYLTYPE *yyls = yylsa;
741   YYLTYPE *yylsp;
742 #endif
743
744 #if YYLSP_NEEDED
745 # define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
746 #else
747 # define YYPOPSTACK   (yyvsp--, yyssp--)
748 #endif
749
750   YYSIZE_T yystacksize = YYINITDEPTH;
751
752
753   /* The variables used to return semantic value and location from the
754      action routines.  */
755   YYSTYPE yyval;
756 #if YYLSP_NEEDED
757   YYLTYPE yyloc;
758 #endif
759
760   /* When reducing, the number of symbols on the RHS of the reduced
761      rule. */
762   int yylen;
763
764   YYDPRINTF ((stderr, "Starting parse\n"));
765
766   yystate = 0;
767   yyerrstatus = 0;
768   yynerrs = 0;
769   yychar = YYEMPTY;             /* Cause a token to be read.  */
770
771   /* Initialize stack pointers.
772      Waste one element of value and location stack
773      so that they stay on the same level as the state stack.
774      The wasted elements are never initialized.  */
775
776   yyssp = yyss;
777   yyvsp = yyvs;
778 #if YYLSP_NEEDED
779   yylsp = yyls;
780 #endif
781   goto yysetstate;
782
783 /*------------------------------------------------------------.
784 | yynewstate -- Push a new state, which is found in yystate.  |
785 `------------------------------------------------------------*/
786  yynewstate:
787   /* In all cases, when you get here, the value and location stacks
788      have just been pushed. so pushing a state here evens the stacks.
789      */
790   yyssp++;
791
792  yysetstate:
793   *yyssp = yystate;
794
795   if (yyssp >= yyss + yystacksize - 1)
796     {
797       /* Get the current used size of the three stacks, in elements.  */
798       YYSIZE_T yysize = yyssp - yyss + 1;
799
800 #ifdef yyoverflow
801       {
802         /* Give user a chance to reallocate the stack. Use copies of
803            these so that the &'s don't force the real ones into
804            memory.  */
805         YYSTYPE *yyvs1 = yyvs;
806         short *yyss1 = yyss;
807
808         /* Each stack pointer address is followed by the size of the
809            data in use in that stack, in bytes.  */
810 # if YYLSP_NEEDED
811         YYLTYPE *yyls1 = yyls;
812         /* This used to be a conditional around just the two extra args,
813            but that might be undefined if yyoverflow is a macro.  */
814         yyoverflow ("parser stack overflow",
815                     &yyss1, yysize * sizeof (*yyssp),
816                     &yyvs1, yysize * sizeof (*yyvsp),
817                     &yyls1, yysize * sizeof (*yylsp),
818                     &yystacksize);
819         yyls = yyls1;
820 # else
821         yyoverflow ("parser stack overflow",
822                     &yyss1, yysize * sizeof (*yyssp),
823                     &yyvs1, yysize * sizeof (*yyvsp),
824                     &yystacksize);
825 # endif
826         yyss = yyss1;
827         yyvs = yyvs1;
828       }
829 #else /* no yyoverflow */
830 # ifndef YYSTACK_RELOCATE
831       goto yyoverflowlab;
832 # else
833       /* Extend the stack our own way.  */
834       if (yystacksize >= YYMAXDEPTH)
835         goto yyoverflowlab;
836       yystacksize *= 2;
837       if (yystacksize > YYMAXDEPTH)
838         yystacksize = YYMAXDEPTH;
839
840       {
841         short *yyss1 = yyss;
842         union yyalloc *yyptr =
843           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
844         if (! yyptr)
845           goto yyoverflowlab;
846         YYSTACK_RELOCATE (yyss);
847         YYSTACK_RELOCATE (yyvs);
848 # if YYLSP_NEEDED
849         YYSTACK_RELOCATE (yyls);
850 # endif
851 # undef YYSTACK_RELOCATE
852         if (yyss1 != yyssa)
853           YYSTACK_FREE (yyss1);
854       }
855 # endif
856 #endif /* no yyoverflow */
857
858       yyssp = yyss + yysize - 1;
859       yyvsp = yyvs + yysize - 1;
860 #if YYLSP_NEEDED
861       yylsp = yyls + yysize - 1;
862 #endif
863
864       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
865                   (unsigned long int) yystacksize));
866
867       if (yyssp >= yyss + yystacksize - 1)
868         YYABORT;
869     }
870
871   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
872
873   goto yybackup;
874
875
876 /*-----------.
877 | yybackup.  |
878 `-----------*/
879 yybackup:
880
881 /* Do appropriate processing given the current state.  */
882 /* Read a lookahead token if we need one and don't already have one.  */
883 /* yyresume: */
884
885   /* First try to decide what to do without reference to lookahead token.  */
886
887   yyn = yypact[yystate];
888   if (yyn == YYFLAG)
889     goto yydefault;
890
891   /* Not known => get a lookahead token if don't already have one.  */
892
893   /* yychar is either YYEMPTY or YYEOF
894      or a valid token in external form.  */
895
896   if (yychar == YYEMPTY)
897     {
898       YYDPRINTF ((stderr, "Reading a token: "));
899       yychar = YYLEX;
900     }
901
902   /* Convert token to internal form (in yychar1) for indexing tables with */
903
904   if (yychar <= 0)              /* This means end of input. */
905     {
906       yychar1 = 0;
907       yychar = YYEOF;           /* Don't call YYLEX any more */
908
909       YYDPRINTF ((stderr, "Now at end of input.\n"));
910     }
911   else
912     {
913       yychar1 = YYTRANSLATE (yychar);
914
915 #if YYDEBUG
916      /* We have to keep this `#if YYDEBUG', since we use variables
917         which are defined only if `YYDEBUG' is set.  */
918       if (yydebug)
919         {
920           YYFPRINTF (stderr, "Next token is %d (%s",
921                      yychar, yytname[yychar1]);
922           /* Give the individual parser a way to print the precise
923              meaning of a token, for further debugging info.  */
924 # ifdef YYPRINT
925           YYPRINT (stderr, yychar, yylval);
926 # endif
927           YYFPRINTF (stderr, ")\n");
928         }
929 #endif
930     }
931
932   yyn += yychar1;
933   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
934     goto yydefault;
935
936   yyn = yytable[yyn];
937
938   /* yyn is what to do for this token type in this state.
939      Negative => reduce, -yyn is rule number.
940      Positive => shift, yyn is new state.
941        New state is final state => don't bother to shift,
942        just return success.
943      0, or most negative number => error.  */
944
945   if (yyn < 0)
946     {
947       if (yyn == YYFLAG)
948         goto yyerrlab;
949       yyn = -yyn;
950       goto yyreduce;
951     }
952   else if (yyn == 0)
953     goto yyerrlab;
954
955   if (yyn == YYFINAL)
956     YYACCEPT;
957
958   /* Shift the lookahead token.  */
959   YYDPRINTF ((stderr, "Shifting token %d (%s), ",
960               yychar, yytname[yychar1]));
961
962   /* Discard the token being shifted unless it is eof.  */
963   if (yychar != YYEOF)
964     yychar = YYEMPTY;
965
966   *++yyvsp = yylval;
967 #if YYLSP_NEEDED
968   *++yylsp = yylloc;
969 #endif
970
971   /* Count tokens shifted since error; after three, turn off error
972      status.  */
973   if (yyerrstatus)
974     yyerrstatus--;
975
976   yystate = yyn;
977   goto yynewstate;
978
979
980 /*-----------------------------------------------------------.
981 | yydefault -- do the default action for the current state.  |
982 `-----------------------------------------------------------*/
983 yydefault:
984   yyn = yydefact[yystate];
985   if (yyn == 0)
986     goto yyerrlab;
987   goto yyreduce;
988
989
990 /*-----------------------------.
991 | yyreduce -- Do a reduction.  |
992 `-----------------------------*/
993 yyreduce:
994   /* yyn is the number of a rule to reduce with.  */
995   yylen = yyr2[yyn];
996
997   /* If YYLEN is nonzero, implement the default value of the action:
998      `$$ = $1'.
999
1000      Otherwise, the following line sets YYVAL to the semantic value of
1001      the lookahead token.  This behavior is undocumented and Bison
1002      users should not rely upon it.  Assigning to YYVAL
1003      unconditionally makes the parser a bit smaller, and it avoids a
1004      GCC warning that YYVAL may be used uninitialized.  */
1005   yyval = yyvsp[1-yylen];
1006
1007 #if YYLSP_NEEDED
1008   /* Similarly for the default location.  Let the user run additional
1009      commands if for instance locations are ranges.  */
1010   yyloc = yylsp[1-yylen];
1011   YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1012 #endif
1013
1014 #if YYDEBUG
1015   /* We have to keep this `#if YYDEBUG', since we use variables which
1016      are defined only if `YYDEBUG' is set.  */
1017   if (yydebug)
1018     {
1019       int yyi;
1020
1021       YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
1022                  yyn, yyrline[yyn]);
1023
1024       /* Print the symbols being reduced, and their result.  */
1025       for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
1026         YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1027       YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1028     }
1029 #endif
1030
1031   switch (yyn) {
1032
1033 case 1:
1034 #line 179 "plural.y"
1035 {
1036             if (yyvsp[0].exp == NULL)
1037               YYABORT;
1038             ((struct parse_args *) arg)->res = yyvsp[0].exp;
1039           }
1040     break;
1041 case 2:
1042 #line 187 "plural.y"
1043 {
1044             yyval.exp = new_exp_3 (qmop, yyvsp[-4].exp, yyvsp[-2].exp, yyvsp[0].exp);
1045           }
1046     break;
1047 case 3:
1048 #line 191 "plural.y"
1049 {
1050             yyval.exp = new_exp_2 (lor, yyvsp[-2].exp, yyvsp[0].exp);
1051           }
1052     break;
1053 case 4:
1054 #line 195 "plural.y"
1055 {
1056             yyval.exp = new_exp_2 (land, yyvsp[-2].exp, yyvsp[0].exp);
1057           }
1058     break;
1059 case 5:
1060 #line 199 "plural.y"
1061 {
1062             yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
1063           }
1064     break;
1065 case 6:
1066 #line 203 "plural.y"
1067 {
1068             yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
1069           }
1070     break;
1071 case 7:
1072 #line 207 "plural.y"
1073 {
1074             yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
1075           }
1076     break;
1077 case 8:
1078 #line 211 "plural.y"
1079 {
1080             yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
1081           }
1082     break;
1083 case 9:
1084 #line 215 "plural.y"
1085 {
1086             yyval.exp = new_exp_1 (lnot, yyvsp[0].exp);
1087           }
1088     break;
1089 case 10:
1090 #line 219 "plural.y"
1091 {
1092             yyval.exp = new_exp_0 (var);
1093           }
1094     break;
1095 case 11:
1096 #line 223 "plural.y"
1097 {
1098             if ((yyval.exp = new_exp_0 (num)) != NULL)
1099               yyval.exp->val.num = yyvsp[0].num;
1100           }
1101     break;
1102 case 12:
1103 #line 228 "plural.y"
1104 {
1105             yyval.exp = yyvsp[-1].exp;
1106           }
1107     break;
1108 }
1109
1110 #line 705 "/sw/share/bison/bison.simple"
1111
1112 \f
1113   yyvsp -= yylen;
1114   yyssp -= yylen;
1115 #if YYLSP_NEEDED
1116   yylsp -= yylen;
1117 #endif
1118
1119 #if YYDEBUG
1120   if (yydebug)
1121     {
1122       short *yyssp1 = yyss - 1;
1123       YYFPRINTF (stderr, "state stack now");
1124       while (yyssp1 != yyssp)
1125         YYFPRINTF (stderr, " %d", *++yyssp1);
1126       YYFPRINTF (stderr, "\n");
1127     }
1128 #endif
1129
1130   *++yyvsp = yyval;
1131 #if YYLSP_NEEDED
1132   *++yylsp = yyloc;
1133 #endif
1134
1135   /* Now `shift' the result of the reduction.  Determine what state
1136      that goes to, based on the state we popped back to and the rule
1137      number reduced by.  */
1138
1139   yyn = yyr1[yyn];
1140
1141   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1142   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1143     yystate = yytable[yystate];
1144   else
1145     yystate = yydefgoto[yyn - YYNTBASE];
1146
1147   goto yynewstate;
1148
1149
1150 /*------------------------------------.
1151 | yyerrlab -- here on detecting error |
1152 `------------------------------------*/
1153 yyerrlab:
1154   /* If not already recovering from an error, report this error.  */
1155   if (!yyerrstatus)
1156     {
1157       ++yynerrs;
1158
1159 #ifdef YYERROR_VERBOSE
1160       yyn = yypact[yystate];
1161
1162       if (yyn > YYFLAG && yyn < YYLAST)
1163         {
1164           YYSIZE_T yysize = 0;
1165           char *yymsg;
1166           int yyx, yycount;
1167
1168           yycount = 0;
1169           /* Start YYX at -YYN if negative to avoid negative indexes in
1170              YYCHECK.  */
1171           for (yyx = yyn < 0 ? -yyn : 0;
1172                yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1173             if (yycheck[yyx + yyn] == yyx)
1174               yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1175           yysize += yystrlen ("parse error, unexpected ") + 1;
1176           yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1177           yymsg = (char *) YYSTACK_ALLOC (yysize);
1178           if (yymsg != 0)
1179             {
1180               char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1181               yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
1182
1183               if (yycount < 5)
1184                 {
1185                   yycount = 0;
1186                   for (yyx = yyn < 0 ? -yyn : 0;
1187                        yyx < (int) (sizeof (yytname) / sizeof (char *));
1188                        yyx++)
1189                     if (yycheck[yyx + yyn] == yyx)
1190                       {
1191                         const char *yyq = ! yycount ? ", expecting " : " or ";
1192                         yyp = yystpcpy (yyp, yyq);
1193                         yyp = yystpcpy (yyp, yytname[yyx]);
1194                         yycount++;
1195                       }
1196                 }
1197               yyerror (yymsg);
1198               YYSTACK_FREE (yymsg);
1199             }
1200           else
1201             yyerror ("parse error; also virtual memory exhausted");
1202         }
1203       else
1204 #endif /* defined (YYERROR_VERBOSE) */
1205         yyerror ("parse error");
1206     }
1207   goto yyerrlab1;
1208
1209
1210 /*--------------------------------------------------.
1211 | yyerrlab1 -- error raised explicitly by an action |
1212 `--------------------------------------------------*/
1213 yyerrlab1:
1214   if (yyerrstatus == 3)
1215     {
1216       /* If just tried and failed to reuse lookahead token after an
1217          error, discard it.  */
1218
1219       /* return failure if at end of input */
1220       if (yychar == YYEOF)
1221         YYABORT;
1222       YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1223                   yychar, yytname[yychar1]));
1224       yychar = YYEMPTY;
1225     }
1226
1227   /* Else will try to reuse lookahead token after shifting the error
1228      token.  */
1229
1230   yyerrstatus = 3;              /* Each real token shifted decrements this */
1231
1232   goto yyerrhandle;
1233
1234
1235 /*-------------------------------------------------------------------.
1236 | yyerrdefault -- current state does not do anything special for the |
1237 | error token.                                                       |
1238 `-------------------------------------------------------------------*/
1239 yyerrdefault:
1240 #if 0
1241   /* This is wrong; only states that explicitly want error tokens
1242      should shift them.  */
1243
1244   /* If its default is to accept any token, ok.  Otherwise pop it.  */
1245   yyn = yydefact[yystate];
1246   if (yyn)
1247     goto yydefault;
1248 #endif
1249
1250
1251 /*---------------------------------------------------------------.
1252 | yyerrpop -- pop the current state because it cannot handle the |
1253 | error token                                                    |
1254 `---------------------------------------------------------------*/
1255 yyerrpop:
1256   if (yyssp == yyss)
1257     YYABORT;
1258   yyvsp--;
1259   yystate = *--yyssp;
1260 #if YYLSP_NEEDED
1261   yylsp--;
1262 #endif
1263
1264 #if YYDEBUG
1265   if (yydebug)
1266     {
1267       short *yyssp1 = yyss - 1;
1268       YYFPRINTF (stderr, "Error: state stack now");
1269       while (yyssp1 != yyssp)
1270         YYFPRINTF (stderr, " %d", *++yyssp1);
1271       YYFPRINTF (stderr, "\n");
1272     }
1273 #endif
1274
1275 /*--------------.
1276 | yyerrhandle.  |
1277 `--------------*/
1278 yyerrhandle:
1279   yyn = yypact[yystate];
1280   if (yyn == YYFLAG)
1281     goto yyerrdefault;
1282
1283   yyn += YYTERROR;
1284   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1285     goto yyerrdefault;
1286
1287   yyn = yytable[yyn];
1288   if (yyn < 0)
1289     {
1290       if (yyn == YYFLAG)
1291         goto yyerrpop;
1292       yyn = -yyn;
1293       goto yyreduce;
1294     }
1295   else if (yyn == 0)
1296     goto yyerrpop;
1297
1298   if (yyn == YYFINAL)
1299     YYACCEPT;
1300
1301   YYDPRINTF ((stderr, "Shifting error token, "));
1302
1303   *++yyvsp = yylval;
1304 #if YYLSP_NEEDED
1305   *++yylsp = yylloc;
1306 #endif
1307
1308   yystate = yyn;
1309   goto yynewstate;
1310
1311
1312 /*-------------------------------------.
1313 | yyacceptlab -- YYACCEPT comes here.  |
1314 `-------------------------------------*/
1315 yyacceptlab:
1316   yyresult = 0;
1317   goto yyreturn;
1318
1319 /*-----------------------------------.
1320 | yyabortlab -- YYABORT comes here.  |
1321 `-----------------------------------*/
1322 yyabortlab:
1323   yyresult = 1;
1324   goto yyreturn;
1325
1326 /*---------------------------------------------.
1327 | yyoverflowab -- parser overflow comes here.  |
1328 `---------------------------------------------*/
1329 yyoverflowlab:
1330   yyerror ("parser stack overflow");
1331   yyresult = 2;
1332   /* Fall through.  */
1333
1334 yyreturn:
1335 #ifndef yyoverflow
1336   if (yyss != yyssa)
1337     YYSTACK_FREE (yyss);
1338 #endif
1339   return yyresult;
1340 }
1341 #line 233 "plural.y"
1342
1343
1344 void
1345 internal_function
1346 FREE_EXPRESSION (exp)
1347      struct expression *exp;
1348 {
1349   if (exp == NULL)
1350     return;
1351
1352   /* Handle the recursive case.  */
1353   switch (exp->nargs)
1354     {
1355     case 3:
1356       FREE_EXPRESSION (exp->val.args[2]);
1357       /* FALLTHROUGH */
1358     case 2:
1359       FREE_EXPRESSION (exp->val.args[1]);
1360       /* FALLTHROUGH */
1361     case 1:
1362       FREE_EXPRESSION (exp->val.args[0]);
1363       /* FALLTHROUGH */
1364     default:
1365       break;
1366     }
1367
1368   free (exp);
1369 }
1370
1371
1372 static int
1373 yylex (lval, pexp)
1374      YYSTYPE *lval;
1375      const char **pexp;
1376 {
1377   const char *exp = *pexp;
1378   int result;
1379
1380   while (1)
1381     {
1382       if (exp[0] == '\0')
1383         {
1384           *pexp = exp;
1385           return YYEOF;
1386         }
1387
1388       if (exp[0] != ' ' && exp[0] != '\t')
1389         break;
1390
1391       ++exp;
1392     }
1393
1394   result = *exp++;
1395   switch (result)
1396     {
1397     case '0': case '1': case '2': case '3': case '4':
1398     case '5': case '6': case '7': case '8': case '9':
1399       {
1400         unsigned long int n = result - '0';
1401         while (exp[0] >= '0' && exp[0] <= '9')
1402           {
1403             n *= 10;
1404             n += exp[0] - '0';
1405             ++exp;
1406           }
1407         lval->num = n;
1408         result = NUMBER;
1409       }
1410       break;
1411
1412     case '=':
1413       if (exp[0] == '=')
1414         {
1415           ++exp;
1416           lval->op = equal;
1417           result = EQUOP2;
1418         }
1419       else
1420         result = YYERRCODE;
1421       break;
1422
1423     case '!':
1424       if (exp[0] == '=')
1425         {
1426           ++exp;
1427           lval->op = not_equal;
1428           result = EQUOP2;
1429         }
1430       break;
1431
1432     case '&':
1433     case '|':
1434       if (exp[0] == result)
1435         ++exp;
1436       else
1437         result = YYERRCODE;
1438       break;
1439
1440     case '<':
1441       if (exp[0] == '=')
1442         {
1443           ++exp;
1444           lval->op = less_or_equal;
1445         }
1446       else
1447         lval->op = less_than;
1448       result = CMPOP2;
1449       break;
1450
1451     case '>':
1452       if (exp[0] == '=')
1453         {
1454           ++exp;
1455           lval->op = greater_or_equal;
1456         }
1457       else
1458         lval->op = greater_than;
1459       result = CMPOP2;
1460       break;
1461
1462     case '*':
1463       lval->op = mult;
1464       result = MULOP2;
1465       break;
1466
1467     case '/':
1468       lval->op = divide;
1469       result = MULOP2;
1470       break;
1471
1472     case '%':
1473       lval->op = module;
1474       result = MULOP2;
1475       break;
1476
1477     case '+':
1478       lval->op = plus;
1479       result = ADDOP2;
1480       break;
1481
1482     case '-':
1483       lval->op = minus;
1484       result = ADDOP2;
1485       break;
1486
1487     case 'n':
1488     case '?':
1489     case ':':
1490     case '(':
1491     case ')':
1492       /* Nothing, just return the character.  */
1493       break;
1494
1495     case ';':
1496     case '\n':
1497     case '\0':
1498       /* Be safe and let the user call this function again.  */
1499       --exp;
1500       result = YYEOF;
1501       break;
1502
1503     default:
1504       result = YYERRCODE;
1505 #if YYDEBUG != 0
1506       --exp;
1507 #endif
1508       break;
1509     }
1510
1511   *pexp = exp;
1512
1513   return result;
1514 }
1515
1516
1517 static void
1518 yyerror (str)
1519      const char *str;
1520 {
1521   /* Do nothing.  We don't print error messages here.  */
1522 }