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 298
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 44, 45, 2, 2, 48, 2, 2, 2, 2, 2,
430 2, 2, 2, 2, 2, 2, 2, 2, 49, 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, 46, 2, 47, 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,
454 35, 36, 37, 38, 39, 40, 41, 42, 43
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,
467 157, 159, 161, 166, 171
470 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
471 static const yytype_int8 yyrhs[] =
473 51, 0, -1, 5, 52, -1, 6, 56, -1, 7,
474 -1, 3, -1, 4, -1, 38, 52, -1, 52, 36,
475 52, -1, 52, 37, 52, -1, 53, -1, 14, 59,
476 -1, 59, 15, 59, -1, 44, 52, 45, -1, 7,
477 -1, 59, 20, 59, -1, 59, 21, 59, -1, 59,
478 22, 59, -1, 59, 23, 59, -1, 59, 24, 59,
479 -1, 59, 25, 59, -1, 59, 29, 59, -1, 59,
480 30, 59, -1, 59, 31, 59, -1, 59, 32, 59,
481 -1, 59, 33, 59, -1, 59, 34, 59, -1, 59,
482 28, 54, -1, 59, 26, 60, -1, 59, 27, 60,
483 -1, 62, -1, 46, 55, 47, -1, 59, -1, 55,
484 48, 59, -1, 56, 57, -1, 57, -1, 7, -1,
485 10, -1, 58, -1, 61, -1, 18, 9, 19, -1,
486 18, 9, 49, 56, 19, -1, 8, -1, 59, 35,
487 59, -1, 58, -1, 61, -1, 63, -1, 16, 56,
488 17, -1, 16, 17, -1, 11, -1, 12, -1, 13,
489 -1, 9, 44, 59, 45, -1, 9, 44, 59, 45,
490 -1, 9, 44, 55, 45, -1
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,
501 186, 197, 204, 207, 208
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", "\"true\"", "\"false\"",
511 "\"boolean expression\"", "\"string expression\"", "\"error token\"",
512 "\"number\"", "\"identifier\"", "\"cstring\"", "\"regex\"",
513 "\"case-indendent regex\"", "\"regex back reference\"",
514 "\"unary operator\"", "\"binary operator\"", "\"start of string\"",
515 "\"end of string\"", "\"start of variable name\"",
516 "\"end of variable name\"", "\"integer equal\"", "\"integer not equal\"",
517 "\"integer less than\"", "\"integer less or equal\"",
518 "\"integer greater than\"", "\"integer greater or equal\"",
519 "\"regex match\"", "\"regex non-match\"", "\"contained in\"",
520 "\"string equal\"", "\"string not equal\"", "\"string less than\"",
521 "\"string less or equal\"", "\"string greater than\"",
522 "\"string greater or equal\"", "\"string concatenation\"",
523 "\"logical or\"", "\"logical and\"", "\"logical not\"", "\"function\"",
524 "\"listfunction\"", "\"stringpart\"", "\"variable\"", "\"rebackref\"",
525 "'('", "')'", "'{'", "'}'", "','", "':'", "$accept", "root", "expr",
526 "comparison", "wordlist", "words", "string", "strpart", "var", "word",
527 "regex", "backref", "lstfunccall", "strfunccall", 0
532 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
534 static const yytype_uint16 yytoknum[] =
536 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
537 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
538 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
539 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
540 295, 296, 297, 298, 40, 41, 123, 125, 44, 58
544 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
545 static const yytype_uint8 yyr1[] =
547 0, 50, 51, 51, 51, 52, 52, 52, 52, 52,
548 52, 52, 52, 52, 52, 53, 53, 53, 53, 53,
549 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
550 54, 54, 55, 55, 56, 56, 56, 57, 57, 57,
551 58, 58, 59, 59, 59, 59, 59, 59, 59, 60,
555 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
556 static const yytype_uint8 yyr2[] =
558 0, 2, 2, 2, 1, 1, 1, 2, 3, 3,
559 1, 2, 3, 3, 1, 3, 3, 3, 3, 3,
560 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
561 1, 3, 1, 3, 2, 1, 1, 1, 1, 1,
562 3, 5, 1, 3, 1, 1, 1, 3, 2, 1,
566 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
567 Performed when YYTABLE doesn't specify something else to do. Zero
568 means the default is an error. */
569 static const yytype_uint8 yydefact[] =
571 0, 0, 0, 4, 0, 5, 6, 14, 42, 0,
572 51, 0, 0, 0, 0, 0, 2, 10, 44, 0,
573 45, 46, 36, 37, 3, 35, 38, 39, 1, 0,
574 11, 48, 0, 0, 7, 0, 0, 0, 0, 0,
575 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
576 0, 0, 0, 0, 0, 34, 0, 32, 47, 40,
577 0, 13, 8, 9, 12, 15, 16, 17, 18, 19,
578 20, 49, 50, 28, 29, 0, 0, 27, 30, 21,
579 22, 23, 24, 25, 26, 43, 54, 0, 53, 0,
580 0, 0, 32, 33, 41, 0, 31, 52
583 /* YYDEFGOTO[NTERM-NUM]. */
584 static const yytype_int8 yydefgoto[] =
586 -1, 4, 16, 17, 77, 56, 24, 25, 18, 19,
590 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
592 #define YYPACT_NINF -41
593 static const yytype_int8 yypact[] =
595 22, 48, 60, -41, 16, -41, -41, -41, -41, -24,
596 -41, 102, 8, 32, 48, 48, -23, -41, -41, 74,
597 -41, -41, -41, -41, 50, -41, -41, -41, -41, 102,
598 -3, -41, 116, 23, -41, 87, 48, 48, 102, 102,
599 102, 102, 102, 102, 102, 68, 68, -6, 102, 102,
600 102, 102, 102, 102, 102, -41, -40, -28, -41, -41,
601 60, -41, -23, 28, -3, -3, -3, -3, -3, -3,
602 -3, -41, -41, -41, -41, 30, 102, -41, -41, -3,
603 -3, -3, -3, -3, -3, -3, -41, 102, -41, 103,
604 102, 36, -3, -3, -41, -26, -41, -41
607 /* YYPGOTO[NTERM-NUM]. */
608 static const yytype_int8 yypgoto[] =
610 -41, -41, 39, -41, -41, 1, -10, -20, -2, -5,
614 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
615 positive, shift that token. If negative, reduce the rule which
616 number is the opposite. If YYTABLE_NINF, syntax error. */
617 #define YYTABLE_NINF -1
618 static const yytype_uint8 yytable[] =
620 26, 27, 32, 75, 55, 86, 30, 54, 87, 54,
621 26, 27, 55, 36, 37, 22, 28, 88, 23, 97,
622 29, 10, 26, 27, 57, 31, 13, 1, 2, 3,
623 26, 27, 54, 64, 65, 66, 67, 68, 69, 70,
624 76, 33, 59, 79, 80, 81, 82, 83, 84, 85,
625 89, 5, 6, 34, 35, 7, 8, 9, 26, 27,
626 23, 10, 11, 10, 12, 37, 13, 22, 13, 55,
627 23, 92, 60, 10, 90, 62, 63, 91, 13, 71,
628 72, 74, 93, 96, 87, 95, 14, 26, 27, 38,
629 0, 0, 15, 0, 39, 40, 41, 42, 43, 44,
630 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
631 8, 9, 0, 23, 0, 10, 10, 0, 12, 0,
632 13, 13, 94, 36, 37, 0, 23, 0, 0, 10,
636 #define yypact_value_is_default(yystate) \
639 #define yytable_value_is_error(yytable_value) \
642 static const yytype_int8 yycheck[] =
644 2, 2, 12, 9, 24, 45, 11, 35, 48, 35,
645 12, 12, 32, 36, 37, 7, 0, 45, 10, 45,
646 44, 13, 24, 24, 29, 17, 18, 5, 6, 7,
647 32, 32, 35, 38, 39, 40, 41, 42, 43, 44,
648 46, 9, 19, 48, 49, 50, 51, 52, 53, 54,
649 60, 3, 4, 14, 15, 7, 8, 9, 60, 60,
650 10, 13, 14, 13, 16, 37, 18, 7, 18, 89,
651 10, 76, 49, 13, 44, 36, 37, 76, 18, 11,
652 12, 46, 87, 47, 48, 90, 38, 89, 89, 15,
653 -1, -1, 44, -1, 20, 21, 22, 23, 24, 25,
654 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
655 8, 9, -1, 10, -1, 13, 13, -1, 16, -1,
656 18, 18, 19, 36, 37, -1, 10, -1, -1, 13,
660 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
661 symbol of state STATE-NUM. */
662 static const yytype_uint8 yystos[] =
664 0, 5, 6, 7, 51, 3, 4, 7, 8, 9,
665 13, 14, 16, 18, 38, 44, 52, 53, 58, 59,
666 61, 63, 7, 10, 56, 57, 58, 61, 0, 44,
667 59, 17, 56, 9, 52, 52, 36, 37, 15, 20,
668 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
669 31, 32, 33, 34, 35, 57, 55, 59, 17, 19,
670 49, 45, 52, 52, 59, 59, 59, 59, 59, 59,
671 59, 11, 12, 60, 60, 9, 46, 54, 62, 59,
672 59, 59, 59, 59, 59, 59, 45, 48, 45, 56,
673 44, 55, 59, 59, 19, 59, 47, 45
676 #define yyerrok (yyerrstatus = 0)
677 #define yyclearin (yychar = YYEMPTY)
681 #define YYACCEPT goto yyacceptlab
682 #define YYABORT goto yyabortlab
683 #define YYERROR goto yyerrorlab
686 /* Like YYERROR except do call yyerror. This remains here temporarily
687 to ease the transition to the new meaning of YYERROR, for GCC.
688 Once GCC version 2 has supplanted version 1, this can go. However,
689 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
690 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
693 #define YYFAIL goto yyerrlab
695 /* This is here to suppress warnings from the GCC cpp's
696 -Wunused-macros. Normally we don't worry about that warning, but
697 some users do, and we want to make it easy for users to remove
698 YYFAIL uses, which will produce warnings from Bison 2.5. */
701 #define YYRECOVERING() (!!yyerrstatus)
703 #define YYBACKUP(Token, Value) \
705 if (yychar == YYEMPTY && yylen == 1) \
714 yyerror (ctx, YY_("syntax error: cannot back up")); \
721 #define YYERRCODE 256
724 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
725 If N is 0, then set CURRENT to the empty location which ends
726 the previous symbol: RHS[0] (always defined). */
728 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
729 #ifndef YYLLOC_DEFAULT
730 # define YYLLOC_DEFAULT(Current, Rhs, N) \
734 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
735 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
736 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
737 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
741 (Current).first_line = (Current).last_line = \
742 YYRHSLOC (Rhs, 0).last_line; \
743 (Current).first_column = (Current).last_column = \
744 YYRHSLOC (Rhs, 0).last_column; \
750 /* This macro is provided for backward compatibility. */
752 #ifndef YY_LOCATION_PRINT
753 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
757 /* YYLEX -- calling `yylex' with the right arguments. */
760 # define YYLEX yylex (&yylval, YYLEX_PARAM)
762 # define YYLEX yylex (&yylval, yyscanner)
765 /* Enable debugging if requested. */
769 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
770 # define YYFPRINTF fprintf
773 # define YYDPRINTF(Args) \
779 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
783 YYFPRINTF (stderr, "%s ", Title); \
784 yy_symbol_print (stderr, \
786 YYFPRINTF (stderr, "\n"); \
791 /*--------------------------------.
792 | Print this symbol on YYOUTPUT. |
793 `--------------------------------*/
796 #if (defined __STDC__ || defined __C99__FUNC__ \
797 || defined __cplusplus || defined _MSC_VER)
799 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, ap_expr_parse_ctx_t *ctx)
802 yy_symbol_value_print (yyoutput, yytype, yyvaluep, ctx)
805 YYSTYPE const * const yyvaluep;
806 ap_expr_parse_ctx_t *ctx;
813 if (yytype < YYNTOKENS)
814 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
826 /*--------------------------------.
827 | Print this symbol on YYOUTPUT. |
828 `--------------------------------*/
830 #if (defined __STDC__ || defined __C99__FUNC__ \
831 || defined __cplusplus || defined _MSC_VER)
833 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, ap_expr_parse_ctx_t *ctx)
836 yy_symbol_print (yyoutput, yytype, yyvaluep, ctx)
839 YYSTYPE const * const yyvaluep;
840 ap_expr_parse_ctx_t *ctx;
843 if (yytype < YYNTOKENS)
844 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
846 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
848 yy_symbol_value_print (yyoutput, yytype, yyvaluep, ctx);
849 YYFPRINTF (yyoutput, ")");
852 /*------------------------------------------------------------------.
853 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
855 `------------------------------------------------------------------*/
857 #if (defined __STDC__ || defined __C99__FUNC__ \
858 || defined __cplusplus || defined _MSC_VER)
860 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
863 yy_stack_print (yybottom, yytop)
864 yytype_int16 *yybottom;
868 YYFPRINTF (stderr, "Stack now");
869 for (; yybottom <= yytop; yybottom++)
871 int yybot = *yybottom;
872 YYFPRINTF (stderr, " %d", yybot);
874 YYFPRINTF (stderr, "\n");
877 # define YY_STACK_PRINT(Bottom, Top) \
880 yy_stack_print ((Bottom), (Top)); \
884 /*------------------------------------------------.
885 | Report that the YYRULE is going to be reduced. |
886 `------------------------------------------------*/
888 #if (defined __STDC__ || defined __C99__FUNC__ \
889 || defined __cplusplus || defined _MSC_VER)
891 yy_reduce_print (YYSTYPE *yyvsp, int yyrule, ap_expr_parse_ctx_t *ctx)
894 yy_reduce_print (yyvsp, yyrule, ctx)
897 ap_expr_parse_ctx_t *ctx;
900 int yynrhs = yyr2[yyrule];
902 unsigned long int yylno = yyrline[yyrule];
903 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
905 /* The symbols being reduced. */
906 for (yyi = 0; yyi < yynrhs; yyi++)
908 YYFPRINTF (stderr, " $%d = ", yyi + 1);
909 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
910 &(yyvsp[(yyi + 1) - (yynrhs)])
912 YYFPRINTF (stderr, "\n");
916 # define YY_REDUCE_PRINT(Rule) \
919 yy_reduce_print (yyvsp, Rule, ctx); \
922 /* Nonzero means print parse trace. It is left uninitialized so that
923 multiple parsers can coexist. */
926 # define YYDPRINTF(Args)
927 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
928 # define YY_STACK_PRINT(Bottom, Top)
929 # define YY_REDUCE_PRINT(Rule)
930 #endif /* !YYDEBUG */
933 /* YYINITDEPTH -- initial size of the parser's stacks. */
935 # define YYINITDEPTH 200
938 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
939 if the built-in stack extension method is used).
941 Do not make this value too large; the results are undefined if
942 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
943 evaluated with infinite-precision integer arithmetic. */
946 # define YYMAXDEPTH 10000
953 # if defined __GLIBC__ && defined _STRING_H
954 # define yystrlen strlen
956 /* Return the length of YYSTR. */
957 #if (defined __STDC__ || defined __C99__FUNC__ \
958 || defined __cplusplus || defined _MSC_VER)
960 yystrlen (const char *yystr)
968 for (yylen = 0; yystr[yylen]; yylen++)
976 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
977 # define yystpcpy stpcpy
979 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
981 #if (defined __STDC__ || defined __C99__FUNC__ \
982 || defined __cplusplus || defined _MSC_VER)
984 yystpcpy (char *yydest, const char *yysrc)
987 yystpcpy (yydest, yysrc)
993 const char *yys = yysrc;
995 while ((*yyd++ = *yys++) != '\0')
1004 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1005 quotes and backslashes, so that it's suitable for yyerror. The
1006 heuristic is that double-quoting is unnecessary unless the string
1007 contains an apostrophe, a comma, or backslash (other than
1008 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1009 null, do not copy; instead, return the length of what the result
1012 yytnamerr (char *yyres, const char *yystr)
1017 char const *yyp = yystr;
1024 goto do_not_strip_quotes;
1028 goto do_not_strip_quotes;
1041 do_not_strip_quotes: ;
1045 return yystrlen (yystr);
1047 return yystpcpy (yyres, yystr) - yyres;
1051 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1052 about the unexpected token YYTOKEN for the state stack whose top is
1055 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1056 not large enough to hold the message. In that case, also set
1057 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1058 required number of bytes is too large to store. */
1060 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1061 yytype_int16 *yyssp, int yytoken)
1063 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
1064 YYSIZE_T yysize = yysize0;
1066 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1067 /* Internationalized format string. */
1068 const char *yyformat = 0;
1069 /* Arguments of yyformat. */
1070 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1071 /* Number of reported tokens (one for the "unexpected", one per
1075 /* There are many possibilities here to consider:
1076 - Assume YYFAIL is not used. It's too flawed to consider. See
1077 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1078 for details. YYERROR is fine as it does not invoke this
1080 - If this state is a consistent state with a default action, then
1081 the only way this function was invoked is if the default action
1082 is an error action. In that case, don't check for expected
1083 tokens because there are none.
1084 - The only way there can be no lookahead present (in yychar) is if
1085 this state is a consistent state with a default action. Thus,
1086 detecting the absence of a lookahead is sufficient to determine
1087 that there is no unexpected or expected token to report. In that
1088 case, just report a simple "syntax error".
1089 - Don't assume there isn't a lookahead just because this state is a
1090 consistent state with a default action. There might have been a
1091 previous inconsistent state, consistent state with a non-default
1092 action, or user semantic action that manipulated yychar.
1093 - Of course, the expected token list depends on states to have
1094 correct lookahead information, and it depends on the parser not
1095 to perform extra reductions after fetching a lookahead from the
1096 scanner and before detecting a syntax error. Thus, state merging
1097 (from LALR or IELR) and default reductions corrupt the expected
1098 token list. However, the list is correct for canonical LR with
1099 one exception: it will still contain any token that will not be
1100 accepted due to an error action in a later state.
1102 if (yytoken != YYEMPTY)
1104 int yyn = yypact[*yyssp];
1105 yyarg[yycount++] = yytname[yytoken];
1106 if (!yypact_value_is_default (yyn))
1108 /* Start YYX at -YYN if negative to avoid negative indexes in
1109 YYCHECK. In other words, skip the first -YYN actions for
1110 this state because they are default actions. */
1111 int yyxbegin = yyn < 0 ? -yyn : 0;
1112 /* Stay within bounds of both yycheck and yytname. */
1113 int yychecklim = YYLAST - yyn + 1;
1114 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1117 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1118 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1119 && !yytable_value_is_error (yytable[yyx + yyn]))
1121 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1127 yyarg[yycount++] = yytname[yyx];
1128 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1129 if (! (yysize <= yysize1
1130 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1139 # define YYCASE_(N, S) \
1143 YYCASE_(0, YY_("syntax error"));
1144 YYCASE_(1, YY_("syntax error, unexpected %s"));
1145 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1146 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1147 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1148 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1152 yysize1 = yysize + yystrlen (yyformat);
1153 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1157 if (*yymsg_alloc < yysize)
1159 *yymsg_alloc = 2 * yysize;
1160 if (! (yysize <= *yymsg_alloc
1161 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1162 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1166 /* Avoid sprintf, as that infringes on the user's name space.
1167 Don't have undefined behavior even if the translation
1168 produced a string with the wrong number of "%s"s. */
1172 while ((*yyp = *yyformat) != '\0')
1173 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1175 yyp += yytnamerr (yyp, yyarg[yyi++]);
1186 #endif /* YYERROR_VERBOSE */
1188 /*-----------------------------------------------.
1189 | Release the memory associated to this symbol. |
1190 `-----------------------------------------------*/
1193 #if (defined __STDC__ || defined __C99__FUNC__ \
1194 || defined __cplusplus || defined _MSC_VER)
1196 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, ap_expr_parse_ctx_t *ctx)
1199 yydestruct (yymsg, yytype, yyvaluep, ctx)
1203 ap_expr_parse_ctx_t *ctx;
1211 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1222 /* Prevent warnings from -Wmissing-prototypes. */
1223 #ifdef YYPARSE_PARAM
1224 #if defined __STDC__ || defined __cplusplus
1225 int yyparse (void *YYPARSE_PARAM);
1229 #else /* ! YYPARSE_PARAM */
1230 #if defined __STDC__ || defined __cplusplus
1231 int yyparse (ap_expr_parse_ctx_t *ctx);
1235 #endif /* ! YYPARSE_PARAM */
1242 #ifdef YYPARSE_PARAM
1243 #if (defined __STDC__ || defined __C99__FUNC__ \
1244 || defined __cplusplus || defined _MSC_VER)
1246 yyparse (void *YYPARSE_PARAM)
1249 yyparse (YYPARSE_PARAM)
1250 void *YYPARSE_PARAM;
1252 #else /* ! YYPARSE_PARAM */
1253 #if (defined __STDC__ || defined __C99__FUNC__ \
1254 || defined __cplusplus || defined _MSC_VER)
1256 yyparse (ap_expr_parse_ctx_t *ctx)
1260 ap_expr_parse_ctx_t *ctx;
1264 /* The lookahead symbol. */
1267 /* The semantic value of the lookahead symbol. */
1270 /* Number of syntax errors so far. */
1274 /* Number of tokens to shift before error messages enabled. */
1277 /* The stacks and their tools:
1278 `yyss': related to states.
1279 `yyvs': related to semantic values.
1281 Refer to the stacks thru separate pointers, to allow yyoverflow
1282 to reallocate them elsewhere. */
1284 /* The state stack. */
1285 yytype_int16 yyssa[YYINITDEPTH];
1287 yytype_int16 *yyssp;
1289 /* The semantic value stack. */
1290 YYSTYPE yyvsa[YYINITDEPTH];
1294 YYSIZE_T yystacksize;
1298 /* Lookahead token as an internal (translated) token number. */
1300 /* The variables used to return semantic value and location from the
1305 /* Buffer for error messages, and its allocated size. */
1307 char *yymsg = yymsgbuf;
1308 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1311 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1313 /* The number of symbols on the RHS of the reduced rule.
1314 Keep to zero when no symbol should be popped. */
1320 yystacksize = YYINITDEPTH;
1322 YYDPRINTF ((stderr, "Starting parse\n"));
1327 yychar = YYEMPTY; /* Cause a token to be read. */
1329 /* Initialize stack pointers.
1330 Waste one element of value and location stack
1331 so that they stay on the same level as the state stack.
1332 The wasted elements are never initialized. */
1338 /*------------------------------------------------------------.
1339 | yynewstate -- Push a new state, which is found in yystate. |
1340 `------------------------------------------------------------*/
1342 /* In all cases, when you get here, the value and location stacks
1343 have just been pushed. So pushing a state here evens the stacks. */
1349 if (yyss + yystacksize - 1 <= yyssp)
1351 /* Get the current used size of the three stacks, in elements. */
1352 YYSIZE_T yysize = yyssp - yyss + 1;
1356 /* Give user a chance to reallocate the stack. Use copies of
1357 these so that the &'s don't force the real ones into
1359 YYSTYPE *yyvs1 = yyvs;
1360 yytype_int16 *yyss1 = yyss;
1362 /* Each stack pointer address is followed by the size of the
1363 data in use in that stack, in bytes. This used to be a
1364 conditional around just the two extra args, but that might
1365 be undefined if yyoverflow is a macro. */
1366 yyoverflow (YY_("memory exhausted"),
1367 &yyss1, yysize * sizeof (*yyssp),
1368 &yyvs1, yysize * sizeof (*yyvsp),
1374 #else /* no yyoverflow */
1375 # ifndef YYSTACK_RELOCATE
1376 goto yyexhaustedlab;
1378 /* Extend the stack our own way. */
1379 if (YYMAXDEPTH <= yystacksize)
1380 goto yyexhaustedlab;
1382 if (YYMAXDEPTH < yystacksize)
1383 yystacksize = YYMAXDEPTH;
1386 yytype_int16 *yyss1 = yyss;
1387 union yyalloc *yyptr =
1388 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1390 goto yyexhaustedlab;
1391 YYSTACK_RELOCATE (yyss_alloc, yyss);
1392 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1393 # undef YYSTACK_RELOCATE
1395 YYSTACK_FREE (yyss1);
1398 #endif /* no yyoverflow */
1400 yyssp = yyss + yysize - 1;
1401 yyvsp = yyvs + yysize - 1;
1403 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1404 (unsigned long int) yystacksize));
1406 if (yyss + yystacksize - 1 <= yyssp)
1410 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1412 if (yystate == YYFINAL)
1422 /* Do appropriate processing given the current state. Read a
1423 lookahead token if we need one and don't already have one. */
1425 /* First try to decide what to do without reference to lookahead token. */
1426 yyn = yypact[yystate];
1427 if (yypact_value_is_default (yyn))
1430 /* Not known => get a lookahead token if don't already have one. */
1432 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1433 if (yychar == YYEMPTY)
1435 YYDPRINTF ((stderr, "Reading a token: "));
1439 if (yychar <= YYEOF)
1441 yychar = yytoken = YYEOF;
1442 YYDPRINTF ((stderr, "Now at end of input.\n"));
1446 yytoken = YYTRANSLATE (yychar);
1447 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1450 /* If the proper action on seeing token YYTOKEN is to reduce or to
1451 detect an error, take that action. */
1453 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1458 if (yytable_value_is_error (yyn))
1464 /* Count tokens shifted since error; after three, turn off error
1469 /* Shift the lookahead token. */
1470 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1472 /* Discard the shifted token. */
1481 /*-----------------------------------------------------------.
1482 | yydefault -- do the default action for the current state. |
1483 `-----------------------------------------------------------*/
1485 yyn = yydefact[yystate];
1491 /*-----------------------------.
1492 | yyreduce -- Do a reduction. |
1493 `-----------------------------*/
1495 /* yyn is the number of a rule to reduce with. */
1498 /* If YYLEN is nonzero, implement the default value of the action:
1501 Otherwise, the following line sets YYVAL to garbage.
1502 This behavior is undocumented and Bison
1503 users should not rely upon it. Assigning to YYVAL
1504 unconditionally makes the parser a bit smaller, and it avoids a
1505 GCC warning that YYVAL may be used uninitialized. */
1506 yyval = yyvsp[1-yylen];
1509 YY_REDUCE_PRINT (yyn);
1514 /* Line 1806 of yacc.c */
1515 #line 112 "util_expr_parse.y"
1516 { ctx->expr = (yyvsp[(2) - (2)].exVal); }
1521 /* Line 1806 of yacc.c */
1522 #line 113 "util_expr_parse.y"
1523 { ctx->expr = (yyvsp[(2) - (2)].exVal); }
1528 /* Line 1806 of yacc.c */
1529 #line 114 "util_expr_parse.y"
1535 /* Line 1806 of yacc.c */
1536 #line 117 "util_expr_parse.y"
1537 { (yyval.exVal) = ap_expr_make(op_True, NULL, NULL, ctx); }
1542 /* Line 1806 of yacc.c */
1543 #line 118 "util_expr_parse.y"
1544 { (yyval.exVal) = ap_expr_make(op_False, NULL, NULL, ctx); }
1549 /* Line 1806 of yacc.c */
1550 #line 119 "util_expr_parse.y"
1551 { (yyval.exVal) = ap_expr_make(op_Not, (yyvsp[(2) - (2)].exVal), NULL, ctx); }
1556 /* Line 1806 of yacc.c */
1557 #line 120 "util_expr_parse.y"
1558 { (yyval.exVal) = ap_expr_make(op_Or, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1563 /* Line 1806 of yacc.c */
1564 #line 121 "util_expr_parse.y"
1565 { (yyval.exVal) = ap_expr_make(op_And, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1570 /* Line 1806 of yacc.c */
1571 #line 122 "util_expr_parse.y"
1572 { (yyval.exVal) = ap_expr_make(op_Comp, (yyvsp[(1) - (1)].exVal), NULL, ctx); }
1577 /* Line 1806 of yacc.c */
1578 #line 123 "util_expr_parse.y"
1579 { (yyval.exVal) = ap_expr_unary_op_make( (yyvsp[(1) - (2)].cpVal), (yyvsp[(2) - (2)].exVal), ctx); }
1584 /* Line 1806 of yacc.c */
1585 #line 124 "util_expr_parse.y"
1586 { (yyval.exVal) = ap_expr_binary_op_make((yyvsp[(2) - (3)].cpVal), (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1591 /* Line 1806 of yacc.c */
1592 #line 125 "util_expr_parse.y"
1593 { (yyval.exVal) = (yyvsp[(2) - (3)].exVal); }
1598 /* Line 1806 of yacc.c */
1599 #line 126 "util_expr_parse.y"
1605 /* Line 1806 of yacc.c */
1606 #line 129 "util_expr_parse.y"
1607 { (yyval.exVal) = ap_expr_make(op_EQ, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1612 /* Line 1806 of yacc.c */
1613 #line 130 "util_expr_parse.y"
1614 { (yyval.exVal) = ap_expr_make(op_NE, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1619 /* Line 1806 of yacc.c */
1620 #line 131 "util_expr_parse.y"
1621 { (yyval.exVal) = ap_expr_make(op_LT, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1626 /* Line 1806 of yacc.c */
1627 #line 132 "util_expr_parse.y"
1628 { (yyval.exVal) = ap_expr_make(op_LE, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1633 /* Line 1806 of yacc.c */
1634 #line 133 "util_expr_parse.y"
1635 { (yyval.exVal) = ap_expr_make(op_GT, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1640 /* Line 1806 of yacc.c */
1641 #line 134 "util_expr_parse.y"
1642 { (yyval.exVal) = ap_expr_make(op_GE, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1647 /* Line 1806 of yacc.c */
1648 #line 135 "util_expr_parse.y"
1649 { (yyval.exVal) = ap_expr_make(op_STR_EQ, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1654 /* Line 1806 of yacc.c */
1655 #line 136 "util_expr_parse.y"
1656 { (yyval.exVal) = ap_expr_make(op_STR_NE, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1661 /* Line 1806 of yacc.c */
1662 #line 137 "util_expr_parse.y"
1663 { (yyval.exVal) = ap_expr_make(op_STR_LT, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1668 /* Line 1806 of yacc.c */
1669 #line 138 "util_expr_parse.y"
1670 { (yyval.exVal) = ap_expr_make(op_STR_LE, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1675 /* Line 1806 of yacc.c */
1676 #line 139 "util_expr_parse.y"
1677 { (yyval.exVal) = ap_expr_make(op_STR_GT, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1682 /* Line 1806 of yacc.c */
1683 #line 140 "util_expr_parse.y"
1684 { (yyval.exVal) = ap_expr_make(op_STR_GE, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1689 /* Line 1806 of yacc.c */
1690 #line 141 "util_expr_parse.y"
1691 { (yyval.exVal) = ap_expr_make(op_IN, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1696 /* Line 1806 of yacc.c */
1697 #line 142 "util_expr_parse.y"
1698 { (yyval.exVal) = ap_expr_make(op_REG, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1703 /* Line 1806 of yacc.c */
1704 #line 143 "util_expr_parse.y"
1705 { (yyval.exVal) = ap_expr_make(op_NRE, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1710 /* Line 1806 of yacc.c */
1711 #line 146 "util_expr_parse.y"
1712 { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1717 /* Line 1806 of yacc.c */
1718 #line 147 "util_expr_parse.y"
1719 { (yyval.exVal) = (yyvsp[(2) - (3)].exVal); }
1724 /* Line 1806 of yacc.c */
1725 #line 150 "util_expr_parse.y"
1726 { (yyval.exVal) = ap_expr_make(op_ListElement, (yyvsp[(1) - (1)].exVal), NULL, ctx); }
1731 /* Line 1806 of yacc.c */
1732 #line 151 "util_expr_parse.y"
1733 { (yyval.exVal) = ap_expr_make(op_ListElement, (yyvsp[(3) - (3)].exVal), (yyvsp[(1) - (3)].exVal), ctx); }
1738 /* Line 1806 of yacc.c */
1739 #line 154 "util_expr_parse.y"
1740 { (yyval.exVal) = ap_expr_make(op_Concat, (yyvsp[(1) - (2)].exVal), (yyvsp[(2) - (2)].exVal), ctx); }
1745 /* Line 1806 of yacc.c */
1746 #line 155 "util_expr_parse.y"
1747 { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1752 /* Line 1806 of yacc.c */
1753 #line 156 "util_expr_parse.y"
1759 /* Line 1806 of yacc.c */
1760 #line 159 "util_expr_parse.y"
1761 { (yyval.exVal) = ap_expr_make(op_String, (yyvsp[(1) - (1)].cpVal), NULL, ctx); }
1766 /* Line 1806 of yacc.c */
1767 #line 160 "util_expr_parse.y"
1768 { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1773 /* Line 1806 of yacc.c */
1774 #line 161 "util_expr_parse.y"
1775 { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1780 /* Line 1806 of yacc.c */
1781 #line 164 "util_expr_parse.y"
1782 { (yyval.exVal) = ap_expr_var_make((yyvsp[(2) - (3)].cpVal), ctx); }
1787 /* Line 1806 of yacc.c */
1788 #line 165 "util_expr_parse.y"
1789 { (yyval.exVal) = ap_expr_str_func_make((yyvsp[(2) - (5)].cpVal), (yyvsp[(4) - (5)].exVal), ctx); }
1794 /* Line 1806 of yacc.c */
1795 #line 168 "util_expr_parse.y"
1796 { (yyval.exVal) = ap_expr_make(op_Digit, (yyvsp[(1) - (1)].cpVal), NULL, ctx); }
1801 /* Line 1806 of yacc.c */
1802 #line 169 "util_expr_parse.y"
1803 { (yyval.exVal) = ap_expr_make(op_Concat, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1808 /* Line 1806 of yacc.c */
1809 #line 170 "util_expr_parse.y"
1810 { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1815 /* Line 1806 of yacc.c */
1816 #line 171 "util_expr_parse.y"
1817 { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1822 /* Line 1806 of yacc.c */
1823 #line 172 "util_expr_parse.y"
1824 { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1829 /* Line 1806 of yacc.c */
1830 #line 173 "util_expr_parse.y"
1831 { (yyval.exVal) = (yyvsp[(2) - (3)].exVal); }
1836 /* Line 1806 of yacc.c */
1837 #line 174 "util_expr_parse.y"
1838 { (yyval.exVal) = ap_expr_make(op_String, "", NULL, ctx); }
1843 /* Line 1806 of yacc.c */
1844 #line 177 "util_expr_parse.y"
1847 if ((regex = ap_pregcomp(ctx->pool, (yyvsp[(1) - (1)].cpVal),
1848 AP_REG_EXTENDED|AP_REG_NOSUB)) == NULL) {
1849 ctx->error = "Failed to compile regular expression";
1852 (yyval.exVal) = ap_expr_make(op_Regex, regex, NULL, ctx);
1858 /* Line 1806 of yacc.c */
1859 #line 186 "util_expr_parse.y"
1862 if ((regex = ap_pregcomp(ctx->pool, (yyvsp[(1) - (1)].cpVal),
1863 AP_REG_EXTENDED|AP_REG_NOSUB|AP_REG_ICASE)) == NULL) {
1864 ctx->error = "Failed to compile regular expression";
1867 (yyval.exVal) = ap_expr_make(op_Regex, regex, NULL, ctx);
1873 /* Line 1806 of yacc.c */
1874 #line 197 "util_expr_parse.y"
1876 int *n = apr_palloc(ctx->pool, sizeof(int));
1877 *n = (yyvsp[(1) - (1)].num);
1878 (yyval.exVal) = ap_expr_make(op_RegexBackref, n, NULL, ctx);
1884 /* Line 1806 of yacc.c */
1885 #line 204 "util_expr_parse.y"
1886 { (yyval.exVal) = ap_expr_list_func_make((yyvsp[(1) - (4)].cpVal), (yyvsp[(3) - (4)].exVal), ctx); }
1891 /* Line 1806 of yacc.c */
1892 #line 207 "util_expr_parse.y"
1893 { (yyval.exVal) = ap_expr_str_func_make((yyvsp[(1) - (4)].cpVal), (yyvsp[(3) - (4)].exVal), ctx); }
1898 /* Line 1806 of yacc.c */
1899 #line 208 "util_expr_parse.y"
1900 { (yyval.exVal) = ap_expr_str_func_make((yyvsp[(1) - (4)].cpVal), (yyvsp[(3) - (4)].exVal), ctx); }
1905 /* Line 1806 of yacc.c */
1906 #line 1907 "util_expr_parse.c"
1909 /* User semantic actions sometimes alter yychar, and that requires
1910 that yytoken be updated with the new translation. We take the
1911 approach of translating immediately before every use of yytoken.
1912 One alternative is translating here after every semantic action,
1913 but that translation would be missed if the semantic action invokes
1914 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1915 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1916 incorrect destructor might then be invoked immediately. In the
1917 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1918 to an incorrect destructor call or verbose syntax error message
1919 before the lookahead is translated. */
1920 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1924 YY_STACK_PRINT (yyss, yyssp);
1928 /* Now `shift' the result of the reduction. Determine what state
1929 that goes to, based on the state we popped back to and the rule
1930 number reduced by. */
1934 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1935 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1936 yystate = yytable[yystate];
1938 yystate = yydefgoto[yyn - YYNTOKENS];
1943 /*------------------------------------.
1944 | yyerrlab -- here on detecting error |
1945 `------------------------------------*/
1947 /* Make sure we have latest lookahead translation. See comments at
1948 user semantic actions for why this is necessary. */
1949 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1951 /* If not already recovering from an error, report this error. */
1955 #if ! YYERROR_VERBOSE
1956 yyerror (ctx, YY_("syntax error"));
1958 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1961 char const *yymsgp = YY_("syntax error");
1962 int yysyntax_error_status;
1963 yysyntax_error_status = YYSYNTAX_ERROR;
1964 if (yysyntax_error_status == 0)
1966 else if (yysyntax_error_status == 1)
1968 if (yymsg != yymsgbuf)
1969 YYSTACK_FREE (yymsg);
1970 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1974 yymsg_alloc = sizeof yymsgbuf;
1975 yysyntax_error_status = 2;
1979 yysyntax_error_status = YYSYNTAX_ERROR;
1983 yyerror (ctx, yymsgp);
1984 if (yysyntax_error_status == 2)
1985 goto yyexhaustedlab;
1987 # undef YYSYNTAX_ERROR
1993 if (yyerrstatus == 3)
1995 /* If just tried and failed to reuse lookahead token after an
1996 error, discard it. */
1998 if (yychar <= YYEOF)
2000 /* Return failure if at end of input. */
2001 if (yychar == YYEOF)
2006 yydestruct ("Error: discarding",
2007 yytoken, &yylval, ctx);
2012 /* Else will try to reuse lookahead token after shifting the error
2017 /*---------------------------------------------------.
2018 | yyerrorlab -- error raised explicitly by YYERROR. |
2019 `---------------------------------------------------*/
2022 /* Pacify compilers like GCC when the user code never invokes
2023 YYERROR and the label yyerrorlab therefore never appears in user
2025 if (/*CONSTCOND*/ 0)
2028 /* Do not reclaim the symbols of the rule which action triggered
2032 YY_STACK_PRINT (yyss, yyssp);
2037 /*-------------------------------------------------------------.
2038 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2039 `-------------------------------------------------------------*/
2041 yyerrstatus = 3; /* Each real token shifted decrements this. */
2045 yyn = yypact[yystate];
2046 if (!yypact_value_is_default (yyn))
2049 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2057 /* Pop the current state because it cannot handle the error token. */
2062 yydestruct ("Error: popping",
2063 yystos[yystate], yyvsp, ctx);
2066 YY_STACK_PRINT (yyss, yyssp);
2072 /* Shift the error token. */
2073 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2079 /*-------------------------------------.
2080 | yyacceptlab -- YYACCEPT comes here. |
2081 `-------------------------------------*/
2086 /*-----------------------------------.
2087 | yyabortlab -- YYABORT comes here. |
2088 `-----------------------------------*/
2093 #if !defined(yyoverflow) || YYERROR_VERBOSE
2094 /*-------------------------------------------------.
2095 | yyexhaustedlab -- memory exhaustion comes here. |
2096 `-------------------------------------------------*/
2098 yyerror (ctx, YY_("memory exhausted"));
2104 if (yychar != YYEMPTY)
2106 /* Make sure we have latest lookahead translation. See comments at
2107 user semantic actions for why this is necessary. */
2108 yytoken = YYTRANSLATE (yychar);
2109 yydestruct ("Cleanup: discarding lookahead",
2110 yytoken, &yylval, ctx);
2112 /* Do not reclaim the symbols of the rule which action triggered
2113 this YYABORT or YYACCEPT. */
2115 YY_STACK_PRINT (yyss, yyssp);
2116 while (yyssp != yyss)
2118 yydestruct ("Cleanup: popping",
2119 yystos[*yyssp], yyvsp, ctx);
2124 YYSTACK_FREE (yyss);
2127 if (yymsg != yymsgbuf)
2128 YYSTACK_FREE (yymsg);
2130 /* Make sure YYID is used. */
2131 return YYID (yyresult);
2136 /* Line 2067 of yacc.c */
2137 #line 211 "util_expr_parse.y"
2140 void yyerror(ap_expr_parse_ctx_t *ctx, const char *s)
2142 /* s is allocated on the stack */
2143 ctx->error = apr_pstrdup(ctx->ptemp, s);