1 /* A Bison parser, made by GNU Bison 2.5. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "2.5"
50 #define YYSKELETON_NAME "yacc.c"
61 /* Using locations. */
62 #define YYLSP_NEEDED 0
64 /* Substitute the variable and function names. */
65 #define yyparse ap_expr_yyparse
66 #define yylex ap_expr_yylex
67 #define yyerror ap_expr_yyerror
68 #define yylval ap_expr_yylval
69 #define yychar ap_expr_yychar
70 #define yydebug ap_expr_yydebug
71 #define yynerrs ap_expr_yynerrs
74 /* Copy the first part of user declarations. */
76 /* Line 268 of yacc.c */
77 #line 31 "util_expr_parse.y"
79 #include "util_expr_private.h"
82 /* Line 268 of yacc.c */
83 #line 84 "util_expr_parse.c"
85 /* Enabling traces. */
90 /* Enabling verbose error messages. */
91 #ifdef YYERROR_VERBOSE
92 # undef YYERROR_VERBOSE
93 # define YYERROR_VERBOSE 1
95 # define YYERROR_VERBOSE 1
98 /* Enabling the token table. */
100 # define YYTOKEN_TABLE 0
107 /* Put the tokens into the symbol table, so that GDB and other debuggers
120 T_REGEX_BACKREF = 268,
151 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
152 typedef union YYSTYPE
155 /* Line 293 of yacc.c */
156 #line 35 "util_expr_parse.y"
164 /* Line 293 of yacc.c */
165 #line 166 "util_expr_parse.c"
167 # define YYSTYPE_IS_TRIVIAL 1
168 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
169 # define YYSTYPE_IS_DECLARED 1
173 /* Copy the second part of user declarations. */
175 /* Line 343 of yacc.c */
176 #line 102 "util_expr_parse.y"
178 #include "util_expr_private.h"
179 #define yyscanner ctx->scanner
181 int ap_expr_yylex(YYSTYPE *lvalp, void *scanner);
184 /* Line 343 of yacc.c */
185 #line 186 "util_expr_parse.c"
192 typedef YYTYPE_UINT8 yytype_uint8;
194 typedef unsigned char yytype_uint8;
198 typedef YYTYPE_INT8 yytype_int8;
199 #elif (defined __STDC__ || defined __C99__FUNC__ \
200 || defined __cplusplus || defined _MSC_VER)
201 typedef signed char yytype_int8;
203 typedef short int yytype_int8;
207 typedef YYTYPE_UINT16 yytype_uint16;
209 typedef unsigned short int yytype_uint16;
213 typedef YYTYPE_INT16 yytype_int16;
215 typedef short int yytype_int16;
219 # ifdef __SIZE_TYPE__
220 # define YYSIZE_T __SIZE_TYPE__
221 # elif defined size_t
222 # define YYSIZE_T size_t
223 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
224 || defined __cplusplus || defined _MSC_VER)
225 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
226 # define YYSIZE_T size_t
228 # define YYSIZE_T unsigned int
232 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
235 # if defined YYENABLE_NLS && YYENABLE_NLS
237 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
238 # define YY_(msgid) dgettext ("bison-runtime", msgid)
242 # define YY_(msgid) msgid
246 /* Suppress unused-variable warnings by "using" E. */
247 #if ! defined lint || defined __GNUC__
248 # define YYUSE(e) ((void) (e))
250 # define YYUSE(e) /* empty */
253 /* Identity function, used to suppress warnings about constant conditions. */
257 #if (defined __STDC__ || defined __C99__FUNC__ \
258 || defined __cplusplus || defined _MSC_VER)
271 #if ! defined yyoverflow || YYERROR_VERBOSE
273 /* The parser invokes alloca or malloc; define the necessary symbols. */
275 # ifdef YYSTACK_USE_ALLOCA
276 # if YYSTACK_USE_ALLOCA
278 # define YYSTACK_ALLOC __builtin_alloca
279 # elif defined __BUILTIN_VA_ARG_INCR
280 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
282 # define YYSTACK_ALLOC __alloca
283 # elif defined _MSC_VER
284 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
285 # define alloca _alloca
287 # define YYSTACK_ALLOC alloca
288 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
289 || defined __cplusplus || defined _MSC_VER)
290 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
291 # ifndef EXIT_SUCCESS
292 # define EXIT_SUCCESS 0
299 # ifdef YYSTACK_ALLOC
300 /* Pacify GCC's `empty if-body' warning. */
301 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
302 # ifndef YYSTACK_ALLOC_MAXIMUM
303 /* The OS might guarantee only one guard page at the bottom of the stack,
304 and a page size can be as small as 4096 bytes. So we cannot safely
305 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
306 to allow for a few compiler-allocated temporary stack slots. */
307 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
310 # define YYSTACK_ALLOC YYMALLOC
311 # define YYSTACK_FREE YYFREE
312 # ifndef YYSTACK_ALLOC_MAXIMUM
313 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
315 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
316 && ! ((defined YYMALLOC || defined malloc) \
317 && (defined YYFREE || defined free)))
318 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
319 # ifndef EXIT_SUCCESS
320 # define EXIT_SUCCESS 0
324 # define YYMALLOC malloc
325 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
326 || defined __cplusplus || defined _MSC_VER)
327 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
332 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
333 || defined __cplusplus || defined _MSC_VER)
334 void free (void *); /* INFRINGES ON USER NAME SPACE */
338 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
341 #if (! defined yyoverflow \
342 && (! defined __cplusplus \
343 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
345 /* A type that is properly aligned for any stack member. */
348 yytype_int16 yyss_alloc;
352 /* The size of the maximum gap between one aligned stack and the next. */
353 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
355 /* The size of an array large to enough to hold all stacks, each with
357 # define YYSTACK_BYTES(N) \
358 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
359 + YYSTACK_GAP_MAXIMUM)
361 # define YYCOPY_NEEDED 1
363 /* Relocate STACK from its old location to the new one. The
364 local variables YYSIZE and YYSTACKSIZE give the old and new number of
365 elements in the stack, and YYPTR gives the new location of the
366 stack. Advance YYPTR to a properly aligned location for the next
368 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
371 YYSIZE_T yynewbytes; \
372 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
373 Stack = &yyptr->Stack_alloc; \
374 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
375 yyptr += yynewbytes / sizeof (*yyptr); \
381 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
382 /* Copy COUNT objects from FROM to TO. The source and destination do
385 # if defined __GNUC__ && 1 < __GNUC__
386 # define YYCOPY(To, From, Count) \
387 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
389 # define YYCOPY(To, From, Count) \
393 for (yyi = 0; yyi < (Count); yyi++) \
394 (To)[yyi] = (From)[yyi]; \
399 #endif /* !YYCOPY_NEEDED */
401 /* YYFINAL -- State number of the termination state. */
403 /* YYLAST -- Last index in YYTABLE. */
406 /* YYNTOKENS -- Number of terminals. */
408 /* YYNNTS -- Number of nonterminals. */
410 /* YYNRULES -- Number of rules. */
412 /* YYNRULES -- Number of states. */
415 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
417 #define YYMAXUTOK 293
419 #define YYTRANSLATE(YYX) \
420 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
422 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
423 static const yytype_uint8 yytranslate[] =
425 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
426 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
427 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
428 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
429 39, 40, 2, 2, 43, 2, 2, 2, 2, 2,
430 2, 2, 2, 2, 2, 2, 2, 2, 44, 2,
431 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
432 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
433 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
434 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
435 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
436 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
437 2, 2, 2, 41, 2, 42, 2, 2, 2, 2,
438 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
439 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
442 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
443 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
451 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
452 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
453 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
458 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
460 static const yytype_uint8 yyprhs[] =
462 0, 0, 3, 6, 9, 11, 13, 15, 18, 22,
463 26, 28, 31, 35, 39, 41, 45, 49, 53, 57,
464 61, 65, 69, 73, 77, 81, 85, 89, 93, 97,
465 101, 103, 107, 109, 113, 116, 118, 120, 122, 124,
466 126, 130, 136, 138, 142, 144, 146, 148, 152, 155,
470 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
471 static const yytype_int8 yyrhs[] =
473 46, 0, -1, 5, 47, -1, 6, 51, -1, 7,
474 -1, 3, -1, 4, -1, 38, 47, -1, 47, 36,
475 47, -1, 47, 37, 47, -1, 48, -1, 14, 54,
476 -1, 54, 15, 54, -1, 39, 47, 40, -1, 7,
477 -1, 54, 20, 54, -1, 54, 21, 54, -1, 54,
478 22, 54, -1, 54, 23, 54, -1, 54, 24, 54,
479 -1, 54, 25, 54, -1, 54, 29, 54, -1, 54,
480 30, 54, -1, 54, 31, 54, -1, 54, 32, 54,
481 -1, 54, 33, 54, -1, 54, 34, 54, -1, 54,
482 28, 49, -1, 54, 26, 55, -1, 54, 27, 55,
483 -1, 57, -1, 41, 50, 42, -1, 54, -1, 50,
484 43, 54, -1, 51, 52, -1, 52, -1, 7, -1,
485 10, -1, 53, -1, 56, -1, 18, 9, 19, -1,
486 18, 9, 44, 51, 19, -1, 8, -1, 54, 35,
487 54, -1, 53, -1, 56, -1, 58, -1, 16, 51,
488 17, -1, 16, 17, -1, 11, -1, 12, -1, 13,
489 -1, 9, 39, 54, 40, -1, 9, 39, 54, 40,
493 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
494 static const yytype_uint8 yyrline[] =
496 0, 112, 112, 113, 114, 117, 118, 119, 120, 121,
497 122, 123, 124, 125, 126, 129, 130, 131, 132, 133,
498 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
499 146, 147, 150, 151, 154, 155, 156, 159, 160, 161,
500 164, 165, 168, 169, 170, 171, 172, 173, 174, 177,
505 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
506 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
507 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
508 static const char *const yytname[] =
510 "$end", "error", "$undefined", "T_TRUE", "T_FALSE", "T_EXPR_BOOL",
511 "T_EXPR_STRING", "T_ERROR", "T_DIGIT", "T_ID", "T_STRING", "T_REGEX",
512 "T_REGEX_I", "T_REGEX_BACKREF", "T_OP_UNARY", "T_OP_BINARY",
513 "T_STR_BEGIN", "T_STR_END", "T_VAR_BEGIN", "T_VAR_END", "T_OP_EQ",
514 "T_OP_NE", "T_OP_LT", "T_OP_LE", "T_OP_GT", "T_OP_GE", "T_OP_REG",
515 "T_OP_NRE", "T_OP_IN", "T_OP_STR_EQ", "T_OP_STR_NE", "T_OP_STR_LT",
516 "T_OP_STR_LE", "T_OP_STR_GT", "T_OP_STR_GE", "T_OP_CONCAT", "T_OP_OR",
517 "T_OP_AND", "T_OP_NOT", "'('", "')'", "'{'", "'}'", "','", "':'",
518 "$accept", "root", "expr", "comparison", "wordlist", "words", "string",
519 "strpart", "var", "word", "regex", "backref", "lstfunccall",
525 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
527 static const yytype_uint16 yytoknum[] =
529 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
530 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
531 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
532 285, 286, 287, 288, 289, 290, 291, 292, 293, 40,
537 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
538 static const yytype_uint8 yyr1[] =
540 0, 45, 46, 46, 46, 47, 47, 47, 47, 47,
541 47, 47, 47, 47, 47, 48, 48, 48, 48, 48,
542 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
543 49, 49, 50, 50, 51, 51, 51, 52, 52, 52,
544 53, 53, 54, 54, 54, 54, 54, 54, 54, 55,
548 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
549 static const yytype_uint8 yyr2[] =
551 0, 2, 2, 2, 1, 1, 1, 2, 3, 3,
552 1, 2, 3, 3, 1, 3, 3, 3, 3, 3,
553 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
554 1, 3, 1, 3, 2, 1, 1, 1, 1, 1,
555 3, 5, 1, 3, 1, 1, 1, 3, 2, 1,
559 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
560 Performed when YYTABLE doesn't specify something else to do. Zero
561 means the default is an error. */
562 static const yytype_uint8 yydefact[] =
564 0, 0, 0, 4, 0, 5, 6, 14, 42, 0,
565 51, 0, 0, 0, 0, 0, 2, 10, 44, 0,
566 45, 46, 36, 37, 3, 35, 38, 39, 1, 0,
567 11, 48, 0, 0, 7, 0, 0, 0, 0, 0,
568 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
569 0, 0, 0, 0, 0, 34, 0, 47, 40, 0,
570 13, 8, 9, 12, 15, 16, 17, 18, 19, 20,
571 49, 50, 28, 29, 0, 0, 27, 30, 21, 22,
572 23, 24, 25, 26, 43, 53, 0, 0, 0, 32,
576 /* YYDEFGOTO[NTERM-NUM]. */
577 static const yytype_int8 yydefgoto[] =
579 -1, 4, 16, 17, 76, 88, 24, 25, 18, 19,
583 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
585 #define YYPACT_NINF -35
586 static const yytype_int8 yypact[] =
588 48, 60, 73, -35, 7, -35, -35, -35, -35, -34,
589 -35, 43, 8, 11, 60, 60, 86, -35, -35, 80,
590 -35, -35, -35, -35, 108, -35, -35, -35, -35, 43,
591 25, -35, 79, -17, -35, -8, 60, 60, 43, 43,
592 43, 43, 43, 43, 43, 5, 5, 0, 43, 43,
593 43, 43, 43, 43, 43, -35, -27, -35, -35, 73,
594 -35, 86, 3, 25, 25, 25, 25, 25, 25, 25,
595 -35, -35, -35, -35, 23, 43, -35, -35, 25, 25,
596 25, 25, 25, 25, 25, -35, 106, 43, 85, 25,
597 -35, -21, -35, 43, -35, 25
600 /* YYPGOTO[NTERM-NUM]. */
601 static const yytype_int8 yypgoto[] =
603 -35, -35, 57, -35, -35, -35, -9, -20, -2, -5,
607 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
608 positive, shift that token. If negative, reduce the rule which
609 number is the opposite. If YYTABLE_NINF, syntax error. */
610 #define YYTABLE_NINF -1
611 static const yytype_uint8 yytable[] =
613 26, 27, 58, 32, 55, 29, 30, 28, 54, 74,
614 26, 27, 55, 85, 54, 22, 70, 71, 23, 94,
615 33, 10, 26, 27, 56, 31, 13, 59, 36, 37,
616 26, 27, 60, 63, 64, 65, 66, 67, 68, 69,
617 37, 75, 73, 78, 79, 80, 81, 82, 83, 84,
618 86, 8, 9, 1, 2, 3, 10, 26, 27, 12,
619 54, 13, 87, 5, 6, 0, 55, 7, 8, 9,
620 89, 34, 35, 10, 11, 0, 12, 0, 13, 0,
621 22, 0, 91, 23, 26, 27, 10, 0, 95, 23,
622 0, 13, 10, 61, 62, 38, 57, 13, 14, 15,
623 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
624 49, 50, 51, 52, 53, 54, 23, 0, 23, 10,
625 0, 10, 36, 37, 13, 90, 13, 92, 93
628 #define yypact_value_is_default(yystate) \
631 #define yytable_value_is_error(yytable_value) \
634 static const yytype_int8 yycheck[] =
636 2, 2, 19, 12, 24, 39, 11, 0, 35, 9,
637 12, 12, 32, 40, 35, 7, 11, 12, 10, 40,
638 9, 13, 24, 24, 29, 17, 18, 44, 36, 37,
639 32, 32, 40, 38, 39, 40, 41, 42, 43, 44,
640 37, 41, 46, 48, 49, 50, 51, 52, 53, 54,
641 59, 8, 9, 5, 6, 7, 13, 59, 59, 16,
642 35, 18, 39, 3, 4, -1, 86, 7, 8, 9,
643 75, 14, 15, 13, 14, -1, 16, -1, 18, -1,
644 7, -1, 87, 10, 86, 86, 13, -1, 93, 10,
645 -1, 18, 13, 36, 37, 15, 17, 18, 38, 39,
646 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
647 30, 31, 32, 33, 34, 35, 10, -1, 10, 13,
648 -1, 13, 36, 37, 18, 19, 18, 42, 43
651 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
652 symbol of state STATE-NUM. */
653 static const yytype_uint8 yystos[] =
655 0, 5, 6, 7, 46, 3, 4, 7, 8, 9,
656 13, 14, 16, 18, 38, 39, 47, 48, 53, 54,
657 56, 58, 7, 10, 51, 52, 53, 56, 0, 39,
658 54, 17, 51, 9, 47, 47, 36, 37, 15, 20,
659 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
660 31, 32, 33, 34, 35, 52, 54, 17, 19, 44,
661 40, 47, 47, 54, 54, 54, 54, 54, 54, 54,
662 11, 12, 55, 55, 9, 41, 49, 57, 54, 54,
663 54, 54, 54, 54, 54, 40, 51, 39, 50, 54,
664 19, 54, 42, 43, 40, 54
667 #define yyerrok (yyerrstatus = 0)
668 #define yyclearin (yychar = YYEMPTY)
672 #define YYACCEPT goto yyacceptlab
673 #define YYABORT goto yyabortlab
674 #define YYERROR goto yyerrorlab
677 /* Like YYERROR except do call yyerror. This remains here temporarily
678 to ease the transition to the new meaning of YYERROR, for GCC.
679 Once GCC version 2 has supplanted version 1, this can go. However,
680 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
681 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
684 #define YYFAIL goto yyerrlab
686 /* This is here to suppress warnings from the GCC cpp's
687 -Wunused-macros. Normally we don't worry about that warning, but
688 some users do, and we want to make it easy for users to remove
689 YYFAIL uses, which will produce warnings from Bison 2.5. */
692 #define YYRECOVERING() (!!yyerrstatus)
694 #define YYBACKUP(Token, Value) \
696 if (yychar == YYEMPTY && yylen == 1) \
705 yyerror (ctx, YY_("syntax error: cannot back up")); \
712 #define YYERRCODE 256
715 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
716 If N is 0, then set CURRENT to the empty location which ends
717 the previous symbol: RHS[0] (always defined). */
719 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
720 #ifndef YYLLOC_DEFAULT
721 # define YYLLOC_DEFAULT(Current, Rhs, N) \
725 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
726 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
727 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
728 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
732 (Current).first_line = (Current).last_line = \
733 YYRHSLOC (Rhs, 0).last_line; \
734 (Current).first_column = (Current).last_column = \
735 YYRHSLOC (Rhs, 0).last_column; \
741 /* This macro is provided for backward compatibility. */
743 #ifndef YY_LOCATION_PRINT
744 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
748 /* YYLEX -- calling `yylex' with the right arguments. */
751 # define YYLEX yylex (&yylval, YYLEX_PARAM)
753 # define YYLEX yylex (&yylval, yyscanner)
756 /* Enable debugging if requested. */
760 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
761 # define YYFPRINTF fprintf
764 # define YYDPRINTF(Args) \
770 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
774 YYFPRINTF (stderr, "%s ", Title); \
775 yy_symbol_print (stderr, \
777 YYFPRINTF (stderr, "\n"); \
782 /*--------------------------------.
783 | Print this symbol on YYOUTPUT. |
784 `--------------------------------*/
787 #if (defined __STDC__ || defined __C99__FUNC__ \
788 || defined __cplusplus || defined _MSC_VER)
790 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, ap_expr_parse_ctx_t *ctx)
793 yy_symbol_value_print (yyoutput, yytype, yyvaluep, ctx)
796 YYSTYPE const * const yyvaluep;
797 ap_expr_parse_ctx_t *ctx;
804 if (yytype < YYNTOKENS)
805 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
817 /*--------------------------------.
818 | Print this symbol on YYOUTPUT. |
819 `--------------------------------*/
821 #if (defined __STDC__ || defined __C99__FUNC__ \
822 || defined __cplusplus || defined _MSC_VER)
824 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, ap_expr_parse_ctx_t *ctx)
827 yy_symbol_print (yyoutput, yytype, yyvaluep, ctx)
830 YYSTYPE const * const yyvaluep;
831 ap_expr_parse_ctx_t *ctx;
834 if (yytype < YYNTOKENS)
835 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
837 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
839 yy_symbol_value_print (yyoutput, yytype, yyvaluep, ctx);
840 YYFPRINTF (yyoutput, ")");
843 /*------------------------------------------------------------------.
844 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
846 `------------------------------------------------------------------*/
848 #if (defined __STDC__ || defined __C99__FUNC__ \
849 || defined __cplusplus || defined _MSC_VER)
851 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
854 yy_stack_print (yybottom, yytop)
855 yytype_int16 *yybottom;
859 YYFPRINTF (stderr, "Stack now");
860 for (; yybottom <= yytop; yybottom++)
862 int yybot = *yybottom;
863 YYFPRINTF (stderr, " %d", yybot);
865 YYFPRINTF (stderr, "\n");
868 # define YY_STACK_PRINT(Bottom, Top) \
871 yy_stack_print ((Bottom), (Top)); \
875 /*------------------------------------------------.
876 | Report that the YYRULE is going to be reduced. |
877 `------------------------------------------------*/
879 #if (defined __STDC__ || defined __C99__FUNC__ \
880 || defined __cplusplus || defined _MSC_VER)
882 yy_reduce_print (YYSTYPE *yyvsp, int yyrule, ap_expr_parse_ctx_t *ctx)
885 yy_reduce_print (yyvsp, yyrule, ctx)
888 ap_expr_parse_ctx_t *ctx;
891 int yynrhs = yyr2[yyrule];
893 unsigned long int yylno = yyrline[yyrule];
894 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
896 /* The symbols being reduced. */
897 for (yyi = 0; yyi < yynrhs; yyi++)
899 YYFPRINTF (stderr, " $%d = ", yyi + 1);
900 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
901 &(yyvsp[(yyi + 1) - (yynrhs)])
903 YYFPRINTF (stderr, "\n");
907 # define YY_REDUCE_PRINT(Rule) \
910 yy_reduce_print (yyvsp, Rule, ctx); \
913 /* Nonzero means print parse trace. It is left uninitialized so that
914 multiple parsers can coexist. */
917 # define YYDPRINTF(Args)
918 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
919 # define YY_STACK_PRINT(Bottom, Top)
920 # define YY_REDUCE_PRINT(Rule)
921 #endif /* !YYDEBUG */
924 /* YYINITDEPTH -- initial size of the parser's stacks. */
926 # define YYINITDEPTH 200
929 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
930 if the built-in stack extension method is used).
932 Do not make this value too large; the results are undefined if
933 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
934 evaluated with infinite-precision integer arithmetic. */
937 # define YYMAXDEPTH 10000
944 # if defined __GLIBC__ && defined _STRING_H
945 # define yystrlen strlen
947 /* Return the length of YYSTR. */
948 #if (defined __STDC__ || defined __C99__FUNC__ \
949 || defined __cplusplus || defined _MSC_VER)
951 yystrlen (const char *yystr)
959 for (yylen = 0; yystr[yylen]; yylen++)
967 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
968 # define yystpcpy stpcpy
970 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
972 #if (defined __STDC__ || defined __C99__FUNC__ \
973 || defined __cplusplus || defined _MSC_VER)
975 yystpcpy (char *yydest, const char *yysrc)
978 yystpcpy (yydest, yysrc)
984 const char *yys = yysrc;
986 while ((*yyd++ = *yys++) != '\0')
995 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
996 quotes and backslashes, so that it's suitable for yyerror. The
997 heuristic is that double-quoting is unnecessary unless the string
998 contains an apostrophe, a comma, or backslash (other than
999 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1000 null, do not copy; instead, return the length of what the result
1003 yytnamerr (char *yyres, const char *yystr)
1008 char const *yyp = yystr;
1015 goto do_not_strip_quotes;
1019 goto do_not_strip_quotes;
1032 do_not_strip_quotes: ;
1036 return yystrlen (yystr);
1038 return yystpcpy (yyres, yystr) - yyres;
1042 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1043 about the unexpected token YYTOKEN for the state stack whose top is
1046 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1047 not large enough to hold the message. In that case, also set
1048 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1049 required number of bytes is too large to store. */
1051 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1052 yytype_int16 *yyssp, int yytoken)
1054 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
1055 YYSIZE_T yysize = yysize0;
1057 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1058 /* Internationalized format string. */
1059 const char *yyformat = 0;
1060 /* Arguments of yyformat. */
1061 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1062 /* Number of reported tokens (one for the "unexpected", one per
1066 /* There are many possibilities here to consider:
1067 - Assume YYFAIL is not used. It's too flawed to consider. See
1068 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1069 for details. YYERROR is fine as it does not invoke this
1071 - If this state is a consistent state with a default action, then
1072 the only way this function was invoked is if the default action
1073 is an error action. In that case, don't check for expected
1074 tokens because there are none.
1075 - The only way there can be no lookahead present (in yychar) is if
1076 this state is a consistent state with a default action. Thus,
1077 detecting the absence of a lookahead is sufficient to determine
1078 that there is no unexpected or expected token to report. In that
1079 case, just report a simple "syntax error".
1080 - Don't assume there isn't a lookahead just because this state is a
1081 consistent state with a default action. There might have been a
1082 previous inconsistent state, consistent state with a non-default
1083 action, or user semantic action that manipulated yychar.
1084 - Of course, the expected token list depends on states to have
1085 correct lookahead information, and it depends on the parser not
1086 to perform extra reductions after fetching a lookahead from the
1087 scanner and before detecting a syntax error. Thus, state merging
1088 (from LALR or IELR) and default reductions corrupt the expected
1089 token list. However, the list is correct for canonical LR with
1090 one exception: it will still contain any token that will not be
1091 accepted due to an error action in a later state.
1093 if (yytoken != YYEMPTY)
1095 int yyn = yypact[*yyssp];
1096 yyarg[yycount++] = yytname[yytoken];
1097 if (!yypact_value_is_default (yyn))
1099 /* Start YYX at -YYN if negative to avoid negative indexes in
1100 YYCHECK. In other words, skip the first -YYN actions for
1101 this state because they are default actions. */
1102 int yyxbegin = yyn < 0 ? -yyn : 0;
1103 /* Stay within bounds of both yycheck and yytname. */
1104 int yychecklim = YYLAST - yyn + 1;
1105 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1108 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1109 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1110 && !yytable_value_is_error (yytable[yyx + yyn]))
1112 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1118 yyarg[yycount++] = yytname[yyx];
1119 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1120 if (! (yysize <= yysize1
1121 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1130 # define YYCASE_(N, S) \
1134 YYCASE_(0, YY_("syntax error"));
1135 YYCASE_(1, YY_("syntax error, unexpected %s"));
1136 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1137 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1138 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1139 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1143 yysize1 = yysize + yystrlen (yyformat);
1144 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1148 if (*yymsg_alloc < yysize)
1150 *yymsg_alloc = 2 * yysize;
1151 if (! (yysize <= *yymsg_alloc
1152 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1153 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1157 /* Avoid sprintf, as that infringes on the user's name space.
1158 Don't have undefined behavior even if the translation
1159 produced a string with the wrong number of "%s"s. */
1163 while ((*yyp = *yyformat) != '\0')
1164 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1166 yyp += yytnamerr (yyp, yyarg[yyi++]);
1177 #endif /* YYERROR_VERBOSE */
1179 /*-----------------------------------------------.
1180 | Release the memory associated to this symbol. |
1181 `-----------------------------------------------*/
1184 #if (defined __STDC__ || defined __C99__FUNC__ \
1185 || defined __cplusplus || defined _MSC_VER)
1187 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, ap_expr_parse_ctx_t *ctx)
1190 yydestruct (yymsg, yytype, yyvaluep, ctx)
1194 ap_expr_parse_ctx_t *ctx;
1202 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1213 /* Prevent warnings from -Wmissing-prototypes. */
1214 #ifdef YYPARSE_PARAM
1215 #if defined __STDC__ || defined __cplusplus
1216 int yyparse (void *YYPARSE_PARAM);
1220 #else /* ! YYPARSE_PARAM */
1221 #if defined __STDC__ || defined __cplusplus
1222 int yyparse (ap_expr_parse_ctx_t *ctx);
1226 #endif /* ! YYPARSE_PARAM */
1233 #ifdef YYPARSE_PARAM
1234 #if (defined __STDC__ || defined __C99__FUNC__ \
1235 || defined __cplusplus || defined _MSC_VER)
1237 yyparse (void *YYPARSE_PARAM)
1240 yyparse (YYPARSE_PARAM)
1241 void *YYPARSE_PARAM;
1243 #else /* ! YYPARSE_PARAM */
1244 #if (defined __STDC__ || defined __C99__FUNC__ \
1245 || defined __cplusplus || defined _MSC_VER)
1247 yyparse (ap_expr_parse_ctx_t *ctx)
1251 ap_expr_parse_ctx_t *ctx;
1255 /* The lookahead symbol. */
1258 /* The semantic value of the lookahead symbol. */
1261 /* Number of syntax errors so far. */
1265 /* Number of tokens to shift before error messages enabled. */
1268 /* The stacks and their tools:
1269 `yyss': related to states.
1270 `yyvs': related to semantic values.
1272 Refer to the stacks thru separate pointers, to allow yyoverflow
1273 to reallocate them elsewhere. */
1275 /* The state stack. */
1276 yytype_int16 yyssa[YYINITDEPTH];
1278 yytype_int16 *yyssp;
1280 /* The semantic value stack. */
1281 YYSTYPE yyvsa[YYINITDEPTH];
1285 YYSIZE_T yystacksize;
1289 /* Lookahead token as an internal (translated) token number. */
1291 /* The variables used to return semantic value and location from the
1296 /* Buffer for error messages, and its allocated size. */
1298 char *yymsg = yymsgbuf;
1299 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1302 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1304 /* The number of symbols on the RHS of the reduced rule.
1305 Keep to zero when no symbol should be popped. */
1311 yystacksize = YYINITDEPTH;
1313 YYDPRINTF ((stderr, "Starting parse\n"));
1318 yychar = YYEMPTY; /* Cause a token to be read. */
1320 /* Initialize stack pointers.
1321 Waste one element of value and location stack
1322 so that they stay on the same level as the state stack.
1323 The wasted elements are never initialized. */
1329 /*------------------------------------------------------------.
1330 | yynewstate -- Push a new state, which is found in yystate. |
1331 `------------------------------------------------------------*/
1333 /* In all cases, when you get here, the value and location stacks
1334 have just been pushed. So pushing a state here evens the stacks. */
1340 if (yyss + yystacksize - 1 <= yyssp)
1342 /* Get the current used size of the three stacks, in elements. */
1343 YYSIZE_T yysize = yyssp - yyss + 1;
1347 /* Give user a chance to reallocate the stack. Use copies of
1348 these so that the &'s don't force the real ones into
1350 YYSTYPE *yyvs1 = yyvs;
1351 yytype_int16 *yyss1 = yyss;
1353 /* Each stack pointer address is followed by the size of the
1354 data in use in that stack, in bytes. This used to be a
1355 conditional around just the two extra args, but that might
1356 be undefined if yyoverflow is a macro. */
1357 yyoverflow (YY_("memory exhausted"),
1358 &yyss1, yysize * sizeof (*yyssp),
1359 &yyvs1, yysize * sizeof (*yyvsp),
1365 #else /* no yyoverflow */
1366 # ifndef YYSTACK_RELOCATE
1367 goto yyexhaustedlab;
1369 /* Extend the stack our own way. */
1370 if (YYMAXDEPTH <= yystacksize)
1371 goto yyexhaustedlab;
1373 if (YYMAXDEPTH < yystacksize)
1374 yystacksize = YYMAXDEPTH;
1377 yytype_int16 *yyss1 = yyss;
1378 union yyalloc *yyptr =
1379 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1381 goto yyexhaustedlab;
1382 YYSTACK_RELOCATE (yyss_alloc, yyss);
1383 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1384 # undef YYSTACK_RELOCATE
1386 YYSTACK_FREE (yyss1);
1389 #endif /* no yyoverflow */
1391 yyssp = yyss + yysize - 1;
1392 yyvsp = yyvs + yysize - 1;
1394 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1395 (unsigned long int) yystacksize));
1397 if (yyss + yystacksize - 1 <= yyssp)
1401 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1403 if (yystate == YYFINAL)
1413 /* Do appropriate processing given the current state. Read a
1414 lookahead token if we need one and don't already have one. */
1416 /* First try to decide what to do without reference to lookahead token. */
1417 yyn = yypact[yystate];
1418 if (yypact_value_is_default (yyn))
1421 /* Not known => get a lookahead token if don't already have one. */
1423 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1424 if (yychar == YYEMPTY)
1426 YYDPRINTF ((stderr, "Reading a token: "));
1430 if (yychar <= YYEOF)
1432 yychar = yytoken = YYEOF;
1433 YYDPRINTF ((stderr, "Now at end of input.\n"));
1437 yytoken = YYTRANSLATE (yychar);
1438 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1441 /* If the proper action on seeing token YYTOKEN is to reduce or to
1442 detect an error, take that action. */
1444 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1449 if (yytable_value_is_error (yyn))
1455 /* Count tokens shifted since error; after three, turn off error
1460 /* Shift the lookahead token. */
1461 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1463 /* Discard the shifted token. */
1472 /*-----------------------------------------------------------.
1473 | yydefault -- do the default action for the current state. |
1474 `-----------------------------------------------------------*/
1476 yyn = yydefact[yystate];
1482 /*-----------------------------.
1483 | yyreduce -- Do a reduction. |
1484 `-----------------------------*/
1486 /* yyn is the number of a rule to reduce with. */
1489 /* If YYLEN is nonzero, implement the default value of the action:
1492 Otherwise, the following line sets YYVAL to garbage.
1493 This behavior is undocumented and Bison
1494 users should not rely upon it. Assigning to YYVAL
1495 unconditionally makes the parser a bit smaller, and it avoids a
1496 GCC warning that YYVAL may be used uninitialized. */
1497 yyval = yyvsp[1-yylen];
1500 YY_REDUCE_PRINT (yyn);
1505 /* Line 1806 of yacc.c */
1506 #line 112 "util_expr_parse.y"
1507 { ctx->expr = (yyvsp[(2) - (2)].exVal); }
1512 /* Line 1806 of yacc.c */
1513 #line 113 "util_expr_parse.y"
1514 { ctx->expr = (yyvsp[(2) - (2)].exVal); }
1519 /* Line 1806 of yacc.c */
1520 #line 114 "util_expr_parse.y"
1526 /* Line 1806 of yacc.c */
1527 #line 117 "util_expr_parse.y"
1528 { (yyval.exVal) = ap_expr_make(op_True, NULL, NULL, ctx); }
1533 /* Line 1806 of yacc.c */
1534 #line 118 "util_expr_parse.y"
1535 { (yyval.exVal) = ap_expr_make(op_False, NULL, NULL, ctx); }
1540 /* Line 1806 of yacc.c */
1541 #line 119 "util_expr_parse.y"
1542 { (yyval.exVal) = ap_expr_make(op_Not, (yyvsp[(2) - (2)].exVal), NULL, ctx); }
1547 /* Line 1806 of yacc.c */
1548 #line 120 "util_expr_parse.y"
1549 { (yyval.exVal) = ap_expr_make(op_Or, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1554 /* Line 1806 of yacc.c */
1555 #line 121 "util_expr_parse.y"
1556 { (yyval.exVal) = ap_expr_make(op_And, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1561 /* Line 1806 of yacc.c */
1562 #line 122 "util_expr_parse.y"
1563 { (yyval.exVal) = ap_expr_make(op_Comp, (yyvsp[(1) - (1)].exVal), NULL, ctx); }
1568 /* Line 1806 of yacc.c */
1569 #line 123 "util_expr_parse.y"
1570 { (yyval.exVal) = ap_expr_unary_op_make( (yyvsp[(1) - (2)].cpVal), (yyvsp[(2) - (2)].exVal), ctx); }
1575 /* Line 1806 of yacc.c */
1576 #line 124 "util_expr_parse.y"
1577 { (yyval.exVal) = ap_expr_binary_op_make((yyvsp[(2) - (3)].cpVal), (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1582 /* Line 1806 of yacc.c */
1583 #line 125 "util_expr_parse.y"
1584 { (yyval.exVal) = (yyvsp[(2) - (3)].exVal); }
1589 /* Line 1806 of yacc.c */
1590 #line 126 "util_expr_parse.y"
1596 /* Line 1806 of yacc.c */
1597 #line 129 "util_expr_parse.y"
1598 { (yyval.exVal) = ap_expr_make(op_EQ, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1603 /* Line 1806 of yacc.c */
1604 #line 130 "util_expr_parse.y"
1605 { (yyval.exVal) = ap_expr_make(op_NE, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1610 /* Line 1806 of yacc.c */
1611 #line 131 "util_expr_parse.y"
1612 { (yyval.exVal) = ap_expr_make(op_LT, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1617 /* Line 1806 of yacc.c */
1618 #line 132 "util_expr_parse.y"
1619 { (yyval.exVal) = ap_expr_make(op_LE, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1624 /* Line 1806 of yacc.c */
1625 #line 133 "util_expr_parse.y"
1626 { (yyval.exVal) = ap_expr_make(op_GT, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1631 /* Line 1806 of yacc.c */
1632 #line 134 "util_expr_parse.y"
1633 { (yyval.exVal) = ap_expr_make(op_GE, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1638 /* Line 1806 of yacc.c */
1639 #line 135 "util_expr_parse.y"
1640 { (yyval.exVal) = ap_expr_make(op_STR_EQ, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1645 /* Line 1806 of yacc.c */
1646 #line 136 "util_expr_parse.y"
1647 { (yyval.exVal) = ap_expr_make(op_STR_NE, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1652 /* Line 1806 of yacc.c */
1653 #line 137 "util_expr_parse.y"
1654 { (yyval.exVal) = ap_expr_make(op_STR_LT, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1659 /* Line 1806 of yacc.c */
1660 #line 138 "util_expr_parse.y"
1661 { (yyval.exVal) = ap_expr_make(op_STR_LE, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1666 /* Line 1806 of yacc.c */
1667 #line 139 "util_expr_parse.y"
1668 { (yyval.exVal) = ap_expr_make(op_STR_GT, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1673 /* Line 1806 of yacc.c */
1674 #line 140 "util_expr_parse.y"
1675 { (yyval.exVal) = ap_expr_make(op_STR_GE, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1680 /* Line 1806 of yacc.c */
1681 #line 141 "util_expr_parse.y"
1682 { (yyval.exVal) = ap_expr_make(op_IN, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1687 /* Line 1806 of yacc.c */
1688 #line 142 "util_expr_parse.y"
1689 { (yyval.exVal) = ap_expr_make(op_REG, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1694 /* Line 1806 of yacc.c */
1695 #line 143 "util_expr_parse.y"
1696 { (yyval.exVal) = ap_expr_make(op_NRE, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1701 /* Line 1806 of yacc.c */
1702 #line 146 "util_expr_parse.y"
1703 { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1708 /* Line 1806 of yacc.c */
1709 #line 147 "util_expr_parse.y"
1710 { (yyval.exVal) = (yyvsp[(2) - (3)].exVal); }
1715 /* Line 1806 of yacc.c */
1716 #line 150 "util_expr_parse.y"
1717 { (yyval.exVal) = ap_expr_make(op_ListElement, (yyvsp[(1) - (1)].exVal), NULL, ctx); }
1722 /* Line 1806 of yacc.c */
1723 #line 151 "util_expr_parse.y"
1724 { (yyval.exVal) = ap_expr_make(op_ListElement, (yyvsp[(3) - (3)].exVal), (yyvsp[(1) - (3)].exVal), ctx); }
1729 /* Line 1806 of yacc.c */
1730 #line 154 "util_expr_parse.y"
1731 { (yyval.exVal) = ap_expr_make(op_Concat, (yyvsp[(1) - (2)].exVal), (yyvsp[(2) - (2)].exVal), ctx); }
1736 /* Line 1806 of yacc.c */
1737 #line 155 "util_expr_parse.y"
1738 { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1743 /* Line 1806 of yacc.c */
1744 #line 156 "util_expr_parse.y"
1750 /* Line 1806 of yacc.c */
1751 #line 159 "util_expr_parse.y"
1752 { (yyval.exVal) = ap_expr_make(op_String, (yyvsp[(1) - (1)].cpVal), NULL, ctx); }
1757 /* Line 1806 of yacc.c */
1758 #line 160 "util_expr_parse.y"
1759 { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1764 /* Line 1806 of yacc.c */
1765 #line 161 "util_expr_parse.y"
1766 { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1771 /* Line 1806 of yacc.c */
1772 #line 164 "util_expr_parse.y"
1773 { (yyval.exVal) = ap_expr_var_make((yyvsp[(2) - (3)].cpVal), ctx); }
1778 /* Line 1806 of yacc.c */
1779 #line 165 "util_expr_parse.y"
1780 { (yyval.exVal) = ap_expr_str_func_make((yyvsp[(2) - (5)].cpVal), (yyvsp[(4) - (5)].exVal), ctx); }
1785 /* Line 1806 of yacc.c */
1786 #line 168 "util_expr_parse.y"
1787 { (yyval.exVal) = ap_expr_make(op_Digit, (yyvsp[(1) - (1)].cpVal), NULL, ctx); }
1792 /* Line 1806 of yacc.c */
1793 #line 169 "util_expr_parse.y"
1794 { (yyval.exVal) = ap_expr_make(op_Concat, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1799 /* Line 1806 of yacc.c */
1800 #line 170 "util_expr_parse.y"
1801 { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1806 /* Line 1806 of yacc.c */
1807 #line 171 "util_expr_parse.y"
1808 { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1813 /* Line 1806 of yacc.c */
1814 #line 172 "util_expr_parse.y"
1815 { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1820 /* Line 1806 of yacc.c */
1821 #line 173 "util_expr_parse.y"
1822 { (yyval.exVal) = (yyvsp[(2) - (3)].exVal); }
1827 /* Line 1806 of yacc.c */
1828 #line 174 "util_expr_parse.y"
1829 { (yyval.exVal) = ap_expr_make(op_String, "", NULL, ctx); }
1834 /* Line 1806 of yacc.c */
1835 #line 177 "util_expr_parse.y"
1838 if ((regex = ap_pregcomp(ctx->pool, (yyvsp[(1) - (1)].cpVal),
1839 AP_REG_EXTENDED|AP_REG_NOSUB)) == NULL) {
1840 ctx->error = "Failed to compile regular expression";
1843 (yyval.exVal) = ap_expr_make(op_Regex, regex, NULL, ctx);
1849 /* Line 1806 of yacc.c */
1850 #line 186 "util_expr_parse.y"
1853 if ((regex = ap_pregcomp(ctx->pool, (yyvsp[(1) - (1)].cpVal),
1854 AP_REG_EXTENDED|AP_REG_NOSUB|AP_REG_ICASE)) == NULL) {
1855 ctx->error = "Failed to compile regular expression";
1858 (yyval.exVal) = ap_expr_make(op_Regex, regex, NULL, ctx);
1864 /* Line 1806 of yacc.c */
1865 #line 197 "util_expr_parse.y"
1867 int *n = apr_palloc(ctx->pool, sizeof(int));
1868 *n = (yyvsp[(1) - (1)].num);
1869 (yyval.exVal) = ap_expr_make(op_RegexBackref, n, NULL, ctx);
1875 /* Line 1806 of yacc.c */
1876 #line 204 "util_expr_parse.y"
1877 { (yyval.exVal) = ap_expr_list_func_make((yyvsp[(1) - (4)].cpVal), (yyvsp[(3) - (4)].exVal), ctx); }
1882 /* Line 1806 of yacc.c */
1883 #line 207 "util_expr_parse.y"
1884 { (yyval.exVal) = ap_expr_str_func_make((yyvsp[(1) - (4)].cpVal), (yyvsp[(3) - (4)].exVal), ctx); }
1889 /* Line 1806 of yacc.c */
1890 #line 1891 "util_expr_parse.c"
1893 /* User semantic actions sometimes alter yychar, and that requires
1894 that yytoken be updated with the new translation. We take the
1895 approach of translating immediately before every use of yytoken.
1896 One alternative is translating here after every semantic action,
1897 but that translation would be missed if the semantic action invokes
1898 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1899 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1900 incorrect destructor might then be invoked immediately. In the
1901 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1902 to an incorrect destructor call or verbose syntax error message
1903 before the lookahead is translated. */
1904 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1908 YY_STACK_PRINT (yyss, yyssp);
1912 /* Now `shift' the result of the reduction. Determine what state
1913 that goes to, based on the state we popped back to and the rule
1914 number reduced by. */
1918 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1919 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1920 yystate = yytable[yystate];
1922 yystate = yydefgoto[yyn - YYNTOKENS];
1927 /*------------------------------------.
1928 | yyerrlab -- here on detecting error |
1929 `------------------------------------*/
1931 /* Make sure we have latest lookahead translation. See comments at
1932 user semantic actions for why this is necessary. */
1933 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1935 /* If not already recovering from an error, report this error. */
1939 #if ! YYERROR_VERBOSE
1940 yyerror (ctx, YY_("syntax error"));
1942 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1945 char const *yymsgp = YY_("syntax error");
1946 int yysyntax_error_status;
1947 yysyntax_error_status = YYSYNTAX_ERROR;
1948 if (yysyntax_error_status == 0)
1950 else if (yysyntax_error_status == 1)
1952 if (yymsg != yymsgbuf)
1953 YYSTACK_FREE (yymsg);
1954 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1958 yymsg_alloc = sizeof yymsgbuf;
1959 yysyntax_error_status = 2;
1963 yysyntax_error_status = YYSYNTAX_ERROR;
1967 yyerror (ctx, yymsgp);
1968 if (yysyntax_error_status == 2)
1969 goto yyexhaustedlab;
1971 # undef YYSYNTAX_ERROR
1977 if (yyerrstatus == 3)
1979 /* If just tried and failed to reuse lookahead token after an
1980 error, discard it. */
1982 if (yychar <= YYEOF)
1984 /* Return failure if at end of input. */
1985 if (yychar == YYEOF)
1990 yydestruct ("Error: discarding",
1991 yytoken, &yylval, ctx);
1996 /* Else will try to reuse lookahead token after shifting the error
2001 /*---------------------------------------------------.
2002 | yyerrorlab -- error raised explicitly by YYERROR. |
2003 `---------------------------------------------------*/
2006 /* Pacify compilers like GCC when the user code never invokes
2007 YYERROR and the label yyerrorlab therefore never appears in user
2009 if (/*CONSTCOND*/ 0)
2012 /* Do not reclaim the symbols of the rule which action triggered
2016 YY_STACK_PRINT (yyss, yyssp);
2021 /*-------------------------------------------------------------.
2022 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2023 `-------------------------------------------------------------*/
2025 yyerrstatus = 3; /* Each real token shifted decrements this. */
2029 yyn = yypact[yystate];
2030 if (!yypact_value_is_default (yyn))
2033 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2041 /* Pop the current state because it cannot handle the error token. */
2046 yydestruct ("Error: popping",
2047 yystos[yystate], yyvsp, ctx);
2050 YY_STACK_PRINT (yyss, yyssp);
2056 /* Shift the error token. */
2057 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2063 /*-------------------------------------.
2064 | yyacceptlab -- YYACCEPT comes here. |
2065 `-------------------------------------*/
2070 /*-----------------------------------.
2071 | yyabortlab -- YYABORT comes here. |
2072 `-----------------------------------*/
2077 #if !defined(yyoverflow) || YYERROR_VERBOSE
2078 /*-------------------------------------------------.
2079 | yyexhaustedlab -- memory exhaustion comes here. |
2080 `-------------------------------------------------*/
2082 yyerror (ctx, YY_("memory exhausted"));
2088 if (yychar != YYEMPTY)
2090 /* Make sure we have latest lookahead translation. See comments at
2091 user semantic actions for why this is necessary. */
2092 yytoken = YYTRANSLATE (yychar);
2093 yydestruct ("Cleanup: discarding lookahead",
2094 yytoken, &yylval, ctx);
2096 /* Do not reclaim the symbols of the rule which action triggered
2097 this YYABORT or YYACCEPT. */
2099 YY_STACK_PRINT (yyss, yyssp);
2100 while (yyssp != yyss)
2102 yydestruct ("Cleanup: popping",
2103 yystos[*yyssp], yyvsp, ctx);
2108 YYSTACK_FREE (yyss);
2111 if (yymsg != yymsgbuf)
2112 YYSTACK_FREE (yymsg);
2114 /* Make sure YYID is used. */
2115 return YYID (yyresult);
2120 /* Line 2067 of yacc.c */
2121 #line 210 "util_expr_parse.y"
2124 void yyerror(ap_expr_parse_ctx_t *ctx, const char *s)
2126 /* s is allocated on the stack */
2127 ctx->error = apr_pstrdup(ctx->ptemp, s);