bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / modules / ssl / ssl_expr_parse.c
1
2 /*  A Bison parser, made from ssl_expr_parse.y
3     by GNU Bison version 1.28  */
4
5 #define YYBISON 1  /* Identify Bison output.  */
6
7 #define T_TRUE  257
8 #define T_FALSE 258
9 #define T_DIGIT 259
10 #define T_ID    260
11 #define T_STRING        261
12 #define T_REGEX 262
13 #define T_REGEX_I       263
14 #define T_FUNC_FILE     264
15 #define T_OP_EQ 265
16 #define T_OP_NE 266
17 #define T_OP_LT 267
18 #define T_OP_LE 268
19 #define T_OP_GT 269
20 #define T_OP_GE 270
21 #define T_OP_REG        271
22 #define T_OP_NRE        272
23 #define T_OP_IN 273
24 #define T_OP_OR 274
25 #define T_OP_AND        275
26 #define T_OP_NOT        276
27
28 #line 68 "ssl_expr_parse.y"
29
30 #include "mod_ssl.h"
31
32 #line 72 "ssl_expr_parse.y"
33 typedef union {
34     char     *cpVal;
35     ssl_expr *exVal;
36 } YYSTYPE;
37 #include <stdio.h>
38
39 #ifndef __cplusplus
40 #ifndef __STDC__
41 #define const
42 #endif
43 #endif
44
45
46
47 #define YYFINAL         53
48 #define YYFLAG          -32768
49 #define YYNTBASE        29
50
51 #define YYTRANSLATE(x) ((unsigned)(x) <= 276 ? ssl_expr_yytranslate[x] : 36)
52
53 static const char ssl_expr_yytranslate[] = {     0,
54      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
55      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
56      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
57      2,     2,     2,     2,     2,     2,    28,     2,     2,    23,
58     24,     2,     2,    27,     2,     2,     2,     2,     2,     2,
59      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
60      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
61      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
62      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
63      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
64      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
65      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
66      2,     2,    25,     2,    26,     2,     2,     2,     2,     2,
67      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
68      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
69      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
70      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
71      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
72      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
73      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
74      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
75      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
76      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
77      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
78      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
79      2,     2,     2,     2,     2,     1,     3,     4,     5,     6,
80      7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
81     17,    18,    19,    20,    21,    22
82 };
83
84 #if YYDEBUG != 0
85 static const short ssl_expr_yyprhs[] = {     0,
86      0,     2,     4,     6,     9,    13,    17,    19,    23,    27,
87     31,    35,    39,    43,    47,    53,    57,    61,    63,    67,
88     69,    71,    76,    78,    80,    82
89 };
90
91 static const short ssl_expr_yyrhs[] = {    30,
92      0,     3,     0,     4,     0,    22,    30,     0,    30,    20,
93     30,     0,    30,    21,    30,     0,    31,     0,    23,    30,
94     24,     0,    33,    11,    33,     0,    33,    12,    33,     0,
95     33,    13,    33,     0,    33,    14,    33,     0,    33,    15,
96     33,     0,    33,    16,    33,     0,    33,    19,    25,    32,
97     26,     0,    33,    17,    34,     0,    33,    18,    34,     0,
98     33,     0,    32,    27,    33,     0,     5,     0,     7,     0,
99     28,    25,     6,    26,     0,    35,     0,     8,     0,     9,
100      0,    10,    23,     7,    24,     0
101 };
102
103 #endif
104
105 #if YYDEBUG != 0
106 static const short ssl_expr_yyrline[] = { 0,
107    115,   118,   119,   120,   121,   122,   123,   124,   127,   128,
108    129,   130,   131,   132,   133,   134,   135,   138,   139,   142,
109    143,   144,   145,   148,   158,   170
110 };
111 #endif
112
113
114 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
115
116 static const char * const ssl_expr_yytname[] = {   "$","error","$undefined.","T_TRUE",
117 "T_FALSE","T_DIGIT","T_ID","T_STRING","T_REGEX","T_REGEX_I","T_FUNC_FILE","T_OP_EQ",
118 "T_OP_NE","T_OP_LT","T_OP_LE","T_OP_GT","T_OP_GE","T_OP_REG","T_OP_NRE","T_OP_IN",
119 "T_OP_OR","T_OP_AND","T_OP_NOT","'('","')'","'{'","'}'","','","'%'","root","expr",
120 "comparison","words","word","regex","funccall", NULL
121 };
122 #endif
123
124 static const short ssl_expr_yyr1[] = {     0,
125     29,    30,    30,    30,    30,    30,    30,    30,    31,    31,
126     31,    31,    31,    31,    31,    31,    31,    32,    32,    33,
127     33,    33,    33,    34,    34,    35
128 };
129
130 static const short ssl_expr_yyr2[] = {     0,
131      1,     1,     1,     2,     3,     3,     1,     3,     3,     3,
132      3,     3,     3,     3,     5,     3,     3,     1,     3,     1,
133      1,     4,     1,     1,     1,     4
134 };
135
136 static const short ssl_expr_yydefact[] = {     0,
137      2,     3,    20,    21,     0,     0,     0,     0,     1,     7,
138      0,    23,     0,     4,     0,     0,     0,     0,     0,     0,
139      0,     0,     0,     0,     0,     0,     0,     0,     8,     0,
140      5,     6,     9,    10,    11,    12,    13,    14,    24,    25,
141     16,    17,     0,    26,    22,     0,    18,    15,     0,    19,
142      0,     0,     0
143 };
144
145 static const short ssl_expr_yydefgoto[] = {    51,
146      9,    10,    46,    11,    41,    12
147 };
148
149 static const short ssl_expr_yypact[] = {     3,
150 -32768,-32768,-32768,-32768,   -11,     3,     3,   -10,     0,-32768,
151     22,-32768,    16,-32768,    -2,    23,     3,     3,     4,     4,
152      4,     4,     4,     4,    34,    34,    21,    24,-32768,    25,
153     26,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
154 -32768,-32768,     4,-32768,-32768,    18,-32768,-32768,     4,-32768,
155     49,    50,-32768
156 };
157
158 static const short ssl_expr_yypgoto[] = {-32768,
159     10,-32768,-32768,   -19,    27,-32768
160 };
161
162
163 #define YYLAST          53
164
165
166 static const short ssl_expr_yytable[] = {    33,
167     34,    35,    36,    37,    38,     1,     2,     3,     3,     4,
168      4,    13,     5,     5,    16,    14,    15,    17,    18,    17,
169     18,    29,    28,    47,     6,     7,    31,    32,    30,    50,
170      8,     8,    19,    20,    21,    22,    23,    24,    25,    26,
171     27,    39,    40,    48,    49,    43,    18,    44,    52,    53,
172     45,     0,    42
173 };
174
175 static const short ssl_expr_yycheck[] = {    19,
176     20,    21,    22,    23,    24,     3,     4,     5,     5,     7,
177      7,    23,    10,    10,    25,     6,     7,    20,    21,    20,
178     21,    24,     7,    43,    22,    23,    17,    18,     6,    49,
179     28,    28,    11,    12,    13,    14,    15,    16,    17,    18,
180     19,     8,     9,    26,    27,    25,    21,    24,     0,     0,
181     26,    -1,    26
182 };
183 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
184 #line 3 "/usr/local/share/bison.simple"
185 /* This file comes from bison-1.28.  */
186
187 /* Skeleton output parser for bison,
188    Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
189
190    This program is free software; you can redistribute it and/or modify
191    it under the terms of the GNU General Public License as published by
192    the Free Software Foundation; either version 2, or (at your option)
193    any later version.
194
195    This program is distributed in the hope that it will be useful,
196    but WITHOUT ANY WARRANTY; without even the implied warranty of
197    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
198    GNU General Public License for more details.
199
200    You should have received a copy of the GNU General Public License
201    along with this program; if not, write to the Free Software
202    Foundation, Inc., 59 Temple Place - Suite 330,
203    Boston, MA 02111-1307, USA.  */
204
205 /* As a special exception, when this file is copied by Bison into a
206    Bison output file, you may use that output file without restriction.
207    This special exception was added by the Free Software Foundation
208    in version 1.24 of Bison.  */
209
210 /* This is the parser code that is written into each bison parser
211   when the %semantic_parser declaration is not specified in the grammar.
212   It was written by Richard Stallman by simplifying the hairy parser
213   used when %semantic_parser is specified.  */
214
215 #ifndef YYSTACK_USE_ALLOCA
216 #ifdef alloca
217 #define YYSTACK_USE_ALLOCA
218 #else /* alloca not defined */
219 #ifdef __GNUC__
220 #define YYSTACK_USE_ALLOCA
221 #define alloca __builtin_alloca
222 #else /* not GNU C.  */
223 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
224 #define YYSTACK_USE_ALLOCA
225 #include <alloca.h>
226 #else /* not sparc */
227 /* We think this test detects Watcom and Microsoft C.  */
228 /* This used to test MSDOS, but that is a bad idea
229    since that symbol is in the user namespace.  */
230 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
231 #if 0 /* No need for malloc.h, which pollutes the namespace;
232          instead, just don't use alloca.  */
233 #include <malloc.h>
234 #endif
235 #else /* not MSDOS, or __TURBOC__ */
236 #if defined(_AIX)
237 /* I don't know what this was needed for, but it pollutes the namespace.
238    So I turned it off.   rms, 2 May 1997.  */
239 /* #include <malloc.h>  */
240 #pragma alloca
241 #define YYSTACK_USE_ALLOCA
242 #else /* not MSDOS, or __TURBOC__, or _AIX */
243 #if 0
244 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
245                  and on HPUX 10.  Eventually we can turn this on.  */
246 #define YYSTACK_USE_ALLOCA
247 #define alloca __builtin_alloca
248 #endif /* __hpux */
249 #endif
250 #endif /* not _AIX */
251 #endif /* not MSDOS, or __TURBOC__ */
252 #endif /* not sparc */
253 #endif /* not GNU C */
254 #endif /* alloca not defined */
255 #endif /* YYSTACK_USE_ALLOCA not defined */
256
257 #ifdef YYSTACK_USE_ALLOCA
258 #define YYSTACK_ALLOC alloca
259 #else
260 #define YYSTACK_ALLOC malloc
261 #endif
262
263 /* Note: there must be only one dollar sign in this file.
264    It is replaced by the list of actions, each action
265    as one case of the switch.  */
266
267 #define ssl_expr_yyerrok                (ssl_expr_yyerrstatus = 0)
268 #define ssl_expr_yyclearin      (ssl_expr_yychar = YYEMPTY)
269 #define YYEMPTY         -2
270 #define YYEOF           0
271 #define YYACCEPT        goto ssl_expr_yyacceptlab
272 #define YYABORT         goto ssl_expr_yyabortlab
273 #define YYERROR         goto ssl_expr_yyerrlab1
274 /* Like YYERROR except do call ssl_expr_yyerror.
275    This remains here temporarily to ease the
276    transition to the new meaning of YYERROR, for GCC.
277    Once GCC version 2 has supplanted version 1, this can go.  */
278 #define YYFAIL          goto ssl_expr_yyerrlab
279 #define YYRECOVERING()  (!!ssl_expr_yyerrstatus)
280 #define YYBACKUP(token, value) \
281 do                                                              \
282   if (ssl_expr_yychar == YYEMPTY && ssl_expr_yylen == 1)                                \
283     { ssl_expr_yychar = (token), ssl_expr_yylval = (value);                     \
284       ssl_expr_yychar1 = YYTRANSLATE (ssl_expr_yychar);                         \
285       YYPOPSTACK;                                               \
286       goto ssl_expr_yybackup;                                           \
287     }                                                           \
288   else                                                          \
289     { ssl_expr_yyerror ("syntax error: cannot back up"); YYERROR; }     \
290 while (0)
291
292 #define YYTERROR        1
293 #define YYERRCODE       256
294
295 #ifndef YYPURE
296 #define YYLEX           ssl_expr_yylex()
297 #endif
298
299 #ifdef YYPURE
300 #ifdef YYLSP_NEEDED
301 #ifdef YYLEX_PARAM
302 #define YYLEX           ssl_expr_yylex(&ssl_expr_yylval, &ssl_expr_yylloc, YYLEX_PARAM)
303 #else
304 #define YYLEX           ssl_expr_yylex(&ssl_expr_yylval, &ssl_expr_yylloc)
305 #endif
306 #else /* not YYLSP_NEEDED */
307 #ifdef YYLEX_PARAM
308 #define YYLEX           ssl_expr_yylex(&ssl_expr_yylval, YYLEX_PARAM)
309 #else
310 #define YYLEX           ssl_expr_yylex(&ssl_expr_yylval)
311 #endif
312 #endif /* not YYLSP_NEEDED */
313 #endif
314
315 /* If nonreentrant, generate the variables here */
316
317 #ifndef YYPURE
318
319 int     ssl_expr_yychar;                        /*  the lookahead symbol                */
320 YYSTYPE ssl_expr_yylval;                        /*  the semantic value of the           */
321                                 /*  lookahead symbol                    */
322
323 #ifdef YYLSP_NEEDED
324 YYLTYPE ssl_expr_yylloc;                        /*  location data for the lookahead     */
325                                 /*  symbol                              */
326 #endif
327
328 int ssl_expr_yynerrs;                   /*  number of parse errors so far       */
329 #endif  /* not YYPURE */
330
331 #if YYDEBUG != 0
332 int ssl_expr_yydebug;                   /*  nonzero means print parse trace     */
333 /* Since this is uninitialized, it does not stop multiple parsers
334    from coexisting.  */
335 #endif
336
337 /*  YYINITDEPTH indicates the initial size of the parser's stacks       */
338
339 #ifndef YYINITDEPTH
340 #define YYINITDEPTH 200
341 #endif
342
343 /*  YYMAXDEPTH is the maximum size the stacks can grow to
344     (effective only if the built-in stack extension method is used).  */
345
346 #if YYMAXDEPTH == 0
347 #undef YYMAXDEPTH
348 #endif
349
350 #ifndef YYMAXDEPTH
351 #define YYMAXDEPTH 10000
352 #endif
353
354 /* Define __ssl_expr_yy_memcpy.  Note that the size argument
355    should be passed with type unsigned int, because that is what the non-GCC
356    definitions require.  With GCC, __builtin_memcpy takes an arg
357    of type size_t, but it can handle unsigned int.  */
358
359 #if __GNUC__ > 1                /* GNU C and GNU C++ define this.  */
360 #define __ssl_expr_yy_memcpy(TO,FROM,COUNT)     __builtin_memcpy(TO,FROM,COUNT)
361 #else                           /* not GNU C or C++ */
362 #ifndef __cplusplus
363
364 /* This is the most reliable way to avoid incompatibilities
365    in available built-in functions on various systems.  */
366 static void
367 __ssl_expr_yy_memcpy (to, from, count)
368      char *to;
369      char *from;
370      unsigned int count;
371 {
372   register char *f = from;
373   register char *t = to;
374   register int i = count;
375
376   while (i-- > 0)
377     *t++ = *f++;
378 }
379
380 #else /* __cplusplus */
381
382 /* This is the most reliable way to avoid incompatibilities
383    in available built-in functions on various systems.  */
384 static void
385 __ssl_expr_yy_memcpy (char *to, char *from, unsigned int count)
386 {
387   register char *t = to;
388   register char *f = from;
389   register int i = count;
390
391   while (i-- > 0)
392     *t++ = *f++;
393 }
394
395 #endif
396 #endif
397 \f
398 #line 217 "/usr/local/share/bison.simple"
399
400 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
401    into ssl_expr_yyparse.  The argument should have type void *.
402    It should actually point to an object.
403    Grammar actions can access the variable by casting it
404    to the proper pointer type.  */
405
406 #ifdef YYPARSE_PARAM
407 #ifdef __cplusplus
408 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
409 #define YYPARSE_PARAM_DECL
410 #else /* not __cplusplus */
411 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
412 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
413 #endif /* not __cplusplus */
414 #else /* not YYPARSE_PARAM */
415 #define YYPARSE_PARAM_ARG
416 #define YYPARSE_PARAM_DECL
417 #endif /* not YYPARSE_PARAM */
418
419 /* Prevent warning if -Wstrict-prototypes.  */
420 #ifdef __GNUC__
421 #ifdef YYPARSE_PARAM
422 int ssl_expr_yyparse (void *);
423 #else
424 int ssl_expr_yyparse (void);
425 #endif
426 #endif
427
428 int
429 ssl_expr_yyparse(YYPARSE_PARAM_ARG)
430      YYPARSE_PARAM_DECL
431 {
432   register int ssl_expr_yystate;
433   register int ssl_expr_yyn;
434   register short *ssl_expr_yyssp;
435   register YYSTYPE *ssl_expr_yyvsp;
436   int ssl_expr_yyerrstatus;     /*  number of tokens to shift before error messages enabled */
437   int ssl_expr_yychar1 = 0;             /*  lookahead token as an internal (translated) token number */
438
439   short ssl_expr_yyssa[YYINITDEPTH];    /*  the state stack                     */
440   YYSTYPE ssl_expr_yyvsa[YYINITDEPTH];  /*  the semantic value stack            */
441
442   short *ssl_expr_yyss = ssl_expr_yyssa;                /*  refer to the stacks thru separate pointers */
443   YYSTYPE *ssl_expr_yyvs = ssl_expr_yyvsa;      /*  to allow ssl_expr_yyoverflow to reallocate them elsewhere */
444
445 #ifdef YYLSP_NEEDED
446   YYLTYPE ssl_expr_yylsa[YYINITDEPTH];  /*  the location stack                  */
447   YYLTYPE *ssl_expr_yyls = ssl_expr_yylsa;
448   YYLTYPE *ssl_expr_yylsp;
449
450 #define YYPOPSTACK   (ssl_expr_yyvsp--, ssl_expr_yyssp--, ssl_expr_yylsp--)
451 #else
452 #define YYPOPSTACK   (ssl_expr_yyvsp--, ssl_expr_yyssp--)
453 #endif
454
455   int ssl_expr_yystacksize = YYINITDEPTH;
456   int ssl_expr_yyfree_stacks = 0;
457
458 #ifdef YYPURE
459   int ssl_expr_yychar;
460   YYSTYPE ssl_expr_yylval;
461   int ssl_expr_yynerrs;
462 #ifdef YYLSP_NEEDED
463   YYLTYPE ssl_expr_yylloc;
464 #endif
465 #endif
466
467   YYSTYPE ssl_expr_yyval;               /*  the variable used to return         */
468                                 /*  semantic values from the action     */
469                                 /*  routines                            */
470
471   int ssl_expr_yylen;
472
473 #if YYDEBUG != 0
474   if (ssl_expr_yydebug)
475     fprintf(stderr, "Starting parse\n");
476 #endif
477
478   ssl_expr_yystate = 0;
479   ssl_expr_yyerrstatus = 0;
480   ssl_expr_yynerrs = 0;
481   ssl_expr_yychar = YYEMPTY;            /* Cause a token to be read.  */
482
483   /* Initialize stack pointers.
484      Waste one element of value and location stack
485      so that they stay on the same level as the state stack.
486      The wasted elements are never initialized.  */
487
488   ssl_expr_yyssp = ssl_expr_yyss - 1;
489   ssl_expr_yyvsp = ssl_expr_yyvs;
490 #ifdef YYLSP_NEEDED
491   ssl_expr_yylsp = ssl_expr_yyls;
492 #endif
493
494 /* Push a new state, which is found in  ssl_expr_yystate  .  */
495 /* In all cases, when you get here, the value and location stacks
496    have just been pushed. so pushing a state here evens the stacks.  */
497 ssl_expr_yynewstate:
498
499   *++ssl_expr_yyssp = ssl_expr_yystate;
500
501   if (ssl_expr_yyssp >= ssl_expr_yyss + ssl_expr_yystacksize - 1)
502     {
503       /* Give user a chance to reallocate the stack */
504       /* Use copies of these so that the &'s don't force the real ones into memory. */
505       YYSTYPE *ssl_expr_yyvs1 = ssl_expr_yyvs;
506       short *ssl_expr_yyss1 = ssl_expr_yyss;
507 #ifdef YYLSP_NEEDED
508       YYLTYPE *ssl_expr_yyls1 = ssl_expr_yyls;
509 #endif
510
511       /* Get the current used size of the three stacks, in elements.  */
512       int size = ssl_expr_yyssp - ssl_expr_yyss + 1;
513
514 #ifdef ssl_expr_yyoverflow
515       /* Each stack pointer address is followed by the size of
516          the data in use in that stack, in bytes.  */
517 #ifdef YYLSP_NEEDED
518       /* This used to be a conditional around just the two extra args,
519          but that might be undefined if ssl_expr_yyoverflow is a macro.  */
520       ssl_expr_yyoverflow("parser stack overflow",
521                  &ssl_expr_yyss1, size * sizeof (*ssl_expr_yyssp),
522                  &ssl_expr_yyvs1, size * sizeof (*ssl_expr_yyvsp),
523                  &ssl_expr_yyls1, size * sizeof (*ssl_expr_yylsp),
524                  &ssl_expr_yystacksize);
525 #else
526       ssl_expr_yyoverflow("parser stack overflow",
527                  &ssl_expr_yyss1, size * sizeof (*ssl_expr_yyssp),
528                  &ssl_expr_yyvs1, size * sizeof (*ssl_expr_yyvsp),
529                  &ssl_expr_yystacksize);
530 #endif
531
532       ssl_expr_yyss = ssl_expr_yyss1; ssl_expr_yyvs = ssl_expr_yyvs1;
533 #ifdef YYLSP_NEEDED
534       ssl_expr_yyls = ssl_expr_yyls1;
535 #endif
536 #else /* no ssl_expr_yyoverflow */
537       /* Extend the stack our own way.  */
538       if (ssl_expr_yystacksize >= YYMAXDEPTH)
539         {
540           ssl_expr_yyerror("parser stack overflow");
541           if (ssl_expr_yyfree_stacks)
542             {
543               free (ssl_expr_yyss);
544               free (ssl_expr_yyvs);
545 #ifdef YYLSP_NEEDED
546               free (ssl_expr_yyls);
547 #endif
548             }
549           return 2;
550         }
551       ssl_expr_yystacksize *= 2;
552       if (ssl_expr_yystacksize > YYMAXDEPTH)
553         ssl_expr_yystacksize = YYMAXDEPTH;
554 #ifndef YYSTACK_USE_ALLOCA
555       ssl_expr_yyfree_stacks = 1;
556 #endif
557       ssl_expr_yyss = (short *) YYSTACK_ALLOC (ssl_expr_yystacksize * sizeof (*ssl_expr_yyssp));
558       __ssl_expr_yy_memcpy ((char *)ssl_expr_yyss, (char *)ssl_expr_yyss1,
559                    size * (unsigned int) sizeof (*ssl_expr_yyssp));
560       ssl_expr_yyvs = (YYSTYPE *) YYSTACK_ALLOC (ssl_expr_yystacksize * sizeof (*ssl_expr_yyvsp));
561       __ssl_expr_yy_memcpy ((char *)ssl_expr_yyvs, (char *)ssl_expr_yyvs1,
562                    size * (unsigned int) sizeof (*ssl_expr_yyvsp));
563 #ifdef YYLSP_NEEDED
564       ssl_expr_yyls = (YYLTYPE *) YYSTACK_ALLOC (ssl_expr_yystacksize * sizeof (*ssl_expr_yylsp));
565       __ssl_expr_yy_memcpy ((char *)ssl_expr_yyls, (char *)ssl_expr_yyls1,
566                    size * (unsigned int) sizeof (*ssl_expr_yylsp));
567 #endif
568 #endif /* no ssl_expr_yyoverflow */
569
570       ssl_expr_yyssp = ssl_expr_yyss + size - 1;
571       ssl_expr_yyvsp = ssl_expr_yyvs + size - 1;
572 #ifdef YYLSP_NEEDED
573       ssl_expr_yylsp = ssl_expr_yyls + size - 1;
574 #endif
575
576 #if YYDEBUG != 0
577       if (ssl_expr_yydebug)
578         fprintf(stderr, "Stack size increased to %d\n", ssl_expr_yystacksize);
579 #endif
580
581       if (ssl_expr_yyssp >= ssl_expr_yyss + ssl_expr_yystacksize - 1)
582         YYABORT;
583     }
584
585 #if YYDEBUG != 0
586   if (ssl_expr_yydebug)
587     fprintf(stderr, "Entering state %d\n", ssl_expr_yystate);
588 #endif
589
590   goto ssl_expr_yybackup;
591  ssl_expr_yybackup:
592
593 /* Do appropriate processing given the current state.  */
594 /* Read a lookahead token if we need one and don't already have one.  */
595 /* ssl_expr_yyresume: */
596
597   /* First try to decide what to do without reference to lookahead token.  */
598
599   ssl_expr_yyn = ssl_expr_yypact[ssl_expr_yystate];
600   if (ssl_expr_yyn == YYFLAG)
601     goto ssl_expr_yydefault;
602
603   /* Not known => get a lookahead token if don't already have one.  */
604
605   /* ssl_expr_yychar is either YYEMPTY or YYEOF
606      or a valid token in external form.  */
607
608   if (ssl_expr_yychar == YYEMPTY)
609     {
610 #if YYDEBUG != 0
611       if (ssl_expr_yydebug)
612         fprintf(stderr, "Reading a token: ");
613 #endif
614       ssl_expr_yychar = YYLEX;
615     }
616
617   /* Convert token to internal form (in ssl_expr_yychar1) for indexing tables with */
618
619   if (ssl_expr_yychar <= 0)             /* This means end of input. */
620     {
621       ssl_expr_yychar1 = 0;
622       ssl_expr_yychar = YYEOF;          /* Don't call YYLEX any more */
623
624 #if YYDEBUG != 0
625       if (ssl_expr_yydebug)
626         fprintf(stderr, "Now at end of input.\n");
627 #endif
628     }
629   else
630     {
631       ssl_expr_yychar1 = YYTRANSLATE(ssl_expr_yychar);
632
633 #if YYDEBUG != 0
634       if (ssl_expr_yydebug)
635         {
636           fprintf (stderr, "Next token is %d (%s", ssl_expr_yychar, ssl_expr_yytname[ssl_expr_yychar1]);
637           /* Give the individual parser a way to print the precise meaning
638              of a token, for further debugging info.  */
639 #ifdef YYPRINT
640           YYPRINT (stderr, ssl_expr_yychar, ssl_expr_yylval);
641 #endif
642           fprintf (stderr, ")\n");
643         }
644 #endif
645     }
646
647   ssl_expr_yyn += ssl_expr_yychar1;
648   if (ssl_expr_yyn < 0 || ssl_expr_yyn > YYLAST || ssl_expr_yycheck[ssl_expr_yyn] != ssl_expr_yychar1)
649     goto ssl_expr_yydefault;
650
651   ssl_expr_yyn = ssl_expr_yytable[ssl_expr_yyn];
652
653   /* ssl_expr_yyn is what to do for this token type in this state.
654      Negative => reduce, -ssl_expr_yyn is rule number.
655      Positive => shift, ssl_expr_yyn is new state.
656        New state is final state => don't bother to shift,
657        just return success.
658      0, or most negative number => error.  */
659
660   if (ssl_expr_yyn < 0)
661     {
662       if (ssl_expr_yyn == YYFLAG)
663         goto ssl_expr_yyerrlab;
664       ssl_expr_yyn = -ssl_expr_yyn;
665       goto ssl_expr_yyreduce;
666     }
667   else if (ssl_expr_yyn == 0)
668     goto ssl_expr_yyerrlab;
669
670   if (ssl_expr_yyn == YYFINAL)
671     YYACCEPT;
672
673   /* Shift the lookahead token.  */
674
675 #if YYDEBUG != 0
676   if (ssl_expr_yydebug)
677     fprintf(stderr, "Shifting token %d (%s), ", ssl_expr_yychar, ssl_expr_yytname[ssl_expr_yychar1]);
678 #endif
679
680   /* Discard the token being shifted unless it is eof.  */
681   if (ssl_expr_yychar != YYEOF)
682     ssl_expr_yychar = YYEMPTY;
683
684   *++ssl_expr_yyvsp = ssl_expr_yylval;
685 #ifdef YYLSP_NEEDED
686   *++ssl_expr_yylsp = ssl_expr_yylloc;
687 #endif
688
689   /* count tokens shifted since error; after three, turn off error status.  */
690   if (ssl_expr_yyerrstatus) ssl_expr_yyerrstatus--;
691
692   ssl_expr_yystate = ssl_expr_yyn;
693   goto ssl_expr_yynewstate;
694
695 /* Do the default action for the current state.  */
696 ssl_expr_yydefault:
697
698   ssl_expr_yyn = ssl_expr_yydefact[ssl_expr_yystate];
699   if (ssl_expr_yyn == 0)
700     goto ssl_expr_yyerrlab;
701
702 /* Do a reduction.  ssl_expr_yyn is the number of a rule to reduce with.  */
703 ssl_expr_yyreduce:
704   ssl_expr_yylen = ssl_expr_yyr2[ssl_expr_yyn];
705   if (ssl_expr_yylen > 0)
706     ssl_expr_yyval = ssl_expr_yyvsp[1-ssl_expr_yylen]; /* implement default value of the action */
707
708 #if YYDEBUG != 0
709   if (ssl_expr_yydebug)
710     {
711       int i;
712
713       fprintf (stderr, "Reducing via rule %d (line %d), ",
714                ssl_expr_yyn, ssl_expr_yyrline[ssl_expr_yyn]);
715
716       /* Print the symbols being reduced, and their result.  */
717       for (i = ssl_expr_yyprhs[ssl_expr_yyn]; ssl_expr_yyrhs[i] > 0; i++)
718         fprintf (stderr, "%s ", ssl_expr_yytname[ssl_expr_yyrhs[i]]);
719       fprintf (stderr, " -> %s\n", ssl_expr_yytname[ssl_expr_yyr1[ssl_expr_yyn]]);
720     }
721 #endif
722
723
724   switch (ssl_expr_yyn) {
725
726 case 1:
727 #line 115 "ssl_expr_parse.y"
728 { ssl_expr_info.expr = ssl_expr_yyvsp[0].exVal; ;
729     break;}
730 case 2:
731 #line 118 "ssl_expr_parse.y"
732 { ssl_expr_yyval.exVal = ssl_expr_make(op_True,  NULL, NULL); ;
733     break;}
734 case 3:
735 #line 119 "ssl_expr_parse.y"
736 { ssl_expr_yyval.exVal = ssl_expr_make(op_False, NULL, NULL); ;
737     break;}
738 case 4:
739 #line 120 "ssl_expr_parse.y"
740 { ssl_expr_yyval.exVal = ssl_expr_make(op_Not,   ssl_expr_yyvsp[0].exVal,   NULL); ;
741     break;}
742 case 5:
743 #line 121 "ssl_expr_parse.y"
744 { ssl_expr_yyval.exVal = ssl_expr_make(op_Or,    ssl_expr_yyvsp[-2].exVal,   ssl_expr_yyvsp[0].exVal);   ;
745     break;}
746 case 6:
747 #line 122 "ssl_expr_parse.y"
748 { ssl_expr_yyval.exVal = ssl_expr_make(op_And,   ssl_expr_yyvsp[-2].exVal,   ssl_expr_yyvsp[0].exVal);   ;
749     break;}
750 case 7:
751 #line 123 "ssl_expr_parse.y"
752 { ssl_expr_yyval.exVal = ssl_expr_make(op_Comp,  ssl_expr_yyvsp[0].exVal,   NULL); ;
753     break;}
754 case 8:
755 #line 124 "ssl_expr_parse.y"
756 { ssl_expr_yyval.exVal = ssl_expr_yyvsp[-1].exVal; ;
757     break;}
758 case 9:
759 #line 127 "ssl_expr_parse.y"
760 { ssl_expr_yyval.exVal = ssl_expr_make(op_EQ,  ssl_expr_yyvsp[-2].exVal, ssl_expr_yyvsp[0].exVal); ;
761     break;}
762 case 10:
763 #line 128 "ssl_expr_parse.y"
764 { ssl_expr_yyval.exVal = ssl_expr_make(op_NE,  ssl_expr_yyvsp[-2].exVal, ssl_expr_yyvsp[0].exVal); ;
765     break;}
766 case 11:
767 #line 129 "ssl_expr_parse.y"
768 { ssl_expr_yyval.exVal = ssl_expr_make(op_LT,  ssl_expr_yyvsp[-2].exVal, ssl_expr_yyvsp[0].exVal); ;
769     break;}
770 case 12:
771 #line 130 "ssl_expr_parse.y"
772 { ssl_expr_yyval.exVal = ssl_expr_make(op_LE,  ssl_expr_yyvsp[-2].exVal, ssl_expr_yyvsp[0].exVal); ;
773     break;}
774 case 13:
775 #line 131 "ssl_expr_parse.y"
776 { ssl_expr_yyval.exVal = ssl_expr_make(op_GT,  ssl_expr_yyvsp[-2].exVal, ssl_expr_yyvsp[0].exVal); ;
777     break;}
778 case 14:
779 #line 132 "ssl_expr_parse.y"
780 { ssl_expr_yyval.exVal = ssl_expr_make(op_GE,  ssl_expr_yyvsp[-2].exVal, ssl_expr_yyvsp[0].exVal); ;
781     break;}
782 case 15:
783 #line 133 "ssl_expr_parse.y"
784 { ssl_expr_yyval.exVal = ssl_expr_make(op_IN,  ssl_expr_yyvsp[-4].exVal, ssl_expr_yyvsp[-1].exVal); ;
785     break;}
786 case 16:
787 #line 134 "ssl_expr_parse.y"
788 { ssl_expr_yyval.exVal = ssl_expr_make(op_REG, ssl_expr_yyvsp[-2].exVal, ssl_expr_yyvsp[0].exVal); ;
789     break;}
790 case 17:
791 #line 135 "ssl_expr_parse.y"
792 { ssl_expr_yyval.exVal = ssl_expr_make(op_NRE, ssl_expr_yyvsp[-2].exVal, ssl_expr_yyvsp[0].exVal); ;
793     break;}
794 case 18:
795 #line 138 "ssl_expr_parse.y"
796 { ssl_expr_yyval.exVal = ssl_expr_make(op_ListElement, ssl_expr_yyvsp[0].exVal, NULL); ;
797     break;}
798 case 19:
799 #line 139 "ssl_expr_parse.y"
800 { ssl_expr_yyval.exVal = ssl_expr_make(op_ListElement, ssl_expr_yyvsp[0].exVal, ssl_expr_yyvsp[-2].exVal);   ;
801     break;}
802 case 20:
803 #line 142 "ssl_expr_parse.y"
804 { ssl_expr_yyval.exVal = ssl_expr_make(op_Digit,  ssl_expr_yyvsp[0].cpVal, NULL); ;
805     break;}
806 case 21:
807 #line 143 "ssl_expr_parse.y"
808 { ssl_expr_yyval.exVal = ssl_expr_make(op_String, ssl_expr_yyvsp[0].cpVal, NULL); ;
809     break;}
810 case 22:
811 #line 144 "ssl_expr_parse.y"
812 { ssl_expr_yyval.exVal = ssl_expr_make(op_Var,    ssl_expr_yyvsp[-1].cpVal, NULL); ;
813     break;}
814 case 23:
815 #line 145 "ssl_expr_parse.y"
816 { ssl_expr_yyval.exVal = ssl_expr_yyvsp[0].exVal; ;
817     break;}
818 case 24:
819 #line 148 "ssl_expr_parse.y"
820
821                 regex_t *regex;
822                 if ((regex = ap_pregcomp(ssl_expr_info.pool, ssl_expr_yyvsp[0].cpVal, 
823                                          REG_EXTENDED|REG_NOSUB)) == NULL) {
824                     ssl_expr_error = "Failed to compile regular expression";
825                     YYERROR;
826                     regex = NULL;
827                 }
828                 ssl_expr_yyval.exVal = ssl_expr_make(op_Regex, regex, NULL);
829             ;
830     break;}
831 case 25:
832 #line 158 "ssl_expr_parse.y"
833 {
834                 regex_t *regex;
835                 if ((regex = ap_pregcomp(ssl_expr_info.pool, ssl_expr_yyvsp[0].cpVal, 
836                                          REG_EXTENDED|REG_NOSUB|REG_ICASE)) == NULL) {
837                     ssl_expr_error = "Failed to compile regular expression";
838                     YYERROR;
839                     regex = NULL;
840                 }
841                 ssl_expr_yyval.exVal = ssl_expr_make(op_Regex, regex, NULL);
842             ;
843     break;}
844 case 26:
845 #line 170 "ssl_expr_parse.y"
846
847                ssl_expr *args = ssl_expr_make(op_ListElement, ssl_expr_yyvsp[-1].cpVal, NULL);
848                ssl_expr_yyval.exVal = ssl_expr_make(op_Func, "file", args);
849             ;
850     break;}
851 }
852    /* the action file gets copied in in place of this dollarsign */
853 #line 543 "/usr/local/share/bison.simple"
854 \f
855   ssl_expr_yyvsp -= ssl_expr_yylen;
856   ssl_expr_yyssp -= ssl_expr_yylen;
857 #ifdef YYLSP_NEEDED
858   ssl_expr_yylsp -= ssl_expr_yylen;
859 #endif
860
861 #if YYDEBUG != 0
862   if (ssl_expr_yydebug)
863     {
864       short *ssp1 = ssl_expr_yyss - 1;
865       fprintf (stderr, "state stack now");
866       while (ssp1 != ssl_expr_yyssp)
867         fprintf (stderr, " %d", *++ssp1);
868       fprintf (stderr, "\n");
869     }
870 #endif
871
872   *++ssl_expr_yyvsp = ssl_expr_yyval;
873
874 #ifdef YYLSP_NEEDED
875   ssl_expr_yylsp++;
876   if (ssl_expr_yylen == 0)
877     {
878       ssl_expr_yylsp->first_line = ssl_expr_yylloc.first_line;
879       ssl_expr_yylsp->first_column = ssl_expr_yylloc.first_column;
880       ssl_expr_yylsp->last_line = (ssl_expr_yylsp-1)->last_line;
881       ssl_expr_yylsp->last_column = (ssl_expr_yylsp-1)->last_column;
882       ssl_expr_yylsp->text = 0;
883     }
884   else
885     {
886       ssl_expr_yylsp->last_line = (ssl_expr_yylsp+ssl_expr_yylen-1)->last_line;
887       ssl_expr_yylsp->last_column = (ssl_expr_yylsp+ssl_expr_yylen-1)->last_column;
888     }
889 #endif
890
891   /* Now "shift" the result of the reduction.
892      Determine what state that goes to,
893      based on the state we popped back to
894      and the rule number reduced by.  */
895
896   ssl_expr_yyn = ssl_expr_yyr1[ssl_expr_yyn];
897
898   ssl_expr_yystate = ssl_expr_yypgoto[ssl_expr_yyn - YYNTBASE] + *ssl_expr_yyssp;
899   if (ssl_expr_yystate >= 0 && ssl_expr_yystate <= YYLAST && ssl_expr_yycheck[ssl_expr_yystate] == *ssl_expr_yyssp)
900     ssl_expr_yystate = ssl_expr_yytable[ssl_expr_yystate];
901   else
902     ssl_expr_yystate = ssl_expr_yydefgoto[ssl_expr_yyn - YYNTBASE];
903
904   goto ssl_expr_yynewstate;
905
906 ssl_expr_yyerrlab:   /* here on detecting error */
907
908   if (! ssl_expr_yyerrstatus)
909     /* If not already recovering from an error, report this error.  */
910     {
911       ++ssl_expr_yynerrs;
912
913 #ifdef YYERROR_VERBOSE
914       ssl_expr_yyn = ssl_expr_yypact[ssl_expr_yystate];
915
916       if (ssl_expr_yyn > YYFLAG && ssl_expr_yyn < YYLAST)
917         {
918           int size = 0;
919           char *msg;
920           int x, count;
921
922           count = 0;
923           /* Start X at -ssl_expr_yyn if nec to avoid negative indexes in ssl_expr_yycheck.  */
924           for (x = (ssl_expr_yyn < 0 ? -ssl_expr_yyn : 0);
925                x < (sizeof(ssl_expr_yytname) / sizeof(char *)); x++)
926             if (ssl_expr_yycheck[x + ssl_expr_yyn] == x)
927               size += strlen(ssl_expr_yytname[x]) + 15, count++;
928           msg = (char *) malloc(size + 15);
929           if (msg != 0)
930             {
931               strcpy(msg, "parse error");
932
933               if (count < 5)
934                 {
935                   count = 0;
936                   for (x = (ssl_expr_yyn < 0 ? -ssl_expr_yyn : 0);
937                        x < (sizeof(ssl_expr_yytname) / sizeof(char *)); x++)
938                     if (ssl_expr_yycheck[x + ssl_expr_yyn] == x)
939                       {
940                         strcat(msg, count == 0 ? ", expecting `" : " or `");
941                         strcat(msg, ssl_expr_yytname[x]);
942                         strcat(msg, "'");
943                         count++;
944                       }
945                 }
946               ssl_expr_yyerror(msg);
947               free(msg);
948             }
949           else
950             ssl_expr_yyerror ("parse error; also virtual memory exceeded");
951         }
952       else
953 #endif /* YYERROR_VERBOSE */
954         ssl_expr_yyerror("parse error");
955     }
956
957   goto ssl_expr_yyerrlab1;
958 ssl_expr_yyerrlab1:   /* here on error raised explicitly by an action */
959
960   if (ssl_expr_yyerrstatus == 3)
961     {
962       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
963
964       /* return failure if at end of input */
965       if (ssl_expr_yychar == YYEOF)
966         YYABORT;
967
968 #if YYDEBUG != 0
969       if (ssl_expr_yydebug)
970         fprintf(stderr, "Discarding token %d (%s).\n", ssl_expr_yychar, ssl_expr_yytname[ssl_expr_yychar1]);
971 #endif
972
973       ssl_expr_yychar = YYEMPTY;
974     }
975
976   /* Else will try to reuse lookahead token
977      after shifting the error token.  */
978
979   ssl_expr_yyerrstatus = 3;             /* Each real token shifted decrements this */
980
981   goto ssl_expr_yyerrhandle;
982
983 ssl_expr_yyerrdefault:  /* current state does not do anything special for the error token. */
984
985 #if 0
986   /* This is wrong; only states that explicitly want error tokens
987      should shift them.  */
988   ssl_expr_yyn = ssl_expr_yydefact[ssl_expr_yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
989   if (ssl_expr_yyn) goto ssl_expr_yydefault;
990 #endif
991
992 ssl_expr_yyerrpop:   /* pop the current state because it cannot handle the error token */
993
994   if (ssl_expr_yyssp == ssl_expr_yyss) YYABORT;
995   ssl_expr_yyvsp--;
996   ssl_expr_yystate = *--ssl_expr_yyssp;
997 #ifdef YYLSP_NEEDED
998   ssl_expr_yylsp--;
999 #endif
1000
1001 #if YYDEBUG != 0
1002   if (ssl_expr_yydebug)
1003     {
1004       short *ssp1 = ssl_expr_yyss - 1;
1005       fprintf (stderr, "Error: state stack now");
1006       while (ssp1 != ssl_expr_yyssp)
1007         fprintf (stderr, " %d", *++ssp1);
1008       fprintf (stderr, "\n");
1009     }
1010 #endif
1011
1012 ssl_expr_yyerrhandle:
1013
1014   ssl_expr_yyn = ssl_expr_yypact[ssl_expr_yystate];
1015   if (ssl_expr_yyn == YYFLAG)
1016     goto ssl_expr_yyerrdefault;
1017
1018   ssl_expr_yyn += YYTERROR;
1019   if (ssl_expr_yyn < 0 || ssl_expr_yyn > YYLAST || ssl_expr_yycheck[ssl_expr_yyn] != YYTERROR)
1020     goto ssl_expr_yyerrdefault;
1021
1022   ssl_expr_yyn = ssl_expr_yytable[ssl_expr_yyn];
1023   if (ssl_expr_yyn < 0)
1024     {
1025       if (ssl_expr_yyn == YYFLAG)
1026         goto ssl_expr_yyerrpop;
1027       ssl_expr_yyn = -ssl_expr_yyn;
1028       goto ssl_expr_yyreduce;
1029     }
1030   else if (ssl_expr_yyn == 0)
1031     goto ssl_expr_yyerrpop;
1032
1033   if (ssl_expr_yyn == YYFINAL)
1034     YYACCEPT;
1035
1036 #if YYDEBUG != 0
1037   if (ssl_expr_yydebug)
1038     fprintf(stderr, "Shifting error token, ");
1039 #endif
1040
1041   *++ssl_expr_yyvsp = ssl_expr_yylval;
1042 #ifdef YYLSP_NEEDED
1043   *++ssl_expr_yylsp = ssl_expr_yylloc;
1044 #endif
1045
1046   ssl_expr_yystate = ssl_expr_yyn;
1047   goto ssl_expr_yynewstate;
1048
1049  ssl_expr_yyacceptlab:
1050   /* YYACCEPT comes here.  */
1051   if (ssl_expr_yyfree_stacks)
1052     {
1053       free (ssl_expr_yyss);
1054       free (ssl_expr_yyvs);
1055 #ifdef YYLSP_NEEDED
1056       free (ssl_expr_yyls);
1057 #endif
1058     }
1059   return 0;
1060
1061  ssl_expr_yyabortlab:
1062   /* YYABORT comes here.  */
1063   if (ssl_expr_yyfree_stacks)
1064     {
1065       free (ssl_expr_yyss);
1066       free (ssl_expr_yyvs);
1067 #ifdef YYLSP_NEEDED
1068       free (ssl_expr_yyls);
1069 #endif
1070     }
1071   return 1;
1072 }
1073 #line 176 "ssl_expr_parse.y"
1074
1075
1076 int ssl_expr_yyerror(char *s)
1077 {
1078     ssl_expr_error = s;
1079     return 2;
1080 }
1081