Coverage Report

Created: 2025-11-24 06:34

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