Coverage Report

Created: 2026-03-12 07:14

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/gettext/gettext-runtime/intl/plural.c
Line
Count
Source
1
/* A Bison parser, made by GNU Bison 3.5.1.  */
2
3
/* Bison implementation for Yacc-like parsers in C
4
5
   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
6
   Inc.
7
8
   This program is free software: you can redistribute it and/or modify
9
   it under the terms of the GNU General Public License as published by
10
   the Free Software Foundation, either version 3 of the License, or
11
   (at your option) any later version.
12
13
   This program is distributed in the hope that it will be useful,
14
   but WITHOUT ANY WARRANTY; without even the implied warranty of
15
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
   GNU General Public License for more details.
17
18
   You should have received a copy of the GNU General Public License
19
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
20
21
/* As a special exception, you may create a larger work that contains
22
   part or all of the Bison parser skeleton and distribute that work
23
   under terms of your choice, so long as that work isn't itself a
24
   parser generator using the skeleton or a modified version thereof
25
   as a parser skeleton.  Alternatively, if you modify or redistribute
26
   the parser skeleton itself, you may (at your option) remove this
27
   special exception, which will cause the skeleton and the resulting
28
   Bison output files to be licensed under the GNU General Public
29
   License without this special exception.
30
31
   This special exception was added by the Free Software Foundation in
32
   version 2.2 of Bison.  */
33
34
/* C LALR(1) parser skeleton written by Richard Stallman, by
35
   simplifying the original so-called "semantic" parser.  */
36
37
/* All symbols defined below should begin with yy or YY, to avoid
38
   infringing on user name space.  This should be done even for local
39
   variables, as they might otherwise be expanded by user macros.
40
   There are some unavoidable exceptions within include files to
41
   define necessary library symbols; they are noted "INFRINGES ON
42
   USER NAME SPACE" below.  */
43
44
/* Undocumented macros, especially those whose name start with YY_,
45
   are private implementation details.  Do not rely on them.  */
46
47
/* Identify Bison output.  */
48
#define YYBISON 1
49
50
/* Bison version.  */
51
#define YYBISON_VERSION "3.5.1"
52
53
/* Skeleton name.  */
54
#define YYSKELETON_NAME "yacc.c"
55
56
/* Pure parsers.  */
57
#define YYPURE 2
58
59
/* Push parsers.  */
60
#define YYPUSH 0
61
62
/* Pull parsers.  */
63
#define YYPULL 1
64
65
66
/* Substitute the variable and function names.  */
67
#define yyparse         __gettextparse
68
0
#define yylex           __gettextlex
69
0
#define yyerror         __gettexterror
70
#define yydebug         __gettextdebug
71
0
#define yynerrs         __gettextnerrs
72
73
/* First part of user prologue.  */
74
#line 1 "plural.y"
75
76
/* Expression parsing for plural form selection.
77
   Copyright (C) 2000-2026 Free Software Foundation, Inc.
78
79
   This program is free software: you can redistribute it and/or modify
80
   it under the terms of the GNU Lesser General Public License as published by
81
   the Free Software Foundation; either version 2.1 of the License, or
82
   (at your option) any later version.
83
84
   This program is distributed in the hope that it will be useful,
85
   but WITHOUT ANY WARRANTY; without even the implied warranty of
86
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
87
   GNU Lesser General Public License for more details.
88
89
   You should have received a copy of the GNU Lesser General Public License
90
   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
91
92
/* Written by Ulrich Drepper, Bruno Haible, and Daiki Ueno.  */
93
94
#ifdef HAVE_CONFIG_H
95
# include <config.h>
96
#endif
97
98
#include <stddef.h>
99
#include <stdlib.h>
100
#include <string.h>
101
#include "plural-exp.h"
102
#include "attribute.h"
103
104
/* The main function generated by the parser is called __gettextparse,
105
   but we want it to be called PLURAL_PARSE.  */
106
#ifndef _LIBC
107
# define __gettextparse PLURAL_PARSE
108
#endif
109
110
/* Later we provide those prototypes.  Without these macros, bison may
111
   generate its own prototypes with possible conflicts.  */
112
#define YYLEX_IS_DECLARED
113
#define YYERROR_IS_DECLARED
114
115
116
#line 117 "plural.c"
117
118
# ifndef YY_CAST
119
#  ifdef __cplusplus
120
#   define YY_CAST(Type, Val) static_cast<Type> (Val)
121
#   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
122
#  else
123
0
#   define YY_CAST(Type, Val) ((Type) (Val))
124
#   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
125
#  endif
126
# endif
127
# ifndef YY_NULLPTR
128
#  if defined __cplusplus
129
#   if 201103L <= __cplusplus
130
#    define YY_NULLPTR nullptr
131
#   else
132
#    define YY_NULLPTR 0
133
#   endif
134
#  else
135
#   define YY_NULLPTR ((void*)0)
136
#  endif
137
# endif
138
139
/* Enabling verbose error messages.  */
140
#ifdef YYERROR_VERBOSE
141
# undef YYERROR_VERBOSE
142
# define YYERROR_VERBOSE 1
143
#else
144
# define YYERROR_VERBOSE 0
145
#endif
146
147
/* Use api.header.include to #include this header
148
   instead of duplicating it here.  */
149
#ifndef YY__GETTEXT_PLURAL_TAB_H_INCLUDED
150
# define YY__GETTEXT_PLURAL_TAB_H_INCLUDED
151
/* Debug traces.  */
152
#ifndef YYDEBUG
153
# define YYDEBUG 0
154
#endif
155
#if YYDEBUG
156
extern int __gettextdebug;
157
#endif
158
159
/* Token type.  */
160
#ifndef YYTOKENTYPE
161
# define YYTOKENTYPE
162
  enum yytokentype
163
  {
164
    EQUOP2 = 258,
165
    CMPOP2 = 259,
166
    ADDOP2 = 260,
167
    MULOP2 = 261,
168
    NUMBER = 262
169
  };
170
#endif
171
172
/* Value type.  */
173
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
174
union YYSTYPE
175
{
176
#line 48 "plural.y"
177
178
  unsigned long int num;
179
  enum expression_operator op;
180
  struct expression *exp;
181
182
#line 183 "plural.c"
183
184
};
185
typedef union YYSTYPE YYSTYPE;
186
# define YYSTYPE_IS_TRIVIAL 1
187
# define YYSTYPE_IS_DECLARED 1
188
#endif
189
190
191
192
int __gettextparse (struct parse_args *arg);
193
194
#endif /* !YY__GETTEXT_PLURAL_TAB_H_INCLUDED  */
195
196
/* Second part of user prologue.  */
197
#line 54 "plural.y"
198
199
/* Prototypes for local functions.  */
200
static int yylex (YYSTYPE *lval, struct parse_args *arg);
201
static void yyerror (struct parse_args *arg, const char *str);
202
203
/* Allocation of expressions.  */
204
205
static struct expression *
206
new_exp (int nargs, enum expression_operator op,
207
   struct expression * const *args)
208
0
{
209
0
  int i;
210
0
  struct expression *newp;
211
212
  /* If any of the argument could not be malloc'ed, just return NULL.  */
213
0
  for (i = nargs - 1; i >= 0; i--)
214
0
    if (args[i] == NULL)
215
0
      goto fail;
216
217
  /* Allocate a new expression.  */
218
0
  newp = (struct expression *) malloc (sizeof (*newp));
219
0
  if (newp != NULL)
220
0
    {
221
0
      newp->nargs = nargs;
222
0
      newp->operation = op;
223
0
      for (i = nargs - 1; i >= 0; i--)
224
0
  newp->val.args[i] = args[i];
225
0
      return newp;
226
0
    }
227
228
0
 fail:
229
0
  for (i = nargs - 1; i >= 0; i--)
230
0
    FREE_EXPRESSION (args[i]);
231
232
0
  return NULL;
233
0
}
234
235
static inline struct expression *
236
new_exp_0 (enum expression_operator op)
237
0
{
238
0
  return new_exp (0, op, NULL);
239
0
}
240
241
static inline struct expression *
242
new_exp_1 (enum expression_operator op, struct expression *right)
243
0
{
244
0
  struct expression *args[1];
245
246
0
  args[0] = right;
247
0
  return new_exp (1, op, args);
248
0
}
249
250
static struct expression *
251
new_exp_2 (enum expression_operator op, struct expression *left,
252
     struct expression *right)
253
0
{
254
0
  struct expression *args[2];
255
256
0
  args[0] = left;
257
0
  args[1] = right;
258
0
  return new_exp (2, op, args);
259
0
}
260
261
static inline struct expression *
262
new_exp_3 (enum expression_operator op, struct expression *bexp,
263
     struct expression *tbranch, struct expression *fbranch)
264
0
{
265
0
  struct expression *args[3];
266
267
0
  args[0] = bexp;
268
0
  args[1] = tbranch;
269
0
  args[2] = fbranch;
270
0
  return new_exp (3, op, args);
271
0
}
272
273
274
#line 275 "plural.c"
275
276
277
#ifdef short
278
# undef short
279
#endif
280
281
/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
282
   <limits.h> and (if available) <stdint.h> are included
283
   so that the code can choose integer types of a good width.  */
284
285
#ifndef __PTRDIFF_MAX__
286
# include <limits.h> /* INFRINGES ON USER NAME SPACE */
287
# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
288
#  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
289
#  define YY_STDINT_H
290
# endif
291
#endif
292
293
/* Narrow types that promote to a signed type and that can represent a
294
   signed or unsigned integer of at least N bits.  In tables they can
295
   save space and decrease cache pressure.  Promoting to a signed type
296
   helps avoid bugs in integer arithmetic.  */
297
298
#ifdef __INT_LEAST8_MAX__
299
typedef __INT_LEAST8_TYPE__ yytype_int8;
300
#elif defined YY_STDINT_H
301
typedef int_least8_t yytype_int8;
302
#else
303
typedef signed char yytype_int8;
304
#endif
305
306
#ifdef __INT_LEAST16_MAX__
307
typedef __INT_LEAST16_TYPE__ yytype_int16;
308
#elif defined YY_STDINT_H
309
typedef int_least16_t yytype_int16;
310
#else
311
typedef short yytype_int16;
312
#endif
313
314
#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
315
typedef __UINT_LEAST8_TYPE__ yytype_uint8;
316
#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
317
       && UINT_LEAST8_MAX <= INT_MAX)
318
typedef uint_least8_t yytype_uint8;
319
#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
320
typedef unsigned char yytype_uint8;
321
#else
322
typedef short yytype_uint8;
323
#endif
324
325
#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
326
typedef __UINT_LEAST16_TYPE__ yytype_uint16;
327
#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
328
       && UINT_LEAST16_MAX <= INT_MAX)
329
typedef uint_least16_t yytype_uint16;
330
#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
331
typedef unsigned short yytype_uint16;
332
#else
333
typedef int yytype_uint16;
334
#endif
335
336
#ifndef YYPTRDIFF_T
337
# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
338
0
#  define YYPTRDIFF_T __PTRDIFF_TYPE__
339
#  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
340
# elif defined PTRDIFF_MAX
341
#  ifndef ptrdiff_t
342
#   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
343
#  endif
344
#  define YYPTRDIFF_T ptrdiff_t
345
#  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
346
# else
347
#  define YYPTRDIFF_T long
348
#  define YYPTRDIFF_MAXIMUM LONG_MAX
349
# endif
350
#endif
351
352
#ifndef YYSIZE_T
353
# ifdef __SIZE_TYPE__
354
#  define YYSIZE_T __SIZE_TYPE__
355
# elif defined size_t
356
#  define YYSIZE_T size_t
357
# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
358
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
359
#  define YYSIZE_T size_t
360
# else
361
#  define YYSIZE_T unsigned
362
# endif
363
#endif
364
365
#define YYSIZE_MAXIMUM                                  \
366
  YY_CAST (YYPTRDIFF_T,                                 \
367
           (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
368
            ? YYPTRDIFF_MAXIMUM                         \
369
            : YY_CAST (YYSIZE_T, -1)))
370
371
0
#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
372
373
/* Stored state numbers (used for stacks). */
374
typedef yytype_int8 yy_state_t;
375
376
/* State numbers in computations.  */
377
typedef int yy_state_fast_t;
378
379
#ifndef YY_
380
# if defined YYENABLE_NLS && YYENABLE_NLS
381
#  if ENABLE_NLS
382
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
383
#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
384
#  endif
385
# endif
386
# ifndef YY_
387
0
#  define YY_(Msgid) Msgid
388
# endif
389
#endif
390
391
#ifndef YY_ATTRIBUTE_PURE
392
# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
393
#  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
394
# else
395
#  define YY_ATTRIBUTE_PURE
396
# endif
397
#endif
398
399
#ifndef YY_ATTRIBUTE_UNUSED
400
# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
401
#  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
402
# else
403
#  define YY_ATTRIBUTE_UNUSED
404
# endif
405
#endif
406
407
/* Suppress unused-variable warnings by "using" E.  */
408
#if ! defined lint || defined __GNUC__
409
0
# define YYUSE(E) ((void) (E))
410
#else
411
# define YYUSE(E) /* empty */
412
#endif
413
414
#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
415
/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
416
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                            \
417
    _Pragma ("GCC diagnostic push")                                     \
418
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
419
    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
420
# define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
421
    _Pragma ("GCC diagnostic pop")
422
#else
423
0
# define YY_INITIAL_VALUE(Value) Value
424
#endif
425
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
426
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
427
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
428
#endif
429
#ifndef YY_INITIAL_VALUE
430
# define YY_INITIAL_VALUE(Value) /* Nothing. */
431
#endif
432
433
#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
434
# define YY_IGNORE_USELESS_CAST_BEGIN                          \
435
    _Pragma ("GCC diagnostic push")                            \
436
    _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
437
# define YY_IGNORE_USELESS_CAST_END            \
438
    _Pragma ("GCC diagnostic pop")
439
#endif
440
#ifndef YY_IGNORE_USELESS_CAST_BEGIN
441
# define YY_IGNORE_USELESS_CAST_BEGIN
442
# define YY_IGNORE_USELESS_CAST_END
443
#endif
444
445
446
0
#define YY_ASSERT(E) ((void) (0 && (E)))
447
448
#if ! defined yyoverflow || YYERROR_VERBOSE
449
450
/* The parser invokes alloca or malloc; define the necessary symbols.  */
451
452
# ifdef YYSTACK_USE_ALLOCA
453
#  if YYSTACK_USE_ALLOCA
454
#   ifdef __GNUC__
455
#    define YYSTACK_ALLOC __builtin_alloca
456
#   elif defined __BUILTIN_VA_ARG_INCR
457
#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
458
#   elif defined _AIX
459
#    define YYSTACK_ALLOC __alloca
460
#   elif defined _MSC_VER
461
#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
462
#    define alloca _alloca
463
#   else
464
#    define YYSTACK_ALLOC alloca
465
#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
466
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
467
      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
468
#     ifndef EXIT_SUCCESS
469
#      define EXIT_SUCCESS 0
470
#     endif
471
#    endif
472
#   endif
473
#  endif
474
# endif
475
476
# ifdef YYSTACK_ALLOC
477
   /* Pacify GCC's 'empty if-body' warning.  */
478
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
479
#  ifndef YYSTACK_ALLOC_MAXIMUM
480
    /* The OS might guarantee only one guard page at the bottom of the stack,
481
       and a page size can be as small as 4096 bytes.  So we cannot safely
482
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
483
       to allow for a few compiler-allocated temporary stack slots.  */
484
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
485
#  endif
486
# else
487
#  define YYSTACK_ALLOC YYMALLOC
488
0
#  define YYSTACK_FREE YYFREE
489
#  ifndef YYSTACK_ALLOC_MAXIMUM
490
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
491
#  endif
492
#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
493
       && ! ((defined YYMALLOC || defined malloc) \
494
             && (defined YYFREE || defined free)))
495
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
496
#   ifndef EXIT_SUCCESS
497
#    define EXIT_SUCCESS 0
498
#   endif
499
#  endif
500
#  ifndef YYMALLOC
501
#   define YYMALLOC malloc
502
#   if ! defined malloc && ! defined EXIT_SUCCESS
503
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
504
#   endif
505
#  endif
506
#  ifndef YYFREE
507
0
#   define YYFREE free
508
#   if ! defined free && ! defined EXIT_SUCCESS
509
void free (void *); /* INFRINGES ON USER NAME SPACE */
510
#   endif
511
#  endif
512
# endif
513
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
514
515
516
#if (! defined yyoverflow \
517
     && (! defined __cplusplus \
518
         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
519
520
/* A type that is properly aligned for any stack member.  */
521
union yyalloc
522
{
523
  yy_state_t yyss_alloc;
524
  YYSTYPE yyvs_alloc;
525
};
526
527
/* The size of the maximum gap between one aligned stack and the next.  */
528
0
# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
529
530
/* The size of an array large to enough to hold all stacks, each with
531
   N elements.  */
532
# define YYSTACK_BYTES(N) \
533
     ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
534
      + YYSTACK_GAP_MAXIMUM)
535
536
# define YYCOPY_NEEDED 1
537
538
/* Relocate STACK from its old location to the new one.  The
539
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
540
   elements in the stack, and YYPTR gives the new location of the
541
   stack.  Advance YYPTR to a properly aligned location for the next
542
   stack.  */
543
# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
544
0
    do                                                                  \
545
0
      {                                                                 \
546
0
        YYPTRDIFF_T yynewbytes;                                         \
547
0
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
548
0
        Stack = &yyptr->Stack_alloc;                                    \
549
0
        yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
550
0
        yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
551
0
      }                                                                 \
552
0
    while (0)
553
554
#endif
555
556
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
557
/* Copy COUNT objects from SRC to DST.  The source and destination do
558
   not overlap.  */
559
# ifndef YYCOPY
560
#  if defined __GNUC__ && 1 < __GNUC__
561
#   define YYCOPY(Dst, Src, Count) \
562
0
      __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
563
#  else
564
#   define YYCOPY(Dst, Src, Count)              \
565
      do                                        \
566
        {                                       \
567
          YYPTRDIFF_T yyi;                      \
568
          for (yyi = 0; yyi < (Count); yyi++)   \
569
            (Dst)[yyi] = (Src)[yyi];            \
570
        }                                       \
571
      while (0)
572
#  endif
573
# endif
574
#endif /* !YYCOPY_NEEDED */
575
576
/* YYFINAL -- State number of the termination state.  */
577
0
#define YYFINAL  9
578
/* YYLAST -- Last index in YYTABLE.  */
579
0
#define YYLAST   53
580
581
/* YYNTOKENS -- Number of terminals.  */
582
0
#define YYNTOKENS  16
583
/* YYNNTS -- Number of nonterminals.  */
584
#define YYNNTS  3
585
/* YYNRULES -- Number of rules.  */
586
#define YYNRULES  13
587
/* YYNSTATES -- Number of states.  */
588
#define YYNSTATES  27
589
590
0
#define YYUNDEFTOK  2
591
0
#define YYMAXUTOK   262
592
593
594
/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
595
   as returned by yylex, with out-of-bounds checking.  */
596
#define YYTRANSLATE(YYX)                                                \
597
0
  (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
598
599
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
600
   as returned by yylex.  */
601
static const yytype_int8 yytranslate[] =
602
{
603
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
604
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
605
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
606
       2,     2,     2,    11,     2,     2,     2,     2,     6,     2,
607
      14,    15,     2,     2,     2,     2,     2,     2,     2,     2,
608
       2,     2,     2,     2,     2,     2,     2,     2,     4,     2,
609
       2,     2,     2,     3,     2,     2,     2,     2,     2,     2,
610
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
611
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
612
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
613
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
614
      13,     2,     2,     2,     2,     2,     2,     2,     2,     2,
615
       2,     2,     2,     2,     5,     2,     2,     2,     2,     2,
616
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
617
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
618
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
619
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
620
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
621
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
622
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
623
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
624
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
625
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
626
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
627
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
628
       2,     2,     2,     2,     2,     2,     1,     2,     7,     8,
629
       9,    10,    12
630
};
631
632
#if YYDEBUG
633
  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
634
static const yytype_uint8 yyrline[] =
635
{
636
       0,   151,   151,   159,   163,   167,   171,   175,   179,   183,
637
     187,   191,   195,   200
638
};
639
#endif
640
641
#if YYDEBUG || YYERROR_VERBOSE || 0
642
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
643
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
644
static const char *const yytname[] =
645
{
646
  "$end", "error", "$undefined", "'?'", "':'", "'|'", "'&'", "EQUOP2",
647
  "CMPOP2", "ADDOP2", "MULOP2", "'!'", "NUMBER", "'n'", "'('", "')'",
648
  "$accept", "start", "exp", YY_NULLPTR
649
};
650
#endif
651
652
# ifdef YYPRINT
653
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
654
   (internal) symbol number NUM (which must be that of a token).  */
655
static const yytype_int16 yytoknum[] =
656
{
657
       0,   256,   257,    63,    58,   124,    38,   258,   259,   260,
658
     261,    33,   262,   110,    40,    41
659
};
660
# endif
661
662
0
#define YYPACT_NINF (-9)
663
664
#define yypact_value_is_default(Yyn) \
665
0
  ((Yyn) == YYPACT_NINF)
666
667
#define YYTABLE_NINF (-1)
668
669
#define yytable_value_is_error(Yyn) \
670
0
  0
671
672
  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
673
     STATE-NUM.  */
674
static const yytype_int8 yypact[] =
675
{
676
      35,    35,    -9,    -9,    35,    38,    34,    -9,    13,    -9,
677
      35,    35,    35,    35,    35,    35,    35,    -9,    26,    -2,
678
      43,    17,    -8,     7,    -9,    35,    34
679
};
680
681
  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
682
     Performed when YYTABLE does not specify something else to do.  Zero
683
     means the default is an error.  */
684
static const yytype_int8 yydefact[] =
685
{
686
       0,     0,    12,    11,     0,     0,     2,    10,     0,     1,
687
       0,     0,     0,     0,     0,     0,     0,    13,     0,     4,
688
       5,     6,     7,     8,     9,     0,     3
689
};
690
691
  /* YYPGOTO[NTERM-NUM].  */
692
static const yytype_int8 yypgoto[] =
693
{
694
      -9,    -9,    -1
695
};
696
697
  /* YYDEFGOTO[NTERM-NUM].  */
698
static const yytype_int8 yydefgoto[] =
699
{
700
      -1,     5,     6
701
};
702
703
  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
704
     positive, shift that token.  If negative, reduce the rule whose
705
     number is the opposite.  If YYTABLE_NINF, syntax error.  */
706
static const yytype_int8 yytable[] =
707
{
708
       7,    15,    16,     8,    12,    13,    14,    15,    16,    18,
709
      19,    20,    21,    22,    23,    24,    10,    16,    11,    12,
710
      13,    14,    15,    16,    26,    14,    15,    16,    17,    10,
711
      25,    11,    12,    13,    14,    15,    16,    10,     9,    11,
712
      12,    13,    14,    15,    16,     0,     1,     2,     3,     4,
713
      13,    14,    15,    16
714
};
715
716
static const yytype_int8 yycheck[] =
717
{
718
       1,     9,    10,     4,     6,     7,     8,     9,    10,    10,
719
      11,    12,    13,    14,    15,    16,     3,    10,     5,     6,
720
       7,     8,     9,    10,    25,     8,     9,    10,    15,     3,
721
       4,     5,     6,     7,     8,     9,    10,     3,     0,     5,
722
       6,     7,     8,     9,    10,    -1,    11,    12,    13,    14,
723
       7,     8,     9,    10
724
};
725
726
  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
727
     symbol of state STATE-NUM.  */
728
static const yytype_int8 yystos[] =
729
{
730
       0,    11,    12,    13,    14,    17,    18,    18,    18,     0,
731
       3,     5,     6,     7,     8,     9,    10,    15,    18,    18,
732
      18,    18,    18,    18,    18,     4,    18
733
};
734
735
  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
736
static const yytype_int8 yyr1[] =
737
{
738
       0,    16,    17,    18,    18,    18,    18,    18,    18,    18,
739
      18,    18,    18,    18
740
};
741
742
  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
743
static const yytype_int8 yyr2[] =
744
{
745
       0,     2,     1,     5,     3,     3,     3,     3,     3,     3,
746
       2,     1,     1,     3
747
};
748
749
750
#define yyerrok         (yyerrstatus = 0)
751
#define yyclearin       (yychar = YYEMPTY)
752
0
#define YYEMPTY         (-2)
753
0
#define YYEOF           0
754
755
0
#define YYACCEPT        goto yyacceptlab
756
0
#define YYABORT         goto yyabortlab
757
0
#define YYERROR         goto yyerrorlab
758
759
760
#define YYRECOVERING()  (!!yyerrstatus)
761
762
#define YYBACKUP(Token, Value)                                    \
763
  do                                                              \
764
    if (yychar == YYEMPTY)                                        \
765
      {                                                           \
766
        yychar = (Token);                                         \
767
        yylval = (Value);                                         \
768
        YYPOPSTACK (yylen);                                       \
769
        yystate = *yyssp;                                         \
770
        goto yybackup;                                            \
771
      }                                                           \
772
    else                                                          \
773
      {                                                           \
774
        yyerror (arg, YY_("syntax error: cannot back up")); \
775
        YYERROR;                                                  \
776
      }                                                           \
777
  while (0)
778
779
/* Error token number */
780
0
#define YYTERROR        1
781
0
#define YYERRCODE       256
782
783
784
785
/* Enable debugging if requested.  */
786
#if YYDEBUG
787
788
# ifndef YYFPRINTF
789
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
790
#  define YYFPRINTF fprintf
791
# endif
792
793
# define YYDPRINTF(Args)                        \
794
do {                                            \
795
  if (yydebug)                                  \
796
    YYFPRINTF Args;                             \
797
} while (0)
798
799
/* This macro is provided for backward compatibility. */
800
#ifndef YY_LOCATION_PRINT
801
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
802
#endif
803
804
805
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
806
do {                                                                      \
807
  if (yydebug)                                                            \
808
    {                                                                     \
809
      YYFPRINTF (stderr, "%s ", Title);                                   \
810
      yy_symbol_print (stderr,                                            \
811
                  Type, Value, arg); \
812
      YYFPRINTF (stderr, "\n");                                           \
813
    }                                                                     \
814
} while (0)
815
816
817
/*-----------------------------------.
818
| Print this symbol's value on YYO.  |
819
`-----------------------------------*/
820
821
static void
822
yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, struct parse_args *arg)
823
{
824
  FILE *yyoutput = yyo;
825
  YYUSE (yyoutput);
826
  YYUSE (arg);
827
  if (!yyvaluep)
828
    return;
829
# ifdef YYPRINT
830
  if (yytype < YYNTOKENS)
831
    YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
832
# endif
833
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
834
  YYUSE (yytype);
835
  YY_IGNORE_MAYBE_UNINITIALIZED_END
836
}
837
838
839
/*---------------------------.
840
| Print this symbol on YYO.  |
841
`---------------------------*/
842
843
static void
844
yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, struct parse_args *arg)
845
{
846
  YYFPRINTF (yyo, "%s %s (",
847
             yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
848
849
  yy_symbol_value_print (yyo, yytype, yyvaluep, arg);
850
  YYFPRINTF (yyo, ")");
851
}
852
853
/*------------------------------------------------------------------.
854
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
855
| TOP (included).                                                   |
856
`------------------------------------------------------------------*/
857
858
static void
859
yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
860
{
861
  YYFPRINTF (stderr, "Stack now");
862
  for (; yybottom <= yytop; yybottom++)
863
    {
864
      int yybot = *yybottom;
865
      YYFPRINTF (stderr, " %d", yybot);
866
    }
867
  YYFPRINTF (stderr, "\n");
868
}
869
870
# define YY_STACK_PRINT(Bottom, Top)                            \
871
do {                                                            \
872
  if (yydebug)                                                  \
873
    yy_stack_print ((Bottom), (Top));                           \
874
} while (0)
875
876
877
/*------------------------------------------------.
878
| Report that the YYRULE is going to be reduced.  |
879
`------------------------------------------------*/
880
881
static void
882
yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule, struct parse_args *arg)
883
{
884
  int yylno = yyrline[yyrule];
885
  int yynrhs = yyr2[yyrule];
886
  int yyi;
887
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
888
             yyrule - 1, yylno);
889
  /* The symbols being reduced.  */
890
  for (yyi = 0; yyi < yynrhs; yyi++)
891
    {
892
      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
893
      yy_symbol_print (stderr,
894
                       yystos[+yyssp[yyi + 1 - yynrhs]],
895
                       &yyvsp[(yyi + 1) - (yynrhs)]
896
                                              , arg);
897
      YYFPRINTF (stderr, "\n");
898
    }
899
}
900
901
# define YY_REDUCE_PRINT(Rule)          \
902
do {                                    \
903
  if (yydebug)                          \
904
    yy_reduce_print (yyssp, yyvsp, Rule, arg); \
905
} while (0)
906
907
/* Nonzero means print parse trace.  It is left uninitialized so that
908
   multiple parsers can coexist.  */
909
int yydebug;
910
#else /* !YYDEBUG */
911
# define YYDPRINTF(Args)
912
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
913
# define YY_STACK_PRINT(Bottom, Top)
914
# define YY_REDUCE_PRINT(Rule)
915
#endif /* !YYDEBUG */
916
917
918
/* YYINITDEPTH -- initial size of the parser's stacks.  */
919
#ifndef YYINITDEPTH
920
0
# define YYINITDEPTH 200
921
#endif
922
923
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
924
   if the built-in stack extension method is used).
925
926
   Do not make this value too large; the results are undefined if
927
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
928
   evaluated with infinite-precision integer arithmetic.  */
929
930
#ifndef YYMAXDEPTH
931
0
# define YYMAXDEPTH 10000
932
#endif
933
934
935
#if YYERROR_VERBOSE
936
937
# ifndef yystrlen
938
#  if defined __GLIBC__ && defined _STRING_H
939
#   define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
940
#  else
941
/* Return the length of YYSTR.  */
942
static YYPTRDIFF_T
943
yystrlen (const char *yystr)
944
{
945
  YYPTRDIFF_T yylen;
946
  for (yylen = 0; yystr[yylen]; yylen++)
947
    continue;
948
  return yylen;
949
}
950
#  endif
951
# endif
952
953
# ifndef yystpcpy
954
#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
955
#   define yystpcpy stpcpy
956
#  else
957
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
958
   YYDEST.  */
959
static char *
960
yystpcpy (char *yydest, const char *yysrc)
961
{
962
  char *yyd = yydest;
963
  const char *yys = yysrc;
964
965
  while ((*yyd++ = *yys++) != '\0')
966
    continue;
967
968
  return yyd - 1;
969
}
970
#  endif
971
# endif
972
973
# ifndef yytnamerr
974
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
975
   quotes and backslashes, so that it's suitable for yyerror.  The
976
   heuristic is that double-quoting is unnecessary unless the string
977
   contains an apostrophe, a comma, or backslash (other than
978
   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
979
   null, do not copy; instead, return the length of what the result
980
   would have been.  */
981
static YYPTRDIFF_T
982
yytnamerr (char *yyres, const char *yystr)
983
{
984
  if (*yystr == '"')
985
    {
986
      YYPTRDIFF_T yyn = 0;
987
      char const *yyp = yystr;
988
989
      for (;;)
990
        switch (*++yyp)
991
          {
992
          case '\'':
993
          case ',':
994
            goto do_not_strip_quotes;
995
996
          case '\\':
997
            if (*++yyp != '\\')
998
              goto do_not_strip_quotes;
999
            else
1000
              goto append;
1001
1002
          append:
1003
          default:
1004
            if (yyres)
1005
              yyres[yyn] = *yyp;
1006
            yyn++;
1007
            break;
1008
1009
          case '"':
1010
            if (yyres)
1011
              yyres[yyn] = '\0';
1012
            return yyn;
1013
          }
1014
    do_not_strip_quotes: ;
1015
    }
1016
1017
  if (yyres)
1018
    return yystpcpy (yyres, yystr) - yyres;
1019
  else
1020
    return yystrlen (yystr);
1021
}
1022
# endif
1023
1024
/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1025
   about the unexpected token YYTOKEN for the state stack whose top is
1026
   YYSSP.
1027
1028
   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
1029
   not large enough to hold the message.  In that case, also set
1030
   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
1031
   required number of bytes is too large to store.  */
1032
static int
1033
yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
1034
                yy_state_t *yyssp, int yytoken)
1035
{
1036
  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1037
  /* Internationalized format string. */
1038
  const char *yyformat = YY_NULLPTR;
1039
  /* Arguments of yyformat: reported tokens (one for the "unexpected",
1040
     one per "expected"). */
1041
  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1042
  /* Actual size of YYARG. */
1043
  int yycount = 0;
1044
  /* Cumulated lengths of YYARG.  */
1045
  YYPTRDIFF_T yysize = 0;
1046
1047
  /* There are many possibilities here to consider:
1048
     - If this state is a consistent state with a default action, then
1049
       the only way this function was invoked is if the default action
1050
       is an error action.  In that case, don't check for expected
1051
       tokens because there are none.
1052
     - The only way there can be no lookahead present (in yychar) is if
1053
       this state is a consistent state with a default action.  Thus,
1054
       detecting the absence of a lookahead is sufficient to determine
1055
       that there is no unexpected or expected token to report.  In that
1056
       case, just report a simple "syntax error".
1057
     - Don't assume there isn't a lookahead just because this state is a
1058
       consistent state with a default action.  There might have been a
1059
       previous inconsistent state, consistent state with a non-default
1060
       action, or user semantic action that manipulated yychar.
1061
     - Of course, the expected token list depends on states to have
1062
       correct lookahead information, and it depends on the parser not
1063
       to perform extra reductions after fetching a lookahead from the
1064
       scanner and before detecting a syntax error.  Thus, state merging
1065
       (from LALR or IELR) and default reductions corrupt the expected
1066
       token list.  However, the list is correct for canonical LR with
1067
       one exception: it will still contain any token that will not be
1068
       accepted due to an error action in a later state.
1069
  */
1070
  if (yytoken != YYEMPTY)
1071
    {
1072
      int yyn = yypact[+*yyssp];
1073
      YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1074
      yysize = yysize0;
1075
      yyarg[yycount++] = yytname[yytoken];
1076
      if (!yypact_value_is_default (yyn))
1077
        {
1078
          /* Start YYX at -YYN if negative to avoid negative indexes in
1079
             YYCHECK.  In other words, skip the first -YYN actions for
1080
             this state because they are default actions.  */
1081
          int yyxbegin = yyn < 0 ? -yyn : 0;
1082
          /* Stay within bounds of both yycheck and yytname.  */
1083
          int yychecklim = YYLAST - yyn + 1;
1084
          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1085
          int yyx;
1086
1087
          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1088
            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1089
                && !yytable_value_is_error (yytable[yyx + yyn]))
1090
              {
1091
                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1092
                  {
1093
                    yycount = 1;
1094
                    yysize = yysize0;
1095
                    break;
1096
                  }
1097
                yyarg[yycount++] = yytname[yyx];
1098
                {
1099
                  YYPTRDIFF_T yysize1
1100
                    = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1101
                  if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1102
                    yysize = yysize1;
1103
                  else
1104
                    return 2;
1105
                }
1106
              }
1107
        }
1108
    }
1109
1110
  switch (yycount)
1111
    {
1112
# define YYCASE_(N, S)                      \
1113
      case N:                               \
1114
        yyformat = S;                       \
1115
      break
1116
    default: /* Avoid compiler warnings. */
1117
      YYCASE_(0, YY_("syntax error"));
1118
      YYCASE_(1, YY_("syntax error, unexpected %s"));
1119
      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1120
      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1121
      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1122
      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1123
# undef YYCASE_
1124
    }
1125
1126
  {
1127
    /* Don't count the "%s"s in the final size, but reserve room for
1128
       the terminator.  */
1129
    YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1;
1130
    if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1131
      yysize = yysize1;
1132
    else
1133
      return 2;
1134
  }
1135
1136
  if (*yymsg_alloc < yysize)
1137
    {
1138
      *yymsg_alloc = 2 * yysize;
1139
      if (! (yysize <= *yymsg_alloc
1140
             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1141
        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1142
      return 1;
1143
    }
1144
1145
  /* Avoid sprintf, as that infringes on the user's name space.
1146
     Don't have undefined behavior even if the translation
1147
     produced a string with the wrong number of "%s"s.  */
1148
  {
1149
    char *yyp = *yymsg;
1150
    int yyi = 0;
1151
    while ((*yyp = *yyformat) != '\0')
1152
      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1153
        {
1154
          yyp += yytnamerr (yyp, yyarg[yyi++]);
1155
          yyformat += 2;
1156
        }
1157
      else
1158
        {
1159
          ++yyp;
1160
          ++yyformat;
1161
        }
1162
  }
1163
  return 0;
1164
}
1165
#endif /* YYERROR_VERBOSE */
1166
1167
/*-----------------------------------------------.
1168
| Release the memory associated to this symbol.  |
1169
`-----------------------------------------------*/
1170
1171
static void
1172
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, struct parse_args *arg)
1173
0
{
1174
0
  YYUSE (yyvaluep);
1175
0
  YYUSE (arg);
1176
0
  if (!yymsg)
1177
0
    yymsg = "Deleting";
1178
0
  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1179
1180
0
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1181
0
  YYUSE (yytype);
1182
0
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1183
0
}
1184
1185
1186
1187
1188
/*----------.
1189
| yyparse.  |
1190
`----------*/
1191
1192
int
1193
yyparse (struct parse_args *arg)
1194
0
{
1195
/* The lookahead symbol.  */
1196
0
int yychar;
1197
1198
1199
/* The semantic value of the lookahead symbol.  */
1200
/* Default value used for initialization, for pacifying older GCCs
1201
   or non-GCC compilers.  */
1202
0
YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1203
0
YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1204
1205
    /* Number of syntax errors so far.  */
1206
0
    int yynerrs;
1207
1208
0
    yy_state_fast_t yystate;
1209
    /* Number of tokens to shift before error messages enabled.  */
1210
0
    int yyerrstatus;
1211
1212
    /* The stacks and their tools:
1213
       'yyss': related to states.
1214
       'yyvs': related to semantic values.
1215
1216
       Refer to the stacks through separate pointers, to allow yyoverflow
1217
       to reallocate them elsewhere.  */
1218
1219
    /* The state stack.  */
1220
0
    yy_state_t yyssa[YYINITDEPTH];
1221
0
    yy_state_t *yyss;
1222
0
    yy_state_t *yyssp;
1223
1224
    /* The semantic value stack.  */
1225
0
    YYSTYPE yyvsa[YYINITDEPTH];
1226
0
    YYSTYPE *yyvs;
1227
0
    YYSTYPE *yyvsp;
1228
1229
0
    YYPTRDIFF_T yystacksize;
1230
1231
0
  int yyn;
1232
0
  int yyresult;
1233
  /* Lookahead token as an internal (translated) token number.  */
1234
0
  int yytoken = 0;
1235
  /* The variables used to return semantic value and location from the
1236
     action routines.  */
1237
0
  YYSTYPE yyval;
1238
1239
#if YYERROR_VERBOSE
1240
  /* Buffer for error messages, and its allocated size.  */
1241
  char yymsgbuf[128];
1242
  char *yymsg = yymsgbuf;
1243
  YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
1244
#endif
1245
1246
0
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1247
1248
  /* The number of symbols on the RHS of the reduced rule.
1249
     Keep to zero when no symbol should be popped.  */
1250
0
  int yylen = 0;
1251
1252
0
  yyssp = yyss = yyssa;
1253
0
  yyvsp = yyvs = yyvsa;
1254
0
  yystacksize = YYINITDEPTH;
1255
1256
0
  YYDPRINTF ((stderr, "Starting parse\n"));
1257
1258
0
  yystate = 0;
1259
0
  yyerrstatus = 0;
1260
0
  yynerrs = 0;
1261
0
  yychar = YYEMPTY; /* Cause a token to be read.  */
1262
0
  goto yysetstate;
1263
1264
1265
/*------------------------------------------------------------.
1266
| yynewstate -- push a new state, which is found in yystate.  |
1267
`------------------------------------------------------------*/
1268
0
yynewstate:
1269
  /* In all cases, when you get here, the value and location stacks
1270
     have just been pushed.  So pushing a state here evens the stacks.  */
1271
0
  yyssp++;
1272
1273
1274
/*--------------------------------------------------------------------.
1275
| yysetstate -- set current state (the top of the stack) to yystate.  |
1276
`--------------------------------------------------------------------*/
1277
0
yysetstate:
1278
0
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1279
0
  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1280
0
  YY_IGNORE_USELESS_CAST_BEGIN
1281
0
  *yyssp = YY_CAST (yy_state_t, yystate);
1282
0
  YY_IGNORE_USELESS_CAST_END
1283
1284
0
  if (yyss + yystacksize - 1 <= yyssp)
1285
#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1286
    goto yyexhaustedlab;
1287
#else
1288
0
    {
1289
      /* Get the current used size of the three stacks, in elements.  */
1290
0
      YYPTRDIFF_T yysize = yyssp - yyss + 1;
1291
1292
# if defined yyoverflow
1293
      {
1294
        /* Give user a chance to reallocate the stack.  Use copies of
1295
           these so that the &'s don't force the real ones into
1296
           memory.  */
1297
        yy_state_t *yyss1 = yyss;
1298
        YYSTYPE *yyvs1 = yyvs;
1299
1300
        /* Each stack pointer address is followed by the size of the
1301
           data in use in that stack, in bytes.  This used to be a
1302
           conditional around just the two extra args, but that might
1303
           be undefined if yyoverflow is a macro.  */
1304
        yyoverflow (YY_("memory exhausted"),
1305
                    &yyss1, yysize * YYSIZEOF (*yyssp),
1306
                    &yyvs1, yysize * YYSIZEOF (*yyvsp),
1307
                    &yystacksize);
1308
        yyss = yyss1;
1309
        yyvs = yyvs1;
1310
      }
1311
# else /* defined YYSTACK_RELOCATE */
1312
      /* Extend the stack our own way.  */
1313
0
      if (YYMAXDEPTH <= yystacksize)
1314
0
        goto yyexhaustedlab;
1315
0
      yystacksize *= 2;
1316
0
      if (YYMAXDEPTH < yystacksize)
1317
0
        yystacksize = YYMAXDEPTH;
1318
1319
0
      {
1320
0
        yy_state_t *yyss1 = yyss;
1321
0
        union yyalloc *yyptr =
1322
0
          YY_CAST (union yyalloc *,
1323
0
                   YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1324
0
        if (! yyptr)
1325
0
          goto yyexhaustedlab;
1326
0
        YYSTACK_RELOCATE (yyss_alloc, yyss);
1327
0
        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1328
0
# undef YYSTACK_RELOCATE
1329
0
        if (yyss1 != yyssa)
1330
0
          YYSTACK_FREE (yyss1);
1331
0
      }
1332
0
# endif
1333
1334
0
      yyssp = yyss + yysize - 1;
1335
0
      yyvsp = yyvs + yysize - 1;
1336
1337
0
      YY_IGNORE_USELESS_CAST_BEGIN
1338
0
      YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1339
0
                  YY_CAST (long, yystacksize)));
1340
0
      YY_IGNORE_USELESS_CAST_END
1341
1342
0
      if (yyss + yystacksize - 1 <= yyssp)
1343
0
        YYABORT;
1344
0
    }
1345
0
#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1346
1347
0
  if (yystate == YYFINAL)
1348
0
    YYACCEPT;
1349
1350
0
  goto yybackup;
1351
1352
1353
/*-----------.
1354
| yybackup.  |
1355
`-----------*/
1356
0
yybackup:
1357
  /* Do appropriate processing given the current state.  Read a
1358
     lookahead token if we need one and don't already have one.  */
1359
1360
  /* First try to decide what to do without reference to lookahead token.  */
1361
0
  yyn = yypact[yystate];
1362
0
  if (yypact_value_is_default (yyn))
1363
0
    goto yydefault;
1364
1365
  /* Not known => get a lookahead token if don't already have one.  */
1366
1367
  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1368
0
  if (yychar == YYEMPTY)
1369
0
    {
1370
0
      YYDPRINTF ((stderr, "Reading a token: "));
1371
0
      yychar = yylex (&yylval, arg);
1372
0
    }
1373
1374
0
  if (yychar <= YYEOF)
1375
0
    {
1376
0
      yychar = yytoken = YYEOF;
1377
0
      YYDPRINTF ((stderr, "Now at end of input.\n"));
1378
0
    }
1379
0
  else
1380
0
    {
1381
0
      yytoken = YYTRANSLATE (yychar);
1382
0
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1383
0
    }
1384
1385
  /* If the proper action on seeing token YYTOKEN is to reduce or to
1386
     detect an error, take that action.  */
1387
0
  yyn += yytoken;
1388
0
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1389
0
    goto yydefault;
1390
0
  yyn = yytable[yyn];
1391
0
  if (yyn <= 0)
1392
0
    {
1393
0
      if (yytable_value_is_error (yyn))
1394
0
        goto yyerrlab;
1395
0
      yyn = -yyn;
1396
0
      goto yyreduce;
1397
0
    }
1398
1399
  /* Count tokens shifted since error; after three, turn off error
1400
     status.  */
1401
0
  if (yyerrstatus)
1402
0
    yyerrstatus--;
1403
1404
  /* Shift the lookahead token.  */
1405
0
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1406
0
  yystate = yyn;
1407
0
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1408
0
  *++yyvsp = yylval;
1409
0
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1410
1411
  /* Discard the shifted token.  */
1412
0
  yychar = YYEMPTY;
1413
0
  goto yynewstate;
1414
1415
1416
/*-----------------------------------------------------------.
1417
| yydefault -- do the default action for the current state.  |
1418
`-----------------------------------------------------------*/
1419
0
yydefault:
1420
0
  yyn = yydefact[yystate];
1421
0
  if (yyn == 0)
1422
0
    goto yyerrlab;
1423
0
  goto yyreduce;
1424
1425
1426
/*-----------------------------.
1427
| yyreduce -- do a reduction.  |
1428
`-----------------------------*/
1429
0
yyreduce:
1430
  /* yyn is the number of a rule to reduce with.  */
1431
0
  yylen = yyr2[yyn];
1432
1433
  /* If YYLEN is nonzero, implement the default value of the action:
1434
     '$$ = $1'.
1435
1436
     Otherwise, the following line sets YYVAL to garbage.
1437
     This behavior is undocumented and Bison
1438
     users should not rely upon it.  Assigning to YYVAL
1439
     unconditionally makes the parser a bit smaller, and it avoids a
1440
     GCC warning that YYVAL may be used uninitialized.  */
1441
0
  yyval = yyvsp[1-yylen];
1442
1443
1444
0
  YY_REDUCE_PRINT (yyn);
1445
0
  switch (yyn)
1446
0
    {
1447
0
  case 2:
1448
0
#line 152 "plural.y"
1449
0
          {
1450
0
      if ((yyvsp[0].exp) == NULL)
1451
0
        YYABORT;
1452
0
      arg->res = (yyvsp[0].exp);
1453
0
    }
1454
0
#line 1455 "plural.c"
1455
0
    break;
1456
1457
0
  case 3:
1458
0
#line 160 "plural.y"
1459
0
          {
1460
0
      (yyval.exp) = new_exp_3 (qmop, (yyvsp[-4].exp), (yyvsp[-2].exp), (yyvsp[0].exp));
1461
0
    }
1462
0
#line 1463 "plural.c"
1463
0
    break;
1464
1465
0
  case 4:
1466
0
#line 164 "plural.y"
1467
0
          {
1468
0
      (yyval.exp) = new_exp_2 (lor, (yyvsp[-2].exp), (yyvsp[0].exp));
1469
0
    }
1470
0
#line 1471 "plural.c"
1471
0
    break;
1472
1473
0
  case 5:
1474
0
#line 168 "plural.y"
1475
0
          {
1476
0
      (yyval.exp) = new_exp_2 (land, (yyvsp[-2].exp), (yyvsp[0].exp));
1477
0
    }
1478
0
#line 1479 "plural.c"
1479
0
    break;
1480
1481
0
  case 6:
1482
0
#line 172 "plural.y"
1483
0
          {
1484
0
      (yyval.exp) = new_exp_2 ((yyvsp[-1].op), (yyvsp[-2].exp), (yyvsp[0].exp));
1485
0
    }
1486
0
#line 1487 "plural.c"
1487
0
    break;
1488
1489
0
  case 7:
1490
0
#line 176 "plural.y"
1491
0
          {
1492
0
      (yyval.exp) = new_exp_2 ((yyvsp[-1].op), (yyvsp[-2].exp), (yyvsp[0].exp));
1493
0
    }
1494
0
#line 1495 "plural.c"
1495
0
    break;
1496
1497
0
  case 8:
1498
0
#line 180 "plural.y"
1499
0
          {
1500
0
      (yyval.exp) = new_exp_2 ((yyvsp[-1].op), (yyvsp[-2].exp), (yyvsp[0].exp));
1501
0
    }
1502
0
#line 1503 "plural.c"
1503
0
    break;
1504
1505
0
  case 9:
1506
0
#line 184 "plural.y"
1507
0
          {
1508
0
      (yyval.exp) = new_exp_2 ((yyvsp[-1].op), (yyvsp[-2].exp), (yyvsp[0].exp));
1509
0
    }
1510
0
#line 1511 "plural.c"
1511
0
    break;
1512
1513
0
  case 10:
1514
0
#line 188 "plural.y"
1515
0
          {
1516
0
      (yyval.exp) = new_exp_1 (lnot, (yyvsp[0].exp));
1517
0
    }
1518
0
#line 1519 "plural.c"
1519
0
    break;
1520
1521
0
  case 11:
1522
0
#line 192 "plural.y"
1523
0
          {
1524
0
      (yyval.exp) = new_exp_0 (var);
1525
0
    }
1526
0
#line 1527 "plural.c"
1527
0
    break;
1528
1529
0
  case 12:
1530
0
#line 196 "plural.y"
1531
0
          {
1532
0
      if (((yyval.exp) = new_exp_0 (num)) != NULL)
1533
0
        (yyval.exp)->val.num = (yyvsp[0].num);
1534
0
    }
1535
0
#line 1536 "plural.c"
1536
0
    break;
1537
1538
0
  case 13:
1539
0
#line 201 "plural.y"
1540
0
          {
1541
0
      (yyval.exp) = (yyvsp[-1].exp);
1542
0
    }
1543
0
#line 1544 "plural.c"
1544
0
    break;
1545
1546
1547
0
#line 1548 "plural.c"
1548
1549
0
      default: break;
1550
0
    }
1551
  /* User semantic actions sometimes alter yychar, and that requires
1552
     that yytoken be updated with the new translation.  We take the
1553
     approach of translating immediately before every use of yytoken.
1554
     One alternative is translating here after every semantic action,
1555
     but that translation would be missed if the semantic action invokes
1556
     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1557
     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
1558
     incorrect destructor might then be invoked immediately.  In the
1559
     case of YYERROR or YYBACKUP, subsequent parser actions might lead
1560
     to an incorrect destructor call or verbose syntax error message
1561
     before the lookahead is translated.  */
1562
0
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1563
1564
0
  YYPOPSTACK (yylen);
1565
0
  yylen = 0;
1566
0
  YY_STACK_PRINT (yyss, yyssp);
1567
1568
0
  *++yyvsp = yyval;
1569
1570
  /* Now 'shift' the result of the reduction.  Determine what state
1571
     that goes to, based on the state we popped back to and the rule
1572
     number reduced by.  */
1573
0
  {
1574
0
    const int yylhs = yyr1[yyn] - YYNTOKENS;
1575
0
    const int yyi = yypgoto[yylhs] + *yyssp;
1576
0
    yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1577
0
               ? yytable[yyi]
1578
0
               : yydefgoto[yylhs]);
1579
0
  }
1580
1581
0
  goto yynewstate;
1582
1583
1584
/*--------------------------------------.
1585
| yyerrlab -- here on detecting error.  |
1586
`--------------------------------------*/
1587
0
yyerrlab:
1588
  /* Make sure we have latest lookahead translation.  See comments at
1589
     user semantic actions for why this is necessary.  */
1590
0
  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1591
1592
  /* If not already recovering from an error, report this error.  */
1593
0
  if (!yyerrstatus)
1594
0
    {
1595
0
      ++yynerrs;
1596
0
#if ! YYERROR_VERBOSE
1597
0
      yyerror (arg, YY_("syntax error"));
1598
#else
1599
# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1600
                                        yyssp, yytoken)
1601
      {
1602
        char const *yymsgp = YY_("syntax error");
1603
        int yysyntax_error_status;
1604
        yysyntax_error_status = YYSYNTAX_ERROR;
1605
        if (yysyntax_error_status == 0)
1606
          yymsgp = yymsg;
1607
        else if (yysyntax_error_status == 1)
1608
          {
1609
            if (yymsg != yymsgbuf)
1610
              YYSTACK_FREE (yymsg);
1611
            yymsg = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
1612
            if (!yymsg)
1613
              {
1614
                yymsg = yymsgbuf;
1615
                yymsg_alloc = sizeof yymsgbuf;
1616
                yysyntax_error_status = 2;
1617
              }
1618
            else
1619
              {
1620
                yysyntax_error_status = YYSYNTAX_ERROR;
1621
                yymsgp = yymsg;
1622
              }
1623
          }
1624
        yyerror (arg, yymsgp);
1625
        if (yysyntax_error_status == 2)
1626
          goto yyexhaustedlab;
1627
      }
1628
# undef YYSYNTAX_ERROR
1629
#endif
1630
0
    }
1631
1632
1633
1634
0
  if (yyerrstatus == 3)
1635
0
    {
1636
      /* If just tried and failed to reuse lookahead token after an
1637
         error, discard it.  */
1638
1639
0
      if (yychar <= YYEOF)
1640
0
        {
1641
          /* Return failure if at end of input.  */
1642
0
          if (yychar == YYEOF)
1643
0
            YYABORT;
1644
0
        }
1645
0
      else
1646
0
        {
1647
0
          yydestruct ("Error: discarding",
1648
0
                      yytoken, &yylval, arg);
1649
0
          yychar = YYEMPTY;
1650
0
        }
1651
0
    }
1652
1653
  /* Else will try to reuse lookahead token after shifting the error
1654
     token.  */
1655
0
  goto yyerrlab1;
1656
1657
1658
/*---------------------------------------------------.
1659
| yyerrorlab -- error raised explicitly by YYERROR.  |
1660
`---------------------------------------------------*/
1661
0
yyerrorlab:
1662
  /* Pacify compilers when the user code never invokes YYERROR and the
1663
     label yyerrorlab therefore never appears in user code.  */
1664
0
  if (0)
1665
0
    YYERROR;
1666
1667
  /* Do not reclaim the symbols of the rule whose action triggered
1668
     this YYERROR.  */
1669
0
  YYPOPSTACK (yylen);
1670
0
  yylen = 0;
1671
0
  YY_STACK_PRINT (yyss, yyssp);
1672
0
  yystate = *yyssp;
1673
0
  goto yyerrlab1;
1674
1675
1676
/*-------------------------------------------------------------.
1677
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
1678
`-------------------------------------------------------------*/
1679
0
yyerrlab1:
1680
0
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
1681
1682
0
  for (;;)
1683
0
    {
1684
0
      yyn = yypact[yystate];
1685
0
      if (!yypact_value_is_default (yyn))
1686
0
        {
1687
0
          yyn += YYTERROR;
1688
0
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1689
0
            {
1690
0
              yyn = yytable[yyn];
1691
0
              if (0 < yyn)
1692
0
                break;
1693
0
            }
1694
0
        }
1695
1696
      /* Pop the current state because it cannot handle the error token.  */
1697
0
      if (yyssp == yyss)
1698
0
        YYABORT;
1699
1700
1701
0
      yydestruct ("Error: popping",
1702
0
                  yystos[yystate], yyvsp, arg);
1703
0
      YYPOPSTACK (1);
1704
0
      yystate = *yyssp;
1705
0
      YY_STACK_PRINT (yyss, yyssp);
1706
0
    }
1707
1708
0
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1709
0
  *++yyvsp = yylval;
1710
0
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1711
1712
1713
  /* Shift the error token.  */
1714
0
  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1715
1716
0
  yystate = yyn;
1717
0
  goto yynewstate;
1718
1719
1720
/*-------------------------------------.
1721
| yyacceptlab -- YYACCEPT comes here.  |
1722
`-------------------------------------*/
1723
0
yyacceptlab:
1724
0
  yyresult = 0;
1725
0
  goto yyreturn;
1726
1727
1728
/*-----------------------------------.
1729
| yyabortlab -- YYABORT comes here.  |
1730
`-----------------------------------*/
1731
0
yyabortlab:
1732
0
  yyresult = 1;
1733
0
  goto yyreturn;
1734
1735
1736
0
#if !defined yyoverflow || YYERROR_VERBOSE
1737
/*-------------------------------------------------.
1738
| yyexhaustedlab -- memory exhaustion comes here.  |
1739
`-------------------------------------------------*/
1740
0
yyexhaustedlab:
1741
0
  yyerror (arg, YY_("memory exhausted"));
1742
0
  yyresult = 2;
1743
  /* Fall through.  */
1744
0
#endif
1745
1746
1747
/*-----------------------------------------------------.
1748
| yyreturn -- parsing is finished, return the result.  |
1749
`-----------------------------------------------------*/
1750
0
yyreturn:
1751
0
  if (yychar != YYEMPTY)
1752
0
    {
1753
      /* Make sure we have latest lookahead translation.  See comments at
1754
         user semantic actions for why this is necessary.  */
1755
0
      yytoken = YYTRANSLATE (yychar);
1756
0
      yydestruct ("Cleanup: discarding lookahead",
1757
0
                  yytoken, &yylval, arg);
1758
0
    }
1759
  /* Do not reclaim the symbols of the rule whose action triggered
1760
     this YYABORT or YYACCEPT.  */
1761
0
  YYPOPSTACK (yylen);
1762
0
  YY_STACK_PRINT (yyss, yyssp);
1763
0
  while (yyssp != yyss)
1764
0
    {
1765
0
      yydestruct ("Cleanup: popping",
1766
0
                  yystos[+*yyssp], yyvsp, arg);
1767
0
      YYPOPSTACK (1);
1768
0
    }
1769
0
#ifndef yyoverflow
1770
0
  if (yyss != yyssa)
1771
0
    YYSTACK_FREE (yyss);
1772
0
#endif
1773
#if YYERROR_VERBOSE
1774
  if (yymsg != yymsgbuf)
1775
    YYSTACK_FREE (yymsg);
1776
#endif
1777
0
  return yyresult;
1778
0
}
1779
#line 206 "plural.y"
1780
1781
1782
void
1783
FREE_EXPRESSION (struct expression *exp)
1784
0
{
1785
0
  if (exp == NULL)
1786
0
    return;
1787
1788
  /* Handle the recursive case.  */
1789
0
  switch (exp->nargs)
1790
0
    {
1791
0
    case 3:
1792
0
      FREE_EXPRESSION (exp->val.args[2]);
1793
0
      FALLTHROUGH;
1794
0
    case 2:
1795
0
      FREE_EXPRESSION (exp->val.args[1]);
1796
0
      FALLTHROUGH;
1797
0
    case 1:
1798
0
      FREE_EXPRESSION (exp->val.args[0]);
1799
0
      FALLTHROUGH;
1800
0
    default:
1801
0
      break;
1802
0
    }
1803
1804
0
  free (exp);
1805
0
}
1806
1807
1808
static int
1809
yylex (YYSTYPE *lval, struct parse_args *arg)
1810
0
{
1811
0
  const char *exp = arg->cp;
1812
0
  int result;
1813
1814
0
  while (1)
1815
0
    {
1816
0
      if (exp[0] == '\0')
1817
0
  {
1818
0
    arg->cp = exp;
1819
0
    return YYEOF;
1820
0
  }
1821
1822
0
      if (exp[0] != ' ' && exp[0] != '\t')
1823
0
  break;
1824
1825
0
      ++exp;
1826
0
    }
1827
1828
0
  result = *exp++;
1829
0
  switch (result)
1830
0
    {
1831
0
    case '0': case '1': case '2': case '3': case '4':
1832
0
    case '5': case '6': case '7': case '8': case '9':
1833
0
      {
1834
0
  unsigned long int n = result - '0';
1835
0
  while (exp[0] >= '0' && exp[0] <= '9')
1836
0
    {
1837
0
      n *= 10;
1838
0
      n += exp[0] - '0';
1839
0
      ++exp;
1840
0
    }
1841
0
  lval->num = n;
1842
0
  result = NUMBER;
1843
0
      }
1844
0
      break;
1845
1846
0
    case '=':
1847
0
      if (exp[0] == '=')
1848
0
  {
1849
0
    ++exp;
1850
0
    lval->op = equal;
1851
0
    result = EQUOP2;
1852
0
  }
1853
0
      else
1854
0
  result = YYERRCODE;
1855
0
      break;
1856
1857
0
    case '!':
1858
0
      if (exp[0] == '=')
1859
0
  {
1860
0
    ++exp;
1861
0
    lval->op = not_equal;
1862
0
    result = EQUOP2;
1863
0
  }
1864
0
      break;
1865
1866
0
    case '&':
1867
0
    case '|':
1868
0
      if (exp[0] == result)
1869
0
  ++exp;
1870
0
      else
1871
0
  result = YYERRCODE;
1872
0
      break;
1873
1874
0
    case '<':
1875
0
      if (exp[0] == '=')
1876
0
  {
1877
0
    ++exp;
1878
0
    lval->op = less_or_equal;
1879
0
  }
1880
0
      else
1881
0
  lval->op = less_than;
1882
0
      result = CMPOP2;
1883
0
      break;
1884
1885
0
    case '>':
1886
0
      if (exp[0] == '=')
1887
0
  {
1888
0
    ++exp;
1889
0
    lval->op = greater_or_equal;
1890
0
  }
1891
0
      else
1892
0
  lval->op = greater_than;
1893
0
      result = CMPOP2;
1894
0
      break;
1895
1896
0
    case '*':
1897
0
      lval->op = mult;
1898
0
      result = MULOP2;
1899
0
      break;
1900
1901
0
    case '/':
1902
0
      lval->op = divide;
1903
0
      result = MULOP2;
1904
0
      break;
1905
1906
0
    case '%':
1907
0
      lval->op = module;
1908
0
      result = MULOP2;
1909
0
      break;
1910
1911
0
    case '+':
1912
0
      lval->op = plus;
1913
0
      result = ADDOP2;
1914
0
      break;
1915
1916
0
    case '-':
1917
0
      lval->op = minus;
1918
0
      result = ADDOP2;
1919
0
      break;
1920
1921
0
    case 'n':
1922
0
    case '?':
1923
0
    case ':':
1924
0
    case '(':
1925
0
    case ')':
1926
      /* Nothing, just return the character.  */
1927
0
      break;
1928
1929
0
    case ';':
1930
0
    case '\n':
1931
0
    case '\0':
1932
      /* Be safe and let the user call this function again.  */
1933
0
      --exp;
1934
0
      result = YYEOF;
1935
0
      break;
1936
1937
0
    default:
1938
0
      result = YYERRCODE;
1939
#if YYDEBUG != 0
1940
      --exp;
1941
#endif
1942
0
      break;
1943
0
    }
1944
1945
0
  arg->cp = exp;
1946
1947
0
  return result;
1948
0
}
1949
1950
1951
static void
1952
yyerror (struct parse_args *arg, const char *str)
1953
0
{
1954
  /* Do nothing.  We don't print error messages here.  */
1955
0
}