Coverage Report

Created: 2025-10-10 06:41

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/yara/libyara/hex_grammar.c
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         hex_yyparse
69
#define yylex           hex_yylex
70
#define yyerror         hex_yyerror
71
#define yydebug         hex_yydebug
72
#define yynerrs         hex_yynerrs
73
74
/* First part of user prologue.  */
75
#line 30 "hex_grammar.y"
76
77
78
#include <string.h>
79
#include <limits.h>
80
81
#include <yara/integers.h>
82
#include <yara/utils.h>
83
#include <yara/hex_lexer.h>
84
#include <yara/limits.h>
85
#include <yara/mem.h>
86
#include <yara/error.h>
87
88
89
#define STR_EXPAND(tok) #tok
90
#define STR(tok) STR_EXPAND(tok)
91
92
#define YYERROR_VERBOSE
93
94
#define YYMALLOC yr_malloc
95
324
#define YYFREE yr_free
96
97
#define mark_as_not_fast_regexp() \
98
1.43k
    ((RE_AST*) yyget_extra(yyscanner))->flags &= ~RE_FLAGS_FAST_REGEXP
99
100
#define fail_if(x, error) \
101
67.8k
    if (x) \
102
67.8k
    { \
103
0
      lex_env->last_error = error; \
104
0
      YYABORT; \
105
0
    } \
106
107
#define destroy_node_if(x, node) \
108
5.35k
    if (x) \
109
5.35k
    { \
110
0
      yr_re_node_destroy(node); \
111
0
    } \
112
113
114
#line 115 "hex_grammar.c"
115
116
# ifndef YY_CAST
117
#  ifdef __cplusplus
118
#   define YY_CAST(Type, Val) static_cast<Type> (Val)
119
#   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
120
#  else
121
1.07M
#   define YY_CAST(Type, Val) ((Type) (Val))
122
#   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
123
#  endif
124
# endif
125
# ifndef YY_NULLPTR
126
#  if defined __cplusplus
127
#   if 201103L <= __cplusplus
128
#    define YY_NULLPTR nullptr
129
#   else
130
#    define YY_NULLPTR 0
131
#   endif
132
#  else
133
#   define YY_NULLPTR ((void*)0)
134
#  endif
135
# endif
136
137
/* Use api.header.include to #include this header
138
   instead of duplicating it here.  */
139
#ifndef YY_HEX_YY_HEX_GRAMMAR_H_INCLUDED
140
# define YY_HEX_YY_HEX_GRAMMAR_H_INCLUDED
141
/* Debug traces.  */
142
#ifndef YYDEBUG
143
# define YYDEBUG 0
144
#endif
145
#if YYDEBUG
146
extern int hex_yydebug;
147
#endif
148
149
/* Token kinds.  */
150
#ifndef YYTOKENTYPE
151
# define YYTOKENTYPE
152
  enum yytokentype
153
  {
154
    YYEMPTY = -2,
155
    YYEOF = 0,                     /* "end of file"  */
156
    YYerror = 256,                 /* error  */
157
    YYUNDEF = 257,                 /* "invalid token"  */
158
    _BYTE_ = 258,                  /* _BYTE_  */
159
    _MASKED_BYTE_ = 259,           /* _MASKED_BYTE_  */
160
    _NOT_BYTE_ = 260,              /* _NOT_BYTE_  */
161
    _MASKED_NOT_BYTE_ = 261,       /* _MASKED_NOT_BYTE_  */
162
    _NUMBER_ = 262                 /* _NUMBER_  */
163
  };
164
  typedef enum yytokentype yytoken_kind_t;
165
#endif
166
/* Token kinds.  */
167
#define YYEMPTY -2
168
#define YYEOF 0
169
#define YYerror 256
170
#define YYUNDEF 257
171
#define _BYTE_ 258
172
#define _MASKED_BYTE_ 259
173
#define _NOT_BYTE_ 260
174
#define _MASKED_NOT_BYTE_ 261
175
#define _NUMBER_ 262
176
177
/* Value type.  */
178
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
179
union YYSTYPE
180
{
181
#line 78 "hex_grammar.y"
182
183
  int64_t integer;
184
  RE_NODE *re_node;
185
186
#line 187 "hex_grammar.c"
187
188
};
189
typedef union YYSTYPE YYSTYPE;
190
# define YYSTYPE_IS_TRIVIAL 1
191
# define YYSTYPE_IS_DECLARED 1
192
#endif
193
194
195
196
197
int hex_yyparse (void *yyscanner, HEX_LEX_ENVIRONMENT *lex_env);
198
199
200
#endif /* !YY_HEX_YY_HEX_GRAMMAR_H_INCLUDED  */
201
/* Symbol kind.  */
202
enum yysymbol_kind_t
203
{
204
  YYSYMBOL_YYEMPTY = -2,
205
  YYSYMBOL_YYEOF = 0,                      /* "end of file"  */
206
  YYSYMBOL_YYerror = 1,                    /* error  */
207
  YYSYMBOL_YYUNDEF = 2,                    /* "invalid token"  */
208
  YYSYMBOL__BYTE_ = 3,                     /* _BYTE_  */
209
  YYSYMBOL__MASKED_BYTE_ = 4,              /* _MASKED_BYTE_  */
210
  YYSYMBOL__NOT_BYTE_ = 5,                 /* _NOT_BYTE_  */
211
  YYSYMBOL__MASKED_NOT_BYTE_ = 6,          /* _MASKED_NOT_BYTE_  */
212
  YYSYMBOL__NUMBER_ = 7,                   /* _NUMBER_  */
213
  YYSYMBOL_8_ = 8,                         /* '{'  */
214
  YYSYMBOL_9_ = 9,                         /* '}'  */
215
  YYSYMBOL_10_ = 10,                       /* '('  */
216
  YYSYMBOL_11_ = 11,                       /* ')'  */
217
  YYSYMBOL_12_ = 12,                       /* '['  */
218
  YYSYMBOL_13_ = 13,                       /* ']'  */
219
  YYSYMBOL_14_ = 14,                       /* '-'  */
220
  YYSYMBOL_15_ = 15,                       /* '|'  */
221
  YYSYMBOL_YYACCEPT = 16,                  /* $accept  */
222
  YYSYMBOL_hex_string = 17,                /* hex_string  */
223
  YYSYMBOL_tokens = 18,                    /* tokens  */
224
  YYSYMBOL_token_sequence = 19,            /* token_sequence  */
225
  YYSYMBOL_token_or_range = 20,            /* token_or_range  */
226
  YYSYMBOL_token = 21,                     /* token  */
227
  YYSYMBOL_22_1 = 22,                      /* $@1  */
228
  YYSYMBOL_range = 23,                     /* range  */
229
  YYSYMBOL_alternatives = 24,              /* alternatives  */
230
  YYSYMBOL_byte = 25                       /* byte  */
231
};
232
typedef enum yysymbol_kind_t yysymbol_kind_t;
233
234
235
236
237
#ifdef short
238
# undef short
239
#endif
240
241
/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
242
   <limits.h> and (if available) <stdint.h> are included
243
   so that the code can choose integer types of a good width.  */
244
245
#ifndef __PTRDIFF_MAX__
246
# include <limits.h> /* INFRINGES ON USER NAME SPACE */
247
# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
248
#  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
249
#  define YY_STDINT_H
250
# endif
251
#endif
252
253
/* Narrow types that promote to a signed type and that can represent a
254
   signed or unsigned integer of at least N bits.  In tables they can
255
   save space and decrease cache pressure.  Promoting to a signed type
256
   helps avoid bugs in integer arithmetic.  */
257
258
#ifdef __INT_LEAST8_MAX__
259
typedef __INT_LEAST8_TYPE__ yytype_int8;
260
#elif defined YY_STDINT_H
261
typedef int_least8_t yytype_int8;
262
#else
263
typedef signed char yytype_int8;
264
#endif
265
266
#ifdef __INT_LEAST16_MAX__
267
typedef __INT_LEAST16_TYPE__ yytype_int16;
268
#elif defined YY_STDINT_H
269
typedef int_least16_t yytype_int16;
270
#else
271
typedef short yytype_int16;
272
#endif
273
274
/* Work around bug in HP-UX 11.23, which defines these macros
275
   incorrectly for preprocessor constants.  This workaround can likely
276
   be removed in 2023, as HPE has promised support for HP-UX 11.23
277
   (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
278
   <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>.  */
279
#ifdef __hpux
280
# undef UINT_LEAST8_MAX
281
# undef UINT_LEAST16_MAX
282
# define UINT_LEAST8_MAX 255
283
# define UINT_LEAST16_MAX 65535
284
#endif
285
286
#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
287
typedef __UINT_LEAST8_TYPE__ yytype_uint8;
288
#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
289
       && UINT_LEAST8_MAX <= INT_MAX)
290
typedef uint_least8_t yytype_uint8;
291
#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
292
typedef unsigned char yytype_uint8;
293
#else
294
typedef short yytype_uint8;
295
#endif
296
297
#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
298
typedef __UINT_LEAST16_TYPE__ yytype_uint16;
299
#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
300
       && UINT_LEAST16_MAX <= INT_MAX)
301
typedef uint_least16_t yytype_uint16;
302
#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
303
typedef unsigned short yytype_uint16;
304
#else
305
typedef int yytype_uint16;
306
#endif
307
308
#ifndef YYPTRDIFF_T
309
# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
310
2.11k
#  define YYPTRDIFF_T __PTRDIFF_TYPE__
311
#  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
312
# elif defined PTRDIFF_MAX
313
#  ifndef ptrdiff_t
314
#   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
315
#  endif
316
#  define YYPTRDIFF_T ptrdiff_t
317
#  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
318
# else
319
#  define YYPTRDIFF_T long
320
#  define YYPTRDIFF_MAXIMUM LONG_MAX
321
# endif
322
#endif
323
324
#ifndef YYSIZE_T
325
# ifdef __SIZE_TYPE__
326
#  define YYSIZE_T __SIZE_TYPE__
327
# elif defined size_t
328
#  define YYSIZE_T size_t
329
# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
330
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
331
#  define YYSIZE_T size_t
332
# else
333
#  define YYSIZE_T unsigned
334
# endif
335
#endif
336
337
#define YYSIZE_MAXIMUM                                  \
338
  YY_CAST (YYPTRDIFF_T,                                 \
339
           (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
340
            ? YYPTRDIFF_MAXIMUM                         \
341
            : YY_CAST (YYSIZE_T, -1)))
342
343
1.94k
#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
344
345
346
/* Stored state numbers (used for stacks). */
347
typedef yytype_int8 yy_state_t;
348
349
/* State numbers in computations.  */
350
typedef int yy_state_fast_t;
351
352
#ifndef YY_
353
# if defined YYENABLE_NLS && YYENABLE_NLS
354
#  if ENABLE_NLS
355
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
356
#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
357
#  endif
358
# endif
359
# ifndef YY_
360
280
#  define YY_(Msgid) Msgid
361
# endif
362
#endif
363
364
365
#ifndef YY_ATTRIBUTE_PURE
366
# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
367
#  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
368
# else
369
#  define YY_ATTRIBUTE_PURE
370
# endif
371
#endif
372
373
#ifndef YY_ATTRIBUTE_UNUSED
374
# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
375
#  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
376
# else
377
#  define YY_ATTRIBUTE_UNUSED
378
# endif
379
#endif
380
381
/* Suppress unused-variable warnings by "using" E.  */
382
#if ! defined lint || defined __GNUC__
383
728k
# define YY_USE(E) ((void) (E))
384
#else
385
# define YY_USE(E) /* empty */
386
#endif
387
388
/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
389
#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
390
# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
391
#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
392
    _Pragma ("GCC diagnostic push")                                     \
393
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
394
# else
395
#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
396
    _Pragma ("GCC diagnostic push")                                     \
397
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
398
    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
399
# endif
400
# define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
401
    _Pragma ("GCC diagnostic pop")
402
#else
403
2.26k
# define YY_INITIAL_VALUE(Value) Value
404
#endif
405
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
406
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
407
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
408
#endif
409
#ifndef YY_INITIAL_VALUE
410
# define YY_INITIAL_VALUE(Value) /* Nothing. */
411
#endif
412
413
#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
414
# define YY_IGNORE_USELESS_CAST_BEGIN                          \
415
    _Pragma ("GCC diagnostic push")                            \
416
    _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
417
# define YY_IGNORE_USELESS_CAST_END            \
418
    _Pragma ("GCC diagnostic pop")
419
#endif
420
#ifndef YY_IGNORE_USELESS_CAST_BEGIN
421
# define YY_IGNORE_USELESS_CAST_BEGIN
422
# define YY_IGNORE_USELESS_CAST_END
423
#endif
424
425
426
573k
#define YY_ASSERT(E) ((void) (0 && (E)))
427
428
#if !defined yyoverflow
429
430
/* The parser invokes alloca or malloc; define the necessary symbols.  */
431
432
# ifdef YYSTACK_USE_ALLOCA
433
#  if YYSTACK_USE_ALLOCA
434
#   ifdef __GNUC__
435
#    define YYSTACK_ALLOC __builtin_alloca
436
#   elif defined __BUILTIN_VA_ARG_INCR
437
#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
438
#   elif defined _AIX
439
#    define YYSTACK_ALLOC __alloca
440
#   elif defined _MSC_VER
441
#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
442
#    define alloca _alloca
443
#   else
444
#    define YYSTACK_ALLOC alloca
445
#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
446
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
447
      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
448
#     ifndef EXIT_SUCCESS
449
#      define EXIT_SUCCESS 0
450
#     endif
451
#    endif
452
#   endif
453
#  endif
454
# endif
455
456
# ifdef YYSTACK_ALLOC
457
   /* Pacify GCC's 'empty if-body' warning.  */
458
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
459
#  ifndef YYSTACK_ALLOC_MAXIMUM
460
    /* The OS might guarantee only one guard page at the bottom of the stack,
461
       and a page size can be as small as 4096 bytes.  So we cannot safely
462
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
463
       to allow for a few compiler-allocated temporary stack slots.  */
464
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
465
#  endif
466
# else
467
#  define YYSTACK_ALLOC YYMALLOC
468
324
#  define YYSTACK_FREE YYFREE
469
#  ifndef YYSTACK_ALLOC_MAXIMUM
470
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
471
#  endif
472
#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
473
       && ! ((defined YYMALLOC || defined malloc) \
474
             && (defined YYFREE || defined free)))
475
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
476
#   ifndef EXIT_SUCCESS
477
#    define EXIT_SUCCESS 0
478
#   endif
479
#  endif
480
#  ifndef YYMALLOC
481
#   define YYMALLOC malloc
482
#   if ! defined malloc && ! defined EXIT_SUCCESS
483
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
484
#   endif
485
#  endif
486
#  ifndef YYFREE
487
#   define YYFREE free
488
#   if ! defined free && ! defined EXIT_SUCCESS
489
void free (void *); /* INFRINGES ON USER NAME SPACE */
490
#   endif
491
#  endif
492
# endif
493
#endif /* !defined yyoverflow */
494
495
#if (! defined yyoverflow \
496
     && (! defined __cplusplus \
497
         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
498
499
/* A type that is properly aligned for any stack member.  */
500
union yyalloc
501
{
502
  yy_state_t yyss_alloc;
503
  YYSTYPE yyvs_alloc;
504
};
505
506
/* The size of the maximum gap between one aligned stack and the next.  */
507
648
# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
508
509
/* The size of an array large to enough to hold all stacks, each with
510
   N elements.  */
511
# define YYSTACK_BYTES(N) \
512
     ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
513
      + YYSTACK_GAP_MAXIMUM)
514
515
# define YYCOPY_NEEDED 1
516
517
/* Relocate STACK from its old location to the new one.  The
518
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
519
   elements in the stack, and YYPTR gives the new location of the
520
   stack.  Advance YYPTR to a properly aligned location for the next
521
   stack.  */
522
# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
523
648
    do                                                                  \
524
648
      {                                                                 \
525
648
        YYPTRDIFF_T yynewbytes;                                         \
526
648
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
527
648
        Stack = &yyptr->Stack_alloc;                                    \
528
648
        yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
529
648
        yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
530
648
      }                                                                 \
531
648
    while (0)
532
533
#endif
534
535
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
536
/* Copy COUNT objects from SRC to DST.  The source and destination do
537
   not overlap.  */
538
# ifndef YYCOPY
539
#  if defined __GNUC__ && 1 < __GNUC__
540
#   define YYCOPY(Dst, Src, Count) \
541
648
      __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
542
#  else
543
#   define YYCOPY(Dst, Src, Count)              \
544
      do                                        \
545
        {                                       \
546
          YYPTRDIFF_T yyi;                      \
547
          for (yyi = 0; yyi < (Count); yyi++)   \
548
            (Dst)[yyi] = (Src)[yyi];            \
549
        }                                       \
550
      while (0)
551
#  endif
552
# endif
553
#endif /* !YYCOPY_NEEDED */
554
555
/* YYFINAL -- State number of the termination state.  */
556
573k
#define YYFINAL  11
557
/* YYLAST -- Last index in YYTABLE.  */
558
894k
#define YYLAST   35
559
560
/* YYNTOKENS -- Number of terminals.  */
561
367k
#define YYNTOKENS  16
562
/* YYNNTS -- Number of nonterminals.  */
563
#define YYNNTS  10
564
/* YYNRULES -- Number of rules.  */
565
#define YYNRULES  22
566
/* YYNSTATES -- Number of states.  */
567
#define YYNSTATES  34
568
569
/* YYMAXUTOK -- Last valid token kind.  */
570
259k
#define YYMAXUTOK   262
571
572
573
/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
574
   as returned by yylex, with out-of-bounds checking.  */
575
#define YYTRANSLATE(YYX)                                \
576
260k
  (0 <= (YYX) && (YYX) <= YYMAXUTOK                     \
577
260k
   ? YY_CAST (yysymbol_kind_t, yytranslate[YYX])        \
578
260k
   : YYSYMBOL_YYUNDEF)
579
580
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
581
   as returned by yylex.  */
582
static const yytype_int8 yytranslate[] =
583
{
584
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
585
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
586
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
587
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
588
      10,    11,     2,     2,     2,    14,     2,     2,     2,     2,
589
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
590
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
591
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
592
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
593
       2,    12,     2,    13,     2,     2,     2,     2,     2,     2,
594
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
595
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
596
       2,     2,     2,     8,    15,     9,     2,     2,     2,     2,
597
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
598
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
599
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
600
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
601
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
602
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
603
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
604
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
605
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
606
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
607
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
608
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
609
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
610
       5,     6,     7
611
};
612
613
#if YYDEBUG
614
/* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
615
static const yytype_int16 yyrline[] =
616
{
617
       0,   107,   107,   116,   120,   132,   143,   152,   161,   165,
618
     174,   179,   178,   191,   227,   259,   281,   301,   305,   322,
619
     331,   340,   363
620
};
621
#endif
622
623
/** Accessing symbol of state STATE.  */
624
242k
#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
625
626
#if YYDEBUG || 0
627
/* The user-facing name of the symbol whose (internal) number is
628
   YYSYMBOL.  No bounds checking.  */
629
static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
630
631
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
632
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
633
static const char *const yytname[] =
634
{
635
  "\"end of file\"", "error", "\"invalid token\"", "_BYTE_",
636
  "_MASKED_BYTE_", "_NOT_BYTE_", "_MASKED_NOT_BYTE_", "_NUMBER_", "'{'",
637
  "'}'", "'('", "')'", "'['", "']'", "'-'", "'|'", "$accept", "hex_string",
638
  "tokens", "token_sequence", "token_or_range", "token", "$@1", "range",
639
  "alternatives", "byte", YY_NULLPTR
640
};
641
642
static const char *
643
yysymbol_name (yysymbol_kind_t yysymbol)
644
{
645
  return yytname[yysymbol];
646
}
647
#endif
648
649
657k
#define YYPACT_NINF (-13)
650
651
#define yypact_value_is_default(Yyn) \
652
657k
  ((Yyn) == YYPACT_NINF)
653
654
#define YYTABLE_NINF (-6)
655
656
#define yytable_value_is_error(Yyn) \
657
1.75k
  0
658
659
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
660
   STATE-NUM.  */
661
static const yytype_int8 yypact[] =
662
{
663
       1,    12,    24,   -13,   -13,   -13,   -13,   -13,     3,    -2,
664
     -13,   -13,    12,   -13,    -1,    -2,   -13,    -4,   -13,   -13,
665
      16,    19,    15,   -13,    10,   -13,    12,   -13,    13,   -13,
666
     -13,    17,   -13,   -13
667
};
668
669
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
670
   Performed when YYTABLE does not specify something else to do.  Zero
671
   means the default is an error.  */
672
static const yytype_int8 yydefact[] =
673
{
674
       0,     0,     0,    19,    21,    20,    22,    11,     0,     3,
675
      10,     1,     0,     2,     0,     0,     6,     8,     9,    17,
676
       0,     0,     0,     7,     8,    12,     0,    13,     0,    16,
677
      18,     0,    15,    14
678
};
679
680
/* YYPGOTO[NTERM-NUM].  */
681
static const yytype_int8 yypgoto[] =
682
{
683
     -13,   -13,   -12,   -13,    20,    14,   -13,   -13,   -13,   -13
684
};
685
686
/* YYDEFGOTO[NTERM-NUM].  */
687
static const yytype_int8 yydefgoto[] =
688
{
689
       0,     2,     8,    15,    16,     9,    12,    18,    20,    10
690
};
691
692
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
693
   positive, shift that token.  If negative, reduce the rule whose
694
   number is the opposite.  If YYTABLE_NINF, syntax error.  */
695
static const yytype_int8 yytable[] =
696
{
697
      19,     3,     4,     5,     6,    -4,    21,    -4,     7,     1,
698
      14,    -4,    13,    22,    30,     3,     4,     5,     6,    -5,
699
      31,    -5,     7,    17,    11,    -5,    32,    25,    29,    24,
700
      33,    26,    27,    28,     0,    23
701
};
702
703
static const yytype_int8 yycheck[] =
704
{
705
      12,     3,     4,     5,     6,     9,     7,    11,    10,     8,
706
      12,    15,     9,    14,    26,     3,     4,     5,     6,     9,
707
       7,    11,    10,     9,     0,    15,    13,    11,    13,    15,
708
      13,    15,    13,    14,    -1,    15
709
};
710
711
/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
712
   state STATE-NUM.  */
713
static const yytype_int8 yystos[] =
714
{
715
       0,     8,    17,     3,     4,     5,     6,    10,    18,    21,
716
      25,     0,    22,     9,    12,    19,    20,    21,    23,    18,
717
      24,     7,    14,    20,    21,    11,    15,    13,    14,    13,
718
      18,     7,    13,    13
719
};
720
721
/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.  */
722
static const yytype_int8 yyr1[] =
723
{
724
       0,    16,    17,    18,    18,    18,    19,    19,    20,    20,
725
      21,    22,    21,    23,    23,    23,    23,    24,    24,    25,
726
      25,    25,    25
727
};
728
729
/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.  */
730
static const yytype_int8 yyr2[] =
731
{
732
       0,     2,     3,     1,     2,     3,     1,     2,     1,     1,
733
       1,     0,     4,     3,     5,     4,     3,     1,     3,     1,
734
       1,     1,     1
735
};
736
737
738
enum { YYENOMEM = -2 };
739
740
#define yyerrok         (yyerrstatus = 0)
741
#define yyclearin       (yychar = YYEMPTY)
742
743
763
#define YYACCEPT        goto yyacceptlab
744
360
#define YYABORT         goto yyabortlab
745
0
#define YYERROR         goto yyerrorlab
746
10
#define YYNOMEM         goto yyexhaustedlab
747
748
749
#define YYRECOVERING()  (!!yyerrstatus)
750
751
#define YYBACKUP(Token, Value)                                    \
752
  do                                                              \
753
    if (yychar == YYEMPTY)                                        \
754
      {                                                           \
755
        yychar = (Token);                                         \
756
        yylval = (Value);                                         \
757
        YYPOPSTACK (yylen);                                       \
758
        yystate = *yyssp;                                         \
759
        goto yybackup;                                            \
760
      }                                                           \
761
    else                                                          \
762
      {                                                           \
763
        yyerror (yyscanner, lex_env, YY_("syntax error: cannot back up")); \
764
        YYERROR;                                                  \
765
      }                                                           \
766
  while (0)
767
768
/* Backward compatibility with an undocumented macro.
769
   Use YYerror or YYUNDEF. */
770
#define YYERRCODE YYUNDEF
771
772
773
/* Enable debugging if requested.  */
774
#if YYDEBUG
775
776
# ifndef YYFPRINTF
777
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
778
#  define YYFPRINTF fprintf
779
# endif
780
781
# define YYDPRINTF(Args)                        \
782
do {                                            \
783
  if (yydebug)                                  \
784
    YYFPRINTF Args;                             \
785
} while (0)
786
787
788
789
790
# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
791
do {                                                                      \
792
  if (yydebug)                                                            \
793
    {                                                                     \
794
      YYFPRINTF (stderr, "%s ", Title);                                   \
795
      yy_symbol_print (stderr,                                            \
796
                  Kind, Value, yyscanner, lex_env); \
797
      YYFPRINTF (stderr, "\n");                                           \
798
    }                                                                     \
799
} while (0)
800
801
802
/*-----------------------------------.
803
| Print this symbol's value on YYO.  |
804
`-----------------------------------*/
805
806
static void
807
yy_symbol_value_print (FILE *yyo,
808
                       yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, void *yyscanner, HEX_LEX_ENVIRONMENT *lex_env)
809
{
810
  FILE *yyoutput = yyo;
811
  YY_USE (yyoutput);
812
  YY_USE (yyscanner);
813
  YY_USE (lex_env);
814
  if (!yyvaluep)
815
    return;
816
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
817
  YY_USE (yykind);
818
  YY_IGNORE_MAYBE_UNINITIALIZED_END
819
}
820
821
822
/*---------------------------.
823
| Print this symbol on YYO.  |
824
`---------------------------*/
825
826
static void
827
yy_symbol_print (FILE *yyo,
828
                 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, void *yyscanner, HEX_LEX_ENVIRONMENT *lex_env)
829
{
830
  YYFPRINTF (yyo, "%s %s (",
831
             yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
832
833
  yy_symbol_value_print (yyo, yykind, yyvaluep, yyscanner, lex_env);
834
  YYFPRINTF (yyo, ")");
835
}
836
837
/*------------------------------------------------------------------.
838
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
839
| TOP (included).                                                   |
840
`------------------------------------------------------------------*/
841
842
static void
843
yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
844
{
845
  YYFPRINTF (stderr, "Stack now");
846
  for (; yybottom <= yytop; yybottom++)
847
    {
848
      int yybot = *yybottom;
849
      YYFPRINTF (stderr, " %d", yybot);
850
    }
851
  YYFPRINTF (stderr, "\n");
852
}
853
854
# define YY_STACK_PRINT(Bottom, Top)                            \
855
do {                                                            \
856
  if (yydebug)                                                  \
857
    yy_stack_print ((Bottom), (Top));                           \
858
} while (0)
859
860
861
/*------------------------------------------------.
862
| Report that the YYRULE is going to be reduced.  |
863
`------------------------------------------------*/
864
865
static void
866
yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
867
                 int yyrule, void *yyscanner, HEX_LEX_ENVIRONMENT *lex_env)
868
{
869
  int yylno = yyrline[yyrule];
870
  int yynrhs = yyr2[yyrule];
871
  int yyi;
872
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
873
             yyrule - 1, yylno);
874
  /* The symbols being reduced.  */
875
  for (yyi = 0; yyi < yynrhs; yyi++)
876
    {
877
      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
878
      yy_symbol_print (stderr,
879
                       YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
880
                       &yyvsp[(yyi + 1) - (yynrhs)], yyscanner, lex_env);
881
      YYFPRINTF (stderr, "\n");
882
    }
883
}
884
885
# define YY_REDUCE_PRINT(Rule)          \
886
do {                                    \
887
  if (yydebug)                          \
888
    yy_reduce_print (yyssp, yyvsp, Rule, yyscanner, lex_env); \
889
} while (0)
890
891
/* Nonzero means print parse trace.  It is left uninitialized so that
892
   multiple parsers can coexist.  */
893
int yydebug;
894
#else /* !YYDEBUG */
895
780k
# define YYDPRINTF(Args) ((void) 0)
896
# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
897
# define YY_STACK_PRINT(Bottom, Top)
898
# define YY_REDUCE_PRINT(Rule)
899
#endif /* !YYDEBUG */
900
901
902
/* YYINITDEPTH -- initial size of the parser's stacks.  */
903
#ifndef YYINITDEPTH
904
1.13k
# define YYINITDEPTH 200
905
#endif
906
907
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
908
   if the built-in stack extension method is used).
909
910
   Do not make this value too large; the results are undefined if
911
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
912
   evaluated with infinite-precision integer arithmetic.  */
913
914
#ifndef YYMAXDEPTH
915
674
# define YYMAXDEPTH 10000
916
#endif
917
918
919
920
921
922
923
/*-----------------------------------------------.
924
| Release the memory associated to this symbol.  |
925
`-----------------------------------------------*/
926
927
static void
928
yydestruct (const char *yymsg,
929
            yysymbol_kind_t yykind, YYSTYPE *yyvaluep, void *yyscanner, HEX_LEX_ENVIRONMENT *lex_env)
930
242k
{
931
242k
  YY_USE (yyvaluep);
932
242k
  YY_USE (yyscanner);
933
242k
  YY_USE (lex_env);
934
242k
  if (!yymsg)
935
0
    yymsg = "Deleting";
936
242k
  YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
937
938
242k
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
939
242k
  switch (yykind)
940
242k
    {
941
98
    case YYSYMBOL_tokens: /* tokens  */
942
98
#line 96 "hex_grammar.y"
943
98
            { yr_re_node_destroy(((*yyvaluep).re_node)); ((*yyvaluep).re_node) = NULL; }
944
98
#line 945 "hex_grammar.c"
945
98
        break;
946
947
259
    case YYSYMBOL_token_sequence: /* token_sequence  */
948
259
#line 97 "hex_grammar.y"
949
259
            { yr_re_node_destroy(((*yyvaluep).re_node)); ((*yyvaluep).re_node) = NULL; }
950
259
#line 951 "hex_grammar.c"
951
259
        break;
952
953
0
    case YYSYMBOL_token_or_range: /* token_or_range  */
954
0
#line 98 "hex_grammar.y"
955
0
            { yr_re_node_destroy(((*yyvaluep).re_node)); ((*yyvaluep).re_node) = NULL; }
956
0
#line 957 "hex_grammar.c"
957
0
        break;
958
959
449
    case YYSYMBOL_token: /* token  */
960
449
#line 99 "hex_grammar.y"
961
449
            { yr_re_node_destroy(((*yyvaluep).re_node)); ((*yyvaluep).re_node) = NULL; }
962
449
#line 963 "hex_grammar.c"
963
449
        break;
964
965
0
    case YYSYMBOL_range: /* range  */
966
0
#line 102 "hex_grammar.y"
967
0
            { yr_re_node_destroy(((*yyvaluep).re_node)); ((*yyvaluep).re_node) = NULL; }
968
0
#line 969 "hex_grammar.c"
969
0
        break;
970
971
305
    case YYSYMBOL_alternatives: /* alternatives  */
972
305
#line 101 "hex_grammar.y"
973
305
            { yr_re_node_destroy(((*yyvaluep).re_node)); ((*yyvaluep).re_node) = NULL; }
974
305
#line 975 "hex_grammar.c"
975
305
        break;
976
977
0
    case YYSYMBOL_byte: /* byte  */
978
0
#line 100 "hex_grammar.y"
979
0
            { yr_re_node_destroy(((*yyvaluep).re_node)); ((*yyvaluep).re_node) = NULL; }
980
0
#line 981 "hex_grammar.c"
981
0
        break;
982
983
241k
      default:
984
241k
        break;
985
242k
    }
986
242k
  YY_IGNORE_MAYBE_UNINITIALIZED_END
987
242k
}
988
989
990
991
992
993
994
/*----------.
995
| yyparse.  |
996
`----------*/
997
998
int
999
yyparse (void *yyscanner, HEX_LEX_ENVIRONMENT *lex_env)
1000
1.13k
{
1001
/* Lookahead token kind.  */
1002
1.13k
int yychar;
1003
1004
1005
/* The semantic value of the lookahead symbol.  */
1006
/* Default value used for initialization, for pacifying older GCCs
1007
   or non-GCC compilers.  */
1008
1.13k
YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1009
1.13k
YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1010
1011
    /* Number of syntax errors so far.  */
1012
1.13k
    int yynerrs = 0;
1013
1014
1.13k
    yy_state_fast_t yystate = 0;
1015
    /* Number of tokens to shift before error messages enabled.  */
1016
1.13k
    int yyerrstatus = 0;
1017
1018
    /* Refer to the stacks through separate pointers, to allow yyoverflow
1019
       to reallocate them elsewhere.  */
1020
1021
    /* Their size.  */
1022
1.13k
    YYPTRDIFF_T yystacksize = YYINITDEPTH;
1023
1024
    /* The state stack: array, bottom, top.  */
1025
1.13k
    yy_state_t yyssa[YYINITDEPTH];
1026
1.13k
    yy_state_t *yyss = yyssa;
1027
1.13k
    yy_state_t *yyssp = yyss;
1028
1029
    /* The semantic value stack: array, bottom, top.  */
1030
1.13k
    YYSTYPE yyvsa[YYINITDEPTH];
1031
1.13k
    YYSTYPE *yyvs = yyvsa;
1032
1.13k
    YYSTYPE *yyvsp = yyvs;
1033
1034
1.13k
  int yyn;
1035
  /* The return value of yyparse.  */
1036
1.13k
  int yyresult;
1037
  /* Lookahead symbol kind.  */
1038
1.13k
  yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1039
  /* The variables used to return semantic value and location from the
1040
     action routines.  */
1041
1.13k
  YYSTYPE yyval;
1042
1043
1044
1045
611k
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1046
1047
  /* The number of symbols on the RHS of the reduced rule.
1048
     Keep to zero when no symbol should be popped.  */
1049
1.13k
  int yylen = 0;
1050
1051
1.13k
  YYDPRINTF ((stderr, "Starting parse\n"));
1052
1053
1.13k
  yychar = YYEMPTY; /* Cause a token to be read.  */
1054
1055
1.13k
  goto yysetstate;
1056
1057
1058
/*------------------------------------------------------------.
1059
| yynewstate -- push a new state, which is found in yystate.  |
1060
`------------------------------------------------------------*/
1061
572k
yynewstate:
1062
  /* In all cases, when you get here, the value and location stacks
1063
     have just been pushed.  So pushing a state here evens the stacks.  */
1064
572k
  yyssp++;
1065
1066
1067
/*--------------------------------------------------------------------.
1068
| yysetstate -- set current state (the top of the stack) to yystate.  |
1069
`--------------------------------------------------------------------*/
1070
573k
yysetstate:
1071
573k
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1072
573k
  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1073
573k
  YY_IGNORE_USELESS_CAST_BEGIN
1074
573k
  *yyssp = YY_CAST (yy_state_t, yystate);
1075
573k
  YY_IGNORE_USELESS_CAST_END
1076
573k
  YY_STACK_PRINT (yyss, yyssp);
1077
1078
573k
  if (yyss + yystacksize - 1 <= yyssp)
1079
#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1080
    YYNOMEM;
1081
#else
1082
334
    {
1083
      /* Get the current used size of the three stacks, in elements.  */
1084
334
      YYPTRDIFF_T yysize = yyssp - yyss + 1;
1085
1086
# if defined yyoverflow
1087
      {
1088
        /* Give user a chance to reallocate the stack.  Use copies of
1089
           these so that the &'s don't force the real ones into
1090
           memory.  */
1091
        yy_state_t *yyss1 = yyss;
1092
        YYSTYPE *yyvs1 = yyvs;
1093
1094
        /* Each stack pointer address is followed by the size of the
1095
           data in use in that stack, in bytes.  This used to be a
1096
           conditional around just the two extra args, but that might
1097
           be undefined if yyoverflow is a macro.  */
1098
        yyoverflow (YY_("memory exhausted"),
1099
                    &yyss1, yysize * YYSIZEOF (*yyssp),
1100
                    &yyvs1, yysize * YYSIZEOF (*yyvsp),
1101
                    &yystacksize);
1102
        yyss = yyss1;
1103
        yyvs = yyvs1;
1104
      }
1105
# else /* defined YYSTACK_RELOCATE */
1106
      /* Extend the stack our own way.  */
1107
334
      if (YYMAXDEPTH <= yystacksize)
1108
10
        YYNOMEM;
1109
324
      yystacksize *= 2;
1110
324
      if (YYMAXDEPTH < yystacksize)
1111
16
        yystacksize = YYMAXDEPTH;
1112
1113
324
      {
1114
324
        yy_state_t *yyss1 = yyss;
1115
324
        union yyalloc *yyptr =
1116
324
          YY_CAST (union yyalloc *,
1117
324
                   YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1118
324
        if (! yyptr)
1119
0
          YYNOMEM;
1120
324
        YYSTACK_RELOCATE (yyss_alloc, yyss);
1121
324
        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1122
324
#  undef YYSTACK_RELOCATE
1123
324
        if (yyss1 != yyssa)
1124
215
          YYSTACK_FREE (yyss1);
1125
324
      }
1126
0
# endif
1127
1128
0
      yyssp = yyss + yysize - 1;
1129
324
      yyvsp = yyvs + yysize - 1;
1130
1131
324
      YY_IGNORE_USELESS_CAST_BEGIN
1132
324
      YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1133
324
                  YY_CAST (long, yystacksize)));
1134
324
      YY_IGNORE_USELESS_CAST_END
1135
1136
324
      if (yyss + yystacksize - 1 <= yyssp)
1137
0
        YYABORT;
1138
324
    }
1139
573k
#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1140
1141
1142
573k
  if (yystate == YYFINAL)
1143
763
    YYACCEPT;
1144
1145
572k
  goto yybackup;
1146
1147
1148
/*-----------.
1149
| yybackup.  |
1150
`-----------*/
1151
572k
yybackup:
1152
  /* Do appropriate processing given the current state.  Read a
1153
     lookahead token if we need one and don't already have one.  */
1154
1155
  /* First try to decide what to do without reference to lookahead token.  */
1156
572k
  yyn = yypact[yystate];
1157
572k
  if (yypact_value_is_default (yyn))
1158
311k
    goto yydefault;
1159
1160
  /* Not known => get a lookahead token if don't already have one.  */
1161
1162
  /* YYCHAR is either empty, or end-of-input, or a valid lookahead.  */
1163
260k
  if (yychar == YYEMPTY)
1164
204k
    {
1165
204k
      YYDPRINTF ((stderr, "Reading a token\n"));
1166
204k
      yychar = yylex (&yylval, yyscanner, lex_env);
1167
204k
    }
1168
1169
260k
  if (yychar <= YYEOF)
1170
1.07k
    {
1171
1.07k
      yychar = YYEOF;
1172
1.07k
      yytoken = YYSYMBOL_YYEOF;
1173
1.07k
      YYDPRINTF ((stderr, "Now at end of input.\n"));
1174
1.07k
    }
1175
259k
  else if (yychar == YYerror)
1176
0
    {
1177
      /* The scanner already issued an error message, process directly
1178
         to error recovery.  But do not keep the error token as
1179
         lookahead, it is too special and may lead us to an endless
1180
         loop in error recovery. */
1181
0
      yychar = YYUNDEF;
1182
0
      yytoken = YYSYMBOL_YYerror;
1183
0
      goto yyerrlab1;
1184
0
    }
1185
259k
  else
1186
259k
    {
1187
259k
      yytoken = YYTRANSLATE (yychar);
1188
259k
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1189
259k
    }
1190
1191
  /* If the proper action on seeing token YYTOKEN is to reduce or to
1192
     detect an error, take that action.  */
1193
260k
  yyn += yytoken;
1194
260k
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1195
54.3k
    goto yydefault;
1196
206k
  yyn = yytable[yyn];
1197
206k
  if (yyn <= 0)
1198
1.75k
    {
1199
1.75k
      if (yytable_value_is_error (yyn))
1200
0
        goto yyerrlab;
1201
1.75k
      yyn = -yyn;
1202
1.75k
      goto yyreduce;
1203
1.75k
    }
1204
1205
  /* Count tokens shifted since error; after three, turn off error
1206
     status.  */
1207
204k
  if (yyerrstatus)
1208
0
    yyerrstatus--;
1209
1210
  /* Shift the lookahead token.  */
1211
204k
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1212
204k
  yystate = yyn;
1213
204k
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1214
204k
  *++yyvsp = yylval;
1215
204k
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1216
1217
  /* Discard the shifted token.  */
1218
204k
  yychar = YYEMPTY;
1219
204k
  goto yynewstate;
1220
1221
1222
/*-----------------------------------------------------------.
1223
| yydefault -- do the default action for the current state.  |
1224
`-----------------------------------------------------------*/
1225
366k
yydefault:
1226
366k
  yyn = yydefact[yystate];
1227
366k
  if (yyn == 0)
1228
270
    goto yyerrlab;
1229
366k
  goto yyreduce;
1230
1231
1232
/*-----------------------------.
1233
| yyreduce -- do a reduction.  |
1234
`-----------------------------*/
1235
367k
yyreduce:
1236
  /* yyn is the number of a rule to reduce with.  */
1237
367k
  yylen = yyr2[yyn];
1238
1239
  /* If YYLEN is nonzero, implement the default value of the action:
1240
     '$$ = $1'.
1241
1242
     Otherwise, the following line sets YYVAL to garbage.
1243
     This behavior is undocumented and Bison
1244
     users should not rely upon it.  Assigning to YYVAL
1245
     unconditionally makes the parser a bit smaller, and it avoids a
1246
     GCC warning that YYVAL may be used uninitialized.  */
1247
367k
  yyval = yyvsp[1-yylen];
1248
1249
1250
367k
  YY_REDUCE_PRINT (yyn);
1251
367k
  switch (yyn)
1252
367k
    {
1253
763
  case 2: /* hex_string: '{' tokens '}'  */
1254
763
#line 108 "hex_grammar.y"
1255
763
      {
1256
763
        RE_AST* re_ast = yyget_extra(yyscanner);
1257
763
        re_ast->root_node = (yyvsp[-1].re_node);
1258
763
      }
1259
763
#line 1260 "hex_grammar.c"
1260
763
    break;
1261
1262
1.32k
  case 3: /* tokens: token  */
1263
1.32k
#line 117 "hex_grammar.y"
1264
1.32k
      {
1265
1.32k
        (yyval.re_node) = (yyvsp[0].re_node);
1266
1.32k
      }
1267
1.32k
#line 1268 "hex_grammar.c"
1268
1.32k
    break;
1269
1270
470
  case 4: /* tokens: token token  */
1271
470
#line 121 "hex_grammar.y"
1272
470
      {
1273
470
        (yyval.re_node) = yr_re_node_create(RE_NODE_CONCAT);
1274
1275
470
        destroy_node_if((yyval.re_node) == NULL, (yyvsp[-1].re_node));
1276
470
        destroy_node_if((yyval.re_node) == NULL, (yyvsp[0].re_node));
1277
1278
470
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1279
1280
470
        yr_re_node_append_child((yyval.re_node), (yyvsp[-1].re_node));
1281
470
        yr_re_node_append_child((yyval.re_node), (yyvsp[0].re_node));
1282
470
      }
1283
0
#line 1284 "hex_grammar.c"
1284
0
    break;
1285
1286
1.28k
  case 5: /* tokens: token token_sequence token  */
1287
1.28k
#line 133 "hex_grammar.y"
1288
1.28k
      {
1289
1.28k
        yr_re_node_append_child((yyvsp[-1].re_node), (yyvsp[0].re_node));
1290
1.28k
        yr_re_node_prepend_child((yyvsp[-1].re_node), (yyvsp[-2].re_node));
1291
1292
1.28k
        (yyval.re_node) = (yyvsp[-1].re_node);
1293
1.28k
      }
1294
1.28k
#line 1295 "hex_grammar.c"
1295
1.28k
    break;
1296
1297
1.54k
  case 6: /* token_sequence: token_or_range  */
1298
1.54k
#line 144 "hex_grammar.y"
1299
1.54k
      {
1300
1.54k
        (yyval.re_node) = yr_re_node_create(RE_NODE_CONCAT);
1301
1302
1.54k
        destroy_node_if((yyval.re_node) == NULL, (yyvsp[0].re_node));
1303
1.54k
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1304
1305
1.54k
        yr_re_node_append_child((yyval.re_node), (yyvsp[0].re_node));
1306
1.54k
      }
1307
0
#line 1308 "hex_grammar.c"
1308
0
    break;
1309
1310
58.0k
  case 7: /* token_sequence: token_sequence token_or_range  */
1311
58.0k
#line 153 "hex_grammar.y"
1312
58.0k
      {
1313
58.0k
        yr_re_node_append_child((yyvsp[-1].re_node), (yyvsp[0].re_node));
1314
58.0k
        (yyval.re_node) = (yyvsp[-1].re_node);
1315
58.0k
      }
1316
58.0k
#line 1317 "hex_grammar.c"
1317
58.0k
    break;
1318
1319
52.8k
  case 8: /* token_or_range: token  */
1320
52.8k
#line 162 "hex_grammar.y"
1321
52.8k
      {
1322
52.8k
        (yyval.re_node) = (yyvsp[0].re_node);
1323
52.8k
      }
1324
52.8k
#line 1325 "hex_grammar.c"
1325
52.8k
    break;
1326
1327
6.79k
  case 9: /* token_or_range: range  */
1328
6.79k
#line 166 "hex_grammar.y"
1329
6.79k
      {
1330
6.79k
        (yyval.re_node) = (yyvsp[0].re_node);
1331
6.79k
        (yyval.re_node)->greedy = false;
1332
6.79k
      }
1333
6.79k
#line 1334 "hex_grammar.c"
1334
6.79k
    break;
1335
1336
57.6k
  case 10: /* token: byte  */
1337
57.6k
#line 175 "hex_grammar.y"
1338
57.6k
      {
1339
57.6k
        (yyval.re_node) = (yyvsp[0].re_node);
1340
57.6k
      }
1341
57.6k
#line 1342 "hex_grammar.c"
1342
57.6k
    break;
1343
1344
120k
  case 11: /* $@1: %empty  */
1345
120k
#line 179 "hex_grammar.y"
1346
120k
      {
1347
120k
        lex_env->inside_or++;
1348
120k
      }
1349
120k
#line 1350 "hex_grammar.c"
1350
120k
    break;
1351
1352
473
  case 12: /* token: '(' $@1 alternatives ')'  */
1353
473
#line 183 "hex_grammar.y"
1354
473
      {
1355
473
        (yyval.re_node) = (yyvsp[-1].re_node);
1356
473
        lex_env->inside_or--;
1357
473
      }
1358
473
#line 1359 "hex_grammar.c"
1359
473
    break;
1360
1361
5.11k
  case 13: /* range: '[' _NUMBER_ ']'  */
1362
5.11k
#line 192 "hex_grammar.y"
1363
5.11k
      {
1364
5.11k
        if ((yyvsp[-1].integer) <= 0)
1365
3
        {
1366
3
          yyerror(yyscanner, lex_env, "invalid jump length");
1367
3
          YYABORT;
1368
3
        }
1369
1370
5.11k
        if (lex_env->inside_or && (yyvsp[-1].integer) > YR_STRING_CHAINING_THRESHOLD)
1371
0
        {
1372
0
          yyerror(yyscanner, lex_env, "jumps over "
1373
0
              STR(YR_STRING_CHAINING_THRESHOLD)
1374
0
              " not allowed inside alternation (|)");
1375
0
          YYABORT;
1376
0
        }
1377
1378
        // A jump of one is equivalent to ??
1379
5.11k
        if ((yyvsp[-1].integer) == 1)
1380
462
        {
1381
462
          (yyval.re_node) = yr_re_node_create(RE_NODE_MASKED_LITERAL);
1382
1383
462
          fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1384
1385
462
          (yyval.re_node)->value = 0x00;
1386
462
          (yyval.re_node)->mask = 0x00;
1387
462
        }
1388
4.64k
        else
1389
4.64k
        {
1390
4.64k
          (yyval.re_node) = yr_re_node_create(RE_NODE_RANGE_ANY);
1391
1392
4.64k
          fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1393
1394
4.64k
          (yyval.re_node)->start = (int) (yyvsp[-1].integer);
1395
4.64k
          (yyval.re_node)->end = (int) (yyvsp[-1].integer);
1396
4.64k
        }
1397
5.11k
      }
1398
5.11k
#line 1399 "hex_grammar.c"
1399
5.11k
    break;
1400
1401
5.11k
  case 14: /* range: '[' _NUMBER_ '-' _NUMBER_ ']'  */
1402
328
#line 228 "hex_grammar.y"
1403
328
      {
1404
328
        if (lex_env->inside_or &&
1405
260
            ((yyvsp[-3].integer) > YR_STRING_CHAINING_THRESHOLD ||
1406
259
             (yyvsp[-1].integer) > YR_STRING_CHAINING_THRESHOLD) )
1407
2
        {
1408
2
          yyerror(yyscanner, lex_env, "jumps over "
1409
2
              STR(YR_STRING_CHAINING_THRESHOLD)
1410
2
              " not allowed inside alternation (|)");
1411
1412
2
          YYABORT;
1413
2
        }
1414
1415
326
        if ((yyvsp[-3].integer) < 0 || (yyvsp[-1].integer) < 0)
1416
21
        {
1417
21
          yyerror(yyscanner, lex_env, "invalid negative jump length");
1418
21
          YYABORT;
1419
21
        }
1420
1421
305
        if ((yyvsp[-3].integer) > (yyvsp[-1].integer))
1422
14
        {
1423
14
          yyerror(yyscanner, lex_env, "invalid jump range");
1424
14
          YYABORT;
1425
14
        }
1426
1427
291
        (yyval.re_node) = yr_re_node_create(RE_NODE_RANGE_ANY);
1428
1429
291
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1430
1431
291
        (yyval.re_node)->start = (int) (yyvsp[-3].integer);
1432
291
        (yyval.re_node)->end = (int) (yyvsp[-1].integer);
1433
291
      }
1434
0
#line 1435 "hex_grammar.c"
1435
0
    break;
1436
1437
399
  case 15: /* range: '[' _NUMBER_ '-' ']'  */
1438
399
#line 260 "hex_grammar.y"
1439
399
      {
1440
399
        if (lex_env->inside_or)
1441
3
        {
1442
3
          yyerror(yyscanner, lex_env,
1443
3
              "unbounded jumps not allowed inside alternation (|)");
1444
3
          YYABORT;
1445
3
        }
1446
1447
396
        if ((yyvsp[-2].integer) < 0)
1448
6
        {
1449
6
          yyerror(yyscanner, lex_env, "invalid negative jump length");
1450
6
          YYABORT;
1451
6
        }
1452
1453
390
        (yyval.re_node) = yr_re_node_create(RE_NODE_RANGE_ANY);
1454
1455
390
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1456
1457
390
        (yyval.re_node)->start = (int) (yyvsp[-2].integer);
1458
390
        (yyval.re_node)->end = INT_MAX;
1459
390
      }
1460
0
#line 1461 "hex_grammar.c"
1461
0
    break;
1462
1463
1.04k
  case 16: /* range: '[' '-' ']'  */
1464
1.04k
#line 282 "hex_grammar.y"
1465
1.04k
      {
1466
1.04k
        if (lex_env->inside_or)
1467
41
        {
1468
41
          yyerror(yyscanner, lex_env,
1469
41
              "unbounded jumps not allowed inside alternation (|)");
1470
41
          YYABORT;
1471
41
        }
1472
1473
1.00k
        (yyval.re_node) = yr_re_node_create(RE_NODE_RANGE_ANY);
1474
1475
1.00k
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1476
1477
1.00k
        (yyval.re_node)->start = 0;
1478
1.00k
        (yyval.re_node)->end = INT_MAX;
1479
1.00k
      }
1480
0
#line 1481 "hex_grammar.c"
1481
0
    break;
1482
1483
778
  case 17: /* alternatives: tokens  */
1484
778
#line 302 "hex_grammar.y"
1485
778
      {
1486
778
          (yyval.re_node) = (yyvsp[0].re_node);
1487
778
      }
1488
778
#line 1489 "hex_grammar.c"
1489
778
    break;
1490
1491
1.43k
  case 18: /* alternatives: alternatives '|' tokens  */
1492
1.43k
#line 306 "hex_grammar.y"
1493
1.43k
      {
1494
1.43k
        mark_as_not_fast_regexp();
1495
1496
1.43k
        (yyval.re_node) = yr_re_node_create(RE_NODE_ALT);
1497
1498
1.43k
        destroy_node_if((yyval.re_node) == NULL, (yyvsp[-2].re_node));
1499
1.43k
        destroy_node_if((yyval.re_node) == NULL, (yyvsp[0].re_node));
1500
1501
1.43k
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1502
1503
1.43k
        yr_re_node_append_child((yyval.re_node), (yyvsp[-2].re_node));
1504
1.43k
        yr_re_node_append_child((yyval.re_node), (yyvsp[0].re_node));
1505
1.43k
      }
1506
0
#line 1507 "hex_grammar.c"
1507
0
    break;
1508
1509
52.1k
  case 19: /* byte: _BYTE_  */
1510
52.1k
#line 323 "hex_grammar.y"
1511
52.1k
      {
1512
52.1k
        (yyval.re_node) = yr_re_node_create(RE_NODE_LITERAL);
1513
1514
52.1k
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1515
1516
52.1k
        (yyval.re_node)->value = (int) (yyvsp[0].integer);
1517
52.1k
        (yyval.re_node)->mask = 0xFF;
1518
52.1k
      }
1519
0
#line 1520 "hex_grammar.c"
1520
0
    break;
1521
1522
294
  case 20: /* byte: _NOT_BYTE_  */
1523
294
#line 332 "hex_grammar.y"
1524
294
      {
1525
294
        (yyval.re_node) = yr_re_node_create(RE_NODE_NOT_LITERAL);
1526
1527
294
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1528
1529
294
        (yyval.re_node)->value = (int) (yyvsp[0].integer);
1530
294
        (yyval.re_node)->mask = 0xFF;
1531
294
      }
1532
0
#line 1533 "hex_grammar.c"
1533
0
    break;
1534
1535
4.53k
  case 21: /* byte: _MASKED_BYTE_  */
1536
4.53k
#line 341 "hex_grammar.y"
1537
4.53k
      {
1538
4.53k
        uint8_t mask = (uint8_t) ((yyvsp[0].integer) >> 8);
1539
1540
4.53k
        if (mask == 0x00)
1541
732
        {
1542
732
          (yyval.re_node) = yr_re_node_create(RE_NODE_ANY);
1543
1544
732
          fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1545
1546
732
          (yyval.re_node)->value = 0x00;
1547
732
          (yyval.re_node)->mask = 0x00;
1548
732
        }
1549
3.80k
        else
1550
3.80k
        {
1551
3.80k
          (yyval.re_node) = yr_re_node_create(RE_NODE_MASKED_LITERAL);
1552
1553
3.80k
          fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1554
1555
3.80k
          (yyval.re_node)->value = (yyvsp[0].integer) & 0xFF;
1556
3.80k
          (yyval.re_node)->mask = mask;
1557
3.80k
        }
1558
4.53k
      }
1559
4.53k
#line 1560 "hex_grammar.c"
1560
4.53k
    break;
1561
1562
4.53k
  case 22: /* byte: _MASKED_NOT_BYTE_  */
1563
593
#line 364 "hex_grammar.y"
1564
593
      {
1565
593
        uint8_t mask = (uint8_t) ((yyvsp[0].integer) >> 8);
1566
1567
593
        (yyval.re_node) = yr_re_node_create(RE_NODE_MASKED_NOT_LITERAL);
1568
1569
593
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1570
1571
593
        (yyval.re_node)->value = (yyvsp[0].integer) & 0xFF;
1572
593
        (yyval.re_node)->mask = mask;
1573
593
      }
1574
0
#line 1575 "hex_grammar.c"
1575
0
    break;
1576
1577
1578
0
#line 1579 "hex_grammar.c"
1579
1580
0
      default: break;
1581
367k
    }
1582
  /* User semantic actions sometimes alter yychar, and that requires
1583
     that yytoken be updated with the new translation.  We take the
1584
     approach of translating immediately before every use of yytoken.
1585
     One alternative is translating here after every semantic action,
1586
     but that translation would be missed if the semantic action invokes
1587
     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1588
     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
1589
     incorrect destructor might then be invoked immediately.  In the
1590
     case of YYERROR or YYBACKUP, subsequent parser actions might lead
1591
     to an incorrect destructor call or verbose syntax error message
1592
     before the lookahead is translated.  */
1593
367k
  YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1594
1595
367k
  YYPOPSTACK (yylen);
1596
367k
  yylen = 0;
1597
1598
367k
  *++yyvsp = yyval;
1599
1600
  /* Now 'shift' the result of the reduction.  Determine what state
1601
     that goes to, based on the state we popped back to and the rule
1602
     number reduced by.  */
1603
367k
  {
1604
367k
    const int yylhs = yyr1[yyn] - YYNTOKENS;
1605
367k
    const int yyi = yypgoto[yylhs] + *yyssp;
1606
367k
    yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1607
367k
               ? yytable[yyi]
1608
367k
               : yydefgoto[yylhs]);
1609
367k
  }
1610
1611
367k
  goto yynewstate;
1612
1613
1614
/*--------------------------------------.
1615
| yyerrlab -- here on detecting error.  |
1616
`--------------------------------------*/
1617
270
yyerrlab:
1618
  /* Make sure we have latest lookahead translation.  See comments at
1619
     user semantic actions for why this is necessary.  */
1620
270
  yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1621
  /* If not already recovering from an error, report this error.  */
1622
270
  if (!yyerrstatus)
1623
270
    {
1624
270
      ++yynerrs;
1625
270
      yyerror (yyscanner, lex_env, YY_("syntax error"));
1626
270
    }
1627
1628
270
  if (yyerrstatus == 3)
1629
0
    {
1630
      /* If just tried and failed to reuse lookahead token after an
1631
         error, discard it.  */
1632
1633
0
      if (yychar <= YYEOF)
1634
0
        {
1635
          /* Return failure if at end of input.  */
1636
0
          if (yychar == YYEOF)
1637
0
            YYABORT;
1638
0
        }
1639
0
      else
1640
0
        {
1641
0
          yydestruct ("Error: discarding",
1642
0
                      yytoken, &yylval, yyscanner, lex_env);
1643
0
          yychar = YYEMPTY;
1644
0
        }
1645
0
    }
1646
1647
  /* Else will try to reuse lookahead token after shifting the error
1648
     token.  */
1649
270
  goto yyerrlab1;
1650
1651
1652
/*---------------------------------------------------.
1653
| yyerrorlab -- error raised explicitly by YYERROR.  |
1654
`---------------------------------------------------*/
1655
270
yyerrorlab:
1656
  /* Pacify compilers when the user code never invokes YYERROR and the
1657
     label yyerrorlab therefore never appears in user code.  */
1658
0
  if (0)
1659
0
    YYERROR;
1660
0
  ++yynerrs;
1661
1662
  /* Do not reclaim the symbols of the rule whose action triggered
1663
     this YYERROR.  */
1664
0
  YYPOPSTACK (yylen);
1665
0
  yylen = 0;
1666
0
  YY_STACK_PRINT (yyss, yyssp);
1667
0
  yystate = *yyssp;
1668
0
  goto yyerrlab1;
1669
1670
1671
/*-------------------------------------------------------------.
1672
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
1673
`-------------------------------------------------------------*/
1674
270
yyerrlab1:
1675
270
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
1676
1677
  /* Pop stack until we find a state that shifts the error token.  */
1678
270
  for (;;)
1679
85.1k
    {
1680
85.1k
      yyn = yypact[yystate];
1681
85.1k
      if (!yypact_value_is_default (yyn))
1682
43.4k
        {
1683
43.4k
          yyn += YYSYMBOL_YYerror;
1684
43.4k
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1685
0
            {
1686
0
              yyn = yytable[yyn];
1687
0
              if (0 < yyn)
1688
0
                break;
1689
0
            }
1690
43.4k
        }
1691
1692
      /* Pop the current state because it cannot handle the error token.  */
1693
85.1k
      if (yyssp == yyss)
1694
270
        YYABORT;
1695
1696
1697
84.8k
      yydestruct ("Error: popping",
1698
84.8k
                  YY_ACCESSING_SYMBOL (yystate), yyvsp, yyscanner, lex_env);
1699
84.8k
      YYPOPSTACK (1);
1700
84.8k
      yystate = *yyssp;
1701
84.8k
      YY_STACK_PRINT (yyss, yyssp);
1702
84.8k
    }
1703
1704
0
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1705
0
  *++yyvsp = yylval;
1706
0
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1707
1708
1709
  /* Shift the error token.  */
1710
0
  YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1711
1712
0
  yystate = yyn;
1713
0
  goto yynewstate;
1714
1715
1716
/*-------------------------------------.
1717
| yyacceptlab -- YYACCEPT comes here.  |
1718
`-------------------------------------*/
1719
763
yyacceptlab:
1720
763
  yyresult = 0;
1721
763
  goto yyreturnlab;
1722
1723
1724
/*-----------------------------------.
1725
| yyabortlab -- YYABORT comes here.  |
1726
`-----------------------------------*/
1727
360
yyabortlab:
1728
360
  yyresult = 1;
1729
360
  goto yyreturnlab;
1730
1731
1732
/*-----------------------------------------------------------.
1733
| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here.  |
1734
`-----------------------------------------------------------*/
1735
10
yyexhaustedlab:
1736
10
  yyerror (yyscanner, lex_env, YY_("memory exhausted"));
1737
10
  yyresult = 2;
1738
10
  goto yyreturnlab;
1739
1740
1741
/*----------------------------------------------------------.
1742
| yyreturnlab -- parsing is finished, clean up and return.  |
1743
`----------------------------------------------------------*/
1744
1.13k
yyreturnlab:
1745
1.13k
  if (yychar != YYEMPTY)
1746
270
    {
1747
      /* Make sure we have latest lookahead translation.  See comments at
1748
         user semantic actions for why this is necessary.  */
1749
270
      yytoken = YYTRANSLATE (yychar);
1750
270
      yydestruct ("Cleanup: discarding lookahead",
1751
270
                  yytoken, &yylval, yyscanner, lex_env);
1752
270
    }
1753
  /* Do not reclaim the symbols of the rule whose action triggered
1754
     this YYABORT or YYACCEPT.  */
1755
1.13k
  YYPOPSTACK (yylen);
1756
1.13k
  YY_STACK_PRINT (yyss, yyssp);
1757
158k
  while (yyssp != yyss)
1758
157k
    {
1759
157k
      yydestruct ("Cleanup: popping",
1760
157k
                  YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yyscanner, lex_env);
1761
157k
      YYPOPSTACK (1);
1762
157k
    }
1763
1.13k
#ifndef yyoverflow
1764
1.13k
  if (yyss != yyssa)
1765
109
    YYSTACK_FREE (yyss);
1766
1.13k
#endif
1767
1768
1.13k
  return yyresult;
1769
270
}
1770
1771
#line 376 "hex_grammar.y"
1772