Coverage Report

Created: 2023-03-01 06:20

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