~ubuntu-branches/ubuntu/gutsy/findutils/gutsy-proposed

« back to all changes in this revision

Viewing changes to intl/plural.c

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Metzler
  • Date: 2005-07-04 11:37:37 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050704113737-ll89ui8be35r0pir
Tags: 4.2.22-2
* Remove locatedb on purge. (Closes: #315343)
* revert regex-syntax back to emacs-re. (Closes: #315136) Future versions
  will allow to select this by commandline parameter.

Show diffs side-by-side

added added

removed removed

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