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