root/trunk/intl/plural.c

Revision 2, 36.4 kB (checked in by jordi, 2 years ago)

Added the initial source layout with autotools and gettext support. Still no code for the project.

Line 
1 /* A Bison parser, made from plural.y
2    by GNU bison 1.35.  */
3
4 #define YYBISON/* 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, 2003 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 <stddef.h>
53 #include <stdlib.h>
54 #include "plural-exp.h"
55
56 /* The main function generated by the parser is called __gettextparse,
57    but we want it to be called PLURAL_PARSE.  */
58 #ifndef _LIBC
59 # define __gettextparse PLURAL_PARSE
60 #endif
61
62 #define YYLEX_PARAM &((struct parse_args *) arg)->cp
63 #define YYPARSE_PARAM   arg
64
65 #line 49 "plural.y"
66 #ifndef YYSTYPE
67 typedef union {
68   unsigned long int num;
69   enum operator op;
70   struct expression *exp;
71 } yystype;
72 # define YYSTYPE yystype
73 # define YYSTYPE_IS_TRIVIAL 1
74 #endif
75 #line 55 "plural.y"
76
77 /* Prototypes for local functions.  */
78 static int yylex (YYSTYPE *lval, const char **pexp);
79 static void yyerror (const char *str);
80
81 /* Allocation of expressions.  */
82
83 static struct expression *
84 new_exp (int nargs, enum operator op, struct expression * const *args)
85 {
86   int i;
87   struct expression *newp;
88
89   /* If any of the argument could not be malloc'ed, just return NULL.  */
90   for (i = nargs - 1; i >= 0; i--)
91     if (args[i] == NULL)
92       goto fail;
93
94   /* Allocate a new expression.  */
95   newp = (struct expression *) malloc (sizeof (*newp));
96   if (newp != NULL)
97     {
98       newp->nargs = nargs;
99       newp->operation = op;
100       for (i = nargs - 1; i >= 0; i--)
101     newp->val.args[i] = args[i];
102       return newp;
103     }
104
105  fail:
106   for (i = nargs - 1; i >= 0; i--)
107     FREE_EXPRESSION (args[i]);
108
109   return NULL;
110 }
111
112 static inline struct expression *
113 new_exp_0 (enum operator op)
114 {
115   return new_exp (0, op, NULL);
116 }
117
118 static inline struct expression *
119 new_exp_1 (enum operator op, struct expression *right)
120 {
121   struct expression *args[1];
122
123   args[0] = right;
124   return new_exp (1, op, args);
125 }
126
127 static struct expression *
128 new_exp_2 (enum operator op, struct expression *left, struct expression *right)
129 {
130   struct expression *args[2];
131
132   args[0] = left;
133   args[1] = right;
134   return new_exp (2, op, args);
135 }
136
137 static inline struct expression *
138 new_exp_3 (enum operator op, struct expression *bexp,
139        struct expression *tbranch, struct expression *fbranch)
140 {
141   struct expression *args[3];
142
143   args[0] = bexp;
144   args[1] = tbranch;
145   args[2] = fbranch;
146   return new_exp (3, op, args);
147 }
148
149 #ifndef YYDEBUG
150 # define YYDEBUG 0
151 #endif
152
153
154
155 #define YYFINAL     27
156 #define YYFLAG      -32768
157 #define YYNTBASE    16
158
159 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
160 #define YYTRANSLATE(x) ((unsigned)(x) <= 261 ? yytranslate[x] : 18)
161
162 /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
163 static const char yytranslate[] =
164 {
165        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
166        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
167        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
168        2,     2,     2,    10,     2,     2,     2,     2,     5,     2,
169       14,    15,     2,     2,     2,     2,     2,     2,     2,     2,
170        2,     2,     2,     2,     2,     2,     2,     2,    12,     2,
171        2,     2,     2,     3,     2,     2,     2,     2,     2,     2,
172        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
173        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
174        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
175        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
176       13,     2,     2,     2,     2,     2,     2,     2,     2,     2,
177        2,     2,     2,     2,     4,     2,     2,     2,     2,     2,
178        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
179        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
180        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
181        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
182        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
183        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
184        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
185        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
186        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
187        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
188        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
189        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
190        2,     2,     2,     2,     2,     2,     1,     6,     7,     8,
191        9,    11
192 };
193
194 #if YYDEBUG
195 static const short yyprhs[] =
196 {
197        0,     0,     2,     8,    12,    16,    20,    24,    28,    32,
198       35,    37,    39
199 };
200 static const short yyrhs[] =
201 {
202       17,     0,    17,     3,    17,    12,    17,     0,    17,     4,
203       17,     0,    17,     5,    17,     0,    17,     6,    17,     0,
204       17,     7,    17,     0,    17,     8,    17,     0,    17,     9,
205       17,     0,    10,    17,     0,    13,     0,    11,     0,    14,
206       17,    15,     0
207 };
208
209 #endif
210
211 #if YYDEBUG
212 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
213 static const short yyrline[] =
214 {
215        0,   150,   158,   162,   166,   170,   174,   178,   182,   186,
216      190,   194,   199
217 };
218 #endif
219
220
221 #if (YYDEBUG) || defined YYERROR_VERBOSE
222
223 /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
224 static const char *const yytname[] =
225 {
226   "$", "error", "$undefined.", "'?'", "'|'", "'&'", "EQUOP2", "CMPOP2",
227   "ADDOP2", "MULOP2", "'!'", "NUMBER", "':'", "'n'", "'('", "')'",
228   "start", "exp", 0
229 };
230 #endif
231
232 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
233 static const short yyr1[] =
234 {
235        0,    16,    17,    17,    17,    17,    17,    17,    17,    17,
236       17,    17,    17
237 };
238
239 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
240 static const short yyr2[] =
241 {
242        0,     1,     5,     3,     3,     3,     3,     3,     3,     2,
243        1,     1,     3
244 };
245
246 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
247    doesn't specify something else to do.  Zero means the default is an
248    error. */
249 static const short yydefact[] =
250 {
251        0,     0,    11,    10,     0,     1,     9,     0,     0,     0,
252        0,     0,     0,     0,     0,    12,     0,     3,     4,     5,
253        6,     7,     8,     0,     2,     0,     0,     0
254 };
255
256 static const short yydefgoto[] =
257 {
258       25,     5
259 };
260
261 static const short yypact[] =
262 {
263       -9,    -9,-32768,-32768,    -9,    34,-32768,    11,    -9,    -9,
264       -9,    -9,    -9,    -9,    -9,-32768,    24,    39,    43,    16,
265       26,    -3,-32768,    -9,    34,    21,    53,-32768
266 };
267
268 static const short yypgoto[] =
269 {
270   -32768,    -1
271 };
272
273
274 #define YYLAST      53
275
276
277 static const short yytable[] =
278 {
279        6,     1,     2,     7,     3,     4,    14,    16,    17,    18,
280       19,    20,    21,    22,     8,     9,    10,    11,    12,    13,
281       14,    26,    24,    12,    13,    14,    15,     8,     9,    10,
282       11,    12,    13,    14,    13,    14,    23,     8,     9,    10,
283       11,    12,    13,    14,    10,    11,    12,    13,    14,    11,
284       12,    13,    14,    27
285 };
286
287 static const short yycheck[] =
288 {
289        1,    10,    11,     4,    13,    14,     9,     8,     9,    10,
290       11,    12,    13,    14,     3,     4,     5,     6,     7,     8,
291        9,     0,    23,     7,     8,     9,    15,     3,     4,     5,
292        6,     7,     8,     9,     8,     9,    12,     3,     4,     5,
293        6,     7,     8,     9,     5,     6,     7,     8,     9,     6,
294        7,     8,     9,     0
295 };
296 #define YYPURE 1
297
298 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
299 #line 3 "/usr/local/share/bison/bison.simple"
300
301 /* Skeleton output parser for bison,
302
303    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
304    Foundation, Inc.
305
306    This program is free software; you can redistribute it and/or modify
307    it under the terms of the GNU General Public License as published by
308    the Free Software Foundation; either version 2, or (at your option)
309    any later version.
310
311    This program is distributed in the hope that it will be useful,
312    but WITHOUT ANY WARRANTY; without even the implied warranty of
313    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
314    GNU General Public License for more details.
315
316    You should have received a copy of the GNU General Public License
317    along with this program; if not, write to the Free Software
318    Foundation, Inc., 59 Temple Place - Suite 330,
319    Boston, MA 02111-1307, USA.  */
320
321 /* As a special exception, when this file is copied by Bison into a
322    Bison output file, you may use that output file without restriction.
323    This special exception was added by the Free Software Foundation
324    in version 1.24 of Bison.  */
325
326 /* This is the parser code that is written into each bison parser when
327    the %semantic_parser declaration is not specified in the grammar.
328    It was written by Richard Stallman by simplifying the hairy parser
329    used when %semantic_parser is specified.  */
330
331 /* All symbols defined below should begin with yy or YY, to avoid
332    infringing on user name space.  This should be done even for local
333    variables, as they might otherwise be expanded by user macros.
334    There are some unavoidable exceptions within include files to
335    define necessary library symbols; they are noted "INFRINGES ON
336    USER NAME SPACE" below.  */
337
338 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
339
340 /* The parser invokes alloca or malloc; define the necessary symbols.  */
341
342 # if YYSTACK_USE_ALLOCA
343 define YYSTACK_ALLOC alloca
344 # else
345 ifndef YYSTACK_USE_ALLOCA
346 #   if defined (alloca) || defined (_ALLOCA_H)
347 #    define YYSTACK_ALLOC alloca
348 #   else
349 #    ifdef __GNUC__
350 #     define YYSTACK_ALLOC __builtin_alloca
351 #    endif
352 #   endif
353 endif
354 # endif
355
356 # ifdef YYSTACK_ALLOC
357    /* Pacify GCC's `empty if-body' warning. */
358 define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
359 # else
360 if defined (__STDC__) || defined (__cplusplus)
361 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
362 #   define YYSIZE_T size_t
363 endif
364 define YYSTACK_ALLOC malloc
365 define YYSTACK_FREE free
366 # endif
367 #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
368
369
370 #if (! defined (yyoverflow) \
371      && (! defined (__cplusplus) \
372      || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
373
374 /* A type that is properly aligned for any stack member.  */
375 union yyalloc
376 {
377   short yyss;
378   YYSTYPE yyvs;
379 # if YYLSP_NEEDED
380   YYLTYPE yyls;
381 # endif
382 };
383
384 /* The size of the maximum gap between one aligned stack and the next.  */
385 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
386
387 /* The size of an array large to enough to hold all stacks, each with
388    N elements.  */
389 # if YYLSP_NEEDED
390 define YYSTACK_BYTES(N) \
391      ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE))  \
392       + 2 * YYSTACK_GAP_MAX)
393 # else
394 define YYSTACK_BYTES(N) \
395      ((N) * (sizeof (short) + sizeof (YYSTYPE))             \
396       + YYSTACK_GAP_MAX)
397 # endif
398
399 /* Copy COUNT objects from FROM to TO.  The source and destination do
400    not overlap.  */
401 # ifndef YYCOPY
402 if 1 < __GNUC__
403 #   define YYCOPY(To, From, Count) \
404       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
405 else
406 #   define YYCOPY(To, From, Count)      \
407       do                    \
408     {                   \
409       register YYSIZE_T yyi;        \
410       for (yyi = 0; yyi < (Count); yyi++)   \
411         (To)[yyi] = (From)[yyi];        \
412     }                   \
413       while (0)
414 endif
415 # endif
416
417 /* Relocate STACK from its old location to the new one.  The
418    local variables YYSIZE and YYSTACKSIZE give the old and new number of
419    elements in the stack, and YYPTR gives the new location of the
420    stack.  Advance YYPTR to a properly aligned location for the next
421    stack.  */
422 # define YYSTACK_RELOCATE(Stack)                    \
423     do                                  \
424       {                                 \
425     YYSIZE_T yynewbytes;                        \
426     YYCOPY (&yyptr->Stack, Stack, yysize);              \
427     Stack = &yyptr->Stack;                      \
428     yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX;   \
429     yyptr += yynewbytes / sizeof (*yyptr);              \
430       }                                 \
431     while (0)
432
433 #endif
434
435
436 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
437 # define YYSIZE_T __SIZE_TYPE__
438 #endif
439 #if ! defined (YYSIZE_T) && defined (size_t)
440 # define YYSIZE_T size_t
441 #endif
442 #if ! defined (YYSIZE_T)
443 # if defined (__STDC__) || defined (__cplusplus)
444 include <stddef.h> /* INFRINGES ON USER NAME SPACE */
445 define YYSIZE_T size_t
446 # endif
447 #endif
448 #if ! defined (YYSIZE_T)
449 # define YYSIZE_T unsigned int
450 #endif
451
452 #define yyerrok     (yyerrstatus = 0)
453 #define yyclearin   (yychar = YYEMPTY)
454 #define YYEMPTY     -2
455 #define YYEOF       0
456 #define YYACCEPT    goto yyacceptlab
457 #define YYABORT     goto yyabortlab
458 #define YYERROR     goto yyerrlab1
459 /* Like YYERROR except do call yyerror.  This remains here temporarily
460    to ease the transition to the new meaning of YYERROR, for GCC.
461    Once GCC version 2 has supplanted version 1, this can go.  */
462 #define YYFAIL      goto yyerrlab
463 #define YYRECOVERING()  (!!yyerrstatus)
464 #define YYBACKUP(Token, Value)                  \
465 do                              \
466   if (yychar == YYEMPTY && yylen == 1)              \
467     {                               \
468       yychar = (Token);                     \
469       yylval = (Value);                     \
470       yychar1 = YYTRANSLATE (yychar);               \
471       YYPOPSTACK;                       \
472       goto yybackup;                        \
473     }                               \
474   else                              \
475     {                               \
476       yyerror ("syntax error: cannot back up");         \
477       YYERROR;                          \
478     }                               \
479 while (0)
480
481 #define YYTERROR    1
482 #define YYERRCODE   256
483
484
485 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
486    are run).
487
488    When YYLLOC_DEFAULT is run, CURRENT is set the location of the
489    first token.  By default, to implement support for ranges, extend
490    its range to the last symbol.  */
491
492 #ifndef YYLLOC_DEFAULT
493 # define YYLLOC_DEFAULT(Current, Rhs, N)        \
494    Current.last_line   = Rhs[N].last_line;  \
495    Current.last_column = Rhs[N].last_column;
496 #endif
497
498
499 /* YYLEX -- calling `yylex' with the right arguments.  */
500
501 #if YYPURE
502 # if YYLSP_NEEDED
503 ifdef YYLEX_PARAM
504 #   define YYLEX        yylex (&yylval, &yylloc, YYLEX_PARAM)
505 else
506 #   define YYLEX        yylex (&yylval, &yylloc)
507 endif
508 # else /* !YYLSP_NEEDED */
509 ifdef YYLEX_PARAM
510 #   define YYLEX        yylex (&yylval, YYLEX_PARAM)
511 else
512 #   define YYLEX        yylex (&yylval)
513 endif
514 # endif /* !YYLSP_NEEDED */
515 #else /* !YYPURE */
516 # define YYLEX          yylex ()
517 #endif /* !YYPURE */
518
519
520 /* Enable debugging if requested.  */
521 #if YYDEBUG
522
523 # ifndef YYFPRINTF
524 include <stdio.h> /* INFRINGES ON USER NAME SPACE */
525 define YYFPRINTF fprintf
526 # endif
527
528 # define YYDPRINTF(Args)            \
529 do {                        \
530   if (yydebug)                  \
531     YYFPRINTF Args;             \
532 } while (0)
533 /* Nonzero means print parse trace.  It is left uninitialized so that
534    multiple parsers can coexist.  */
535 int yydebug;
536 #else /* !YYDEBUG */
537 # define YYDPRINTF(Args)
538 #endif /* !YYDEBUG */
539
540 /* YYINITDEPTH -- initial size of the parser's stacks.  */
541 #ifndef YYINITDEPTH
542 # define YYINITDEPTH 200
543 #endif
544
545 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
546    if the built-in stack extension method is used).
547
548    Do not make this value too large; the results are undefined if
549    SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
550    evaluated with infinite-precision integer arithmetic.  */
551
552 #if YYMAXDEPTH == 0
553 # undef YYMAXDEPTH
554 #endif
555
556 #ifndef YYMAXDEPTH
557 # define YYMAXDEPTH 10000
558 #endif
559
560 #ifdef YYERROR_VERBOSE
561
562 # ifndef yystrlen
563 if defined (__GLIBC__) && defined (_STRING_H)
564 #   define yystrlen strlen
565 else
566 /* Return the length of YYSTR.  */
567 static YYSIZE_T
568 #   if defined (__STDC__) || defined (__cplusplus)
569 yystrlen (const char *yystr)
570 #   else
571 yystrlen (yystr)
572      const char *yystr;
573 #   endif
574 {
575   register const char *yys = yystr;
576
577   while (*yys++ != '\0')
578     continue;
579
580   return yys - yystr - 1;
581 }
582 endif
583 # endif
584
585 # ifndef yystpcpy
586 if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
587 #   define yystpcpy stpcpy
588 else
589 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
590    YYDEST.  */
591 static char *
592 #   if defined (__STDC__) || defined (__cplusplus)
593 yystpcpy (char *yydest, const char *yysrc)
594 #   else
595 yystpcpy (yydest, yysrc)
596      char *yydest;
597      const char *yysrc;
598 #   endif
599 {
600   register char *yyd = yydest;
601   register const char *yys = yysrc;
602
603   while ((*yyd++ = *yys++) != '\0')
604     continue;
605
606   return yyd - 1;
607 }
608 endif
609 # endif
610 #endif
611
612 #line 315 "/usr/local/share/bison/bison.simple"
613
614
615 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
616    into yyparse.  The argument should have type void *.
617    It should actually point to an object.
618    Grammar actions can access the variable by casting it
619    to the proper pointer type.  */
620
621 #ifdef YYPARSE_PARAM
622 # if defined (__STDC__) || defined (__cplusplus)
623 define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
624 define YYPARSE_PARAM_DECL
625 # else
626 define YYPARSE_PARAM_ARG YYPARSE_PARAM
627 define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
628 # endif
629 #else /* !YYPARSE_PARAM */
630 # define YYPARSE_PARAM_ARG
631 # define YYPARSE_PARAM_DECL
632 #endif /* !YYPARSE_PARAM */
633
634 /* Prevent warning if -Wstrict-prototypes.  */
635 #ifdef __GNUC__
636 # ifdef YYPARSE_PARAM
637 int yyparse (void *);
638 # else
639 int yyparse (void);
640 # endif
641 #endif
642
643 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
644    variables are global, or local to YYPARSE.  */
645
646 #define YY_DECL_NON_LSP_VARIABLES           \
647 /* The lookahead symbol. */                \
648 int yychar;                     \
649                             \
650 /* The semantic value of the lookahead symbol. */   \
651 YYSTYPE yylval;                     \
652                             \
653 /* Number of parse errors so far. */           \
654 int yynerrs;
655
656 #if YYLSP_NEEDED
657 # define YY_DECL_VARIABLES          \
658 YY_DECL_NON_LSP_VARIABLES           \
659                         \
660 /* Location data for the lookahead symbol. */  \
661 YYLTYPE yylloc;
662 #else
663 # define YY_DECL_VARIABLES          \
664 YY_DECL_NON_LSP_VARIABLES
665 #endif
666
667
668 /* If nonreentrant, generate the variables here. */
669
670 #if !YYPURE
671 YY_DECL_VARIABLES
672 #endif  /* !YYPURE */
673
674 int
675 yyparse (YYPARSE_PARAM_ARG)
676      YYPARSE_PARAM_DECL
677 {
678   /* If reentrant, generate the variables here. */
679 #if YYPURE
680   YY_DECL_VARIABLES
681 #endif  /* !YYPURE */
682
683   register int yystate;
684   register int yyn;
685   int yyresult;
686   /* Number of tokens to shift before error messages enabled.  */
687   int yyerrstatus;
688   /* Lookahead token as an internal (translated) token number.  */
689   int yychar1 = 0;
690
691   /* Three stacks and their tools:
692      `yyss': related to states,
693      `yyvs': related to semantic values,
694      `yyls': related to locations.
695
696      Refer to the stacks thru separate pointers, to allow yyoverflow
697      to reallocate them elsewhere.  */
698
699   /* The state stack. */
700   short yyssa[YYINITDEPTH];
701   short *yyss = yyssa;
702   register short *yyssp;
703
704   /* The semantic value stack.  */
705   YYSTYPE yyvsa[YYINITDEPTH];
706   YYSTYPE *yyvs = yyvsa;
707   register YYSTYPE *yyvsp;
708
709 #if YYLSP_NEEDED
710   /* The location stack.  */
711   YYLTYPE yylsa[YYINITDEPTH];
712   YYLTYPE *yyls = yylsa;
713   YYLTYPE *yylsp;
714 #endif
715
716 #if YYLSP_NEEDED
717 # define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
718 #else
719 # define YYPOPSTACK   (yyvsp--, yyssp--)
720 #endif
721
722   YYSIZE_T yystacksize = YYINITDEPTH;
723
724
725   /* The variables used to return semantic value and location from the
726      action routines.  */
727   YYSTYPE yyval;
728 #if YYLSP_NEEDED
729   YYLTYPE yyloc;
730 #endif
731
732   /* When reducing, the number of symbols on the RHS of the reduced
733      rule. */
734   int yylen;
735
736   YYDPRINTF ((stderr, "Starting parse\n"));
737
738   yystate = 0;
739   yyerrstatus = 0;
740   yynerrs = 0;
741   yychar = YYEMPTY;     /* Cause a token to be read.  */
742
743   /* Initialize stack pointers.
744      Waste one element of value and location stack
745      so that they stay on the same level as the state stack.
746      The wasted elements are never initialized.  */
747
748   yyssp = yyss;
749   yyvsp = yyvs;
750 #if YYLSP_NEEDED
751   yylsp = yyls;
752 #endif
753   goto yysetstate;
754
755 /*------------------------------------------------------------.
756 | yynewstate -- Push a new state, which is found in yystate.  |
757 `------------------------------------------------------------*/
758  yynewstate:
759   /* In all cases, when you get here, the value and location stacks
760      have just been pushed. so pushing a state here evens the stacks.
761      */
762   yyssp++;
763
764  yysetstate:
765   *yyssp = yystate;
766
767   if (yyssp >= yyss + yystacksize - 1)
768     {
769       /* Get the current used size of the three stacks, in elements.  */
770       YYSIZE_T yysize = yyssp - yyss + 1;
771
772 #ifdef yyoverflow
773       {
774     /* Give user a chance to reallocate the stack. Use copies of
775        these so that the &'s don't force the real ones into
776        memory.  */
777     YYSTYPE *yyvs1 = yyvs;
778     short *yyss1 = yyss;
779
780     /* Each stack pointer address is followed by the size of the
781        data in use in that stack, in bytes.  */
782 # if YYLSP_NEEDED
783     YYLTYPE *yyls1 = yyls;
784     /* This used to be a conditional around just the two extra args,
785        but that might be undefined if yyoverflow is a macro.  */
786     yyoverflow ("parser stack overflow",
787             &yyss1, yysize * sizeof (*yyssp),
788             &yyvs1, yysize * sizeof (*yyvsp),
789             &yyls1, yysize * sizeof (*yylsp),
790             &yystacksize);
791     yyls = yyls1;
792 # else
793     yyoverflow ("parser stack overflow",
794             &yyss1, yysize * sizeof (*yyssp),
795             &yyvs1, yysize * sizeof (*yyvsp),
796             &yystacksize);
797 # endif
798     yyss = yyss1;
799     yyvs = yyvs1;
800       }
801 #else /* no yyoverflow */
802 # ifndef YYSTACK_RELOCATE
803       goto yyoverflowlab;
804 # else
805       /* Extend the stack our own way.  */
806       if (yystacksize >= YYMAXDEPTH)
807     goto yyoverflowlab;
808       yystacksize *= 2;
809       if (yystacksize > YYMAXDEPTH)
810     yystacksize = YYMAXDEPTH;
811
812       {
813     short *yyss1 = yyss;
814     union yyalloc *yyptr =
815       (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
816     if (! yyptr)
817       goto yyoverflowlab;
818     YYSTACK_RELOCATE (yyss);
819     YYSTACK_RELOCATE (yyvs);
820 # if YYLSP_NEEDED
821     YYSTACK_RELOCATE (yyls);
822 # endif
823 # undef YYSTACK_RELOCATE
824     if (yyss1 != yyssa)
825       YYSTACK_FREE (yyss1);
826       }
827 # endif
828 #endif /* no yyoverflow */
829
830       yyssp = yyss + yysize - 1;
831       yyvsp = yyvs + yysize - 1;
832 #if YYLSP_NEEDED
833       yylsp = yyls + yysize - 1;
834 #endif
835
836       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
837           (unsigned long int) yystacksize));
838
839       if (yyssp >= yyss + yystacksize - 1)
840     YYABORT;
841     }
842
843   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
844
845   goto yybackup;
846
847
848 /*-----------.
849 | yybackup.  |
850 `-----------*/
851 yybackup:
852
853 /* Do appropriate processing given the current state.  */
854 /* Read a lookahead token if we need one and don't already have one.  */
855 /* yyresume: */
856
857   /* First try to decide what to do without reference to lookahead token.  */
858
859   yyn = yypact[yystate];
860   if (yyn == YYFLAG)
861     goto yydefault;
862
863   /* Not known => get a lookahead token if don't already have one.  */
864
865   /* yychar is either YYEMPTY or YYEOF
866      or a valid token in external form.  */
867
868   if (yychar == YYEMPTY)
869     {
870       YYDPRINTF ((stderr, "Reading a token: "));
871       yychar = YYLEX;
872     }
873
874   /* Convert token to internal form (in yychar1) for indexing tables with */
875
876   if (yychar <= 0)      /* This means end of input. */
877     {
878       yychar1 = 0;
879       yychar = YYEOF;       /* Don't call YYLEX any more */
880
881       YYD