Coverage Report

Created: 2026-07-30 06:52

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
49.8k
#define yylex           cmExpr_yylex
70
250
#define yyerror         cmExpr_yyerror
71
768k
#define yydebug         cmExpr_yydebug
72
248
#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
260k
#   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
577
#    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.61k
#  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
329
  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
250
#  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.2k
# 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.70k
# 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
165k
#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
329
#   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
165k
#define YYFINAL  19
512
/* YYLAST -- Last index in YYTABLE.  */
513
310k
#define YYLAST   34
514
515
/* YYNTOKENS -- Number of terminals.  */
516
114k
#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
87.1k
#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
87.5k
  (0 <= (YYX) && (YYX) <= YYMAXUTOK                     \
532
87.5k
   ? YY_CAST (yysymbol_kind_t, yytranslate[YYX])        \
533
87.5k
   : 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.49k
#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
167k
#define YYPACT_NINF (-11)
607
608
#define yypact_value_is_default(Yyn) \
609
167k
  ((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.51k
#define YYACCEPT        goto yyacceptlab
704
248
#define YYABORT         goto yyabortlab
705
0
#define YYERROR         goto yyerrorlab
706
2
#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
227k
# define YYDPRINTF(Args)                        \
742
227k
do {                                            \
743
227k
  if (yydebug)                                  \
744
227k
    YYFPRINTF Args;                             \
745
227k
} while (0)
746
747
748
749
750
256k
# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
751
256k
do {                                                                      \
752
256k
  if (yydebug)                                                            \
753
256k
    {                                                                     \
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
256k
} 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
170k
# define YY_STACK_PRINT(Bottom, Top)                            \
814
170k
do {                                                            \
815
170k
  if (yydebug)                                                  \
816
170k
    yy_stack_print ((Bottom), (Top));                           \
817
170k
} 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
113k
# define YY_REDUCE_PRINT(Rule)          \
845
113k
do {                                    \
846
113k
  if (yydebug)                          \
847
113k
    yy_reduce_print (yyssp, yyvsp, Rule, yyscanner); \
848
113k
} 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.85k
# 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
248
{
895
  /* Actual size of YYARG. */
896
248
  int yycount = 0;
897
248
  int yyn = yypact[+*yyctx->yyssp];
898
248
  if (!yypact_value_is_default (yyn))
899
248
    {
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
248
      int yyxbegin = yyn < 0 ? -yyn : 0;
904
      /* Stay within bounds of both yycheck and yytname.  */
905
248
      int yychecklim = YYLAST - yyn + 1;
906
248
      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
907
248
      int yyx;
908
4.27k
      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
909
4.21k
        if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
910
0
            && !yytable_value_is_error (yytable[yyx + yyn]))
911
1.04k
          {
912
1.04k
            if (!yyarg)
913
0
              ++yycount;
914
1.04k
            else if (yycount == yyargn)
915
192
              return 0;
916
849
            else
917
849
              yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
918
1.04k
          }
919
248
    }
920
56
  if (yyarg && yycount == 0 && 0 < yyargn)
921
0
    yyarg[0] = YYSYMBOL_YYEMPTY;
922
56
  return yycount;
923
248
}
924
925
926
927
928
#ifndef yystrlen
929
# if defined __GLIBC__ && defined _STRING_H
930
409
#  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
161
#  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
658
{
975
658
  if (*yystr == '"')
976
336
    {
977
336
      YYPTRDIFF_T yyn = 0;
978
336
      char const *yyp = yystr;
979
336
      for (;;)
980
4.03k
        switch (*++yyp)
981
4.03k
          {
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
3.69k
          default:
994
3.69k
            if (yyres)
995
1.84k
              yyres[yyn] = *yyp;
996
3.69k
            yyn++;
997
3.69k
            break;
998
999
336
          case '"':
1000
336
            if (yyres)
1001
168
              yyres[yyn] = '\0';
1002
336
            return yyn;
1003
4.03k
          }
1004
0
    do_not_strip_quotes: ;
1005
0
    }
1006
1007
322
  if (yyres)
1008
161
    return yystpcpy (yyres, yystr) - yyres;
1009
161
  else
1010
161
    return yystrlen (yystr);
1011
322
}
1012
#endif
1013
1014
1015
static int
1016
yy_syntax_error_arguments (const yypcontext_t *yyctx,
1017
                           yysymbol_kind_t yyarg[], int yyargn)
1018
248
{
1019
  /* Actual size of YYARG. */
1020
248
  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
248
  if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
1045
248
    {
1046
248
      int yyn;
1047
248
      if (yyarg)
1048
248
        yyarg[yycount] = yyctx->yytoken;
1049
248
      ++yycount;
1050
248
      yyn = yypcontext_expected_tokens (yyctx,
1051
248
                                        yyarg ? yyarg + 1 : yyarg, yyargn - 1);
1052
248
      if (yyn == YYENOMEM)
1053
0
        return YYENOMEM;
1054
248
      else
1055
248
        yycount += yyn;
1056
248
    }
1057
248
  return yycount;
1058
248
}
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
248
{
1072
248
  enum { YYARGS_MAX = 5 };
1073
  /* Internationalized format string. */
1074
248
  const char *yyformat = YY_NULLPTR;
1075
  /* Arguments of yyformat: reported tokens (one for the "unexpected",
1076
     one per "expected"). */
1077
248
  yysymbol_kind_t yyarg[YYARGS_MAX];
1078
  /* Cumulated lengths of YYARG.  */
1079
248
  YYPTRDIFF_T yysize = 0;
1080
1081
  /* Actual size of YYARG. */
1082
248
  int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
1083
248
  if (yycount == YYENOMEM)
1084
0
    return YYENOMEM;
1085
1086
248
  switch (yycount)
1087
248
    {
1088
0
#define YYCASE_(N, S)                       \
1089
248
      case N:                               \
1090
248
        yyformat = S;                       \
1091
248
        break
1092
0
    default: /* Avoid compiler warnings. */
1093
0
      YYCASE_(0, YY_("syntax error"));
1094
192
      YYCASE_(1, YY_("syntax error, unexpected %s"));
1095
31
      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
248
      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1099
248
#undef YYCASE_
1100
248
    }
1101
1102
  /* Compute error message size.  Don't count the "%s"s, but reserve
1103
     room for the terminator.  */
1104
248
  yysize = yystrlen (yyformat) - 2 * yycount + 1;
1105
248
  {
1106
248
    int yyi;
1107
577
    for (yyi = 0; yyi < yycount; ++yyi)
1108
329
      {
1109
329
        YYPTRDIFF_T yysize1
1110
329
          = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
1111
329
        if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1112
329
          yysize = yysize1;
1113
0
        else
1114
0
          return YYENOMEM;
1115
329
      }
1116
248
  }
1117
1118
248
  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
248
  {
1131
248
    char *yyp = *yymsg;
1132
248
    int yyi = 0;
1133
7.54k
    while ((*yyp = *yyformat) != '\0')
1134
7.30k
      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1135
329
        {
1136
329
          yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
1137
329
          yyformat += 2;
1138
329
        }
1139
6.97k
      else
1140
6.97k
        {
1141
6.97k
          ++yyp;
1142
6.97k
          ++yyformat;
1143
6.97k
        }
1144
248
  }
1145
248
  return 0;
1146
248
}
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.74k
{
1157
6.74k
  YY_USE (yyvaluep);
1158
6.74k
  YY_USE (yyscanner);
1159
6.74k
  if (!yymsg)
1160
0
    yymsg = "Deleting";
1161
6.74k
  YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1162
1163
6.74k
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1164
6.74k
  YY_USE (yykind);
1165
6.74k
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1166
6.74k
}
1167
1168
1169
1170
1171
1172
1173
/*----------.
1174
| yyparse.  |
1175
`----------*/
1176
1177
int
1178
yyparse (yyscan_t yyscanner)
1179
1.85k
{
1180
/* Lookahead token kind.  */
1181
1.85k
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.85k
YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1188
1.85k
YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1189
1190
    /* Number of syntax errors so far.  */
1191
1.85k
    int yynerrs = 0;
1192
1193
1.85k
    yy_state_fast_t yystate = 0;
1194
    /* Number of tokens to shift before error messages enabled.  */
1195
1.85k
    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.85k
    YYPTRDIFF_T yystacksize = YYINITDEPTH;
1202
1203
    /* The state stack: array, bottom, top.  */
1204
1.85k
    yy_state_t yyssa[YYINITDEPTH];
1205
1.85k
    yy_state_t *yyss = yyssa;
1206
1.85k
    yy_state_t *yyssp = yyss;
1207
1208
    /* The semantic value stack: array, bottom, top.  */
1209
1.85k
    YYSTYPE yyvsa[YYINITDEPTH];
1210
1.85k
    YYSTYPE *yyvs = yyvsa;
1211
1.85k
    YYSTYPE *yyvsp = yyvs;
1212
1213
1.85k
  int yyn;
1214
  /* The return value of yyparse.  */
1215
1.85k
  int yyresult;
1216
  /* Lookahead symbol kind.  */
1217
1.85k
  yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1218
  /* The variables used to return semantic value and location from the
1219
     action routines.  */
1220
1.85k
  YYSTYPE yyval;
1221
1222
  /* Buffer for error messages, and its allocated size.  */
1223
1.85k
  char yymsgbuf[128];
1224
1.85k
  char *yymsg = yymsgbuf;
1225
1.85k
  YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
1226
1227
122k
#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.85k
  int yylen = 0;
1232
1233
1.85k
  YYDPRINTF ((stderr, "Starting parse\n"));
1234
1235
1.85k
  yychar = YYEMPTY; /* Cause a token to be read.  */
1236
1237
1.85k
  goto yysetstate;
1238
1239
1240
/*------------------------------------------------------------.
1241
| yynewstate -- push a new state, which is found in yystate.  |
1242
`------------------------------------------------------------*/
1243
163k
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
163k
  yyssp++;
1247
1248
1249
/*--------------------------------------------------------------------.
1250
| yysetstate -- set current state (the top of the stack) to yystate.  |
1251
`--------------------------------------------------------------------*/
1252
165k
yysetstate:
1253
165k
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1254
165k
  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1255
165k
  YY_IGNORE_USELESS_CAST_BEGIN
1256
165k
  *yyssp = YY_CAST (yy_state_t, yystate);
1257
165k
  YY_IGNORE_USELESS_CAST_END
1258
165k
  YY_STACK_PRINT (yyss, yyssp);
1259
1260
165k
  if (yyss + yystacksize - 1 <= yyssp)
1261
2
#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1262
2
    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
165k
  if (yystate == YYFINAL)
1325
1.51k
    YYACCEPT;
1326
1327
163k
  goto yybackup;
1328
1329
1330
/*-----------.
1331
| yybackup.  |
1332
`-----------*/
1333
163k
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
163k
  yyn = yypact[yystate];
1339
163k
  if (yypact_value_is_default (yyn))
1340
66.1k
    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
97.6k
  if (yychar == YYEMPTY)
1346
49.8k
    {
1347
49.8k
      YYDPRINTF ((stderr, "Reading a token\n"));
1348
49.8k
      yychar = yylex (&yylval, yyscanner);
1349
49.8k
    }
1350
1351
97.6k
  if (yychar <= YYEOF)
1352
10.8k
    {
1353
10.8k
      yychar = YYEOF;
1354
10.8k
      yytoken = YYSYMBOL_YYEOF;
1355
10.8k
      YYDPRINTF ((stderr, "Now at end of input.\n"));
1356
10.8k
    }
1357
86.7k
  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
86.7k
  else
1368
86.7k
    {
1369
86.7k
      yytoken = YYTRANSLATE (yychar);
1370
86.7k
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1371
86.7k
    }
1372
1373
  /* If the proper action on seeing token YYTOKEN is to reduce or to
1374
     detect an error, take that action.  */
1375
97.6k
  yyn += yytoken;
1376
97.6k
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1377
47.9k
    goto yydefault;
1378
49.6k
  yyn = yytable[yyn];
1379
49.6k
  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
49.6k
  if (yyerrstatus)
1390
0
    yyerrstatus--;
1391
1392
  /* Shift the lookahead token.  */
1393
49.6k
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1394
49.6k
  yystate = yyn;
1395
49.6k
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1396
49.6k
  *++yyvsp = yylval;
1397
49.6k
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1398
1399
  /* Discard the shifted token.  */
1400
49.6k
  yychar = YYEMPTY;
1401
49.6k
  goto yynewstate;
1402
1403
1404
/*-----------------------------------------------------------.
1405
| yydefault -- do the default action for the current state.  |
1406
`-----------------------------------------------------------*/
1407
114k
yydefault:
1408
114k
  yyn = yydefact[yystate];
1409
114k
  if (yyn == 0)
1410
248
    goto yyerrlab;
1411
113k
  goto yyreduce;
1412
1413
1414
/*-----------------------------.
1415
| yyreduce -- do a reduction.  |
1416
`-----------------------------*/
1417
113k
yyreduce:
1418
  /* yyn is the number of a rule to reduce with.  */
1419
113k
  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
113k
  yyval = yyvsp[1-yylen];
1430
1431
1432
113k
  YY_REDUCE_PRINT (yyn);
1433
113k
  switch (yyn)
1434
113k
    {
1435
1.55k
  case 2: /* start: exp  */
1436
1.55k
#line 89 "cmExprParser.y"
1437
1.55k
      {
1438
1.55k
    cmExpr_yyget_extra(yyscanner)->SetResult((yyvsp[0].Number));
1439
1.55k
  }
1440
1.55k
#line 1441 "cmExprParser.cxx"
1441
1.55k
    break;
1442
1443
4.15k
  case 3: /* exp: bitwiseor  */
1444
4.15k
#line 94 "cmExprParser.y"
1445
4.15k
            {
1446
4.15k
    (yyval.Number) = (yyvsp[0].Number);
1447
4.15k
  }
1448
4.15k
#line 1449 "cmExprParser.cxx"
1449
4.15k
    break;
1450
1451
730
  case 4: /* exp: exp exp_OR bitwiseor  */
1452
730
#line 97 "cmExprParser.y"
1453
730
                       {
1454
730
    (yyval.Number) = (yyvsp[-2].Number) | (yyvsp[0].Number);
1455
730
  }
1456
730
#line 1457 "cmExprParser.cxx"
1457
730
    break;
1458
1459
4.98k
  case 5: /* bitwiseor: bitwisexor  */
1460
4.98k
#line 102 "cmExprParser.y"
1461
4.98k
             {
1462
4.98k
    (yyval.Number) = (yyvsp[0].Number);
1463
4.98k
  }
1464
4.98k
#line 1465 "cmExprParser.cxx"
1465
4.98k
    break;
1466
1467
1.31k
  case 6: /* bitwiseor: bitwiseor exp_XOR bitwisexor  */
1468
1.31k
#line 105 "cmExprParser.y"
1469
1.31k
                               {
1470
1.31k
    (yyval.Number) = (yyvsp[-2].Number) ^ (yyvsp[0].Number);
1471
1.31k
  }
1472
1.31k
#line 1473 "cmExprParser.cxx"
1473
1.31k
    break;
1474
1475
6.31k
  case 7: /* bitwisexor: bitwiseand  */
1476
6.31k
#line 110 "cmExprParser.y"
1477
6.31k
             {
1478
6.31k
    (yyval.Number) = (yyvsp[0].Number);
1479
6.31k
  }
1480
6.31k
#line 1481 "cmExprParser.cxx"
1481
6.31k
    break;
1482
1483
545
  case 8: /* bitwisexor: bitwisexor exp_AND bitwiseand  */
1484
545
#line 113 "cmExprParser.y"
1485
545
                                {
1486
545
    (yyval.Number) = (yyvsp[-2].Number) & (yyvsp[0].Number);
1487
545
  }
1488
545
#line 1489 "cmExprParser.cxx"
1489
545
    break;
1490
1491
6.97k
  case 9: /* bitwiseand: shift  */
1492
6.97k
#line 118 "cmExprParser.y"
1493
6.97k
        {
1494
6.97k
    (yyval.Number) = (yyvsp[0].Number);
1495
6.97k
  }
1496
6.97k
#line 1497 "cmExprParser.cxx"
1497
6.97k
    break;
1498
1499
3.92k
  case 10: /* bitwiseand: bitwiseand exp_SHIFTLEFT shift  */
1500
3.92k
#line 121 "cmExprParser.y"
1501
3.92k
                                 {
1502
3.92k
    (yyval.Number) = cmExpr_yyget_extra(yyscanner)
1503
3.92k
      ->ShL((yyvsp[-2].Number), (yyvsp[0].Number));
1504
3.92k
  }
1505
3.92k
#line 1506 "cmExprParser.cxx"
1506
3.92k
    break;
1507
1508
1.58k
  case 11: /* bitwiseand: bitwiseand exp_SHIFTRIGHT shift  */
1509
1.58k
#line 125 "cmExprParser.y"
1510
1.58k
                                  {
1511
1.58k
    (yyval.Number) = cmExpr_yyget_extra(yyscanner)
1512
1.58k
      ->ShR((yyvsp[-2].Number), (yyvsp[0].Number));
1513
1.58k
  }
1514
1.58k
#line 1515 "cmExprParser.cxx"
1515
1.58k
    break;
1516
1517
12.5k
  case 12: /* shift: term  */
1518
12.5k
#line 131 "cmExprParser.y"
1519
12.5k
       {
1520
12.5k
    (yyval.Number) = (yyvsp[0].Number);
1521
12.5k
  }
1522
12.5k
#line 1523 "cmExprParser.cxx"
1523
12.5k
    break;
1524
1525
665
  case 13: /* shift: shift exp_PLUS term  */
1526
665
#line 134 "cmExprParser.y"
1527
665
                      {
1528
665
    (yyval.Number) = cmExpr_yyget_extra(yyscanner)
1529
665
      ->Add((yyvsp[-2].Number), (yyvsp[0].Number));
1530
665
  }
1531
665
#line 1532 "cmExprParser.cxx"
1532
665
    break;
1533
1534
2.41k
  case 14: /* shift: shift exp_MINUS term  */
1535
2.41k
#line 138 "cmExprParser.y"
1536
2.41k
                       {
1537
2.41k
    (yyval.Number) = cmExpr_yyget_extra(yyscanner)
1538
2.41k
      ->Sub((yyvsp[-2].Number), (yyvsp[0].Number));
1539
2.41k
  }
1540
2.41k
#line 1541 "cmExprParser.cxx"
1541
2.41k
    break;
1542
1543
15.7k
  case 15: /* term: unary  */
1544
15.7k
#line 144 "cmExprParser.y"
1545
15.7k
        {
1546
15.7k
    (yyval.Number) = (yyvsp[0].Number);
1547
15.7k
  }
1548
15.7k
#line 1549 "cmExprParser.cxx"
1549
15.7k
    break;
1550
1551
725
  case 16: /* term: term exp_TIMES unary  */
1552
725
#line 147 "cmExprParser.y"
1553
725
                       {
1554
725
    (yyval.Number) = cmExpr_yyget_extra(yyscanner)
1555
725
      ->Mul((yyvsp[-2].Number), (yyvsp[0].Number));
1556
725
  }
1557
725
#line 1558 "cmExprParser.cxx"
1558
725
    break;
1559
1560
1.27k
  case 17: /* term: term exp_DIVIDE unary  */
1561
1.27k
#line 151 "cmExprParser.y"
1562
1.27k
                        {
1563
1.27k
    (yyval.Number) = cmExpr_yyget_extra(yyscanner)
1564
1.27k
      ->Div((yyvsp[-2].Number), (yyvsp[0].Number));
1565
1.27k
  }
1566
1.27k
#line 1567 "cmExprParser.cxx"
1567
1.27k
    break;
1568
1569
1.33k
  case 18: /* term: term exp_MOD unary  */
1570
1.33k
#line 155 "cmExprParser.y"
1571
1.33k
                     {
1572
1.33k
    (yyval.Number) = cmExpr_yyget_extra(yyscanner)
1573
1.33k
      ->Mod((yyvsp[-2].Number), (yyvsp[0].Number));
1574
1.33k
  }
1575
1.33k
#line 1576 "cmExprParser.cxx"
1576
1.33k
    break;
1577
1578
19.0k
  case 19: /* unary: factor  */
1579
19.0k
#line 161 "cmExprParser.y"
1580
19.0k
         {
1581
19.0k
    (yyval.Number) = (yyvsp[0].Number);
1582
19.0k
  }
1583
19.0k
#line 1584 "cmExprParser.cxx"
1584
19.0k
    break;
1585
1586
569
  case 20: /* unary: exp_PLUS unary  */
1587
569
#line 164 "cmExprParser.y"
1588
569
                 {
1589
569
    (yyval.Number) = + (yyvsp[0].Number);
1590
569
  }
1591
569
#line 1592 "cmExprParser.cxx"
1592
569
    break;
1593
1594
7.10k
  case 21: /* unary: exp_MINUS unary  */
1595
7.10k
#line 167 "cmExprParser.y"
1596
7.10k
                  {
1597
7.10k
    (yyval.Number) = cmExpr_yyget_extra(yyscanner)
1598
7.10k
      ->Neg((yyvsp[0].Number));
1599
7.10k
  }
1600
7.10k
#line 1601 "cmExprParser.cxx"
1601
7.10k
    break;
1602
1603
1.20k
  case 22: /* unary: exp_NOT unary  */
1604
1.20k
#line 171 "cmExprParser.y"
1605
1.20k
                {
1606
1.20k
    (yyval.Number) = ~ (yyvsp[0].Number);
1607
1.20k
  }
1608
1.20k
#line 1609 "cmExprParser.cxx"
1609
1.20k
    break;
1610
1611
16.5k
  case 23: /* factor: exp_NUMBER  */
1612
16.5k
#line 176 "cmExprParser.y"
1613
16.5k
             {
1614
16.5k
    (yyval.Number) = (yyvsp[0].Number);
1615
16.5k
  }
1616
16.5k
#line 1617 "cmExprParser.cxx"
1617
16.5k
    break;
1618
1619
2.55k
  case 24: /* factor: exp_OPENPARENT exp exp_CLOSEPARENT  */
1620
2.55k
#line 179 "cmExprParser.y"
1621
2.55k
                                     {
1622
2.55k
    (yyval.Number) = (yyvsp[-1].Number);
1623
2.55k
  }
1624
2.55k
#line 1625 "cmExprParser.cxx"
1625
2.55k
    break;
1626
1627
1628
0
#line 1629 "cmExprParser.cxx"
1629
1630
0
      default: break;
1631
113k
    }
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
113k
  YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1644
1645
113k
  YYPOPSTACK (yylen);
1646
113k
  yylen = 0;
1647
1648
113k
  *++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
113k
  {
1654
113k
    const int yylhs = yyr1[yyn] - YYNTOKENS;
1655
113k
    const int yyi = yypgoto[yylhs] + *yyssp;
1656
113k
    yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1657
113k
               ? yytable[yyi]
1658
113k
               : yydefgoto[yylhs]);
1659
113k
  }
1660
1661
113k
  goto yynewstate;
1662
1663
1664
/*--------------------------------------.
1665
| yyerrlab -- here on detecting error.  |
1666
`--------------------------------------*/
1667
248
yyerrlab:
1668
  /* Make sure we have latest lookahead translation.  See comments at
1669
     user semantic actions for why this is necessary.  */
1670
248
  yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1671
  /* If not already recovering from an error, report this error.  */
1672
248
  if (!yyerrstatus)
1673
248
    {
1674
248
      ++yynerrs;
1675
248
      {
1676
248
        yypcontext_t yyctx
1677
248
          = {yyssp, yytoken};
1678
248
        char const *yymsgp = YY_("syntax error");
1679
248
        int yysyntax_error_status;
1680
248
        yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
1681
248
        if (yysyntax_error_status == 0)
1682
248
          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
248
        yyerror (yyscanner, yymsgp);
1703
248
        if (yysyntax_error_status == YYENOMEM)
1704
0
          YYNOMEM;
1705
248
      }
1706
248
    }
1707
1708
248
  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
248
  goto yyerrlab1;
1730
1731
1732
/*---------------------------------------------------.
1733
| yyerrorlab -- error raised explicitly by YYERROR.  |
1734
`---------------------------------------------------*/
1735
248
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
248
yyerrlab1:
1755
248
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
1756
1757
  /* Pop stack until we find a state that shifts the error token.  */
1758
248
  for (;;)
1759
3.30k
    {
1760
3.30k
      yyn = yypact[yystate];
1761
3.30k
      if (!yypact_value_is_default (yyn))
1762
3.30k
        {
1763
3.30k
          yyn += YYSYMBOL_YYerror;
1764
3.30k
          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.30k
        }
1771
1772
      /* Pop the current state because it cannot handle the error token.  */
1773
3.30k
      if (yyssp == yyss)
1774
248
        YYABORT;
1775
1776
1777
3.05k
      yydestruct ("Error: popping",
1778
3.05k
                  YY_ACCESSING_SYMBOL (yystate), yyvsp, yyscanner);
1779
3.05k
      YYPOPSTACK (1);
1780
3.05k
      yystate = *yyssp;
1781
3.05k
      YY_STACK_PRINT (yyss, yyssp);
1782
3.05k
    }
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.51k
yyacceptlab:
1800
1.51k
  yyresult = 0;
1801
1.51k
  goto yyreturnlab;
1802
1803
1804
/*-----------------------------------.
1805
| yyabortlab -- YYABORT comes here.  |
1806
`-----------------------------------*/
1807
248
yyabortlab:
1808
248
  yyresult = 1;
1809
248
  goto yyreturnlab;
1810
1811
1812
/*-----------------------------------------------------------.
1813
| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here.  |
1814
`-----------------------------------------------------------*/
1815
2
yyexhaustedlab:
1816
2
  yyerror (yyscanner, YY_("memory exhausted"));
1817
2
  yyresult = 2;
1818
2
  goto yyreturnlab;
1819
1820
1821
/*----------------------------------------------------------.
1822
| yyreturnlab -- parsing is finished, clean up and return.  |
1823
`----------------------------------------------------------*/
1824
1.76k
yyreturnlab:
1825
1.76k
  if (yychar != YYEMPTY)
1826
248
    {
1827
      /* Make sure we have latest lookahead translation.  See comments at
1828
         user semantic actions for why this is necessary.  */
1829
248
      yytoken = YYTRANSLATE (yychar);
1830
248
      yydestruct ("Cleanup: discarding lookahead",
1831
248
                  yytoken, &yylval, yyscanner);
1832
248
    }
1833
  /* Do not reclaim the symbols of the rule whose action triggered
1834
     this YYABORT or YYACCEPT.  */
1835
1.76k
  YYPOPSTACK (yylen);
1836
1.76k
  YY_STACK_PRINT (yyss, yyssp);
1837
5.20k
  while (yyssp != yyss)
1838
3.43k
    {
1839
3.43k
      yydestruct ("Cleanup: popping",
1840
3.43k
                  YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yyscanner);
1841
3.43k
      YYPOPSTACK (1);
1842
3.43k
    }
1843
1.76k
#ifndef yyoverflow
1844
1.76k
  if (yyss != yyssa)
1845
0
    YYSTACK_FREE (yyss);
1846
1.76k
#endif
1847
1.76k
  if (yymsg != yymsgbuf)
1848
0
    YYSTACK_FREE (yymsg);
1849
1.76k
  return yyresult;
1850
248
}
1851
1852
#line 184 "cmExprParser.y"
1853
1854
/* End of grammar */
1855
1856
/*--------------------------------------------------------------------------*/
1857
void cmExpr_yyerror(yyscan_t yyscanner, const char* message)
1858
250
{
1859
250
  cmExpr_yyget_extra(yyscanner)->Error(message);
1860
250
}