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