Coverage Report

Created: 2026-10-28 07:09

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