Coverage Report

Created: 2026-10-19 06:44

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/yara/libyara/re_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         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
210
#define YYFREE yr_free
91
92
#define mark_as_not_fast_regexp() \
93
37.4k
    ((RE_AST*) yyget_extra(yyscanner))->flags &= ~RE_FLAGS_FAST_REGEXP
94
95
#define fail_if(x, error) \
96
1.79M
    if (x) \
97
1.79M
    { \
98
0
      lex_env->last_error = error; \
99
0
      YYABORT; \
100
0
    } \
101
102
#define destroy_node_if(x, node) \
103
193k
    if (x) \
104
193k
    { \
105
5.11k
      yr_re_node_destroy(node); \
106
5.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
10.8M
#   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
23.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.26k
#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
558
#  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
253k
# 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
46.0k
# 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.12M
#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
210
#  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
420
# 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
420
    do                                                                  \
539
420
      {                                                                 \
540
420
        YYPTRDIFF_T yynewbytes;                                         \
541
420
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
542
420
        Stack = &yyptr->Stack_alloc;                                    \
543
420
        yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
544
420
        yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
545
420
      }                                                                 \
546
420
    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
420
      __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.12M
#define YYFINAL  22
572
/* YYLAST -- Last index in YYTABLE.  */
573
14.1M
#define YYLAST   45
574
575
/* YYNTOKENS -- Number of terminals.  */
576
5.23M
#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.60M
#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.61M
  (0 <= (YYX) && (YYX) <= YYMAXUTOK                     \
592
3.61M
   ? YY_CAST (yysymbol_kind_t, yytranslate[YYX])        \
593
3.61M
   : 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
79.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.13M
#define YYPACT_NINF (-12)
667
668
#define yypact_value_is_default(Yyn) \
669
7.13M
  ((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
23.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.10M
# 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
23.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
420
# 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
84.5k
{
952
84.5k
  YY_USE (yyvaluep);
953
84.5k
  YY_USE (yyscanner);
954
84.5k
  YY_USE (lex_env);
955
84.5k
  if (!yymsg)
956
0
    yymsg = "Deleting";
957
84.5k
  YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
958
959
84.5k
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
960
84.5k
  switch (yykind)
961
84.5k
    {
962
301
    case YYSYMBOL__CLASS_: /* _CLASS_  */
963
301
#line 98 "re_grammar.y"
964
301
            { yr_free(((*yyvaluep).re_class)); ((*yyvaluep).re_class) = NULL; }
965
301
#line 966 "re_grammar.c"
966
301
        break;
967
968
476
    case YYSYMBOL_alternative: /* alternative  */
969
476
#line 99 "re_grammar.y"
970
476
            { yr_re_node_destroy(((*yyvaluep).re_node)); ((*yyvaluep).re_node) = NULL; }
971
476
#line 972 "re_grammar.c"
972
476
        break;
973
974
1.22k
    case YYSYMBOL_concatenation: /* concatenation  */
975
1.22k
#line 100 "re_grammar.y"
976
1.22k
            { yr_re_node_destroy(((*yyvaluep).re_node)); ((*yyvaluep).re_node) = NULL; }
977
1.22k
#line 978 "re_grammar.c"
978
1.22k
        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
82.5k
      default:
993
82.5k
        break;
994
84.5k
    }
995
84.5k
  YY_IGNORE_MAYBE_UNINITIALIZED_END
996
84.5k
}
997
998
999
1000
1001
1002
1003
/*----------.
1004
| yyparse.  |
1005
`----------*/
1006
1007
int
1008
yyparse (void *yyscanner, RE_LEX_ENVIRONMENT *lex_env)
1009
23.0k
{
1010
/* Lookahead token kind.  */
1011
23.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
23.0k
YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1018
23.0k
YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1019
1020
    /* Number of syntax errors so far.  */
1021
23.0k
    int yynerrs = 0;
1022
1023
23.0k
    yy_state_fast_t yystate = 0;
1024
    /* Number of tokens to shift before error messages enabled.  */
1025
23.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
23.0k
    YYPTRDIFF_T yystacksize = YYINITDEPTH;
1032
1033
    /* The state stack: array, bottom, top.  */
1034
23.0k
    yy_state_t yyssa[YYINITDEPTH];
1035
23.0k
    yy_state_t *yyss = yyssa;
1036
23.0k
    yy_state_t *yyssp = yyss;
1037
1038
    /* The semantic value stack: array, bottom, top.  */
1039
23.0k
    YYSTYPE yyvsa[YYINITDEPTH];
1040
23.0k
    YYSTYPE *yyvs = yyvsa;
1041
23.0k
    YYSTYPE *yyvsp = yyvs;
1042
1043
23.0k
  int yyn;
1044
  /* The return value of yyparse.  */
1045
23.0k
  int yyresult;
1046
  /* Lookahead symbol kind.  */
1047
23.0k
  yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1048
  /* The variables used to return semantic value and location from the
1049
     action routines.  */
1050
23.0k
  YYSTYPE yyval;
1051
1052
1053
1054
5.33M
#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
23.0k
  int yylen = 0;
1059
1060
23.0k
  YYDPRINTF ((stderr, "Starting parse\n"));
1061
1062
23.0k
  yychar = YYEMPTY; /* Cause a token to be read.  */
1063
1064
23.0k
  goto yysetstate;
1065
1066
1067
/*------------------------------------------------------------.
1068
| yynewstate -- push a new state, which is found in yystate.  |
1069
`------------------------------------------------------------*/
1070
7.10M
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.10M
  yyssp++;
1074
1075
1076
/*--------------------------------------------------------------------.
1077
| yysetstate -- set current state (the top of the stack) to yystate.  |
1078
`--------------------------------------------------------------------*/
1079
7.12M
yysetstate:
1080
7.12M
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1081
7.12M
  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1082
7.12M
  YY_IGNORE_USELESS_CAST_BEGIN
1083
7.12M
  *yyssp = YY_CAST (yy_state_t, yystate);
1084
7.12M
  YY_IGNORE_USELESS_CAST_END
1085
7.12M
  YY_STACK_PRINT (yyss, yyssp);
1086
1087
7.12M
  if (yyss + yystacksize - 1 <= yyssp)
1088
#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1089
    YYNOMEM;
1090
#else
1091
210
    {
1092
      /* Get the current used size of the three stacks, in elements.  */
1093
210
      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
210
      if (YYMAXDEPTH <= yystacksize)
1117
0
        YYNOMEM;
1118
210
      yystacksize *= 2;
1119
210
      if (YYMAXDEPTH < yystacksize)
1120
0
        yystacksize = YYMAXDEPTH;
1121
1122
210
      {
1123
210
        yy_state_t *yyss1 = yyss;
1124
210
        union yyalloc *yyptr =
1125
210
          YY_CAST (union yyalloc *,
1126
210
                   YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1127
210
        if (! yyptr)
1128
0
          YYNOMEM;
1129
210
        YYSTACK_RELOCATE (yyss_alloc, yyss);
1130
210
        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1131
210
#  undef YYSTACK_RELOCATE
1132
210
        if (yyss1 != yyssa)
1133
120
          YYSTACK_FREE (yyss1);
1134
210
      }
1135
0
# endif
1136
1137
0
      yyssp = yyss + yysize - 1;
1138
210
      yyvsp = yyvs + yysize - 1;
1139
1140
210
      YY_IGNORE_USELESS_CAST_BEGIN
1141
210
      YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1142
210
                  YY_CAST (long, yystacksize)));
1143
210
      YY_IGNORE_USELESS_CAST_END
1144
1145
210
      if (yyss + yystacksize - 1 <= yyssp)
1146
0
        YYABORT;
1147
210
    }
1148
7.12M
#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1149
1150
1151
7.12M
  if (yystate == YYFINAL)
1152
23.0k
    YYACCEPT;
1153
1154
7.10M
  goto yybackup;
1155
1156
1157
/*-----------.
1158
| yybackup.  |
1159
`-----------*/
1160
7.10M
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.10M
  yyn = yypact[yystate];
1166
7.10M
  if (yypact_value_is_default (yyn))
1167
3.40M
    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.69M
  if (yychar == YYEMPTY)
1173
1.86M
    {
1174
1.86M
      YYDPRINTF ((stderr, "Reading a token\n"));
1175
1.86M
      yychar = yylex (&yylval, yyscanner, lex_env);
1176
1.86M
    }
1177
1178
3.69M
  if (yychar <= YYEOF)
1179
90.0k
    {
1180
90.0k
      yychar = YYEOF;
1181
90.0k
      yytoken = YYSYMBOL_YYEOF;
1182
90.0k
      YYDPRINTF ((stderr, "Now at end of input.\n"));
1183
90.0k
    }
1184
3.60M
  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.60M
  else
1195
3.60M
    {
1196
3.60M
      yytoken = YYTRANSLATE (yychar);
1197
3.60M
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1198
3.60M
    }
1199
1200
  /* If the proper action on seeing token YYTOKEN is to reduce or to
1201
     detect an error, take that action.  */
1202
3.69M
  yyn += yytoken;
1203
3.69M
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1204
1.83M
    goto yydefault;
1205
1.85M
  yyn = yytable[yyn];
1206
1.85M
  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.85M
  if (yyerrstatus)
1217
558
    yyerrstatus--;
1218
1219
  /* Shift the lookahead token.  */
1220
1.85M
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1221
1.85M
  yystate = yyn;
1222
1.85M
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1223
1.85M
  *++yyvsp = yylval;
1224
1.85M
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1225
1226
  /* Discard the shifted token.  */
1227
1.85M
  yychar = YYEMPTY;
1228
1.85M
  goto yynewstate;
1229
1230
1231
/*-----------------------------------------------------------.
1232
| yydefault -- do the default action for the current state.  |
1233
`-----------------------------------------------------------*/
1234
5.24M
yydefault:
1235
5.24M
  yyn = yydefact[yystate];
1236
5.24M
  if (yyn == 0)
1237
5.22k
    goto yyerrlab;
1238
5.23M
  goto yyreduce;
1239
1240
1241
/*-----------------------------.
1242
| yyreduce -- do a reduction.  |
1243
`-----------------------------*/
1244
5.23M
yyreduce:
1245
  /* yyn is the number of a rule to reduce with.  */
1246
5.23M
  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.23M
  yyval = yyvsp[1-yylen];
1257
1258
1259
5.23M
  YY_REDUCE_PRINT (yyn);
1260
5.23M
  switch (yyn)
1261
5.23M
    {
1262
22.6k
  case 2: /* re: alternative  */
1263
22.6k
#line 107 "re_grammar.y"
1264
22.6k
      {
1265
22.6k
        RE_AST* re_ast = yyget_extra(yyscanner);
1266
22.6k
        re_ast->root_node = (yyvsp[0].re_node);
1267
22.6k
      }
1268
22.6k
#line 1269 "re_grammar.c"
1269
22.6k
    break;
1270
1271
85.9k
  case 4: /* alternative: concatenation  */
1272
85.9k
#line 116 "re_grammar.y"
1273
85.9k
      {
1274
85.9k
        (yyval.re_node) = (yyvsp[0].re_node);
1275
85.9k
      }
1276
85.9k
#line 1277 "re_grammar.c"
1277
85.9k
    break;
1278
1279
11.5k
  case 5: /* alternative: alternative '|' concatenation  */
1280
11.5k
#line 120 "re_grammar.y"
1281
11.5k
      {
1282
11.5k
        mark_as_not_fast_regexp();
1283
1284
11.5k
        (yyval.re_node) = yr_re_node_create(RE_NODE_ALT);
1285
1286
11.5k
        destroy_node_if((yyval.re_node) == NULL, (yyvsp[-2].re_node));
1287
11.5k
        destroy_node_if((yyval.re_node) == NULL, (yyvsp[0].re_node));
1288
1289
11.5k
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1290
1291
11.5k
        yr_re_node_append_child((yyval.re_node), (yyvsp[-2].re_node));
1292
11.5k
        yr_re_node_append_child((yyval.re_node), (yyvsp[0].re_node));
1293
11.5k
      }
1294
0
#line 1295 "re_grammar.c"
1295
0
    break;
1296
1297
20.2k
  case 6: /* alternative: alternative '|'  */
1298
20.2k
#line 134 "re_grammar.y"
1299
20.2k
      {
1300
20.2k
        RE_NODE* node;
1301
1302
20.2k
        mark_as_not_fast_regexp();
1303
1304
20.2k
        node = yr_re_node_create(RE_NODE_EMPTY);
1305
1306
20.2k
        destroy_node_if(node == NULL, (yyvsp[-1].re_node));
1307
20.2k
        fail_if(node == NULL, ERROR_INSUFFICIENT_MEMORY);
1308
1309
20.2k
        (yyval.re_node) = yr_re_node_create(RE_NODE_ALT);
1310
1311
20.2k
        destroy_node_if((yyval.re_node) == NULL, node);
1312
20.2k
        destroy_node_if((yyval.re_node) == NULL, (yyvsp[-1].re_node));
1313
1314
20.2k
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1315
1316
20.2k
        yr_re_node_append_child((yyval.re_node), (yyvsp[-1].re_node));
1317
20.2k
        yr_re_node_append_child((yyval.re_node), node);
1318
20.2k
      }
1319
0
#line 1320 "re_grammar.c"
1320
0
    break;
1321
1322
98.6k
  case 7: /* concatenation: repeat  */
1323
98.6k
#line 158 "re_grammar.y"
1324
98.6k
      {
1325
98.6k
        (yyval.re_node) = yr_re_node_create(RE_NODE_CONCAT);
1326
1327
98.6k
        destroy_node_if((yyval.re_node) == NULL, (yyvsp[0].re_node));
1328
98.6k
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1329
1330
98.6k
        yr_re_node_append_child((yyval.re_node), (yyvsp[0].re_node));
1331
98.6k
      }
1332
0
#line 1333 "re_grammar.c"
1333
0
    break;
1334
1335
1.59M
  case 8: /* concatenation: concatenation repeat  */
1336
1.59M
#line 167 "re_grammar.y"
1337
1.59M
      {
1338
1.59M
        yr_re_node_append_child((yyvsp[-1].re_node), (yyvsp[0].re_node));
1339
1.59M
        (yyval.re_node) = (yyvsp[-1].re_node);
1340
1.59M
      }
1341
1.59M
#line 1342 "re_grammar.c"
1342
1.59M
    break;
1343
1344
719
  case 9: /* repeat: single '*'  */
1345
719
#line 175 "re_grammar.y"
1346
719
      {
1347
719
        RE_AST* re_ast;
1348
1349
719
        mark_as_not_fast_regexp();
1350
1351
719
        re_ast = yyget_extra(yyscanner);
1352
719
        re_ast->flags |= RE_FLAGS_GREEDY;
1353
1354
719
        (yyval.re_node) = yr_re_node_create(RE_NODE_STAR);
1355
1356
719
        destroy_node_if((yyval.re_node) == NULL, (yyvsp[-1].re_node));
1357
719
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1358
1359
719
        yr_re_node_append_child((yyval.re_node), (yyvsp[-1].re_node));
1360
719
      }
1361
0
#line 1362 "re_grammar.c"
1362
0
    break;
1363
1364
162
  case 10: /* repeat: single '*' '?'  */
1365
162
#line 191 "re_grammar.y"
1366
162
      {
1367
162
        RE_AST* re_ast;
1368
1369
162
        mark_as_not_fast_regexp();
1370
1371
162
        re_ast = yyget_extra(yyscanner);
1372
162
        re_ast->flags |= RE_FLAGS_UNGREEDY;
1373
1374
162
        (yyval.re_node) = yr_re_node_create(RE_NODE_STAR);
1375
1376
162
        destroy_node_if((yyval.re_node) == NULL, (yyvsp[-2].re_node));
1377
162
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1378
1379
162
        yr_re_node_append_child((yyval.re_node), (yyvsp[-2].re_node));
1380
1381
162
        (yyval.re_node)->greedy = false;
1382
162
      }
1383
0
#line 1384 "re_grammar.c"
1384
0
    break;
1385
1386
1.42k
  case 11: /* repeat: single '+'  */
1387
1.42k
#line 209 "re_grammar.y"
1388
1.42k
      {
1389
1.42k
        RE_AST* re_ast;
1390
1391
1.42k
        mark_as_not_fast_regexp();
1392
1393
1.42k
        re_ast = yyget_extra(yyscanner);
1394
1.42k
        re_ast->flags |= RE_FLAGS_GREEDY;
1395
1396
1.42k
        (yyval.re_node) = yr_re_node_create(RE_NODE_PLUS);
1397
1398
1.42k
        destroy_node_if((yyval.re_node) == NULL, (yyvsp[-1].re_node));
1399
1.42k
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1400
1401
1.42k
        yr_re_node_append_child((yyval.re_node), (yyvsp[-1].re_node));
1402
1.42k
      }
1403
0
#line 1404 "re_grammar.c"
1404
0
    break;
1405
1406
275
  case 12: /* repeat: single '+' '?'  */
1407
275
#line 225 "re_grammar.y"
1408
275
      {
1409
275
        RE_AST* re_ast;
1410
1411
275
        mark_as_not_fast_regexp();
1412
1413
275
        re_ast = yyget_extra(yyscanner);
1414
275
        re_ast->flags |= RE_FLAGS_UNGREEDY;
1415
1416
275
        (yyval.re_node) = yr_re_node_create(RE_NODE_PLUS);
1417
1418
275
        destroy_node_if((yyval.re_node) == NULL, (yyvsp[-2].re_node));
1419
275
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1420
1421
275
        yr_re_node_append_child((yyval.re_node), (yyvsp[-2].re_node));
1422
275
        (yyval.re_node)->greedy = false;
1423
275
      }
1424
0
#line 1425 "re_grammar.c"
1425
0
    break;
1426
1427
1.06k
  case 13: /* repeat: single '?'  */
1428
1.06k
#line 242 "re_grammar.y"
1429
1.06k
      {
1430
1.06k
        RE_AST* re_ast = yyget_extra(yyscanner);
1431
1.06k
        re_ast->flags |= RE_FLAGS_GREEDY;
1432
1433
1.06k
        if ((yyvsp[-1].re_node)->type == RE_NODE_ANY)
1434
218
        {
1435
218
          (yyval.re_node) = yr_re_node_create(RE_NODE_RANGE_ANY);
1436
218
          destroy_node_if(true, (yyvsp[-1].re_node));
1437
218
          fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1438
218
        }
1439
851
        else
1440
851
        {
1441
851
          mark_as_not_fast_regexp();
1442
851
          (yyval.re_node) = yr_re_node_create(RE_NODE_RANGE);
1443
851
          destroy_node_if((yyval.re_node) == NULL, (yyvsp[-1].re_node));
1444
851
          fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1445
851
          yr_re_node_append_child((yyval.re_node), (yyvsp[-1].re_node));
1446
851
        }
1447
1448
1.06k
        (yyval.re_node)->start = 0;
1449
1.06k
        (yyval.re_node)->end = 1;
1450
1.06k
      }
1451
0
#line 1452 "re_grammar.c"
1452
0
    break;
1453
1454
1.12k
  case 14: /* repeat: single '?' '?'  */
1455
1.12k
#line 265 "re_grammar.y"
1456
1.12k
      {
1457
1.12k
        RE_AST* re_ast = yyget_extra(yyscanner);
1458
1.12k
        re_ast->flags |= RE_FLAGS_UNGREEDY;
1459
1460
1.12k
        if ((yyvsp[-2].re_node)->type == RE_NODE_ANY)
1461
938
        {
1462
938
          (yyval.re_node) = yr_re_node_create(RE_NODE_RANGE_ANY);
1463
938
          destroy_node_if(true, (yyvsp[-2].re_node));
1464
938
          fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1465
938
        }
1466
182
        else
1467
182
        {
1468
182
          mark_as_not_fast_regexp();
1469
182
          (yyval.re_node) = yr_re_node_create(RE_NODE_RANGE);
1470
182
          destroy_node_if((yyval.re_node) == NULL, (yyvsp[-2].re_node));
1471
182
          fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1472
182
          yr_re_node_append_child((yyval.re_node), (yyvsp[-2].re_node));
1473
182
        }
1474
1475
1.12k
        (yyval.re_node)->start = 0;
1476
1.12k
        (yyval.re_node)->end = 1;
1477
1.12k
        (yyval.re_node)->greedy = false;
1478
1.12k
      }
1479
0
#line 1480 "re_grammar.c"
1480
0
    break;
1481
1482
1.97k
  case 15: /* repeat: single _RANGE_  */
1483
1.97k
#line 289 "re_grammar.y"
1484
1.97k
      {
1485
1.97k
        RE_AST* re_ast = yyget_extra(yyscanner);
1486
1.97k
        re_ast->flags |= RE_FLAGS_GREEDY;
1487
1488
1.97k
        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.68k
        else
1495
1.68k
        {
1496
1.68k
          mark_as_not_fast_regexp();
1497
1.68k
          (yyval.re_node) = yr_re_node_create(RE_NODE_RANGE);
1498
1.68k
          destroy_node_if((yyval.re_node) == NULL, (yyvsp[-1].re_node));
1499
1.68k
          fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1500
1.68k
          yr_re_node_append_child((yyval.re_node), (yyvsp[-1].re_node));
1501
1.68k
        }
1502
1503
1.97k
        (yyval.re_node)->start = (yyvsp[0].range) & 0xFFFF;;
1504
1.97k
        (yyval.re_node)->end = (yyvsp[0].range) >> 16;;
1505
1.97k
      }
1506
0
#line 1507 "re_grammar.c"
1507
0
    break;
1508
1509
4.08k
  case 16: /* repeat: single _RANGE_ '?'  */
1510
4.08k
#line 312 "re_grammar.y"
1511
4.08k
      {
1512
4.08k
        RE_AST* re_ast = yyget_extra(yyscanner);
1513
4.08k
        re_ast->flags |= RE_FLAGS_UNGREEDY;
1514
1515
4.08k
        if ((yyvsp[-2].re_node)->type == RE_NODE_ANY)
1516
3.66k
        {
1517
3.66k
          (yyval.re_node) = yr_re_node_create(RE_NODE_RANGE_ANY);
1518
3.66k
          destroy_node_if(true, (yyvsp[-2].re_node));
1519
3.66k
          fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1520
3.66k
        }
1521
426
        else
1522
426
        {
1523
426
          mark_as_not_fast_regexp();
1524
426
          (yyval.re_node) = yr_re_node_create(RE_NODE_RANGE);
1525
426
          destroy_node_if((yyval.re_node) == NULL, (yyvsp[-2].re_node));
1526
426
          fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1527
426
          yr_re_node_append_child((yyval.re_node), (yyvsp[-2].re_node));
1528
426
        }
1529
1530
4.08k
        (yyval.re_node)->start = (yyvsp[-1].range) & 0xFFFF;;
1531
4.08k
        (yyval.re_node)->end = (yyvsp[-1].range) >> 16;;
1532
4.08k
        (yyval.re_node)->greedy = false;
1533
4.08k
      }
1534
0
#line 1535 "re_grammar.c"
1535
0
    break;
1536
1537
1.68M
  case 17: /* repeat: single  */
1538
1.68M
#line 336 "re_grammar.y"
1539
1.68M
      {
1540
1.68M
        (yyval.re_node) = (yyvsp[0].re_node);
1541
1.68M
      }
1542
1.68M
#line 1543 "re_grammar.c"
1543
1.68M
    break;
1544
1545
128
  case 18: /* repeat: _WORD_BOUNDARY_  */
1546
128
#line 340 "re_grammar.y"
1547
128
      {
1548
128
        (yyval.re_node) = yr_re_node_create(RE_NODE_WORD_BOUNDARY);
1549
1550
128
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1551
128
      }
1552
0
#line 1553 "re_grammar.c"
1553
0
    break;
1554
1555
128
  case 19: /* repeat: _NON_WORD_BOUNDARY_  */
1556
128
#line 346 "re_grammar.y"
1557
128
      {
1558
128
        (yyval.re_node) = yr_re_node_create(RE_NODE_NON_WORD_BOUNDARY);
1559
1560
128
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1561
128
      }
1562
0
#line 1563 "re_grammar.c"
1563
0
    break;
1564
1565
249
  case 20: /* repeat: '^'  */
1566
249
#line 352 "re_grammar.y"
1567
249
      {
1568
249
        (yyval.re_node) = yr_re_node_create(RE_NODE_ANCHOR_START);
1569
1570
249
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1571
249
      }
1572
0
#line 1573 "re_grammar.c"
1573
0
    break;
1574
1575
1.56k
  case 21: /* repeat: '$'  */
1576
1.56k
#line 358 "re_grammar.y"
1577
1.56k
      {
1578
1.56k
        (yyval.re_node) = yr_re_node_create(RE_NODE_ANCHOR_END);
1579
1580
1.56k
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1581
1.56k
      }
1582
0
#line 1583 "re_grammar.c"
1583
0
    break;
1584
1585
62.7k
  case 22: /* single: '(' alternative ')'  */
1586
62.7k
#line 367 "re_grammar.y"
1587
62.7k
      {
1588
62.7k
        (yyval.re_node) = (yyvsp[-1].re_node);
1589
62.7k
      }
1590
62.7k
#line 1591 "re_grammar.c"
1591
62.7k
    break;
1592
1593
12.1k
  case 23: /* single: '.'  */
1594
12.1k
#line 371 "re_grammar.y"
1595
12.1k
      {
1596
12.1k
        (yyval.re_node) = yr_re_node_create(RE_NODE_ANY);
1597
1598
12.1k
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1599
1600
12.1k
        (yyval.re_node)->value = 0x00;
1601
12.1k
        (yyval.re_node)->mask = 0x00;
1602
12.1k
      }
1603
0
#line 1604 "re_grammar.c"
1604
0
    break;
1605
1606
1.61M
  case 24: /* single: _CHAR_  */
1607
1.61M
#line 380 "re_grammar.y"
1608
1.61M
      {
1609
1.61M
        (yyval.re_node) = yr_re_node_create(RE_NODE_LITERAL);
1610
1611
1.61M
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1612
1613
1.61M
        (yyval.re_node)->value = (yyvsp[0].integer);
1614
1.61M
        (yyval.re_node)->mask = 0xFF;
1615
1.61M
      }
1616
0
#line 1617 "re_grammar.c"
1617
0
    break;
1618
1619
141
  case 25: /* single: _WORD_CHAR_  */
1620
141
#line 389 "re_grammar.y"
1621
141
      {
1622
141
        (yyval.re_node) = yr_re_node_create(RE_NODE_WORD_CHAR);
1623
1624
141
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1625
141
      }
1626
0
#line 1627 "re_grammar.c"
1627
0
    break;
1628
1629
132
  case 26: /* single: _NON_WORD_CHAR_  */
1630
132
#line 395 "re_grammar.y"
1631
132
      {
1632
132
        (yyval.re_node) = yr_re_node_create(RE_NODE_NON_WORD_CHAR);
1633
1634
132
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1635
132
      }
1636
0
#line 1637 "re_grammar.c"
1637
0
    break;
1638
1639
326
  case 27: /* single: _SPACE_  */
1640
326
#line 401 "re_grammar.y"
1641
326
      {
1642
326
        (yyval.re_node) = yr_re_node_create(RE_NODE_SPACE);
1643
1644
326
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1645
326
      }
1646
0
#line 1647 "re_grammar.c"
1647
0
    break;
1648
1649
142
  case 28: /* single: _NON_SPACE_  */
1650
142
#line 407 "re_grammar.y"
1651
142
      {
1652
142
         (yyval.re_node) = yr_re_node_create(RE_NODE_NON_SPACE);
1653
1654
142
         fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1655
142
      }
1656
0
#line 1657 "re_grammar.c"
1657
0
    break;
1658
1659
242
  case 29: /* single: _DIGIT_  */
1660
242
#line 413 "re_grammar.y"
1661
242
      {
1662
242
        (yyval.re_node) = yr_re_node_create(RE_NODE_DIGIT);
1663
1664
242
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1665
242
      }
1666
0
#line 1667 "re_grammar.c"
1667
0
    break;
1668
1669
128
  case 30: /* single: _NON_DIGIT_  */
1670
128
#line 419 "re_grammar.y"
1671
128
      {
1672
128
        (yyval.re_node) = yr_re_node_create(RE_NODE_NON_DIGIT);
1673
1674
128
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1675
128
      }
1676
0
#line 1677 "re_grammar.c"
1677
0
    break;
1678
1679
832
  case 31: /* single: _CLASS_  */
1680
832
#line 425 "re_grammar.y"
1681
832
      {
1682
832
        (yyval.re_node) = yr_re_node_create(RE_NODE_CLASS);
1683
1684
832
        fail_if((yyval.re_node) == NULL, ERROR_INSUFFICIENT_MEMORY);
1685
1686
832
        (yyval.re_node)->re_class = (yyvsp[0].re_class);
1687
832
      }
1688
0
#line 1689 "re_grammar.c"
1689
0
    break;
1690
1691
1692
0
#line 1693 "re_grammar.c"
1693
1694
5.22k
      default: break;
1695
5.23M
    }
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.23M
  YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1708
1709
5.23M
  YYPOPSTACK (yylen);
1710
5.23M
  yylen = 0;
1711
1712
5.23M
  *++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.23M
  {
1718
5.23M
    const int yylhs = yyr1[yyn] - YYNTOKENS;
1719
5.23M
    const int yyi = yypgoto[yylhs] + *yyssp;
1720
5.23M
    yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1721
5.23M
               ? yytable[yyi]
1722
5.23M
               : yydefgoto[yylhs]);
1723
5.23M
  }
1724
1725
5.23M
  goto yynewstate;
1726
1727
1728
/*--------------------------------------.
1729
| yyerrlab -- here on detecting error.  |
1730
`--------------------------------------*/
1731
5.22k
yyerrlab:
1732
  /* Make sure we have latest lookahead translation.  See comments at
1733
     user semantic actions for why this is necessary.  */
1734
5.22k
  yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1735
  /* If not already recovering from an error, report this error.  */
1736
5.22k
  if (!yyerrstatus)
1737
558
    {
1738
558
      ++yynerrs;
1739
558
      yyerror (yyscanner, lex_env, YY_("syntax error"));
1740
558
    }
1741
1742
5.22k
  if (yyerrstatus == 3)
1743
4.66k
    {
1744
      /* If just tried and failed to reuse lookahead token after an
1745
         error, discard it.  */
1746
1747
4.66k
      if (yychar <= YYEOF)
1748
0
        {
1749
          /* Return failure if at end of input.  */
1750
0
          if (yychar == YYEOF)
1751
0
            YYABORT;
1752
0
        }
1753
4.66k
      else
1754
4.66k
        {
1755
4.66k
          yydestruct ("Error: discarding",
1756
4.66k
                      yytoken, &yylval, yyscanner, lex_env);
1757
4.66k
          yychar = YYEMPTY;
1758
4.66k
        }
1759
4.66k
    }
1760
1761
  /* Else will try to reuse lookahead token after shifting the error
1762
     token.  */
1763
5.22k
  goto yyerrlab1;
1764
1765
1766
/*---------------------------------------------------.
1767
| yyerrorlab -- error raised explicitly by YYERROR.  |
1768
`---------------------------------------------------*/
1769
5.22k
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
5.22k
yyerrlab1:
1789
5.22k
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
1790
1791
  /* Pop stack until we find a state that shifts the error token.  */
1792
5.22k
  for (;;)
1793
39.0k
    {
1794
39.0k
      yyn = yypact[yystate];
1795
39.0k
      if (!yypact_value_is_default (yyn))
1796
39.0k
        {
1797
39.0k
          yyn += YYSYMBOL_YYerror;
1798
39.0k
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1799
5.22k
            {
1800
5.22k
              yyn = yytable[yyn];
1801
5.22k
              if (0 < yyn)
1802
5.22k
                break;
1803
5.22k
            }
1804
39.0k
        }
1805
1806
      /* Pop the current state because it cannot handle the error token.  */
1807
33.7k
      if (yyssp == yyss)
1808
0
        YYABORT;
1809
1810
1811
33.7k
      yydestruct ("Error: popping",
1812
33.7k
                  YY_ACCESSING_SYMBOL (yystate), yyvsp, yyscanner, lex_env);
1813
33.7k
      YYPOPSTACK (1);
1814
33.7k
      yystate = *yyssp;
1815
33.7k
      YY_STACK_PRINT (yyss, yyssp);
1816
33.7k
    }
1817
1818
5.22k
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1819
5.22k
  *++yyvsp = yylval;
1820
5.22k
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1821
1822
1823
  /* Shift the error token.  */
1824
5.22k
  YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1825
1826
5.22k
  yystate = yyn;
1827
5.22k
  goto yynewstate;
1828
1829
1830
/*-------------------------------------.
1831
| yyacceptlab -- YYACCEPT comes here.  |
1832
`-------------------------------------*/
1833
23.0k
yyacceptlab:
1834
23.0k
  yyresult = 0;
1835
23.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
23.0k
yyreturnlab:
1859
23.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
23.0k
  YYPOPSTACK (yylen);
1870
23.0k
  YY_STACK_PRINT (yyss, yyssp);
1871
69.1k
  while (yyssp != yyss)
1872
46.0k
    {
1873
46.0k
      yydestruct ("Cleanup: popping",
1874
46.0k
                  YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yyscanner, lex_env);
1875
46.0k
      YYPOPSTACK (1);
1876
46.0k
    }
1877
23.0k
#ifndef yyoverflow
1878
23.0k
  if (yyss != yyssa)
1879
90
    YYSTACK_FREE (yyss);
1880
23.0k
#endif
1881
1882
23.0k
  return yyresult;
1883
5.22k
}
1884
1885
#line 433 "re_grammar.y"
1886