]> granicus.if.org Git - apache/blob - server/util_expr_parse.c
Remove APLOG_NOERRNO.
[apache] / server / util_expr_parse.c
1 /* A Bison parser, made by GNU Bison 2.7.12-4996.  */
2
3 /* Bison implementation for Yacc-like parsers in C
4    
5       Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
6    
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.
11    
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.
16    
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/>.  */
19
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.
29    
30    This special exception was added by the Free Software Foundation in
31    version 2.2 of Bison.  */
32
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34    simplifying the original so-called "semantic" parser.  */
35
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.  */
42
43 /* Identify Bison output.  */
44 #define YYBISON 1
45
46 /* Bison version.  */
47 #define YYBISON_VERSION "2.7.12-4996"
48
49 /* Skeleton name.  */
50 #define YYSKELETON_NAME "yacc.c"
51
52 /* Pure parsers.  */
53 #define YYPURE 1
54
55 /* Push parsers.  */
56 #define YYPUSH 0
57
58 /* Pull parsers.  */
59 #define YYPULL 1
60
61
62 /* Substitute the variable and function names.  */
63 #define yyparse         ap_expr_yyparse
64 #define yylex           ap_expr_yylex
65 #define yyerror         ap_expr_yyerror
66 #define yylval          ap_expr_yylval
67 #define yychar          ap_expr_yychar
68 #define yydebug         ap_expr_yydebug
69 #define yynerrs         ap_expr_yynerrs
70
71 /* Copy the first part of user declarations.  */
72 /* Line 371 of yacc.c  */
73 #line 31 "util_expr_parse.y"
74
75 #include "util_expr_private.h"
76
77 /* Line 371 of yacc.c  */
78 #line 79 "util_expr_parse.c"
79
80 # ifndef YY_NULL
81 #  if defined __cplusplus && 201103L <= __cplusplus
82 #   define YY_NULL nullptr
83 #  else
84 #   define YY_NULL 0
85 #  endif
86 # endif
87
88 /* Enabling verbose error messages.  */
89 #ifdef YYERROR_VERBOSE
90 # undef YYERROR_VERBOSE
91 # define YYERROR_VERBOSE 1
92 #else
93 # define YYERROR_VERBOSE 1
94 #endif
95
96 /* In a future release of Bison, this section will be replaced
97    by #include "util_expr_parse.h".  */
98 #ifndef YY_AP_EXPR_YY_UTIL_EXPR_PARSE_H_INCLUDED
99 # define YY_AP_EXPR_YY_UTIL_EXPR_PARSE_H_INCLUDED
100 /* Enabling traces.  */
101 #ifndef YYDEBUG
102 # define YYDEBUG 0
103 #endif
104 #if YYDEBUG
105 extern int ap_expr_yydebug;
106 #endif
107
108 /* Tokens.  */
109 #ifndef YYTOKENTYPE
110 # define YYTOKENTYPE
111    /* Put the tokens into the symbol table, so that GDB and other debuggers
112       know about them.  */
113    enum yytokentype {
114      T_TRUE = 258,
115      T_FALSE = 259,
116      T_EXPR_BOOL = 260,
117      T_EXPR_STRING = 261,
118      T_ERROR = 262,
119      T_DIGIT = 263,
120      T_ID = 264,
121      T_STRING = 265,
122      T_REGEX = 266,
123      T_REGEX_I = 267,
124      T_REGEX_BACKREF = 268,
125      T_OP_UNARY = 269,
126      T_OP_BINARY = 270,
127      T_STR_BEGIN = 271,
128      T_STR_END = 272,
129      T_VAR_BEGIN = 273,
130      T_VAR_END = 274,
131      T_OP_EQ = 275,
132      T_OP_NE = 276,
133      T_OP_LT = 277,
134      T_OP_LE = 278,
135      T_OP_GT = 279,
136      T_OP_GE = 280,
137      T_OP_REG = 281,
138      T_OP_NRE = 282,
139      T_OP_IN = 283,
140      T_OP_STR_EQ = 284,
141      T_OP_STR_NE = 285,
142      T_OP_STR_LT = 286,
143      T_OP_STR_LE = 287,
144      T_OP_STR_GT = 288,
145      T_OP_STR_GE = 289,
146      T_OP_CONCAT = 290,
147      T_OP_OR = 291,
148      T_OP_AND = 292,
149      T_OP_NOT = 293
150    };
151 #endif
152
153
154 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
155 typedef union YYSTYPE
156 {
157 /* Line 387 of yacc.c  */
158 #line 35 "util_expr_parse.y"
159
160     char      *cpVal;
161     ap_expr_t *exVal;
162     int        num;
163
164
165 /* Line 387 of yacc.c  */
166 #line 167 "util_expr_parse.c"
167 } YYSTYPE;
168 # define YYSTYPE_IS_TRIVIAL 1
169 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
170 # define YYSTYPE_IS_DECLARED 1
171 #endif
172
173
174 #ifdef YYPARSE_PARAM
175 #if defined __STDC__ || defined __cplusplus
176 int ap_expr_yyparse (void *YYPARSE_PARAM);
177 #else
178 int ap_expr_yyparse ();
179 #endif
180 #else /* ! YYPARSE_PARAM */
181 #if defined __STDC__ || defined __cplusplus
182 int ap_expr_yyparse (ap_expr_parse_ctx_t *ctx);
183 #else
184 int ap_expr_yyparse ();
185 #endif
186 #endif /* ! YYPARSE_PARAM */
187
188 #endif /* !YY_AP_EXPR_YY_UTIL_EXPR_PARSE_H_INCLUDED  */
189
190 /* Copy the second part of user declarations.  */
191 /* Line 390 of yacc.c  */
192 #line 102 "util_expr_parse.y"
193
194 #include "util_expr_private.h"
195 #define yyscanner ctx->scanner
196
197 int ap_expr_yylex(YYSTYPE *lvalp, void *scanner);
198
199 /* Line 390 of yacc.c  */
200 #line 201 "util_expr_parse.c"
201
202 #ifdef short
203 # undef short
204 #endif
205
206 #ifdef YYTYPE_UINT8
207 typedef YYTYPE_UINT8 yytype_uint8;
208 #else
209 typedef unsigned char yytype_uint8;
210 #endif
211
212 #ifdef YYTYPE_INT8
213 typedef YYTYPE_INT8 yytype_int8;
214 #elif (defined __STDC__ || defined __C99__FUNC__ \
215      || defined __cplusplus || defined _MSC_VER)
216 typedef signed char yytype_int8;
217 #else
218 typedef short int yytype_int8;
219 #endif
220
221 #ifdef YYTYPE_UINT16
222 typedef YYTYPE_UINT16 yytype_uint16;
223 #else
224 typedef unsigned short int yytype_uint16;
225 #endif
226
227 #ifdef YYTYPE_INT16
228 typedef YYTYPE_INT16 yytype_int16;
229 #else
230 typedef short int yytype_int16;
231 #endif
232
233 #ifndef YYSIZE_T
234 # ifdef __SIZE_TYPE__
235 #  define YYSIZE_T __SIZE_TYPE__
236 # elif defined size_t
237 #  define YYSIZE_T size_t
238 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
239      || defined __cplusplus || defined _MSC_VER)
240 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
241 #  define YYSIZE_T size_t
242 # else
243 #  define YYSIZE_T unsigned int
244 # endif
245 #endif
246
247 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
248
249 #ifndef YY_
250 # if defined YYENABLE_NLS && YYENABLE_NLS
251 #  if ENABLE_NLS
252 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
253 #   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
254 #  endif
255 # endif
256 # ifndef YY_
257 #  define YY_(Msgid) Msgid
258 # endif
259 #endif
260
261 #ifndef __attribute__
262 /* This feature is available in gcc versions 2.5 and later.  */
263 # if (! defined __GNUC__ || __GNUC__ < 2 \
264       || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
265 #  define __attribute__(Spec) /* empty */
266 # endif
267 #endif
268
269 /* Suppress unused-variable warnings by "using" E.  */
270 #if ! defined lint || defined __GNUC__
271 # define YYUSE(E) ((void) (E))
272 #else
273 # define YYUSE(E) /* empty */
274 #endif
275
276
277 /* Identity function, used to suppress warnings about constant conditions.  */
278 #ifndef lint
279 # define YYID(N) (N)
280 #else
281 #if (defined __STDC__ || defined __C99__FUNC__ \
282      || defined __cplusplus || defined _MSC_VER)
283 static int
284 YYID (int yyi)
285 #else
286 static int
287 YYID (yyi)
288     int yyi;
289 #endif
290 {
291   return yyi;
292 }
293 #endif
294
295 #if ! defined yyoverflow || YYERROR_VERBOSE
296
297 /* The parser invokes alloca or malloc; define the necessary symbols.  */
298
299 # ifdef YYSTACK_USE_ALLOCA
300 #  if YYSTACK_USE_ALLOCA
301 #   ifdef __GNUC__
302 #    define YYSTACK_ALLOC __builtin_alloca
303 #   elif defined __BUILTIN_VA_ARG_INCR
304 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
305 #   elif defined _AIX
306 #    define YYSTACK_ALLOC __alloca
307 #   elif defined _MSC_VER
308 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
309 #    define alloca _alloca
310 #   else
311 #    define YYSTACK_ALLOC alloca
312 #    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
313      || defined __cplusplus || defined _MSC_VER)
314 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
315       /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
316 #     ifndef EXIT_SUCCESS
317 #      define EXIT_SUCCESS 0
318 #     endif
319 #    endif
320 #   endif
321 #  endif
322 # endif
323
324 # ifdef YYSTACK_ALLOC
325    /* Pacify GCC's `empty if-body' warning.  */
326 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
327 #  ifndef YYSTACK_ALLOC_MAXIMUM
328     /* The OS might guarantee only one guard page at the bottom of the stack,
329        and a page size can be as small as 4096 bytes.  So we cannot safely
330        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
331        to allow for a few compiler-allocated temporary stack slots.  */
332 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
333 #  endif
334 # else
335 #  define YYSTACK_ALLOC YYMALLOC
336 #  define YYSTACK_FREE YYFREE
337 #  ifndef YYSTACK_ALLOC_MAXIMUM
338 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
339 #  endif
340 #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
341        && ! ((defined YYMALLOC || defined malloc) \
342              && (defined YYFREE || defined free)))
343 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
344 #   ifndef EXIT_SUCCESS
345 #    define EXIT_SUCCESS 0
346 #   endif
347 #  endif
348 #  ifndef YYMALLOC
349 #   define YYMALLOC malloc
350 #   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
351      || defined __cplusplus || defined _MSC_VER)
352 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
353 #   endif
354 #  endif
355 #  ifndef YYFREE
356 #   define YYFREE free
357 #   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
358      || defined __cplusplus || defined _MSC_VER)
359 void free (void *); /* INFRINGES ON USER NAME SPACE */
360 #   endif
361 #  endif
362 # endif
363 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
364
365
366 #if (! defined yyoverflow \
367      && (! defined __cplusplus \
368          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
369
370 /* A type that is properly aligned for any stack member.  */
371 union yyalloc
372 {
373   yytype_int16 yyss_alloc;
374   YYSTYPE yyvs_alloc;
375 };
376
377 /* The size of the maximum gap between one aligned stack and the next.  */
378 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
379
380 /* The size of an array large to enough to hold all stacks, each with
381    N elements.  */
382 # define YYSTACK_BYTES(N) \
383      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
384       + YYSTACK_GAP_MAXIMUM)
385
386 # define YYCOPY_NEEDED 1
387
388 /* Relocate STACK from its old location to the new one.  The
389    local variables YYSIZE and YYSTACKSIZE give the old and new number of
390    elements in the stack, and YYPTR gives the new location of the
391    stack.  Advance YYPTR to a properly aligned location for the next
392    stack.  */
393 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
394     do                                                                  \
395       {                                                                 \
396         YYSIZE_T yynewbytes;                                            \
397         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
398         Stack = &yyptr->Stack_alloc;                                    \
399         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
400         yyptr += yynewbytes / sizeof (*yyptr);                          \
401       }                                                                 \
402     while (YYID (0))
403
404 #endif
405
406 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
407 /* Copy COUNT objects from SRC to DST.  The source and destination do
408    not overlap.  */
409 # ifndef YYCOPY
410 #  if defined __GNUC__ && 1 < __GNUC__
411 #   define YYCOPY(Dst, Src, Count) \
412       __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
413 #  else
414 #   define YYCOPY(Dst, Src, Count)              \
415       do                                        \
416         {                                       \
417           YYSIZE_T yyi;                         \
418           for (yyi = 0; yyi < (Count); yyi++)   \
419             (Dst)[yyi] = (Src)[yyi];            \
420         }                                       \
421       while (YYID (0))
422 #  endif
423 # endif
424 #endif /* !YYCOPY_NEEDED */
425
426 /* YYFINAL -- State number of the termination state.  */
427 #define YYFINAL  28
428 /* YYLAST -- Last index in YYTABLE.  */
429 #define YYLAST   129
430
431 /* YYNTOKENS -- Number of terminals.  */
432 #define YYNTOKENS  50
433 /* YYNNTS -- Number of nonterminals.  */
434 #define YYNNTS  14
435 /* YYNRULES -- Number of rules.  */
436 #define YYNRULES  53
437 /* YYNRULES -- Number of states.  */
438 #define YYNSTATES  96
439
440 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
441 #define YYUNDEFTOK  2
442 #define YYMAXUTOK   298
443
444 #define YYTRANSLATE(YYX)                                                \
445   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
446
447 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
448 static const yytype_uint8 yytranslate[] =
449 {
450        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
451        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
452        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
453        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
454       44,    45,     2,     2,    48,     2,     2,     2,     2,     2,
455        2,     2,     2,     2,     2,     2,     2,     2,    49,     2,
456        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
457        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
458        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
459        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
460        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
461        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
462        2,     2,     2,    46,     2,    47,     2,     2,     2,     2,
463        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
464        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
465        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
466        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
467        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
468        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
469        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
470        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
471        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
472        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
473        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
474        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
475        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
476        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
477       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
478       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
479       35,    36,    37,    38,    39,    40,    41,    42,    43
480 };
481
482 #if YYDEBUG
483 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
484    YYRHS.  */
485 static const yytype_uint8 yyprhs[] =
486 {
487        0,     0,     3,     6,     9,    11,    13,    15,    18,    22,
488       26,    28,    31,    35,    39,    41,    45,    49,    53,    57,
489       61,    65,    69,    73,    77,    81,    85,    89,    93,    97,
490      101,   103,   107,   109,   113,   116,   118,   120,   122,   124,
491      126,   130,   136,   138,   142,   144,   146,   148,   152,   155,
492      157,   159,   161,   166
493 };
494
495 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
496 static const yytype_int8 yyrhs[] =
497 {
498       51,     0,    -1,     5,    52,    -1,     6,    56,    -1,     7,
499       -1,     3,    -1,     4,    -1,    38,    52,    -1,    52,    36,
500       52,    -1,    52,    37,    52,    -1,    53,    -1,    14,    59,
501       -1,    59,    15,    59,    -1,    44,    52,    45,    -1,     7,
502       -1,    59,    20,    59,    -1,    59,    21,    59,    -1,    59,
503       22,    59,    -1,    59,    23,    59,    -1,    59,    24,    59,
504       -1,    59,    25,    59,    -1,    59,    29,    59,    -1,    59,
505       30,    59,    -1,    59,    31,    59,    -1,    59,    32,    59,
506       -1,    59,    33,    59,    -1,    59,    34,    59,    -1,    59,
507       28,    54,    -1,    59,    26,    60,    -1,    59,    27,    60,
508       -1,    62,    -1,    46,    55,    47,    -1,    59,    -1,    55,
509       48,    59,    -1,    56,    57,    -1,    57,    -1,     7,    -1,
510       10,    -1,    58,    -1,    61,    -1,    18,     9,    19,    -1,
511       18,     9,    49,    56,    19,    -1,     8,    -1,    59,    35,
512       59,    -1,    58,    -1,    61,    -1,    63,    -1,    16,    56,
513       17,    -1,    16,    17,    -1,    11,    -1,    12,    -1,    13,
514       -1,     9,    44,    59,    45,    -1,     9,    44,    59,    45,
515       -1
516 };
517
518 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
519 static const yytype_uint8 yyrline[] =
520 {
521        0,   112,   112,   113,   114,   117,   118,   119,   120,   121,
522      122,   123,   124,   125,   126,   129,   130,   131,   132,   133,
523      134,   135,   136,   137,   138,   139,   140,   141,   142,   143,
524      146,   147,   150,   151,   154,   155,   156,   159,   160,   161,
525      164,   165,   168,   169,   170,   171,   172,   173,   174,   177,
526      186,   197,   204,   207
527 };
528 #endif
529
530 #if YYDEBUG || YYERROR_VERBOSE || 1
531 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
532    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
533 static const char *const yytname[] =
534 {
535   "$end", "error", "$undefined", "\"true\"", "\"false\"",
536   "\"boolean expression\"", "\"string expression\"", "\"error token\"",
537   "\"number\"", "\"identifier\"", "\"cstring\"", "\"regex\"",
538   "\"case-indendent regex\"", "\"regex back reference\"",
539   "\"unary operator\"", "\"binary operator\"", "\"start of string\"",
540   "\"end of string\"", "\"start of variable name\"",
541   "\"end of variable name\"", "\"integer equal\"", "\"integer not equal\"",
542   "\"integer less than\"", "\"integer less or equal\"",
543   "\"integer greater than\"", "\"integer greater or equal\"",
544   "\"regex match\"", "\"regex non-match\"", "\"contained in\"",
545   "\"string equal\"", "\"string not equal\"", "\"string less than\"",
546   "\"string less or equal\"", "\"string greater than\"",
547   "\"string greater or equal\"", "\"string concatenation\"",
548   "\"logical or\"", "\"logical and\"", "\"logical not\"", "\"function\"",
549   "\"listfunction\"", "\"stringpart\"", "\"variable\"", "\"rebackref\"",
550   "'('", "')'", "'{'", "'}'", "','", "':'", "$accept", "root", "expr",
551   "comparison", "wordlist", "words", "string", "strpart", "var", "word",
552   "regex", "backref", "lstfunccall", "strfunccall", YY_NULL
553 };
554 #endif
555
556 # ifdef YYPRINT
557 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
558    token YYLEX-NUM.  */
559 static const yytype_uint16 yytoknum[] =
560 {
561        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
562      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
563      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
564      285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
565      295,   296,   297,   298,    40,    41,   123,   125,    44,    58
566 };
567 # endif
568
569 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
570 static const yytype_uint8 yyr1[] =
571 {
572        0,    50,    51,    51,    51,    52,    52,    52,    52,    52,
573       52,    52,    52,    52,    52,    53,    53,    53,    53,    53,
574       53,    53,    53,    53,    53,    53,    53,    53,    53,    53,
575       54,    54,    55,    55,    56,    56,    56,    57,    57,    57,
576       58,    58,    59,    59,    59,    59,    59,    59,    59,    60,
577       60,    61,    62,    63
578 };
579
580 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
581 static const yytype_uint8 yyr2[] =
582 {
583        0,     2,     2,     2,     1,     1,     1,     2,     3,     3,
584        1,     2,     3,     3,     1,     3,     3,     3,     3,     3,
585        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
586        1,     3,     1,     3,     2,     1,     1,     1,     1,     1,
587        3,     5,     1,     3,     1,     1,     1,     3,     2,     1,
588        1,     1,     4,     4
589 };
590
591 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
592    Performed when YYTABLE doesn't specify something else to do.  Zero
593    means the default is an error.  */
594 static const yytype_uint8 yydefact[] =
595 {
596        0,     0,     0,     4,     0,     5,     6,    14,    42,     0,
597       51,     0,     0,     0,     0,     0,     2,    10,    44,     0,
598       45,    46,    36,    37,     3,    35,    38,    39,     1,     0,
599       11,    48,     0,     0,     7,     0,     0,     0,     0,     0,
600        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
601        0,     0,     0,     0,     0,    34,     0,    47,    40,     0,
602       13,     8,     9,    12,    15,    16,    17,    18,    19,    20,
603       49,    50,    28,    29,     0,     0,    27,    30,    21,    22,
604       23,    24,    25,    26,    43,    53,     0,     0,     0,    32,
605       41,     0,    31,     0,    52,    33
606 };
607
608 /* YYDEFGOTO[NTERM-NUM].  */
609 static const yytype_int8 yydefgoto[] =
610 {
611       -1,     4,    16,    17,    76,    88,    24,    25,    18,    19,
612       72,    20,    77,    21
613 };
614
615 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
616    STATE-NUM.  */
617 #define YYPACT_NINF -30
618 static const yytype_int8 yypact[] =
619 {
620        2,    60,     7,   -30,    13,   -30,   -30,   -30,   -30,   -29,
621      -30,    43,    73,    12,    60,    60,    -8,   -30,   -30,    85,
622      -30,   -30,   -30,   -30,    79,   -30,   -30,   -30,   -30,    43,
623       25,   -30,   111,   -17,   -30,    17,    60,    60,    43,    43,
624       43,    43,    43,    43,    43,   114,   114,    -4,    43,    43,
625       43,    43,    43,    43,    43,   -30,   -19,   -30,   -30,     7,
626      -30,    -8,   -10,    25,    25,    25,    25,    25,    25,    25,
627      -30,   -30,   -30,   -30,    31,    43,   -30,   -30,    25,    25,
628       25,    25,    25,    25,    25,   -30,    83,    43,    24,    25,
629      -30,    20,   -30,    43,   -30,    25
630 };
631
632 /* YYPGOTO[NTERM-NUM].  */
633 static const yytype_int8 yypgoto[] =
634 {
635      -30,   -30,     4,   -30,   -30,   -30,    -9,   -20,    -2,    -5,
636       33,    -1,   -30,   -30
637 };
638
639 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
640    positive, shift that token.  If negative, reduce the rule which
641    number is the opposite.  If YYTABLE_NINF, syntax error.  */
642 #define YYTABLE_NINF -1
643 static const yytype_uint8 yytable[] =
644 {
645       26,    27,    58,    32,    55,    74,    30,     1,     2,     3,
646       26,    27,    55,    28,    22,    29,    54,    23,    34,    35,
647       10,    33,    26,    27,    56,    13,    85,    37,    36,    37,
648       26,    27,    59,    63,    64,    65,    66,    67,    68,    69,
649       61,    62,    75,    78,    79,    80,    81,    82,    83,    84,
650       86,     8,     9,    36,    37,    54,    10,    26,    27,    12,
651       54,    13,    60,     5,     6,    94,    55,     7,     8,     9,
652       89,    92,    93,    10,    11,    87,    12,     0,    13,    73,
653       22,     0,    91,    23,    26,    27,    10,     0,    95,    23,
654       31,    13,    10,    23,     0,     0,    10,    13,    14,     0,
655       38,    13,    90,     0,    15,    39,    40,    41,    42,    43,
656       44,    45,    46,    47,    48,    49,    50,    51,    52,    53,
657       54,    23,     0,     0,    10,    70,    71,     0,    57,    13
658 };
659
660 #define yypact_value_is_default(Yystate) \
661   (!!((Yystate) == (-30)))
662
663 #define yytable_value_is_error(Yytable_value) \
664   YYID (0)
665
666 static const yytype_int8 yycheck[] =
667 {
668        2,     2,    19,    12,    24,     9,    11,     5,     6,     7,
669       12,    12,    32,     0,     7,    44,    35,    10,    14,    15,
670       13,     9,    24,    24,    29,    18,    45,    37,    36,    37,
671       32,    32,    49,    38,    39,    40,    41,    42,    43,    44,
672       36,    37,    46,    48,    49,    50,    51,    52,    53,    54,
673       59,     8,     9,    36,    37,    35,    13,    59,    59,    16,
674       35,    18,    45,     3,     4,    45,    86,     7,     8,     9,
675       75,    47,    48,    13,    14,    44,    16,    -1,    18,    46,
676        7,    -1,    87,    10,    86,    86,    13,    -1,    93,    10,
677       17,    18,    13,    10,    -1,    -1,    13,    18,    38,    -1,
678       15,    18,    19,    -1,    44,    20,    21,    22,    23,    24,
679       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
680       35,    10,    -1,    -1,    13,    11,    12,    -1,    17,    18
681 };
682
683 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
684    symbol of state STATE-NUM.  */
685 static const yytype_uint8 yystos[] =
686 {
687        0,     5,     6,     7,    51,     3,     4,     7,     8,     9,
688       13,    14,    16,    18,    38,    44,    52,    53,    58,    59,
689       61,    63,     7,    10,    56,    57,    58,    61,     0,    44,
690       59,    17,    56,     9,    52,    52,    36,    37,    15,    20,
691       21,    22,    23,    24,    25,    26,    27,    28,    29,    30,
692       31,    32,    33,    34,    35,    57,    59,    17,    19,    49,
693       45,    52,    52,    59,    59,    59,    59,    59,    59,    59,
694       11,    12,    60,    60,     9,    46,    54,    62,    59,    59,
695       59,    59,    59,    59,    59,    45,    56,    44,    55,    59,
696       19,    59,    47,    48,    45,    59
697 };
698
699 #define yyerrok         (yyerrstatus = 0)
700 #define yyclearin       (yychar = YYEMPTY)
701 #define YYEMPTY         (-2)
702 #define YYEOF           0
703
704 #define YYACCEPT        goto yyacceptlab
705 #define YYABORT         goto yyabortlab
706 #define YYERROR         goto yyerrorlab
707
708
709 /* Like YYERROR except do call yyerror.  This remains here temporarily
710    to ease the transition to the new meaning of YYERROR, for GCC.
711    Once GCC version 2 has supplanted version 1, this can go.  However,
712    YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
713    in Bison 2.4.2's NEWS entry, where a plan to phase it out is
714    discussed.  */
715
716 #define YYFAIL          goto yyerrlab
717 #if defined YYFAIL
718   /* This is here to suppress warnings from the GCC cpp's
719      -Wunused-macros.  Normally we don't worry about that warning, but
720      some users do, and we want to make it easy for users to remove
721      YYFAIL uses, which will produce warnings from Bison 2.5.  */
722 #endif
723
724 #define YYRECOVERING()  (!!yyerrstatus)
725
726 #define YYBACKUP(Token, Value)                                  \
727 do                                                              \
728   if (yychar == YYEMPTY)                                        \
729     {                                                           \
730       yychar = (Token);                                         \
731       yylval = (Value);                                         \
732       YYPOPSTACK (yylen);                                       \
733       yystate = *yyssp;                                         \
734       goto yybackup;                                            \
735     }                                                           \
736   else                                                          \
737     {                                                           \
738       yyerror (ctx, YY_("syntax error: cannot back up")); \
739       YYERROR;                                                  \
740     }                                                           \
741 while (YYID (0))
742
743 /* Error token number */
744 #define YYTERROR        1
745 #define YYERRCODE       256
746
747
748 /* This macro is provided for backward compatibility. */
749 #ifndef YY_LOCATION_PRINT
750 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
751 #endif
752
753
754 /* YYLEX -- calling `yylex' with the right arguments.  */
755 #ifdef YYLEX_PARAM
756 # define YYLEX yylex (&yylval, YYLEX_PARAM)
757 #else
758 # define YYLEX yylex (&yylval, yyscanner)
759 #endif
760
761 /* Enable debugging if requested.  */
762 #if YYDEBUG
763
764 # ifndef YYFPRINTF
765 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
766 #  define YYFPRINTF fprintf
767 # endif
768
769 # define YYDPRINTF(Args)                        \
770 do {                                            \
771   if (yydebug)                                  \
772     YYFPRINTF Args;                             \
773 } while (YYID (0))
774
775 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
776 do {                                                                      \
777   if (yydebug)                                                            \
778     {                                                                     \
779       YYFPRINTF (stderr, "%s ", Title);                                   \
780       yy_symbol_print (stderr,                                            \
781                   Type, Value, ctx); \
782       YYFPRINTF (stderr, "\n");                                           \
783     }                                                                     \
784 } while (YYID (0))
785
786
787 /*--------------------------------.
788 | Print this symbol on YYOUTPUT.  |
789 `--------------------------------*/
790
791 /*ARGSUSED*/
792 #if (defined __STDC__ || defined __C99__FUNC__ \
793      || defined __cplusplus || defined _MSC_VER)
794 static void
795 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, ap_expr_parse_ctx_t *ctx)
796 #else
797 static void
798 yy_symbol_value_print (yyoutput, yytype, yyvaluep, ctx)
799     FILE *yyoutput;
800     int yytype;
801     YYSTYPE const * const yyvaluep;
802     ap_expr_parse_ctx_t *ctx;
803 #endif
804 {
805   FILE *yyo = yyoutput;
806   YYUSE (yyo);
807   if (!yyvaluep)
808     return;
809   YYUSE (ctx);
810 # ifdef YYPRINT
811   if (yytype < YYNTOKENS)
812     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
813 # else
814   YYUSE (yyoutput);
815 # endif
816   YYUSE (yytype);
817 }
818
819
820 /*--------------------------------.
821 | Print this symbol on YYOUTPUT.  |
822 `--------------------------------*/
823
824 #if (defined __STDC__ || defined __C99__FUNC__ \
825      || defined __cplusplus || defined _MSC_VER)
826 static void
827 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, ap_expr_parse_ctx_t *ctx)
828 #else
829 static void
830 yy_symbol_print (yyoutput, yytype, yyvaluep, ctx)
831     FILE *yyoutput;
832     int yytype;
833     YYSTYPE const * const yyvaluep;
834     ap_expr_parse_ctx_t *ctx;
835 #endif
836 {
837   if (yytype < YYNTOKENS)
838     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
839   else
840     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
841
842   yy_symbol_value_print (yyoutput, yytype, yyvaluep, ctx);
843   YYFPRINTF (yyoutput, ")");
844 }
845
846 /*------------------------------------------------------------------.
847 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
848 | TOP (included).                                                   |
849 `------------------------------------------------------------------*/
850
851 #if (defined __STDC__ || defined __C99__FUNC__ \
852      || defined __cplusplus || defined _MSC_VER)
853 static void
854 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
855 #else
856 static void
857 yy_stack_print (yybottom, yytop)
858     yytype_int16 *yybottom;
859     yytype_int16 *yytop;
860 #endif
861 {
862   YYFPRINTF (stderr, "Stack now");
863   for (; yybottom <= yytop; yybottom++)
864     {
865       int yybot = *yybottom;
866       YYFPRINTF (stderr, " %d", yybot);
867     }
868   YYFPRINTF (stderr, "\n");
869 }
870
871 # define YY_STACK_PRINT(Bottom, Top)                            \
872 do {                                                            \
873   if (yydebug)                                                  \
874     yy_stack_print ((Bottom), (Top));                           \
875 } while (YYID (0))
876
877
878 /*------------------------------------------------.
879 | Report that the YYRULE is going to be reduced.  |
880 `------------------------------------------------*/
881
882 #if (defined __STDC__ || defined __C99__FUNC__ \
883      || defined __cplusplus || defined _MSC_VER)
884 static void
885 yy_reduce_print (YYSTYPE *yyvsp, int yyrule, ap_expr_parse_ctx_t *ctx)
886 #else
887 static void
888 yy_reduce_print (yyvsp, yyrule, ctx)
889     YYSTYPE *yyvsp;
890     int yyrule;
891     ap_expr_parse_ctx_t *ctx;
892 #endif
893 {
894   int yynrhs = yyr2[yyrule];
895   int yyi;
896   unsigned long int yylno = yyrline[yyrule];
897   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
898              yyrule - 1, yylno);
899   /* The symbols being reduced.  */
900   for (yyi = 0; yyi < yynrhs; yyi++)
901     {
902       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
903       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
904                        &(yyvsp[(yyi + 1) - (yynrhs)])
905                                        , ctx);
906       YYFPRINTF (stderr, "\n");
907     }
908 }
909
910 # define YY_REDUCE_PRINT(Rule)          \
911 do {                                    \
912   if (yydebug)                          \
913     yy_reduce_print (yyvsp, Rule, ctx); \
914 } while (YYID (0))
915
916 /* Nonzero means print parse trace.  It is left uninitialized so that
917    multiple parsers can coexist.  */
918 int yydebug;
919 #else /* !YYDEBUG */
920 # define YYDPRINTF(Args)
921 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
922 # define YY_STACK_PRINT(Bottom, Top)
923 # define YY_REDUCE_PRINT(Rule)
924 #endif /* !YYDEBUG */
925
926
927 /* YYINITDEPTH -- initial size of the parser's stacks.  */
928 #ifndef YYINITDEPTH
929 # define YYINITDEPTH 200
930 #endif
931
932 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
933    if the built-in stack extension method is used).
934
935    Do not make this value too large; the results are undefined if
936    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
937    evaluated with infinite-precision integer arithmetic.  */
938
939 #ifndef YYMAXDEPTH
940 # define YYMAXDEPTH 10000
941 #endif
942
943
944 #if YYERROR_VERBOSE
945
946 # ifndef yystrlen
947 #  if defined __GLIBC__ && defined _STRING_H
948 #   define yystrlen strlen
949 #  else
950 /* Return the length of YYSTR.  */
951 #if (defined __STDC__ || defined __C99__FUNC__ \
952      || defined __cplusplus || defined _MSC_VER)
953 static YYSIZE_T
954 yystrlen (const char *yystr)
955 #else
956 static YYSIZE_T
957 yystrlen (yystr)
958     const char *yystr;
959 #endif
960 {
961   YYSIZE_T yylen;
962   for (yylen = 0; yystr[yylen]; yylen++)
963     continue;
964   return yylen;
965 }
966 #  endif
967 # endif
968
969 # ifndef yystpcpy
970 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
971 #   define yystpcpy stpcpy
972 #  else
973 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
974    YYDEST.  */
975 #if (defined __STDC__ || defined __C99__FUNC__ \
976      || defined __cplusplus || defined _MSC_VER)
977 static char *
978 yystpcpy (char *yydest, const char *yysrc)
979 #else
980 static char *
981 yystpcpy (yydest, yysrc)
982     char *yydest;
983     const char *yysrc;
984 #endif
985 {
986   char *yyd = yydest;
987   const char *yys = yysrc;
988
989   while ((*yyd++ = *yys++) != '\0')
990     continue;
991
992   return yyd - 1;
993 }
994 #  endif
995 # endif
996
997 # ifndef yytnamerr
998 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
999    quotes and backslashes, so that it's suitable for yyerror.  The
1000    heuristic is that double-quoting is unnecessary unless the string
1001    contains an apostrophe, a comma, or backslash (other than
1002    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
1003    null, do not copy; instead, return the length of what the result
1004    would have been.  */
1005 static YYSIZE_T
1006 yytnamerr (char *yyres, const char *yystr)
1007 {
1008   if (*yystr == '"')
1009     {
1010       YYSIZE_T yyn = 0;
1011       char const *yyp = yystr;
1012
1013       for (;;)
1014         switch (*++yyp)
1015           {
1016           case '\'':
1017           case ',':
1018             goto do_not_strip_quotes;
1019
1020           case '\\':
1021             if (*++yyp != '\\')
1022               goto do_not_strip_quotes;
1023             /* Fall through.  */
1024           default:
1025             if (yyres)
1026               yyres[yyn] = *yyp;
1027             yyn++;
1028             break;
1029
1030           case '"':
1031             if (yyres)
1032               yyres[yyn] = '\0';
1033             return yyn;
1034           }
1035     do_not_strip_quotes: ;
1036     }
1037
1038   if (! yyres)
1039     return yystrlen (yystr);
1040
1041   return yystpcpy (yyres, yystr) - yyres;
1042 }
1043 # endif
1044
1045 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1046    about the unexpected token YYTOKEN for the state stack whose top is
1047    YYSSP.
1048
1049    Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
1050    not large enough to hold the message.  In that case, also set
1051    *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
1052    required number of bytes is too large to store.  */
1053 static int
1054 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1055                 yytype_int16 *yyssp, int yytoken)
1056 {
1057   YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1058   YYSIZE_T yysize = yysize0;
1059   enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1060   /* Internationalized format string. */
1061   const char *yyformat = YY_NULL;
1062   /* Arguments of yyformat. */
1063   char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1064   /* Number of reported tokens (one for the "unexpected", one per
1065      "expected"). */
1066   int yycount = 0;
1067
1068   /* There are many possibilities here to consider:
1069      - Assume YYFAIL is not used.  It's too flawed to consider.  See
1070        <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1071        for details.  YYERROR is fine as it does not invoke this
1072        function.
1073      - If this state is a consistent state with a default action, then
1074        the only way this function was invoked is if the default action
1075        is an error action.  In that case, don't check for expected
1076        tokens because there are none.
1077      - The only way there can be no lookahead present (in yychar) is if
1078        this state is a consistent state with a default action.  Thus,
1079        detecting the absence of a lookahead is sufficient to determine
1080        that there is no unexpected or expected token to report.  In that
1081        case, just report a simple "syntax error".
1082      - Don't assume there isn't a lookahead just because this state is a
1083        consistent state with a default action.  There might have been a
1084        previous inconsistent state, consistent state with a non-default
1085        action, or user semantic action that manipulated yychar.
1086      - Of course, the expected token list depends on states to have
1087        correct lookahead information, and it depends on the parser not
1088        to perform extra reductions after fetching a lookahead from the
1089        scanner and before detecting a syntax error.  Thus, state merging
1090        (from LALR or IELR) and default reductions corrupt the expected
1091        token list.  However, the list is correct for canonical LR with
1092        one exception: it will still contain any token that will not be
1093        accepted due to an error action in a later state.
1094   */
1095   if (yytoken != YYEMPTY)
1096     {
1097       int yyn = yypact[*yyssp];
1098       yyarg[yycount++] = yytname[yytoken];
1099       if (!yypact_value_is_default (yyn))
1100         {
1101           /* Start YYX at -YYN if negative to avoid negative indexes in
1102              YYCHECK.  In other words, skip the first -YYN actions for
1103              this state because they are default actions.  */
1104           int yyxbegin = yyn < 0 ? -yyn : 0;
1105           /* Stay within bounds of both yycheck and yytname.  */
1106           int yychecklim = YYLAST - yyn + 1;
1107           int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1108           int yyx;
1109
1110           for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1111             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1112                 && !yytable_value_is_error (yytable[yyx + yyn]))
1113               {
1114                 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1115                   {
1116                     yycount = 1;
1117                     yysize = yysize0;
1118                     break;
1119                   }
1120                 yyarg[yycount++] = yytname[yyx];
1121                 {
1122                   YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1123                   if (! (yysize <= yysize1
1124                          && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1125                     return 2;
1126                   yysize = yysize1;
1127                 }
1128               }
1129         }
1130     }
1131
1132   switch (yycount)
1133     {
1134 # define YYCASE_(N, S)                      \
1135       case N:                               \
1136         yyformat = S;                       \
1137       break
1138       YYCASE_(0, YY_("syntax error"));
1139       YYCASE_(1, YY_("syntax error, unexpected %s"));
1140       YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1141       YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1142       YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1143       YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1144 # undef YYCASE_
1145     }
1146
1147   {
1148     YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1149     if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1150       return 2;
1151     yysize = yysize1;
1152   }
1153
1154   if (*yymsg_alloc < yysize)
1155     {
1156       *yymsg_alloc = 2 * yysize;
1157       if (! (yysize <= *yymsg_alloc
1158              && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1159         *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1160       return 1;
1161     }
1162
1163   /* Avoid sprintf, as that infringes on the user's name space.
1164      Don't have undefined behavior even if the translation
1165      produced a string with the wrong number of "%s"s.  */
1166   {
1167     char *yyp = *yymsg;
1168     int yyi = 0;
1169     while ((*yyp = *yyformat) != '\0')
1170       if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1171         {
1172           yyp += yytnamerr (yyp, yyarg[yyi++]);
1173           yyformat += 2;
1174         }
1175       else
1176         {
1177           yyp++;
1178           yyformat++;
1179         }
1180   }
1181   return 0;
1182 }
1183 #endif /* YYERROR_VERBOSE */
1184
1185 /*-----------------------------------------------.
1186 | Release the memory associated to this symbol.  |
1187 `-----------------------------------------------*/
1188
1189 /*ARGSUSED*/
1190 #if (defined __STDC__ || defined __C99__FUNC__ \
1191      || defined __cplusplus || defined _MSC_VER)
1192 static void
1193 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, ap_expr_parse_ctx_t *ctx)
1194 #else
1195 static void
1196 yydestruct (yymsg, yytype, yyvaluep, ctx)
1197     const char *yymsg;
1198     int yytype;
1199     YYSTYPE *yyvaluep;
1200     ap_expr_parse_ctx_t *ctx;
1201 #endif
1202 {
1203   YYUSE (yyvaluep);
1204   YYUSE (ctx);
1205
1206   if (!yymsg)
1207     yymsg = "Deleting";
1208   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1209
1210   YYUSE (yytype);
1211 }
1212
1213
1214
1215
1216 /*----------.
1217 | yyparse.  |
1218 `----------*/
1219
1220 #ifdef YYPARSE_PARAM
1221 #if (defined __STDC__ || defined __C99__FUNC__ \
1222      || defined __cplusplus || defined _MSC_VER)
1223 int
1224 yyparse (void *YYPARSE_PARAM)
1225 #else
1226 int
1227 yyparse (YYPARSE_PARAM)
1228     void *YYPARSE_PARAM;
1229 #endif
1230 #else /* ! YYPARSE_PARAM */
1231 #if (defined __STDC__ || defined __C99__FUNC__ \
1232      || defined __cplusplus || defined _MSC_VER)
1233 int
1234 yyparse (ap_expr_parse_ctx_t *ctx)
1235 #else
1236 int
1237 yyparse (ctx)
1238     ap_expr_parse_ctx_t *ctx;
1239 #endif
1240 #endif
1241 {
1242 /* The lookahead symbol.  */
1243 int yychar;
1244
1245
1246 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
1247 /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
1248 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1249     _Pragma ("GCC diagnostic push") \
1250     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
1251     _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1252 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1253     _Pragma ("GCC diagnostic pop")
1254 #else
1255 /* Default value used for initialization, for pacifying older GCCs
1256    or non-GCC compilers.  */
1257 static YYSTYPE yyval_default;
1258 # define YY_INITIAL_VALUE(Value) = Value
1259 #endif
1260 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1261 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1262 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
1263 #endif
1264 #ifndef YY_INITIAL_VALUE
1265 # define YY_INITIAL_VALUE(Value) /* Nothing. */
1266 #endif
1267
1268 /* The semantic value of the lookahead symbol.  */
1269 YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
1270
1271     /* Number of syntax errors so far.  */
1272     int yynerrs;
1273
1274     int yystate;
1275     /* Number of tokens to shift before error messages enabled.  */
1276     int yyerrstatus;
1277
1278     /* The stacks and their tools:
1279        `yyss': related to states.
1280        `yyvs': related to semantic values.
1281
1282        Refer to the stacks through separate pointers, to allow yyoverflow
1283        to reallocate them elsewhere.  */
1284
1285     /* The state stack.  */
1286     yytype_int16 yyssa[YYINITDEPTH];
1287     yytype_int16 *yyss;
1288     yytype_int16 *yyssp;
1289
1290     /* The semantic value stack.  */
1291     YYSTYPE yyvsa[YYINITDEPTH];
1292     YYSTYPE *yyvs;
1293     YYSTYPE *yyvsp;
1294
1295     YYSIZE_T yystacksize;
1296
1297   int yyn;
1298   int yyresult;
1299   /* Lookahead token as an internal (translated) token number.  */
1300   int yytoken = 0;
1301   /* The variables used to return semantic value and location from the
1302      action routines.  */
1303   YYSTYPE yyval;
1304
1305 #if YYERROR_VERBOSE
1306   /* Buffer for error messages, and its allocated size.  */
1307   char yymsgbuf[128];
1308   char *yymsg = yymsgbuf;
1309   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1310 #endif
1311
1312 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1313
1314   /* The number of symbols on the RHS of the reduced rule.
1315      Keep to zero when no symbol should be popped.  */
1316   int yylen = 0;
1317
1318   yyssp = yyss = yyssa;
1319   yyvsp = yyvs = yyvsa;
1320   yystacksize = YYINITDEPTH;
1321
1322   YYDPRINTF ((stderr, "Starting parse\n"));
1323
1324   yystate = 0;
1325   yyerrstatus = 0;
1326   yynerrs = 0;
1327   yychar = YYEMPTY; /* Cause a token to be read.  */
1328   goto yysetstate;
1329
1330 /*------------------------------------------------------------.
1331 | yynewstate -- Push a new state, which is found in yystate.  |
1332 `------------------------------------------------------------*/
1333  yynewstate:
1334   /* In all cases, when you get here, the value and location stacks
1335      have just been pushed.  So pushing a state here evens the stacks.  */
1336   yyssp++;
1337
1338  yysetstate:
1339   *yyssp = yystate;
1340
1341   if (yyss + yystacksize - 1 <= yyssp)
1342     {
1343       /* Get the current used size of the three stacks, in elements.  */
1344       YYSIZE_T yysize = yyssp - yyss + 1;
1345
1346 #ifdef yyoverflow
1347       {
1348         /* Give user a chance to reallocate the stack.  Use copies of
1349            these so that the &'s don't force the real ones into
1350            memory.  */
1351         YYSTYPE *yyvs1 = yyvs;
1352         yytype_int16 *yyss1 = yyss;
1353
1354         /* Each stack pointer address is followed by the size of the
1355            data in use in that stack, in bytes.  This used to be a
1356            conditional around just the two extra args, but that might
1357            be undefined if yyoverflow is a macro.  */
1358         yyoverflow (YY_("memory exhausted"),
1359                     &yyss1, yysize * sizeof (*yyssp),
1360                     &yyvs1, yysize * sizeof (*yyvsp),
1361                     &yystacksize);
1362
1363         yyss = yyss1;
1364         yyvs = yyvs1;
1365       }
1366 #else /* no yyoverflow */
1367 # ifndef YYSTACK_RELOCATE
1368       goto yyexhaustedlab;
1369 # else
1370       /* Extend the stack our own way.  */
1371       if (YYMAXDEPTH <= yystacksize)
1372         goto yyexhaustedlab;
1373       yystacksize *= 2;
1374       if (YYMAXDEPTH < yystacksize)
1375         yystacksize = YYMAXDEPTH;
1376
1377       {
1378         yytype_int16 *yyss1 = yyss;
1379         union yyalloc *yyptr =
1380           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1381         if (! yyptr)
1382           goto yyexhaustedlab;
1383         YYSTACK_RELOCATE (yyss_alloc, yyss);
1384         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1385 #  undef YYSTACK_RELOCATE
1386         if (yyss1 != yyssa)
1387           YYSTACK_FREE (yyss1);
1388       }
1389 # endif
1390 #endif /* no yyoverflow */
1391
1392       yyssp = yyss + yysize - 1;
1393       yyvsp = yyvs + yysize - 1;
1394
1395       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1396                   (unsigned long int) yystacksize));
1397
1398       if (yyss + yystacksize - 1 <= yyssp)
1399         YYABORT;
1400     }
1401
1402   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1403
1404   if (yystate == YYFINAL)
1405     YYACCEPT;
1406
1407   goto yybackup;
1408
1409 /*-----------.
1410 | yybackup.  |
1411 `-----------*/
1412 yybackup:
1413
1414   /* Do appropriate processing given the current state.  Read a
1415      lookahead token if we need one and don't already have one.  */
1416
1417   /* First try to decide what to do without reference to lookahead token.  */
1418   yyn = yypact[yystate];
1419   if (yypact_value_is_default (yyn))
1420     goto yydefault;
1421
1422   /* Not known => get a lookahead token if don't already have one.  */
1423
1424   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1425   if (yychar == YYEMPTY)
1426     {
1427       YYDPRINTF ((stderr, "Reading a token: "));
1428       yychar = YYLEX;
1429     }
1430
1431   if (yychar <= YYEOF)
1432     {
1433       yychar = yytoken = YYEOF;
1434       YYDPRINTF ((stderr, "Now at end of input.\n"));
1435     }
1436   else
1437     {
1438       yytoken = YYTRANSLATE (yychar);
1439       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1440     }
1441
1442   /* If the proper action on seeing token YYTOKEN is to reduce or to
1443      detect an error, take that action.  */
1444   yyn += yytoken;
1445   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1446     goto yydefault;
1447   yyn = yytable[yyn];
1448   if (yyn <= 0)
1449     {
1450       if (yytable_value_is_error (yyn))
1451         goto yyerrlab;
1452       yyn = -yyn;
1453       goto yyreduce;
1454     }
1455
1456   /* Count tokens shifted since error; after three, turn off error
1457      status.  */
1458   if (yyerrstatus)
1459     yyerrstatus--;
1460
1461   /* Shift the lookahead token.  */
1462   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1463
1464   /* Discard the shifted token.  */
1465   yychar = YYEMPTY;
1466
1467   yystate = yyn;
1468   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1469   *++yyvsp = yylval;
1470   YY_IGNORE_MAYBE_UNINITIALIZED_END
1471
1472   goto yynewstate;
1473
1474
1475 /*-----------------------------------------------------------.
1476 | yydefault -- do the default action for the current state.  |
1477 `-----------------------------------------------------------*/
1478 yydefault:
1479   yyn = yydefact[yystate];
1480   if (yyn == 0)
1481     goto yyerrlab;
1482   goto yyreduce;
1483
1484
1485 /*-----------------------------.
1486 | yyreduce -- Do a reduction.  |
1487 `-----------------------------*/
1488 yyreduce:
1489   /* yyn is the number of a rule to reduce with.  */
1490   yylen = yyr2[yyn];
1491
1492   /* If YYLEN is nonzero, implement the default value of the action:
1493      `$$ = $1'.
1494
1495      Otherwise, the following line sets YYVAL to garbage.
1496      This behavior is undocumented and Bison
1497      users should not rely upon it.  Assigning to YYVAL
1498      unconditionally makes the parser a bit smaller, and it avoids a
1499      GCC warning that YYVAL may be used uninitialized.  */
1500   yyval = yyvsp[1-yylen];
1501
1502
1503   YY_REDUCE_PRINT (yyn);
1504   switch (yyn)
1505     {
1506         case 2:
1507 /* Line 1787 of yacc.c  */
1508 #line 112 "util_expr_parse.y"
1509     { ctx->expr = (yyvsp[(2) - (2)].exVal); }
1510     break;
1511
1512   case 3:
1513 /* Line 1787 of yacc.c  */
1514 #line 113 "util_expr_parse.y"
1515     { ctx->expr = (yyvsp[(2) - (2)].exVal); }
1516     break;
1517
1518   case 4:
1519 /* Line 1787 of yacc.c  */
1520 #line 114 "util_expr_parse.y"
1521     { YYABORT; }
1522     break;
1523
1524   case 5:
1525 /* Line 1787 of yacc.c  */
1526 #line 117 "util_expr_parse.y"
1527     { (yyval.exVal) = ap_expr_make(op_True,        NULL, NULL, ctx); }
1528     break;
1529
1530   case 6:
1531 /* Line 1787 of yacc.c  */
1532 #line 118 "util_expr_parse.y"
1533     { (yyval.exVal) = ap_expr_make(op_False,       NULL, NULL, ctx); }
1534     break;
1535
1536   case 7:
1537 /* Line 1787 of yacc.c  */
1538 #line 119 "util_expr_parse.y"
1539     { (yyval.exVal) = ap_expr_make(op_Not,         (yyvsp[(2) - (2)].exVal),   NULL, ctx); }
1540     break;
1541
1542   case 8:
1543 /* Line 1787 of yacc.c  */
1544 #line 120 "util_expr_parse.y"
1545     { (yyval.exVal) = ap_expr_make(op_Or,          (yyvsp[(1) - (3)].exVal),   (yyvsp[(3) - (3)].exVal),   ctx); }
1546     break;
1547
1548   case 9:
1549 /* Line 1787 of yacc.c  */
1550 #line 121 "util_expr_parse.y"
1551     { (yyval.exVal) = ap_expr_make(op_And,         (yyvsp[(1) - (3)].exVal),   (yyvsp[(3) - (3)].exVal),   ctx); }
1552     break;
1553
1554   case 10:
1555 /* Line 1787 of yacc.c  */
1556 #line 122 "util_expr_parse.y"
1557     { (yyval.exVal) = ap_expr_make(op_Comp,        (yyvsp[(1) - (1)].exVal),   NULL, ctx); }
1558     break;
1559
1560   case 11:
1561 /* Line 1787 of yacc.c  */
1562 #line 123 "util_expr_parse.y"
1563     { (yyval.exVal) = ap_expr_unary_op_make(       (yyvsp[(1) - (2)].cpVal),   (yyvsp[(2) - (2)].exVal),   ctx); }
1564     break;
1565
1566   case 12:
1567 /* Line 1787 of yacc.c  */
1568 #line 124 "util_expr_parse.y"
1569     { (yyval.exVal) = ap_expr_binary_op_make((yyvsp[(2) - (3)].cpVal),   (yyvsp[(1) - (3)].exVal),   (yyvsp[(3) - (3)].exVal),   ctx); }
1570     break;
1571
1572   case 13:
1573 /* Line 1787 of yacc.c  */
1574 #line 125 "util_expr_parse.y"
1575     { (yyval.exVal) = (yyvsp[(2) - (3)].exVal); }
1576     break;
1577
1578   case 14:
1579 /* Line 1787 of yacc.c  */
1580 #line 126 "util_expr_parse.y"
1581     { YYABORT; }
1582     break;
1583
1584   case 15:
1585 /* Line 1787 of yacc.c  */
1586 #line 129 "util_expr_parse.y"
1587     { (yyval.exVal) = ap_expr_make(op_EQ,      (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1588     break;
1589
1590   case 16:
1591 /* Line 1787 of yacc.c  */
1592 #line 130 "util_expr_parse.y"
1593     { (yyval.exVal) = ap_expr_make(op_NE,      (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1594     break;
1595
1596   case 17:
1597 /* Line 1787 of yacc.c  */
1598 #line 131 "util_expr_parse.y"
1599     { (yyval.exVal) = ap_expr_make(op_LT,      (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1600     break;
1601
1602   case 18:
1603 /* Line 1787 of yacc.c  */
1604 #line 132 "util_expr_parse.y"
1605     { (yyval.exVal) = ap_expr_make(op_LE,      (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1606     break;
1607
1608   case 19:
1609 /* Line 1787 of yacc.c  */
1610 #line 133 "util_expr_parse.y"
1611     { (yyval.exVal) = ap_expr_make(op_GT,      (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1612     break;
1613
1614   case 20:
1615 /* Line 1787 of yacc.c  */
1616 #line 134 "util_expr_parse.y"
1617     { (yyval.exVal) = ap_expr_make(op_GE,      (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1618     break;
1619
1620   case 21:
1621 /* Line 1787 of yacc.c  */
1622 #line 135 "util_expr_parse.y"
1623     { (yyval.exVal) = ap_expr_make(op_STR_EQ,  (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1624     break;
1625
1626   case 22:
1627 /* Line 1787 of yacc.c  */
1628 #line 136 "util_expr_parse.y"
1629     { (yyval.exVal) = ap_expr_make(op_STR_NE,  (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1630     break;
1631
1632   case 23:
1633 /* Line 1787 of yacc.c  */
1634 #line 137 "util_expr_parse.y"
1635     { (yyval.exVal) = ap_expr_make(op_STR_LT,  (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1636     break;
1637
1638   case 24:
1639 /* Line 1787 of yacc.c  */
1640 #line 138 "util_expr_parse.y"
1641     { (yyval.exVal) = ap_expr_make(op_STR_LE,  (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1642     break;
1643
1644   case 25:
1645 /* Line 1787 of yacc.c  */
1646 #line 139 "util_expr_parse.y"
1647     { (yyval.exVal) = ap_expr_make(op_STR_GT,  (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1648     break;
1649
1650   case 26:
1651 /* Line 1787 of yacc.c  */
1652 #line 140 "util_expr_parse.y"
1653     { (yyval.exVal) = ap_expr_make(op_STR_GE,  (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1654     break;
1655
1656   case 27:
1657 /* Line 1787 of yacc.c  */
1658 #line 141 "util_expr_parse.y"
1659     { (yyval.exVal) = ap_expr_make(op_IN,      (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1660     break;
1661
1662   case 28:
1663 /* Line 1787 of yacc.c  */
1664 #line 142 "util_expr_parse.y"
1665     { (yyval.exVal) = ap_expr_make(op_REG,     (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1666     break;
1667
1668   case 29:
1669 /* Line 1787 of yacc.c  */
1670 #line 143 "util_expr_parse.y"
1671     { (yyval.exVal) = ap_expr_make(op_NRE,     (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal), ctx); }
1672     break;
1673
1674   case 30:
1675 /* Line 1787 of yacc.c  */
1676 #line 146 "util_expr_parse.y"
1677     { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1678     break;
1679
1680   case 31:
1681 /* Line 1787 of yacc.c  */
1682 #line 147 "util_expr_parse.y"
1683     { (yyval.exVal) = (yyvsp[(2) - (3)].exVal); }
1684     break;
1685
1686   case 32:
1687 /* Line 1787 of yacc.c  */
1688 #line 150 "util_expr_parse.y"
1689     { (yyval.exVal) = ap_expr_make(op_ListElement, (yyvsp[(1) - (1)].exVal), NULL, ctx); }
1690     break;
1691
1692   case 33:
1693 /* Line 1787 of yacc.c  */
1694 #line 151 "util_expr_parse.y"
1695     { (yyval.exVal) = ap_expr_make(op_ListElement, (yyvsp[(3) - (3)].exVal), (yyvsp[(1) - (3)].exVal),   ctx); }
1696     break;
1697
1698   case 34:
1699 /* Line 1787 of yacc.c  */
1700 #line 154 "util_expr_parse.y"
1701     { (yyval.exVal) = ap_expr_make(op_Concat, (yyvsp[(1) - (2)].exVal), (yyvsp[(2) - (2)].exVal), ctx); }
1702     break;
1703
1704   case 35:
1705 /* Line 1787 of yacc.c  */
1706 #line 155 "util_expr_parse.y"
1707     { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1708     break;
1709
1710   case 36:
1711 /* Line 1787 of yacc.c  */
1712 #line 156 "util_expr_parse.y"
1713     { YYABORT; }
1714     break;
1715
1716   case 37:
1717 /* Line 1787 of yacc.c  */
1718 #line 159 "util_expr_parse.y"
1719     { (yyval.exVal) = ap_expr_make(op_String, (yyvsp[(1) - (1)].cpVal), NULL, ctx); }
1720     break;
1721
1722   case 38:
1723 /* Line 1787 of yacc.c  */
1724 #line 160 "util_expr_parse.y"
1725     { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1726     break;
1727
1728   case 39:
1729 /* Line 1787 of yacc.c  */
1730 #line 161 "util_expr_parse.y"
1731     { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1732     break;
1733
1734   case 40:
1735 /* Line 1787 of yacc.c  */
1736 #line 164 "util_expr_parse.y"
1737     { (yyval.exVal) = ap_expr_var_make((yyvsp[(2) - (3)].cpVal), ctx); }
1738     break;
1739
1740   case 41:
1741 /* Line 1787 of yacc.c  */
1742 #line 165 "util_expr_parse.y"
1743     { (yyval.exVal) = ap_expr_str_func_make((yyvsp[(2) - (5)].cpVal), (yyvsp[(4) - (5)].exVal), ctx); }
1744     break;
1745
1746   case 42:
1747 /* Line 1787 of yacc.c  */
1748 #line 168 "util_expr_parse.y"
1749     { (yyval.exVal) = ap_expr_make(op_Digit,  (yyvsp[(1) - (1)].cpVal), NULL, ctx); }
1750     break;
1751
1752   case 43:
1753 /* Line 1787 of yacc.c  */
1754 #line 169 "util_expr_parse.y"
1755     { (yyval.exVal) = ap_expr_make(op_Concat, (yyvsp[(1) - (3)].exVal), (yyvsp[(3) - (3)].exVal),   ctx); }
1756     break;
1757
1758   case 44:
1759 /* Line 1787 of yacc.c  */
1760 #line 170 "util_expr_parse.y"
1761     { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1762     break;
1763
1764   case 45:
1765 /* Line 1787 of yacc.c  */
1766 #line 171 "util_expr_parse.y"
1767     { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1768     break;
1769
1770   case 46:
1771 /* Line 1787 of yacc.c  */
1772 #line 172 "util_expr_parse.y"
1773     { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1774     break;
1775
1776   case 47:
1777 /* Line 1787 of yacc.c  */
1778 #line 173 "util_expr_parse.y"
1779     { (yyval.exVal) = (yyvsp[(2) - (3)].exVal); }
1780     break;
1781
1782   case 48:
1783 /* Line 1787 of yacc.c  */
1784 #line 174 "util_expr_parse.y"
1785     { (yyval.exVal) = ap_expr_make(op_String, "", NULL, ctx); }
1786     break;
1787
1788   case 49:
1789 /* Line 1787 of yacc.c  */
1790 #line 177 "util_expr_parse.y"
1791     {
1792                 ap_regex_t *regex;
1793                 if ((regex = ap_pregcomp(ctx->pool, (yyvsp[(1) - (1)].cpVal),
1794                                          AP_REG_EXTENDED|AP_REG_NOSUB)) == NULL) {
1795                     ctx->error = "Failed to compile regular expression";
1796                     YYERROR;
1797                 }
1798                 (yyval.exVal) = ap_expr_make(op_Regex, regex, NULL, ctx);
1799             }
1800     break;
1801
1802   case 50:
1803 /* Line 1787 of yacc.c  */
1804 #line 186 "util_expr_parse.y"
1805     {
1806                 ap_regex_t *regex;
1807                 if ((regex = ap_pregcomp(ctx->pool, (yyvsp[(1) - (1)].cpVal),
1808                                          AP_REG_EXTENDED|AP_REG_NOSUB|AP_REG_ICASE)) == NULL) {
1809                     ctx->error = "Failed to compile regular expression";
1810                     YYERROR;
1811                 }
1812                 (yyval.exVal) = ap_expr_make(op_Regex, regex, NULL, ctx);
1813             }
1814     break;
1815
1816   case 51:
1817 /* Line 1787 of yacc.c  */
1818 #line 197 "util_expr_parse.y"
1819     {
1820                 int *n = apr_palloc(ctx->pool, sizeof(int));
1821                 *n = (yyvsp[(1) - (1)].num);
1822                 (yyval.exVal) = ap_expr_make(op_RegexBackref, n, NULL, ctx);
1823             }
1824     break;
1825
1826   case 52:
1827 /* Line 1787 of yacc.c  */
1828 #line 204 "util_expr_parse.y"
1829     { (yyval.exVal) = ap_expr_list_func_make((yyvsp[(1) - (4)].cpVal), (yyvsp[(3) - (4)].exVal), ctx); }
1830     break;
1831
1832   case 53:
1833 /* Line 1787 of yacc.c  */
1834 #line 207 "util_expr_parse.y"
1835     { (yyval.exVal) = ap_expr_str_func_make((yyvsp[(1) - (4)].cpVal), (yyvsp[(3) - (4)].exVal), ctx); }
1836     break;
1837
1838
1839 /* Line 1787 of yacc.c  */
1840 #line 1841 "util_expr_parse.c"
1841       default: break;
1842     }
1843   /* User semantic actions sometimes alter yychar, and that requires
1844      that yytoken be updated with the new translation.  We take the
1845      approach of translating immediately before every use of yytoken.
1846      One alternative is translating here after every semantic action,
1847      but that translation would be missed if the semantic action invokes
1848      YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1849      if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
1850      incorrect destructor might then be invoked immediately.  In the
1851      case of YYERROR or YYBACKUP, subsequent parser actions might lead
1852      to an incorrect destructor call or verbose syntax error message
1853      before the lookahead is translated.  */
1854   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1855
1856   YYPOPSTACK (yylen);
1857   yylen = 0;
1858   YY_STACK_PRINT (yyss, yyssp);
1859
1860   *++yyvsp = yyval;
1861
1862   /* Now `shift' the result of the reduction.  Determine what state
1863      that goes to, based on the state we popped back to and the rule
1864      number reduced by.  */
1865
1866   yyn = yyr1[yyn];
1867
1868   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1869   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1870     yystate = yytable[yystate];
1871   else
1872     yystate = yydefgoto[yyn - YYNTOKENS];
1873
1874   goto yynewstate;
1875
1876
1877 /*------------------------------------.
1878 | yyerrlab -- here on detecting error |
1879 `------------------------------------*/
1880 yyerrlab:
1881   /* Make sure we have latest lookahead translation.  See comments at
1882      user semantic actions for why this is necessary.  */
1883   yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1884
1885   /* If not already recovering from an error, report this error.  */
1886   if (!yyerrstatus)
1887     {
1888       ++yynerrs;
1889 #if ! YYERROR_VERBOSE
1890       yyerror (ctx, YY_("syntax error"));
1891 #else
1892 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1893                                         yyssp, yytoken)
1894       {
1895         char const *yymsgp = YY_("syntax error");
1896         int yysyntax_error_status;
1897         yysyntax_error_status = YYSYNTAX_ERROR;
1898         if (yysyntax_error_status == 0)
1899           yymsgp = yymsg;
1900         else if (yysyntax_error_status == 1)
1901           {
1902             if (yymsg != yymsgbuf)
1903               YYSTACK_FREE (yymsg);
1904             yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1905             if (!yymsg)
1906               {
1907                 yymsg = yymsgbuf;
1908                 yymsg_alloc = sizeof yymsgbuf;
1909                 yysyntax_error_status = 2;
1910               }
1911             else
1912               {
1913                 yysyntax_error_status = YYSYNTAX_ERROR;
1914                 yymsgp = yymsg;
1915               }
1916           }
1917         yyerror (ctx, yymsgp);
1918         if (yysyntax_error_status == 2)
1919           goto yyexhaustedlab;
1920       }
1921 # undef YYSYNTAX_ERROR
1922 #endif
1923     }
1924
1925
1926
1927   if (yyerrstatus == 3)
1928     {
1929       /* If just tried and failed to reuse lookahead token after an
1930          error, discard it.  */
1931
1932       if (yychar <= YYEOF)
1933         {
1934           /* Return failure if at end of input.  */
1935           if (yychar == YYEOF)
1936             YYABORT;
1937         }
1938       else
1939         {
1940           yydestruct ("Error: discarding",
1941                       yytoken, &yylval, ctx);
1942           yychar = YYEMPTY;
1943         }
1944     }
1945
1946   /* Else will try to reuse lookahead token after shifting the error
1947      token.  */
1948   goto yyerrlab1;
1949
1950
1951 /*---------------------------------------------------.
1952 | yyerrorlab -- error raised explicitly by YYERROR.  |
1953 `---------------------------------------------------*/
1954 yyerrorlab:
1955
1956   /* Pacify compilers like GCC when the user code never invokes
1957      YYERROR and the label yyerrorlab therefore never appears in user
1958      code.  */
1959   if (/*CONSTCOND*/ 0)
1960      goto yyerrorlab;
1961
1962   /* Do not reclaim the symbols of the rule which action triggered
1963      this YYERROR.  */
1964   YYPOPSTACK (yylen);
1965   yylen = 0;
1966   YY_STACK_PRINT (yyss, yyssp);
1967   yystate = *yyssp;
1968   goto yyerrlab1;
1969
1970
1971 /*-------------------------------------------------------------.
1972 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
1973 `-------------------------------------------------------------*/
1974 yyerrlab1:
1975   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
1976
1977   for (;;)
1978     {
1979       yyn = yypact[yystate];
1980       if (!yypact_value_is_default (yyn))
1981         {
1982           yyn += YYTERROR;
1983           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1984             {
1985               yyn = yytable[yyn];
1986               if (0 < yyn)
1987                 break;
1988             }
1989         }
1990
1991       /* Pop the current state because it cannot handle the error token.  */
1992       if (yyssp == yyss)
1993         YYABORT;
1994
1995
1996       yydestruct ("Error: popping",
1997                   yystos[yystate], yyvsp, ctx);
1998       YYPOPSTACK (1);
1999       yystate = *yyssp;
2000       YY_STACK_PRINT (yyss, yyssp);
2001     }
2002
2003   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2004   *++yyvsp = yylval;
2005   YY_IGNORE_MAYBE_UNINITIALIZED_END
2006
2007
2008   /* Shift the error token.  */
2009   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2010
2011   yystate = yyn;
2012   goto yynewstate;
2013
2014
2015 /*-------------------------------------.
2016 | yyacceptlab -- YYACCEPT comes here.  |
2017 `-------------------------------------*/
2018 yyacceptlab:
2019   yyresult = 0;
2020   goto yyreturn;
2021
2022 /*-----------------------------------.
2023 | yyabortlab -- YYABORT comes here.  |
2024 `-----------------------------------*/
2025 yyabortlab:
2026   yyresult = 1;
2027   goto yyreturn;
2028
2029 #if !defined yyoverflow || YYERROR_VERBOSE
2030 /*-------------------------------------------------.
2031 | yyexhaustedlab -- memory exhaustion comes here.  |
2032 `-------------------------------------------------*/
2033 yyexhaustedlab:
2034   yyerror (ctx, YY_("memory exhausted"));
2035   yyresult = 2;
2036   /* Fall through.  */
2037 #endif
2038
2039 yyreturn:
2040   if (yychar != YYEMPTY)
2041     {
2042       /* Make sure we have latest lookahead translation.  See comments at
2043          user semantic actions for why this is necessary.  */
2044       yytoken = YYTRANSLATE (yychar);
2045       yydestruct ("Cleanup: discarding lookahead",
2046                   yytoken, &yylval, ctx);
2047     }
2048   /* Do not reclaim the symbols of the rule which action triggered
2049      this YYABORT or YYACCEPT.  */
2050   YYPOPSTACK (yylen);
2051   YY_STACK_PRINT (yyss, yyssp);
2052   while (yyssp != yyss)
2053     {
2054       yydestruct ("Cleanup: popping",
2055                   yystos[*yyssp], yyvsp, ctx);
2056       YYPOPSTACK (1);
2057     }
2058 #ifndef yyoverflow
2059   if (yyss != yyssa)
2060     YYSTACK_FREE (yyss);
2061 #endif
2062 #if YYERROR_VERBOSE
2063   if (yymsg != yymsgbuf)
2064     YYSTACK_FREE (yymsg);
2065 #endif
2066   /* Make sure YYID is used.  */
2067   return YYID (yyresult);
2068 }
2069
2070
2071 /* Line 2050 of yacc.c  */
2072 #line 210 "util_expr_parse.y"
2073
2074
2075 void yyerror(ap_expr_parse_ctx_t *ctx, const char *s)
2076 {
2077     /* s is allocated on the stack */
2078     ctx->error = apr_pstrdup(ctx->ptemp, s);
2079 }
2080