Coverage Report

Created: 2026-06-15 07:03

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