]> granicus.if.org Git - apache/blob - server/util_expr_parse.c
util_expr: sync bison generated source files with
[apache] / server / util_expr_parse.c
1 /* A Bison parser, made by GNU Bison 2.5.  */
2
3 /* Bison implementation for Yacc-like parsers in C
4    
5       Copyright (C) 1984, 1989-1990, 2000-2011 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.5"
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 /* Using locations.  */
62 #define YYLSP_NEEDED 0
63
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
72
73
74 /* Copy the first part of user declarations.  */
75
76 /* Line 268 of yacc.c  */
77 #line 31 "util_expr_parse.y"
78
79 #include "util_expr_private.h"
80
81
82 /* Line 268 of yacc.c  */
83 #line 84 "util_expr_parse.c"
84
85 /* Enabling traces.  */
86 #ifndef YYDEBUG
87 # define YYDEBUG 0
88 #endif
89
90 /* Enabling verbose error messages.  */
91 #ifdef YYERROR_VERBOSE
92 # undef YYERROR_VERBOSE
93 # define YYERROR_VERBOSE 1
94 #else
95 # define YYERROR_VERBOSE 1
96 #endif
97
98 /* Enabling the token table.  */
99 #ifndef YYTOKEN_TABLE
100 # define YYTOKEN_TABLE 0
101 #endif
102
103
104 /* Tokens.  */
105 #ifndef YYTOKENTYPE
106 # define YYTOKENTYPE
107    /* Put the tokens into the symbol table, so that GDB and other debuggers
108       know about them.  */
109    enum yytokentype {
110      T_TRUE = 258,
111      T_FALSE = 259,
112      T_EXPR_BOOL = 260,
113      T_EXPR_STRING = 261,
114      T_ERROR = 262,
115      T_DIGIT = 263,
116      T_ID = 264,
117      T_STRING = 265,
118      T_REGEX = 266,
119      T_REGEX_I = 267,
120      T_REGEX_BACKREF = 268,
121      T_OP_UNARY = 269,
122      T_OP_BINARY = 270,
123      T_STR_BEGIN = 271,
124      T_STR_END = 272,
125      T_VAR_BEGIN = 273,
126      T_VAR_END = 274,
127      T_OP_EQ = 275,
128      T_OP_NE = 276,
129      T_OP_LT = 277,
130      T_OP_LE = 278,
131      T_OP_GT = 279,
132      T_OP_GE = 280,
133      T_OP_REG = 281,
134      T_OP_NRE = 282,
135      T_OP_IN = 283,
136      T_OP_STR_EQ = 284,
137      T_OP_STR_NE = 285,
138      T_OP_STR_LT = 286,
139      T_OP_STR_LE = 287,
140      T_OP_STR_GT = 288,
141      T_OP_STR_GE = 289,
142      T_OP_CONCAT = 290,
143      T_OP_OR = 291,
144      T_OP_AND = 292,
145      T_OP_NOT = 293
146    };
147 #endif
148
149
150
151 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
152 typedef union YYSTYPE
153 {
154
155 /* Line 293 of yacc.c  */
156 #line 35 "util_expr_parse.y"
157
158     char      *cpVal;
159     ap_expr_t *exVal;
160     int        num;
161
162
163
164 /* Line 293 of yacc.c  */
165 #line 166 "util_expr_parse.c"
166 } YYSTYPE;
167 # define YYSTYPE_IS_TRIVIAL 1
168 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
169 # define YYSTYPE_IS_DECLARED 1
170 #endif
171
172
173 /* Copy the second part of user declarations.  */
174
175 /* Line 343 of yacc.c  */
176 #line 102 "util_expr_parse.y"
177
178 #include "util_expr_private.h"
179 #define yyscanner ctx->scanner
180
181 int ap_expr_yylex(YYSTYPE *lvalp, void *scanner);
182
183
184 /* Line 343 of yacc.c  */
185 #line 186 "util_expr_parse.c"
186
187 #ifdef short
188 # undef short
189 #endif
190
191 #ifdef YYTYPE_UINT8
192 typedef YYTYPE_UINT8 yytype_uint8;
193 #else
194 typedef unsigned char yytype_uint8;
195 #endif
196
197 #ifdef YYTYPE_INT8
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;
202 #else
203 typedef short int yytype_int8;
204 #endif
205
206 #ifdef YYTYPE_UINT16
207 typedef YYTYPE_UINT16 yytype_uint16;
208 #else
209 typedef unsigned short int yytype_uint16;
210 #endif
211
212 #ifdef YYTYPE_INT16
213 typedef YYTYPE_INT16 yytype_int16;
214 #else
215 typedef short int yytype_int16;
216 #endif
217
218 #ifndef YYSIZE_T
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
227 # else
228 #  define YYSIZE_T unsigned int
229 # endif
230 #endif
231
232 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
233
234 #ifndef YY_
235 # if defined YYENABLE_NLS && YYENABLE_NLS
236 #  if ENABLE_NLS
237 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
238 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
239 #  endif
240 # endif
241 # ifndef YY_
242 #  define YY_(msgid) msgid
243 # endif
244 #endif
245
246 /* Suppress unused-variable warnings by "using" E.  */
247 #if ! defined lint || defined __GNUC__
248 # define YYUSE(e) ((void) (e))
249 #else
250 # define YYUSE(e) /* empty */
251 #endif
252
253 /* Identity function, used to suppress warnings about constant conditions.  */
254 #ifndef lint
255 # define YYID(n) (n)
256 #else
257 #if (defined __STDC__ || defined __C99__FUNC__ \
258      || defined __cplusplus || defined _MSC_VER)
259 static int
260 YYID (int yyi)
261 #else
262 static int
263 YYID (yyi)
264     int yyi;
265 #endif
266 {
267   return yyi;
268 }
269 #endif
270
271 #if ! defined yyoverflow || YYERROR_VERBOSE
272
273 /* The parser invokes alloca or malloc; define the necessary symbols.  */
274
275 # ifdef YYSTACK_USE_ALLOCA
276 #  if YYSTACK_USE_ALLOCA
277 #   ifdef __GNUC__
278 #    define YYSTACK_ALLOC __builtin_alloca
279 #   elif defined __BUILTIN_VA_ARG_INCR
280 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
281 #   elif defined _AIX
282 #    define YYSTACK_ALLOC __alloca
283 #   elif defined _MSC_VER
284 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
285 #    define alloca _alloca
286 #   else
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
293 #     endif
294 #    endif
295 #   endif
296 #  endif
297 # endif
298
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 */
308 #  endif
309 # else
310 #  define YYSTACK_ALLOC YYMALLOC
311 #  define YYSTACK_FREE YYFREE
312 #  ifndef YYSTACK_ALLOC_MAXIMUM
313 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
314 #  endif
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
321 #   endif
322 #  endif
323 #  ifndef YYMALLOC
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 */
328 #   endif
329 #  endif
330 #  ifndef YYFREE
331 #   define YYFREE free
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 */
335 #   endif
336 #  endif
337 # endif
338 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
339
340
341 #if (! defined yyoverflow \
342      && (! defined __cplusplus \
343          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
344
345 /* A type that is properly aligned for any stack member.  */
346 union yyalloc
347 {
348   yytype_int16 yyss_alloc;
349   YYSTYPE yyvs_alloc;
350 };
351
352 /* The size of the maximum gap between one aligned stack and the next.  */
353 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
354
355 /* The size of an array large to enough to hold all stacks, each with
356    N elements.  */
357 # define YYSTACK_BYTES(N) \
358      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
359       + YYSTACK_GAP_MAXIMUM)
360
361 # define YYCOPY_NEEDED 1
362
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
367    stack.  */
368 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
369     do                                                                  \
370       {                                                                 \
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);                          \
376       }                                                                 \
377     while (YYID (0))
378
379 #endif
380
381 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
382 /* Copy COUNT objects from FROM to TO.  The source and destination do
383    not overlap.  */
384 # ifndef YYCOPY
385 #  if defined __GNUC__ && 1 < __GNUC__
386 #   define YYCOPY(To, From, Count) \
387       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
388 #  else
389 #   define YYCOPY(To, From, Count)              \
390       do                                        \
391         {                                       \
392           YYSIZE_T yyi;                         \
393           for (yyi = 0; yyi < (Count); yyi++)   \
394             (To)[yyi] = (From)[yyi];            \
395         }                                       \
396       while (YYID (0))
397 #  endif
398 # endif
399 #endif /* !YYCOPY_NEEDED */
400
401 /* YYFINAL -- State number of the termination state.  */
402 #define YYFINAL  28
403 /* YYLAST -- Last index in YYTABLE.  */
404 #define YYLAST   134
405
406 /* YYNTOKENS -- Number of terminals.  */
407 #define YYNTOKENS  50
408 /* YYNNTS -- Number of nonterminals.  */
409 #define YYNNTS  14
410 /* YYNRULES -- Number of rules.  */
411 #define YYNRULES  54
412 /* YYNRULES -- Number of states.  */
413 #define YYNSTATES  98
414
415 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
416 #define YYUNDEFTOK  2
417 #define YYMAXUTOK   298
418
419 #define YYTRANSLATE(YYX)                                                \
420   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
421
422 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
423 static const yytype_uint8 yytranslate[] =
424 {
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
455 };
456
457 #if YYDEBUG
458 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
459    YYRHS.  */
460 static const yytype_uint8 yyprhs[] =
461 {
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
468 };
469
470 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
471 static const yytype_int8 yyrhs[] =
472 {
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
491 };
492
493 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
494 static const yytype_uint8 yyrline[] =
495 {
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
502 };
503 #endif
504
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[] =
509 {
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
528 };
529 #endif
530
531 # ifdef YYPRINT
532 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
533    token YYLEX-NUM.  */
534 static const yytype_uint16 yytoknum[] =
535 {
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
541 };
542 # endif
543
544 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
545 static const yytype_uint8 yyr1[] =
546 {
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,
552       60,    61,    62,    63,    63
553 };
554
555 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
556 static const yytype_uint8 yyr2[] =
557 {
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,
563        1,     1,     4,     4,     4
564 };
565
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[] =
570 {
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
581 };
582
583 /* YYDEFGOTO[NTERM-NUM].  */
584 static const yytype_int8 yydefgoto[] =
585 {
586       -1,     4,    16,    17,    77,    56,    24,    25,    18,    19,
587       73,    20,    78,    21
588 };
589
590 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
591    STATE-NUM.  */
592 #define YYPACT_NINF -41
593 static const yytype_int8 yypact[] =
594 {
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
605 };
606
607 /* YYPGOTO[NTERM-NUM].  */
608 static const yytype_int8 yypgoto[] =
609 {
610      -41,   -41,    39,   -41,   -41,     1,   -10,   -20,    -2,    -5,
611       35,    -1,   -41,   -41
612 };
613
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[] =
619 {
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,
633        0,     0,    61,    58,    13
634 };
635
636 #define yypact_value_is_default(yystate) \
637   ((yystate) == (-41))
638
639 #define yytable_value_is_error(yytable_value) \
640   YYID (0)
641
642 static const yytype_int8 yycheck[] =
643 {
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,
657       -1,    -1,    45,    17,    18
658 };
659
660 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
661    symbol of state STATE-NUM.  */
662 static const yytype_uint8 yystos[] =
663 {
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
674 };
675
676 #define yyerrok         (yyerrstatus = 0)
677 #define yyclearin       (yychar = YYEMPTY)
678 #define YYEMPTY         (-2)
679 #define YYEOF           0
680
681 #define YYACCEPT        goto yyacceptlab
682 #define YYABORT         goto yyabortlab
683 #define YYERROR         goto yyerrorlab
684
685
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
691    discussed.  */
692
693 #define YYFAIL          goto yyerrlab
694 #if defined YYFAIL
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.  */
699 #endif
700
701 #define YYRECOVERING()  (!!yyerrstatus)
702
703 #define YYBACKUP(Token, Value)                                  \
704 do                                                              \
705   if (yychar == YYEMPTY && yylen == 1)                          \
706     {                                                           \
707       yychar = (Token);                                         \
708       yylval = (Value);                                         \
709       YYPOPSTACK (1);                                           \
710       goto yybackup;                                            \
711     }                                                           \
712   else                                                          \
713     {                                                           \
714       yyerror (ctx, YY_("syntax error: cannot back up")); \
715       YYERROR;                                                  \
716     }                                                           \
717 while (YYID (0))
718
719
720 #define YYTERROR        1
721 #define YYERRCODE       256
722
723
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).  */
727
728 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
729 #ifndef YYLLOC_DEFAULT
730 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
731     do                                                                  \
732       if (YYID (N))                                                    \
733         {                                                               \
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;       \
738         }                                                               \
739       else                                                              \
740         {                                                               \
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;                              \
745         }                                                               \
746     while (YYID (0))
747 #endif
748
749
750 /* This macro is provided for backward compatibility. */
751
752 #ifndef YY_LOCATION_PRINT
753 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
754 #endif
755
756
757 /* YYLEX -- calling `yylex' with the right arguments.  */
758
759 #ifdef YYLEX_PARAM
760 # define YYLEX yylex (&yylval, YYLEX_PARAM)
761 #else
762 # define YYLEX yylex (&yylval, yyscanner)
763 #endif
764
765 /* Enable debugging if requested.  */
766 #if YYDEBUG
767
768 # ifndef YYFPRINTF
769 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
770 #  define YYFPRINTF fprintf
771 # endif
772
773 # define YYDPRINTF(Args)                        \
774 do {                                            \
775   if (yydebug)                                  \
776     YYFPRINTF Args;                             \
777 } while (YYID (0))
778
779 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
780 do {                                                                      \
781   if (yydebug)                                                            \
782     {                                                                     \
783       YYFPRINTF (stderr, "%s ", Title);                                   \
784       yy_symbol_print (stderr,                                            \
785                   Type, Value, ctx); \
786       YYFPRINTF (stderr, "\n");                                           \
787     }                                                                     \
788 } while (YYID (0))
789
790
791 /*--------------------------------.
792 | Print this symbol on YYOUTPUT.  |
793 `--------------------------------*/
794
795 /*ARGSUSED*/
796 #if (defined __STDC__ || defined __C99__FUNC__ \
797      || defined __cplusplus || defined _MSC_VER)
798 static void
799 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, ap_expr_parse_ctx_t *ctx)
800 #else
801 static void
802 yy_symbol_value_print (yyoutput, yytype, yyvaluep, ctx)
803     FILE *yyoutput;
804     int yytype;
805     YYSTYPE const * const yyvaluep;
806     ap_expr_parse_ctx_t *ctx;
807 #endif
808 {
809   if (!yyvaluep)
810     return;
811   YYUSE (ctx);
812 # ifdef YYPRINT
813   if (yytype < YYNTOKENS)
814     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
815 # else
816   YYUSE (yyoutput);
817 # endif
818   switch (yytype)
819     {
820       default:
821         break;
822     }
823 }
824
825
826 /*--------------------------------.
827 | Print this symbol on YYOUTPUT.  |
828 `--------------------------------*/
829
830 #if (defined __STDC__ || defined __C99__FUNC__ \
831      || defined __cplusplus || defined _MSC_VER)
832 static void
833 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, ap_expr_parse_ctx_t *ctx)
834 #else
835 static void
836 yy_symbol_print (yyoutput, yytype, yyvaluep, ctx)
837     FILE *yyoutput;
838     int yytype;
839     YYSTYPE const * const yyvaluep;
840     ap_expr_parse_ctx_t *ctx;
841 #endif
842 {
843   if (yytype < YYNTOKENS)
844     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
845   else
846     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
847
848   yy_symbol_value_print (yyoutput, yytype, yyvaluep, ctx);
849   YYFPRINTF (yyoutput, ")");
850 }
851
852 /*------------------------------------------------------------------.
853 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
854 | TOP (included).                                                   |
855 `------------------------------------------------------------------*/
856
857 #if (defined __STDC__ || defined __C99__FUNC__ \
858      || defined __cplusplus || defined _MSC_VER)
859 static void
860 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
861 #else
862 static void
863 yy_stack_print (yybottom, yytop)
864     yytype_int16 *yybottom;
865     yytype_int16 *yytop;
866 #endif
867 {
868   YYFPRINTF (stderr, "Stack now");
869   for (; yybottom <= yytop; yybottom++)
870     {
871       int yybot = *yybottom;
872       YYFPRINTF (stderr, " %d", yybot);
873     }
874   YYFPRINTF (stderr, "\n");
875 }
876
877 # define YY_STACK_PRINT(Bottom, Top)                            \
878 do {                                                            \
879   if (yydebug)                                                  \
880     yy_stack_print ((Bottom), (Top));                           \
881 } while (YYID (0))
882
883
884 /*------------------------------------------------.
885 | Report that the YYRULE is going to be reduced.  |
886 `------------------------------------------------*/
887
888 #if (defined __STDC__ || defined __C99__FUNC__ \
889      || defined __cplusplus || defined _MSC_VER)
890 static void
891 yy_reduce_print (YYSTYPE *yyvsp, int yyrule, ap_expr_parse_ctx_t *ctx)
892 #else
893 static void
894 yy_reduce_print (yyvsp, yyrule, ctx)
895     YYSTYPE *yyvsp;
896     int yyrule;
897     ap_expr_parse_ctx_t *ctx;
898 #endif
899 {
900   int yynrhs = yyr2[yyrule];
901   int yyi;
902   unsigned long int yylno = yyrline[yyrule];
903   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
904              yyrule - 1, yylno);
905   /* The symbols being reduced.  */
906   for (yyi = 0; yyi < yynrhs; yyi++)
907     {
908       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
909       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
910                        &(yyvsp[(yyi + 1) - (yynrhs)])
911                                        , ctx);
912       YYFPRINTF (stderr, "\n");
913     }
914 }
915
916 # define YY_REDUCE_PRINT(Rule)          \
917 do {                                    \
918   if (yydebug)                          \
919     yy_reduce_print (yyvsp, Rule, ctx); \
920 } while (YYID (0))
921
922 /* Nonzero means print parse trace.  It is left uninitialized so that
923    multiple parsers can coexist.  */
924 int yydebug;
925 #else /* !YYDEBUG */
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 */
931
932
933 /* YYINITDEPTH -- initial size of the parser's stacks.  */
934 #ifndef YYINITDEPTH
935 # define YYINITDEPTH 200
936 #endif
937
938 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
939    if the built-in stack extension method is used).
940
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.  */
944
945 #ifndef YYMAXDEPTH
946 # define YYMAXDEPTH 10000
947 #endif
948
949
950 #if YYERROR_VERBOSE
951
952 # ifndef yystrlen
953 #  if defined __GLIBC__ && defined _STRING_H
954 #   define yystrlen strlen
955 #  else
956 /* Return the length of YYSTR.  */
957 #if (defined __STDC__ || defined __C99__FUNC__ \
958      || defined __cplusplus || defined _MSC_VER)
959 static YYSIZE_T
960 yystrlen (const char *yystr)
961 #else
962 static YYSIZE_T
963 yystrlen (yystr)
964     const char *yystr;
965 #endif
966 {
967   YYSIZE_T yylen;
968   for (yylen = 0; yystr[yylen]; yylen++)
969     continue;
970   return yylen;
971 }
972 #  endif
973 # endif
974
975 # ifndef yystpcpy
976 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
977 #   define yystpcpy stpcpy
978 #  else
979 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
980    YYDEST.  */
981 #if (defined __STDC__ || defined __C99__FUNC__ \
982      || defined __cplusplus || defined _MSC_VER)
983 static char *
984 yystpcpy (char *yydest, const char *yysrc)
985 #else
986 static char *
987 yystpcpy (yydest, yysrc)
988     char *yydest;
989     const char *yysrc;
990 #endif
991 {
992   char *yyd = yydest;
993   const char *yys = yysrc;
994
995   while ((*yyd++ = *yys++) != '\0')
996     continue;
997
998   return yyd - 1;
999 }
1000 #  endif
1001 # endif
1002
1003 # ifndef yytnamerr
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
1010    would have been.  */
1011 static YYSIZE_T
1012 yytnamerr (char *yyres, const char *yystr)
1013 {
1014   if (*yystr == '"')
1015     {
1016       YYSIZE_T yyn = 0;
1017       char const *yyp = yystr;
1018
1019       for (;;)
1020         switch (*++yyp)
1021           {
1022           case '\'':
1023           case ',':
1024             goto do_not_strip_quotes;
1025
1026           case '\\':
1027             if (*++yyp != '\\')
1028               goto do_not_strip_quotes;
1029             /* Fall through.  */
1030           default:
1031             if (yyres)
1032               yyres[yyn] = *yyp;
1033             yyn++;
1034             break;
1035
1036           case '"':
1037             if (yyres)
1038               yyres[yyn] = '\0';
1039             return yyn;
1040           }
1041     do_not_strip_quotes: ;
1042     }
1043
1044   if (! yyres)
1045     return yystrlen (yystr);
1046
1047   return yystpcpy (yyres, yystr) - yyres;
1048 }
1049 # endif
1050
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
1053    YYSSP.
1054
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.  */
1059 static int
1060 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1061                 yytype_int16 *yyssp, int yytoken)
1062 {
1063   YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
1064   YYSIZE_T yysize = yysize0;
1065   YYSIZE_T yysize1;
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
1072      "expected"). */
1073   int yycount = 0;
1074
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
1079        function.
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.
1101   */
1102   if (yytoken != YYEMPTY)
1103     {
1104       int yyn = yypact[*yyssp];
1105       yyarg[yycount++] = yytname[yytoken];
1106       if (!yypact_value_is_default (yyn))
1107         {
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;
1115           int yyx;
1116
1117           for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1118             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1119                 && !yytable_value_is_error (yytable[yyx + yyn]))
1120               {
1121                 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1122                   {
1123                     yycount = 1;
1124                     yysize = yysize0;
1125                     break;
1126                   }
1127                 yyarg[yycount++] = yytname[yyx];
1128                 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1129                 if (! (yysize <= yysize1
1130                        && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1131                   return 2;
1132                 yysize = yysize1;
1133               }
1134         }
1135     }
1136
1137   switch (yycount)
1138     {
1139 # define YYCASE_(N, S)                      \
1140       case N:                               \
1141         yyformat = S;                       \
1142       break
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"));
1149 # undef YYCASE_
1150     }
1151
1152   yysize1 = yysize + yystrlen (yyformat);
1153   if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1154     return 2;
1155   yysize = yysize1;
1156
1157   if (*yymsg_alloc < yysize)
1158     {
1159       *yymsg_alloc = 2 * yysize;
1160       if (! (yysize <= *yymsg_alloc
1161              && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1162         *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1163       return 1;
1164     }
1165
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.  */
1169   {
1170     char *yyp = *yymsg;
1171     int yyi = 0;
1172     while ((*yyp = *yyformat) != '\0')
1173       if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1174         {
1175           yyp += yytnamerr (yyp, yyarg[yyi++]);
1176           yyformat += 2;
1177         }
1178       else
1179         {
1180           yyp++;
1181           yyformat++;
1182         }
1183   }
1184   return 0;
1185 }
1186 #endif /* YYERROR_VERBOSE */
1187
1188 /*-----------------------------------------------.
1189 | Release the memory associated to this symbol.  |
1190 `-----------------------------------------------*/
1191
1192 /*ARGSUSED*/
1193 #if (defined __STDC__ || defined __C99__FUNC__ \
1194      || defined __cplusplus || defined _MSC_VER)
1195 static void
1196 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, ap_expr_parse_ctx_t *ctx)
1197 #else
1198 static void
1199 yydestruct (yymsg, yytype, yyvaluep, ctx)
1200     const char *yymsg;
1201     int yytype;
1202     YYSTYPE *yyvaluep;
1203     ap_expr_parse_ctx_t *ctx;
1204 #endif
1205 {
1206   YYUSE (yyvaluep);
1207   YYUSE (ctx);
1208
1209   if (!yymsg)
1210     yymsg = "Deleting";
1211   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1212
1213   switch (yytype)
1214     {
1215
1216       default:
1217         break;
1218     }
1219 }
1220
1221
1222 /* Prevent warnings from -Wmissing-prototypes.  */
1223 #ifdef YYPARSE_PARAM
1224 #if defined __STDC__ || defined __cplusplus
1225 int yyparse (void *YYPARSE_PARAM);
1226 #else
1227 int yyparse ();
1228 #endif
1229 #else /* ! YYPARSE_PARAM */
1230 #if defined __STDC__ || defined __cplusplus
1231 int yyparse (ap_expr_parse_ctx_t *ctx);
1232 #else
1233 int yyparse ();
1234 #endif
1235 #endif /* ! YYPARSE_PARAM */
1236
1237
1238 /*----------.
1239 | yyparse.  |
1240 `----------*/
1241
1242 #ifdef YYPARSE_PARAM
1243 #if (defined __STDC__ || defined __C99__FUNC__ \
1244      || defined __cplusplus || defined _MSC_VER)
1245 int
1246 yyparse (void *YYPARSE_PARAM)
1247 #else
1248 int
1249 yyparse (YYPARSE_PARAM)
1250     void *YYPARSE_PARAM;
1251 #endif
1252 #else /* ! YYPARSE_PARAM */
1253 #if (defined __STDC__ || defined __C99__FUNC__ \
1254      || defined __cplusplus || defined _MSC_VER)
1255 int
1256 yyparse (ap_expr_parse_ctx_t *ctx)
1257 #else
1258 int
1259 yyparse (ctx)
1260     ap_expr_parse_ctx_t *ctx;
1261 #endif
1262 #endif
1263 {
1264 /* The lookahead symbol.  */
1265 int yychar;
1266
1267 /* The semantic value of the lookahead symbol.  */
1268 YYSTYPE yylval;
1269
1270     /* Number of syntax errors so far.  */
1271     int yynerrs;
1272
1273     int yystate;
1274     /* Number of tokens to shift before error messages enabled.  */
1275     int yyerrstatus;
1276
1277     /* The stacks and their tools:
1278        `yyss': related to states.
1279        `yyvs': related to semantic values.
1280
1281        Refer to the stacks thru separate pointers, to allow yyoverflow
1282        to reallocate them elsewhere.  */
1283
1284     /* The state stack.  */
1285     yytype_int16 yyssa[YYINITDEPTH];
1286     yytype_int16 *yyss;
1287     yytype_int16 *yyssp;
1288
1289     /* The semantic value stack.  */
1290     YYSTYPE yyvsa[YYINITDEPTH];
1291     YYSTYPE *yyvs;
1292     YYSTYPE *yyvsp;
1293
1294     YYSIZE_T yystacksize;
1295
1296   int yyn;
1297   int yyresult;
1298   /* Lookahead token as an internal (translated) token number.  */
1299   int yytoken;
1300   /* The variables used to return semantic value and location from the
1301      action routines.  */
1302   YYSTYPE yyval;
1303
1304 #if YYERROR_VERBOSE
1305   /* Buffer for error messages, and its allocated size.  */
1306   char yymsgbuf[128];
1307   char *yymsg = yymsgbuf;
1308   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1309 #endif
1310
1311 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1312
1313   /* The number of symbols on the RHS of the reduced rule.
1314      Keep to zero when no symbol should be popped.  */
1315   int yylen = 0;
1316
1317   yytoken = 0;
1318   yyss = yyssa;
1319   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
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.  */
1333   yyssp = yyss;
1334   yyvsp = yyvs;
1335
1336   goto yysetstate;
1337
1338 /*------------------------------------------------------------.
1339 | yynewstate -- Push a new state, which is found in yystate.  |
1340 `------------------------------------------------------------*/
1341  yynewstate:
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.  */
1344   yyssp++;
1345
1346  yysetstate:
1347   *yyssp = yystate;
1348
1349   if (yyss + yystacksize - 1 <= yyssp)
1350     {
1351       /* Get the current used size of the three stacks, in elements.  */
1352       YYSIZE_T yysize = yyssp - yyss + 1;
1353
1354 #ifdef yyoverflow
1355       {
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
1358            memory.  */
1359         YYSTYPE *yyvs1 = yyvs;
1360         yytype_int16 *yyss1 = yyss;
1361
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),
1369                     &yystacksize);
1370
1371         yyss = yyss1;
1372         yyvs = yyvs1;
1373       }
1374 #else /* no yyoverflow */
1375 # ifndef YYSTACK_RELOCATE
1376       goto yyexhaustedlab;
1377 # else
1378       /* Extend the stack our own way.  */
1379       if (YYMAXDEPTH <= yystacksize)
1380         goto yyexhaustedlab;
1381       yystacksize *= 2;
1382       if (YYMAXDEPTH < yystacksize)
1383         yystacksize = YYMAXDEPTH;
1384
1385       {
1386         yytype_int16 *yyss1 = yyss;
1387         union yyalloc *yyptr =
1388           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1389         if (! yyptr)
1390           goto yyexhaustedlab;
1391         YYSTACK_RELOCATE (yyss_alloc, yyss);
1392         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1393 #  undef YYSTACK_RELOCATE
1394         if (yyss1 != yyssa)
1395           YYSTACK_FREE (yyss1);
1396       }
1397 # endif
1398 #endif /* no yyoverflow */
1399
1400       yyssp = yyss + yysize - 1;
1401       yyvsp = yyvs + yysize - 1;
1402
1403       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1404                   (unsigned long int) yystacksize));
1405
1406       if (yyss + yystacksize - 1 <= yyssp)
1407         YYABORT;
1408     }
1409
1410   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1411
1412   if (yystate == YYFINAL)
1413     YYACCEPT;
1414
1415   goto yybackup;
1416
1417 /*-----------.
1418 | yybackup.  |
1419 `-----------*/
1420 yybackup:
1421
1422   /* Do appropriate processing given the current state.  Read a
1423      lookahead token if we need one and don't already have one.  */
1424
1425   /* First try to decide what to do without reference to lookahead token.  */
1426   yyn = yypact[yystate];
1427   if (yypact_value_is_default (yyn))
1428     goto yydefault;
1429
1430   /* Not known => get a lookahead token if don't already have one.  */
1431
1432   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1433   if (yychar == YYEMPTY)
1434     {
1435       YYDPRINTF ((stderr, "Reading a token: "));
1436       yychar = YYLEX;
1437     }
1438
1439   if (yychar <= YYEOF)
1440     {
1441       yychar = yytoken = YYEOF;
1442       YYDPRINTF ((stderr, "Now at end of input.\n"));
1443     }
1444   else
1445     {
1446       yytoken = YYTRANSLATE (yychar);
1447       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1448     }
1449
1450   /* If the proper action on seeing token YYTOKEN is to reduce or to
1451      detect an error, take that action.  */
1452   yyn += yytoken;
1453   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1454     goto yydefault;
1455   yyn = yytable[yyn];
1456   if (yyn <= 0)
1457     {
1458       if (yytable_value_is_error (yyn))
1459         goto yyerrlab;
1460       yyn = -yyn;
1461       goto yyreduce;
1462     }
1463
1464   /* Count tokens shifted since error; after three, turn off error
1465      status.  */
1466   if (yyerrstatus)
1467     yyerrstatus--;
1468
1469   /* Shift the lookahead token.  */
1470   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1471
1472   /* Discard the shifted token.  */
1473   yychar = YYEMPTY;
1474
1475   yystate = yyn;
1476   *++yyvsp = yylval;
1477
1478   goto yynewstate;
1479
1480
1481 /*-----------------------------------------------------------.
1482 | yydefault -- do the default action for the current state.  |
1483 `-----------------------------------------------------------*/
1484 yydefault:
1485   yyn = yydefact[yystate];
1486   if (yyn == 0)
1487     goto yyerrlab;
1488   goto yyreduce;
1489
1490
1491 /*-----------------------------.
1492 | yyreduce -- Do a reduction.  |
1493 `-----------------------------*/
1494 yyreduce:
1495   /* yyn is the number of a rule to reduce with.  */
1496   yylen = yyr2[yyn];
1497
1498   /* If YYLEN is nonzero, implement the default value of the action:
1499      `$$ = $1'.
1500
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];
1507
1508
1509   YY_REDUCE_PRINT (yyn);
1510   switch (yyn)
1511     {
1512         case 2:
1513
1514 /* Line 1806 of yacc.c  */
1515 #line 112 "util_expr_parse.y"
1516     { ctx->expr = (yyvsp[(2) - (2)].exVal); }
1517     break;
1518
1519   case 3:
1520
1521 /* Line 1806 of yacc.c  */
1522 #line 113 "util_expr_parse.y"
1523     { ctx->expr = (yyvsp[(2) - (2)].exVal); }
1524     break;
1525
1526   case 4:
1527
1528 /* Line 1806 of yacc.c  */
1529 #line 114 "util_expr_parse.y"
1530     { YYABORT; }
1531     break;
1532
1533   case 5:
1534
1535 /* Line 1806 of yacc.c  */
1536 #line 117 "util_expr_parse.y"
1537     { (yyval.exVal) = ap_expr_make(op_True,        NULL, NULL, ctx); }
1538     break;
1539
1540   case 6:
1541
1542 /* Line 1806 of yacc.c  */
1543 #line 118 "util_expr_parse.y"
1544     { (yyval.exVal) = ap_expr_make(op_False,       NULL, NULL, ctx); }
1545     break;
1546
1547   case 7:
1548
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); }
1552     break;
1553
1554   case 8:
1555
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); }
1559     break;
1560
1561   case 9:
1562
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); }
1566     break;
1567
1568   case 10:
1569
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); }
1573     break;
1574
1575   case 11:
1576
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); }
1580     break;
1581
1582   case 12:
1583
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); }
1587     break;
1588
1589   case 13:
1590
1591 /* Line 1806 of yacc.c  */
1592 #line 125 "util_expr_parse.y"
1593     { (yyval.exVal) = (yyvsp[(2) - (3)].exVal); }
1594     break;
1595
1596   case 14:
1597
1598 /* Line 1806 of yacc.c  */
1599 #line 126 "util_expr_parse.y"
1600     { YYABORT; }
1601     break;
1602
1603   case 15:
1604
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); }
1608     break;
1609
1610   case 16:
1611
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); }
1615     break;
1616
1617   case 17:
1618
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); }
1622     break;
1623
1624   case 18:
1625
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); }
1629     break;
1630
1631   case 19:
1632
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); }
1636     break;
1637
1638   case 20:
1639
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); }
1643     break;
1644
1645   case 21:
1646
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); }
1650     break;
1651
1652   case 22:
1653
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); }
1657     break;
1658
1659   case 23:
1660
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); }
1664     break;
1665
1666   case 24:
1667
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); }
1671     break;
1672
1673   case 25:
1674
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); }
1678     break;
1679
1680   case 26:
1681
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); }
1685     break;
1686
1687   case 27:
1688
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); }
1692     break;
1693
1694   case 28:
1695
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); }
1699     break;
1700
1701   case 29:
1702
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); }
1706     break;
1707
1708   case 30:
1709
1710 /* Line 1806 of yacc.c  */
1711 #line 146 "util_expr_parse.y"
1712     { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1713     break;
1714
1715   case 31:
1716
1717 /* Line 1806 of yacc.c  */
1718 #line 147 "util_expr_parse.y"
1719     { (yyval.exVal) = (yyvsp[(2) - (3)].exVal); }
1720     break;
1721
1722   case 32:
1723
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); }
1727     break;
1728
1729   case 33:
1730
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); }
1734     break;
1735
1736   case 34:
1737
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); }
1741     break;
1742
1743   case 35:
1744
1745 /* Line 1806 of yacc.c  */
1746 #line 155 "util_expr_parse.y"
1747     { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1748     break;
1749
1750   case 36:
1751
1752 /* Line 1806 of yacc.c  */
1753 #line 156 "util_expr_parse.y"
1754     { YYABORT; }
1755     break;
1756
1757   case 37:
1758
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); }
1762     break;
1763
1764   case 38:
1765
1766 /* Line 1806 of yacc.c  */
1767 #line 160 "util_expr_parse.y"
1768     { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1769     break;
1770
1771   case 39:
1772
1773 /* Line 1806 of yacc.c  */
1774 #line 161 "util_expr_parse.y"
1775     { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1776     break;
1777
1778   case 40:
1779
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); }
1783     break;
1784
1785   case 41:
1786
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); }
1790     break;
1791
1792   case 42:
1793
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); }
1797     break;
1798
1799   case 43:
1800
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); }
1804     break;
1805
1806   case 44:
1807
1808 /* Line 1806 of yacc.c  */
1809 #line 170 "util_expr_parse.y"
1810     { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1811     break;
1812
1813   case 45:
1814
1815 /* Line 1806 of yacc.c  */
1816 #line 171 "util_expr_parse.y"
1817     { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1818     break;
1819
1820   case 46:
1821
1822 /* Line 1806 of yacc.c  */
1823 #line 172 "util_expr_parse.y"
1824     { (yyval.exVal) = (yyvsp[(1) - (1)].exVal); }
1825     break;
1826
1827   case 47:
1828
1829 /* Line 1806 of yacc.c  */
1830 #line 173 "util_expr_parse.y"
1831     { (yyval.exVal) = (yyvsp[(2) - (3)].exVal); }
1832     break;
1833
1834   case 48:
1835
1836 /* Line 1806 of yacc.c  */
1837 #line 174 "util_expr_parse.y"
1838     { (yyval.exVal) = ap_expr_make(op_String, "", NULL, ctx); }
1839     break;
1840
1841   case 49:
1842
1843 /* Line 1806 of yacc.c  */
1844 #line 177 "util_expr_parse.y"
1845     {
1846                 ap_regex_t *regex;
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";
1850                     YYERROR;
1851                 }
1852                 (yyval.exVal) = ap_expr_make(op_Regex, regex, NULL, ctx);
1853             }
1854     break;
1855
1856   case 50:
1857
1858 /* Line 1806 of yacc.c  */
1859 #line 186 "util_expr_parse.y"
1860     {
1861                 ap_regex_t *regex;
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";
1865                     YYERROR;
1866                 }
1867                 (yyval.exVal) = ap_expr_make(op_Regex, regex, NULL, ctx);
1868             }
1869     break;
1870
1871   case 51:
1872
1873 /* Line 1806 of yacc.c  */
1874 #line 197 "util_expr_parse.y"
1875     {
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);
1879             }
1880     break;
1881
1882   case 52:
1883
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); }
1887     break;
1888
1889   case 53:
1890
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); }
1894     break;
1895
1896   case 54:
1897
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); }
1901     break;
1902
1903
1904
1905 /* Line 1806 of yacc.c  */
1906 #line 1907 "util_expr_parse.c"
1907       default: break;
1908     }
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);
1921
1922   YYPOPSTACK (yylen);
1923   yylen = 0;
1924   YY_STACK_PRINT (yyss, yyssp);
1925
1926   *++yyvsp = yyval;
1927
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.  */
1931
1932   yyn = yyr1[yyn];
1933
1934   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1935   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1936     yystate = yytable[yystate];
1937   else
1938     yystate = yydefgoto[yyn - YYNTOKENS];
1939
1940   goto yynewstate;
1941
1942
1943 /*------------------------------------.
1944 | yyerrlab -- here on detecting error |
1945 `------------------------------------*/
1946 yyerrlab:
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);
1950
1951   /* If not already recovering from an error, report this error.  */
1952   if (!yyerrstatus)
1953     {
1954       ++yynerrs;
1955 #if ! YYERROR_VERBOSE
1956       yyerror (ctx, YY_("syntax error"));
1957 #else
1958 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1959                                         yyssp, yytoken)
1960       {
1961         char const *yymsgp = YY_("syntax error");
1962         int yysyntax_error_status;
1963         yysyntax_error_status = YYSYNTAX_ERROR;
1964         if (yysyntax_error_status == 0)
1965           yymsgp = yymsg;
1966         else if (yysyntax_error_status == 1)
1967           {
1968             if (yymsg != yymsgbuf)
1969               YYSTACK_FREE (yymsg);
1970             yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1971             if (!yymsg)
1972               {
1973                 yymsg = yymsgbuf;
1974                 yymsg_alloc = sizeof yymsgbuf;
1975                 yysyntax_error_status = 2;
1976               }
1977             else
1978               {
1979                 yysyntax_error_status = YYSYNTAX_ERROR;
1980                 yymsgp = yymsg;
1981               }
1982           }
1983         yyerror (ctx, yymsgp);
1984         if (yysyntax_error_status == 2)
1985           goto yyexhaustedlab;
1986       }
1987 # undef YYSYNTAX_ERROR
1988 #endif
1989     }
1990
1991
1992
1993   if (yyerrstatus == 3)
1994     {
1995       /* If just tried and failed to reuse lookahead token after an
1996          error, discard it.  */
1997
1998       if (yychar <= YYEOF)
1999         {
2000           /* Return failure if at end of input.  */
2001           if (yychar == YYEOF)
2002             YYABORT;
2003         }
2004       else
2005         {
2006           yydestruct ("Error: discarding",
2007                       yytoken, &yylval, ctx);
2008           yychar = YYEMPTY;
2009         }
2010     }
2011
2012   /* Else will try to reuse lookahead token after shifting the error
2013      token.  */
2014   goto yyerrlab1;
2015
2016
2017 /*---------------------------------------------------.
2018 | yyerrorlab -- error raised explicitly by YYERROR.  |
2019 `---------------------------------------------------*/
2020 yyerrorlab:
2021
2022   /* Pacify compilers like GCC when the user code never invokes
2023      YYERROR and the label yyerrorlab therefore never appears in user
2024      code.  */
2025   if (/*CONSTCOND*/ 0)
2026      goto yyerrorlab;
2027
2028   /* Do not reclaim the symbols of the rule which action triggered
2029      this YYERROR.  */
2030   YYPOPSTACK (yylen);
2031   yylen = 0;
2032   YY_STACK_PRINT (yyss, yyssp);
2033   yystate = *yyssp;
2034   goto yyerrlab1;
2035
2036
2037 /*-------------------------------------------------------------.
2038 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
2039 `-------------------------------------------------------------*/
2040 yyerrlab1:
2041   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
2042
2043   for (;;)
2044     {
2045       yyn = yypact[yystate];
2046       if (!yypact_value_is_default (yyn))
2047         {
2048           yyn += YYTERROR;
2049           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2050             {
2051               yyn = yytable[yyn];
2052               if (0 < yyn)
2053                 break;
2054             }
2055         }
2056
2057       /* Pop the current state because it cannot handle the error token.  */
2058       if (yyssp == yyss)
2059         YYABORT;
2060
2061
2062       yydestruct ("Error: popping",
2063                   yystos[yystate], yyvsp, ctx);
2064       YYPOPSTACK (1);
2065       yystate = *yyssp;
2066       YY_STACK_PRINT (yyss, yyssp);
2067     }
2068
2069   *++yyvsp = yylval;
2070
2071
2072   /* Shift the error token.  */
2073   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2074
2075   yystate = yyn;
2076   goto yynewstate;
2077
2078
2079 /*-------------------------------------.
2080 | yyacceptlab -- YYACCEPT comes here.  |
2081 `-------------------------------------*/
2082 yyacceptlab:
2083   yyresult = 0;
2084   goto yyreturn;
2085
2086 /*-----------------------------------.
2087 | yyabortlab -- YYABORT comes here.  |
2088 `-----------------------------------*/
2089 yyabortlab:
2090   yyresult = 1;
2091   goto yyreturn;
2092
2093 #if !defined(yyoverflow) || YYERROR_VERBOSE
2094 /*-------------------------------------------------.
2095 | yyexhaustedlab -- memory exhaustion comes here.  |
2096 `-------------------------------------------------*/
2097 yyexhaustedlab:
2098   yyerror (ctx, YY_("memory exhausted"));
2099   yyresult = 2;
2100   /* Fall through.  */
2101 #endif
2102
2103 yyreturn:
2104   if (yychar != YYEMPTY)
2105     {
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);
2111     }
2112   /* Do not reclaim the symbols of the rule which action triggered
2113      this YYABORT or YYACCEPT.  */
2114   YYPOPSTACK (yylen);
2115   YY_STACK_PRINT (yyss, yyssp);
2116   while (yyssp != yyss)
2117     {
2118       yydestruct ("Cleanup: popping",
2119                   yystos[*yyssp], yyvsp, ctx);
2120       YYPOPSTACK (1);
2121     }
2122 #ifndef yyoverflow
2123   if (yyss != yyssa)
2124     YYSTACK_FREE (yyss);
2125 #endif
2126 #if YYERROR_VERBOSE
2127   if (yymsg != yymsgbuf)
2128     YYSTACK_FREE (yymsg);
2129 #endif
2130   /* Make sure YYID is used.  */
2131   return YYID (yyresult);
2132 }
2133
2134
2135
2136 /* Line 2067 of yacc.c  */
2137 #line 211 "util_expr_parse.y"
2138
2139
2140 void yyerror(ap_expr_parse_ctx_t *ctx, const char *s)
2141 {
2142     /* s is allocated on the stack */
2143     ctx->error = apr_pstrdup(ctx->ptemp, s);
2144 }
2145
2146