source: trunk/server/source4/heimdal/lib/hx509/lex.yy.c

Last change on this file was 745, checked in by Silvan Scherrer, 13 years ago

Samba Server: updated trunk to 3.6.0

File size: 50.0 KB
Line 
1
2#line 3 "lex.yy.c"
3
4#define YY_INT_ALIGNED short int
5
6/* A lexical scanner generated by flex */
7
8#define FLEX_SCANNER
9#define YY_FLEX_MAJOR_VERSION 2
10#define YY_FLEX_MINOR_VERSION 5
11#define YY_FLEX_SUBMINOR_VERSION 35
12#if YY_FLEX_SUBMINOR_VERSION > 0
13#define FLEX_BETA
14#endif
15
16/* First, we deal with platform-specific or compiler-specific issues. */
17
18/* begin standard C headers. */
19#include <stdio.h>
20#include <string.h>
21#include <errno.h>
22#include <stdlib.h>
23
24/* end standard C headers. */
25
26/* flex integer type definitions */
27
28#ifndef FLEXINT_H
29#define FLEXINT_H
30
31/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
32
33#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
34
35/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36 * if you want the limit (max/min) macros for int types.
37 */
38#ifndef __STDC_LIMIT_MACROS
39#define __STDC_LIMIT_MACROS 1
40#endif
41
42#include <inttypes.h>
43typedef int8_t flex_int8_t;
44typedef uint8_t flex_uint8_t;
45typedef int16_t flex_int16_t;
46typedef uint16_t flex_uint16_t;
47typedef int32_t flex_int32_t;
48typedef uint32_t flex_uint32_t;
49#else
50typedef signed char flex_int8_t;
51typedef short int flex_int16_t;
52typedef int flex_int32_t;
53typedef unsigned char flex_uint8_t;
54typedef unsigned short int flex_uint16_t;
55typedef unsigned int flex_uint32_t;
56
57/* Limits of integral types. */
58#ifndef INT8_MIN
59#define INT8_MIN (-128)
60#endif
61#ifndef INT16_MIN
62#define INT16_MIN (-32767-1)
63#endif
64#ifndef INT32_MIN
65#define INT32_MIN (-2147483647-1)
66#endif
67#ifndef INT8_MAX
68#define INT8_MAX (127)
69#endif
70#ifndef INT16_MAX
71#define INT16_MAX (32767)
72#endif
73#ifndef INT32_MAX
74#define INT32_MAX (2147483647)
75#endif
76#ifndef UINT8_MAX
77#define UINT8_MAX (255U)
78#endif
79#ifndef UINT16_MAX
80#define UINT16_MAX (65535U)
81#endif
82#ifndef UINT32_MAX
83#define UINT32_MAX (4294967295U)
84#endif
85
86#endif /* ! C99 */
87
88#endif /* ! FLEXINT_H */
89
90#ifdef __cplusplus
91
92/* The "const" storage-class-modifier is valid. */
93#define YY_USE_CONST
94
95#else /* ! __cplusplus */
96
97/* C99 requires __STDC__ to be defined as 1. */
98#if defined (__STDC__)
99
100#define YY_USE_CONST
101
102#endif /* defined (__STDC__) */
103#endif /* ! __cplusplus */
104
105#ifdef YY_USE_CONST
106#define yyconst const
107#else
108#define yyconst
109#endif
110
111/* Returned upon end-of-file. */
112#define YY_NULL 0
113
114/* Promotes a possibly negative, possibly signed char to an unsigned
115 * integer for use as an array index. If the signed char is negative,
116 * we want to instead treat it as an 8-bit unsigned char, hence the
117 * double cast.
118 */
119#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
120
121/* Enter a start condition. This macro really ought to take a parameter,
122 * but we do it the disgusting crufty way forced on us by the ()-less
123 * definition of BEGIN.
124 */
125#define BEGIN (yy_start) = 1 + 2 *
126
127/* Translate the current start state into a value that can be later handed
128 * to BEGIN to return to the state. The YYSTATE alias is for lex
129 * compatibility.
130 */
131#define YY_START (((yy_start) - 1) / 2)
132#define YYSTATE YY_START
133
134/* Action number for EOF rule of a given start state. */
135#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
136
137/* Special action meaning "start processing a new file". */
138#define YY_NEW_FILE yyrestart(yyin )
139
140#define YY_END_OF_BUFFER_CHAR 0
141
142/* Size of default input buffer. */
143#ifndef YY_BUF_SIZE
144#ifdef __ia64__
145/* On IA-64, the buffer size is 16k, not 8k.
146 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
147 * Ditto for the __ia64__ case accordingly.
148 */
149#define YY_BUF_SIZE 32768
150#else
151#define YY_BUF_SIZE 16384
152#endif /* __ia64__ */
153#endif
154
155/* The state buf must be large enough to hold one state per character in the main buffer.
156 */
157#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
158
159#ifndef YY_TYPEDEF_YY_BUFFER_STATE
160#define YY_TYPEDEF_YY_BUFFER_STATE
161typedef struct yy_buffer_state *YY_BUFFER_STATE;
162#endif
163
164extern int yyleng;
165
166extern FILE *yyin, *yyout;
167
168#define EOB_ACT_CONTINUE_SCAN 0
169#define EOB_ACT_END_OF_FILE 1
170#define EOB_ACT_LAST_MATCH 2
171
172 #define YY_LESS_LINENO(n)
173
174/* Return all but the first "n" matched characters back to the input stream. */
175#define yyless(n) \
176 do \
177 { \
178 /* Undo effects of setting up yytext. */ \
179 int yyless_macro_arg = (n); \
180 YY_LESS_LINENO(yyless_macro_arg);\
181 *yy_cp = (yy_hold_char); \
182 YY_RESTORE_YY_MORE_OFFSET \
183 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
184 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
185 } \
186 while ( 0 )
187
188#define unput(c) yyunput( c, (yytext_ptr) )
189
190#ifndef YY_TYPEDEF_YY_SIZE_T
191#define YY_TYPEDEF_YY_SIZE_T
192typedef size_t yy_size_t;
193#endif
194
195#ifndef YY_STRUCT_YY_BUFFER_STATE
196#define YY_STRUCT_YY_BUFFER_STATE
197struct yy_buffer_state
198 {
199 FILE *yy_input_file;
200
201 char *yy_ch_buf; /* input buffer */
202 char *yy_buf_pos; /* current position in input buffer */
203
204 /* Size of input buffer in bytes, not including room for EOB
205 * characters.
206 */
207 yy_size_t yy_buf_size;
208
209 /* Number of characters read into yy_ch_buf, not including EOB
210 * characters.
211 */
212 int yy_n_chars;
213
214 /* Whether we "own" the buffer - i.e., we know we created it,
215 * and can realloc() it to grow it, and should free() it to
216 * delete it.
217 */
218 int yy_is_our_buffer;
219
220 /* Whether this is an "interactive" input source; if so, and
221 * if we're using stdio for input, then we want to use getc()
222 * instead of fread(), to make sure we stop fetching input after
223 * each newline.
224 */
225 int yy_is_interactive;
226
227 /* Whether we're considered to be at the beginning of a line.
228 * If so, '^' rules will be active on the next match, otherwise
229 * not.
230 */
231 int yy_at_bol;
232
233 int yy_bs_lineno; /**< The line count. */
234 int yy_bs_column; /**< The column count. */
235
236 /* Whether to try to fill the input buffer when we reach the
237 * end of it.
238 */
239 int yy_fill_buffer;
240
241 int yy_buffer_status;
242
243#define YY_BUFFER_NEW 0
244#define YY_BUFFER_NORMAL 1
245 /* When an EOF's been seen but there's still some text to process
246 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
247 * shouldn't try reading from the input source any more. We might
248 * still have a bunch of tokens to match, though, because of
249 * possible backing-up.
250 *
251 * When we actually see the EOF, we change the status to "new"
252 * (via yyrestart()), so that the user can continue scanning by
253 * just pointing yyin at a new input file.
254 */
255#define YY_BUFFER_EOF_PENDING 2
256
257 };
258#endif /* !YY_STRUCT_YY_BUFFER_STATE */
259
260/* Stack of input buffers. */
261static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
262static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
263static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
264
265/* We provide macros for accessing buffer states in case in the
266 * future we want to put the buffer states in a more general
267 * "scanner state".
268 *
269 * Returns the top of the stack, or NULL.
270 */
271#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
272 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
273 : NULL)
274
275/* Same as previous macro, but useful when we know that the buffer stack is not
276 * NULL or when we need an lvalue. For internal use only.
277 */
278#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
279
280/* yy_hold_char holds the character lost when yytext is formed. */
281static char yy_hold_char;
282static int yy_n_chars; /* number of characters read into yy_ch_buf */
283int yyleng;
284
285/* Points to current character in buffer. */
286static char *yy_c_buf_p = (char *) 0;
287static int yy_init = 0; /* whether we need to initialize */
288static int yy_start = 0; /* start state number */
289
290/* Flag which is used to allow yywrap()'s to do buffer switches
291 * instead of setting up a fresh yyin. A bit of a hack ...
292 */
293static int yy_did_buffer_switch_on_eof;
294
295void yyrestart (FILE *input_file );
296void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
297YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
298void yy_delete_buffer (YY_BUFFER_STATE b );
299void yy_flush_buffer (YY_BUFFER_STATE b );
300void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
301void yypop_buffer_state (void );
302
303static void yyensure_buffer_stack (void );
304static void yy_load_buffer_state (void );
305static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
306
307#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
308
309YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
310YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
311YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
312
313void *yyalloc (yy_size_t );
314void *yyrealloc (void *,yy_size_t );
315void yyfree (void * );
316
317#define yy_new_buffer yy_create_buffer
318
319#define yy_set_interactive(is_interactive) \
320 { \
321 if ( ! YY_CURRENT_BUFFER ){ \
322 yyensure_buffer_stack (); \
323 YY_CURRENT_BUFFER_LVALUE = \
324 yy_create_buffer(yyin,YY_BUF_SIZE ); \
325 } \
326 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
327 }
328
329#define yy_set_bol(at_bol) \
330 { \
331 if ( ! YY_CURRENT_BUFFER ){\
332 yyensure_buffer_stack (); \
333 YY_CURRENT_BUFFER_LVALUE = \
334 yy_create_buffer(yyin,YY_BUF_SIZE ); \
335 } \
336 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
337 }
338
339#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
340
341/* Begin user sect3 */
342
343typedef unsigned char YY_CHAR;
344
345FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
346
347typedef int yy_state_type;
348
349extern int yylineno;
350
351int yylineno = 1;
352
353extern char *yytext;
354#define yytext_ptr yytext
355
356static yy_state_type yy_get_previous_state (void );
357static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
358static int yy_get_next_buffer (void );
359static void yy_fatal_error (yyconst char msg[] );
360
361/* Done after the current pattern has been matched and before the
362 * corresponding action - sets up yytext.
363 */
364#define YY_DO_BEFORE_ACTION \
365 (yytext_ptr) = yy_bp; \
366 yyleng = (size_t) (yy_cp - yy_bp); \
367 (yy_hold_char) = *yy_cp; \
368 *yy_cp = '\0'; \
369 (yy_c_buf_p) = yy_cp;
370
371#define YY_NUM_RULES 12
372#define YY_END_OF_BUFFER 13
373/* This struct is not used in this scanner,
374 but its presence is necessary. */
375struct yy_trans_info
376 {
377 flex_int32_t yy_verify;
378 flex_int32_t yy_nxt;
379 };
380static yyconst flex_int16_t yy_accept[36] =
381 { 0,
382 0, 0, 13, 12, 11, 9, 10, 8, 7, 7,
383 7, 7, 7, 7, 7, 7, 7, 5, 4, 7,
384 7, 3, 7, 7, 7, 7, 7, 1, 2, 7,
385 7, 7, 7, 6, 0
386 } ;
387
388static yyconst flex_int32_t yy_ec[256] =
389 { 0,
390 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
391 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
392 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
393 1, 2, 4, 5, 1, 1, 4, 1, 1, 4,
394 4, 1, 1, 4, 6, 4, 1, 6, 6, 6,
395 6, 6, 6, 6, 6, 6, 6, 1, 1, 1,
396 4, 1, 1, 1, 7, 8, 9, 10, 11, 12,
397 8, 13, 14, 8, 8, 15, 16, 17, 18, 8,
398 8, 19, 20, 21, 22, 8, 8, 8, 8, 8,
399 1, 1, 1, 1, 6, 1, 8, 8, 8, 8,
400
401 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
402 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
403 8, 8, 4, 1, 4, 1, 1, 1, 1, 1,
404 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
405 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
406 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
407 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
408 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
409 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
410 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
411
412 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
415 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
416 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417 1, 1, 1, 1, 1
418 } ;
419
420static yyconst flex_int32_t yy_meta[23] =
421 { 0,
422 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
424 2, 2
425 } ;
426
427static yyconst flex_int16_t yy_base[37] =
428 { 0,
429 0, 0, 43, 44, 44, 44, 44, 44, 25, 0,
430 34, 23, 20, 16, 0, 28, 22, 0, 0, 22,
431 12, 0, 13, 17, 20, 19, 13, 0, 0, 21,
432 6, 17, 12, 0, 44, 22
433 } ;
434
435static yyconst flex_int16_t yy_def[37] =
436 { 0,
437 35, 1, 35, 35, 35, 35, 35, 35, 36, 36,
438 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
439 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
440 36, 36, 36, 36, 0, 35
441 } ;
442
443static yyconst flex_int16_t yy_nxt[67] =
444 { 0,
445 4, 5, 6, 7, 8, 4, 9, 10, 10, 10,
446 10, 11, 10, 12, 10, 10, 10, 13, 10, 10,
447 14, 10, 20, 15, 34, 33, 32, 31, 30, 29,
448 28, 27, 26, 25, 21, 24, 23, 22, 19, 18,
449 17, 16, 35, 3, 35, 35, 35, 35, 35, 35,
450 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
451 35, 35, 35, 35, 35, 35
452 } ;
453
454static yyconst flex_int16_t yy_chk[67] =
455 { 0,
456 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
457 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
458 1, 1, 14, 36, 33, 32, 31, 30, 27, 26,
459 25, 24, 23, 21, 14, 20, 17, 16, 13, 12,
460 11, 9, 3, 35, 35, 35, 35, 35, 35, 35,
461 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
462 35, 35, 35, 35, 35, 35
463 } ;
464
465static yy_state_type yy_last_accepting_state;
466static char *yy_last_accepting_cpos;
467
468extern int yy_flex_debug;
469int yy_flex_debug = 0;
470
471/* The intent behind this definition is that it'll catch
472 * any uses of REJECT which flex missed.
473 */
474#define REJECT reject_used_but_not_detected
475#define yymore() yymore_used_but_not_detected
476#define YY_MORE_ADJ 0
477#define YY_RESTORE_YY_MORE_OFFSET
478char *yytext;
479#line 1 "sel-lex.l"
480#line 2 "sel-lex.l"
481/*
482 * Copyright (c) 2004, 2008 Kungliga Tekniska Högskolan
483 * (Royal Institute of Technology, Stockholm, Sweden).
484 * All rights reserved.
485 *
486 * Redistribution and use in source and binary forms, with or without
487 * modification, are permitted provided that the following conditions
488 * are met:
489 *
490 * 1. Redistributions of source code must retain the above copyright
491 * notice, this list of conditions and the following disclaimer.
492 *
493 * 2. Redistributions in binary form must reproduce the above copyright
494 * notice, this list of conditions and the following disclaimer in the
495 * documentation and/or other materials provided with the distribution.
496 *
497 * 3. Neither the name of the Institute nor the names of its contributors
498 * may be used to endorse or promote products derived from this software
499 * without specific prior written permission.
500 *
501 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
502 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
503 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
504 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
505 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
506 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
507 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
508 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
509 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
510 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
511 * SUCH DAMAGE.
512 */
513
514/* $Id$ */
515
516#ifdef HAVE_CONFIG_H
517#include <config.h>
518#endif
519
520#undef ECHO
521
522#include <stdio.h>
523#include <string.h>
524#include <stdarg.h>
525#include <stdlib.h>
526#include "sel.h"
527#include "sel-gram.h"
528unsigned lineno = 1;
529
530static char * handle_string(void);
531static int lex_input(char *, int);
532
533struct hx_expr_input _hx509_expr_input;
534
535#ifndef YY_NULL
536#define YY_NULL 0
537#endif
538
539#define YY_NO_UNPUT 1
540
541#undef YY_INPUT
542#define YY_INPUT(buf,res,maxsize) (res = lex_input(buf, maxsize))
543
544#undef ECHO
545
546#line 547 "lex.yy.c"
547
548#define INITIAL 0
549
550#ifndef YY_NO_UNISTD_H
551/* Special case for "unistd.h", since it is non-ANSI. We include it way
552 * down here because we want the user's section 1 to have been scanned first.
553 * The user has a chance to override it with an option.
554 */
555#include <unistd.h>
556#endif
557
558#ifndef YY_EXTRA_TYPE
559#define YY_EXTRA_TYPE void *
560#endif
561
562static int yy_init_globals (void );
563
564/* Accessor methods to globals.
565 These are made visible to non-reentrant scanners for convenience. */
566
567int yylex_destroy (void );
568
569int yyget_debug (void );
570
571void yyset_debug (int debug_flag );
572
573YY_EXTRA_TYPE yyget_extra (void );
574
575void yyset_extra (YY_EXTRA_TYPE user_defined );
576
577FILE *yyget_in (void );
578
579void yyset_in (FILE * in_str );
580
581FILE *yyget_out (void );
582
583void yyset_out (FILE * out_str );
584
585int yyget_leng (void );
586
587char *yyget_text (void );
588
589int yyget_lineno (void );
590
591void yyset_lineno (int line_number );
592
593/* Macros after this point can all be overridden by user definitions in
594 * section 1.
595 */
596
597#ifndef YY_SKIP_YYWRAP
598#ifdef __cplusplus
599extern "C" int yywrap (void );
600#else
601extern int yywrap (void );
602#endif
603#endif
604
605 static void yyunput (int c,char *buf_ptr );
606
607#ifndef yytext_ptr
608static void yy_flex_strncpy (char *,yyconst char *,int );
609#endif
610
611#ifdef YY_NEED_STRLEN
612static int yy_flex_strlen (yyconst char * );
613#endif
614
615#ifndef YY_NO_INPUT
616
617#ifdef __cplusplus
618static int yyinput (void );
619#else
620static int input (void );
621#endif
622
623#endif
624
625/* Amount of stuff to slurp up with each read. */
626#ifndef YY_READ_BUF_SIZE
627#ifdef __ia64__
628/* On IA-64, the buffer size is 16k, not 8k */
629#define YY_READ_BUF_SIZE 16384
630#else
631#define YY_READ_BUF_SIZE 8192
632#endif /* __ia64__ */
633#endif
634
635/* Copy whatever the last rule matched to the standard output. */
636#ifndef ECHO
637/* This used to be an fputs(), but since the string might contain NUL's,
638 * we now use fwrite().
639 */
640#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
641#endif
642
643/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
644 * is returned in "result".
645 */
646#ifndef YY_INPUT
647#define YY_INPUT(buf,result,max_size) \
648 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
649 { \
650 int c = '*'; \
651 size_t n; \
652 for ( n = 0; n < max_size && \
653 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
654 buf[n] = (char) c; \
655 if ( c == '\n' ) \
656 buf[n++] = (char) c; \
657 if ( c == EOF && ferror( yyin ) ) \
658 YY_FATAL_ERROR( "input in flex scanner failed" ); \
659 result = n; \
660 } \
661 else \
662 { \
663 errno=0; \
664 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
665 { \
666 if( errno != EINTR) \
667 { \
668 YY_FATAL_ERROR( "input in flex scanner failed" ); \
669 break; \
670 } \
671 errno=0; \
672 clearerr(yyin); \
673 } \
674 }\
675\
676
677#endif
678
679/* No semi-colon after return; correct usage is to write "yyterminate();" -
680 * we don't want an extra ';' after the "return" because that will cause
681 * some compilers to complain about unreachable statements.
682 */
683#ifndef yyterminate
684#define yyterminate() return YY_NULL
685#endif
686
687/* Number of entries by which start-condition stack grows. */
688#ifndef YY_START_STACK_INCR
689#define YY_START_STACK_INCR 25
690#endif
691
692/* Report a fatal error. */
693#ifndef YY_FATAL_ERROR
694#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
695#endif
696
697/* end tables serialization structures and prototypes */
698
699/* Default declaration of generated scanner - a define so the user can
700 * easily add parameters.
701 */
702#ifndef YY_DECL
703#define YY_DECL_IS_OURS 1
704
705extern int yylex (void);
706
707#define YY_DECL int yylex (void)
708#endif /* !YY_DECL */
709
710/* Code executed at the beginning of each rule, after yytext and yyleng
711 * have been set up.
712 */
713#ifndef YY_USER_ACTION
714#define YY_USER_ACTION
715#endif
716
717/* Code executed at the end of each rule. */
718#ifndef YY_BREAK
719#define YY_BREAK break;
720#endif
721
722#define YY_RULE_SETUP \
723 YY_USER_ACTION
724
725/** The main scanner function which does all the work.
726 */
727YY_DECL
728{
729 register yy_state_type yy_current_state;
730 register char *yy_cp, *yy_bp;
731 register int yy_act;
732
733#line 68 "sel-lex.l"
734
735
736#line 737 "lex.yy.c"
737
738 if ( !(yy_init) )
739 {
740 (yy_init) = 1;
741
742#ifdef YY_USER_INIT
743 YY_USER_INIT;
744#endif
745
746 if ( ! (yy_start) )
747 (yy_start) = 1; /* first start state */
748
749 if ( ! yyin )
750 yyin = stdin;
751
752 if ( ! yyout )
753 yyout = stdout;
754
755 if ( ! YY_CURRENT_BUFFER ) {
756 yyensure_buffer_stack ();
757 YY_CURRENT_BUFFER_LVALUE =
758 yy_create_buffer(yyin,YY_BUF_SIZE );
759 }
760
761 yy_load_buffer_state( );
762 }
763
764 while ( 1 ) /* loops until end-of-file is reached */
765 {
766 yy_cp = (yy_c_buf_p);
767
768 /* Support of yytext. */
769 *yy_cp = (yy_hold_char);
770
771 /* yy_bp points to the position in yy_ch_buf of the start of
772 * the current run.
773 */
774 yy_bp = yy_cp;
775
776 yy_current_state = (yy_start);
777yy_match:
778 do
779 {
780 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
781 if ( yy_accept[yy_current_state] )
782 {
783 (yy_last_accepting_state) = yy_current_state;
784 (yy_last_accepting_cpos) = yy_cp;
785 }
786 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
787 {
788 yy_current_state = (int) yy_def[yy_current_state];
789 if ( yy_current_state >= 36 )
790 yy_c = yy_meta[(unsigned int) yy_c];
791 }
792 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
793 ++yy_cp;
794 }
795 while ( yy_base[yy_current_state] != 44 );
796
797yy_find_action:
798 yy_act = yy_accept[yy_current_state];
799 if ( yy_act == 0 )
800 { /* have to back up */
801 yy_cp = (yy_last_accepting_cpos);
802 yy_current_state = (yy_last_accepting_state);
803 yy_act = yy_accept[yy_current_state];
804 }
805
806 YY_DO_BEFORE_ACTION;
807
808do_action: /* This label is used only to access EOF actions. */
809
810 switch ( yy_act )
811 { /* beginning of action switch */
812 case 0: /* must back up */
813 /* undo the effects of YY_DO_BEFORE_ACTION */
814 *yy_cp = (yy_hold_char);
815 yy_cp = (yy_last_accepting_cpos);
816 yy_current_state = (yy_last_accepting_state);
817 goto yy_find_action;
818
819case 1:
820YY_RULE_SETUP
821#line 70 "sel-lex.l"
822{ return kw_TRUE; }
823 YY_BREAK
824case 2:
825YY_RULE_SETUP
826#line 71 "sel-lex.l"
827{ return kw_FALSE; }
828 YY_BREAK
829case 3:
830YY_RULE_SETUP
831#line 72 "sel-lex.l"
832{ return kw_AND; }
833 YY_BREAK
834case 4:
835YY_RULE_SETUP
836#line 73 "sel-lex.l"
837{ return kw_OR; }
838 YY_BREAK
839case 5:
840YY_RULE_SETUP
841#line 74 "sel-lex.l"
842{ return kw_IN; }
843 YY_BREAK
844case 6:
845YY_RULE_SETUP
846#line 75 "sel-lex.l"
847{ return kw_TAILMATCH; }
848 YY_BREAK
849case 7:
850YY_RULE_SETUP
851#line 77 "sel-lex.l"
852{
853 yylval.string = strdup ((const char *)yytext);
854 return IDENTIFIER;
855 }
856 YY_BREAK
857case 8:
858YY_RULE_SETUP
859#line 81 "sel-lex.l"
860{ yylval.string = handle_string(); return STRING; }
861 YY_BREAK
862case 9:
863/* rule 9 can match eol */
864YY_RULE_SETUP
865#line 82 "sel-lex.l"
866{ ++lineno; }
867 YY_BREAK
868case 10:
869YY_RULE_SETUP
870#line 83 "sel-lex.l"
871{ return *yytext; }
872 YY_BREAK
873case 11:
874YY_RULE_SETUP
875#line 84 "sel-lex.l"
876;
877 YY_BREAK
878case 12:
879YY_RULE_SETUP
880#line 85 "sel-lex.l"
881ECHO;
882 YY_BREAK
883#line 884 "lex.yy.c"
884case YY_STATE_EOF(INITIAL):
885 yyterminate();
886
887 case YY_END_OF_BUFFER:
888 {
889 /* Amount of text matched not including the EOB char. */
890 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
891
892 /* Undo the effects of YY_DO_BEFORE_ACTION. */
893 *yy_cp = (yy_hold_char);
894 YY_RESTORE_YY_MORE_OFFSET
895
896 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
897 {
898 /* We're scanning a new file or input source. It's
899 * possible that this happened because the user
900 * just pointed yyin at a new source and called
901 * yylex(). If so, then we have to assure
902 * consistency between YY_CURRENT_BUFFER and our
903 * globals. Here is the right place to do so, because
904 * this is the first action (other than possibly a
905 * back-up) that will match for the new input source.
906 */
907 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
908 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
909 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
910 }
911
912 /* Note that here we test for yy_c_buf_p "<=" to the position
913 * of the first EOB in the buffer, since yy_c_buf_p will
914 * already have been incremented past the NUL character
915 * (since all states make transitions on EOB to the
916 * end-of-buffer state). Contrast this with the test
917 * in input().
918 */
919 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
920 { /* This was really a NUL. */
921 yy_state_type yy_next_state;
922
923 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
924
925 yy_current_state = yy_get_previous_state( );
926
927 /* Okay, we're now positioned to make the NUL
928 * transition. We couldn't have
929 * yy_get_previous_state() go ahead and do it
930 * for us because it doesn't know how to deal
931 * with the possibility of jamming (and we don't
932 * want to build jamming into it because then it
933 * will run more slowly).
934 */
935
936 yy_next_state = yy_try_NUL_trans( yy_current_state );
937
938 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
939
940 if ( yy_next_state )
941 {
942 /* Consume the NUL. */
943 yy_cp = ++(yy_c_buf_p);
944 yy_current_state = yy_next_state;
945 goto yy_match;
946 }
947
948 else
949 {
950 yy_cp = (yy_c_buf_p);
951 goto yy_find_action;
952 }
953 }
954
955 else switch ( yy_get_next_buffer( ) )
956 {
957 case EOB_ACT_END_OF_FILE:
958 {
959 (yy_did_buffer_switch_on_eof) = 0;
960
961 if ( yywrap( ) )
962 {
963 /* Note: because we've taken care in
964 * yy_get_next_buffer() to have set up
965 * yytext, we can now set up
966 * yy_c_buf_p so that if some total
967 * hoser (like flex itself) wants to
968 * call the scanner after we return the
969 * YY_NULL, it'll still work - another
970 * YY_NULL will get returned.
971 */
972 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
973
974 yy_act = YY_STATE_EOF(YY_START);
975 goto do_action;
976 }
977
978 else
979 {
980 if ( ! (yy_did_buffer_switch_on_eof) )
981 YY_NEW_FILE;
982 }
983 break;
984 }
985
986 case EOB_ACT_CONTINUE_SCAN:
987 (yy_c_buf_p) =
988 (yytext_ptr) + yy_amount_of_matched_text;
989
990 yy_current_state = yy_get_previous_state( );
991
992 yy_cp = (yy_c_buf_p);
993 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
994 goto yy_match;
995
996 case EOB_ACT_LAST_MATCH:
997 (yy_c_buf_p) =
998 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
999
1000 yy_current_state = yy_get_previous_state( );
1001
1002 yy_cp = (yy_c_buf_p);
1003 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1004 goto yy_find_action;
1005 }
1006 break;
1007 }
1008
1009 default:
1010 YY_FATAL_ERROR(
1011 "fatal flex scanner internal error--no action found" );
1012 } /* end of action switch */
1013 } /* end of scanning one token */
1014} /* end of yylex */
1015
1016/* yy_get_next_buffer - try to read in a new buffer
1017 *
1018 * Returns a code representing an action:
1019 * EOB_ACT_LAST_MATCH -
1020 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1021 * EOB_ACT_END_OF_FILE - end of file
1022 */
1023static int yy_get_next_buffer (void)
1024{
1025 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1026 register char *source = (yytext_ptr);
1027 register int number_to_move, i;
1028 int ret_val;
1029
1030 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1031 YY_FATAL_ERROR(
1032 "fatal flex scanner internal error--end of buffer missed" );
1033
1034 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1035 { /* Don't try to fill the buffer, so this is an EOF. */
1036 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1037 {
1038 /* We matched a single character, the EOB, so
1039 * treat this as a final EOF.
1040 */
1041 return EOB_ACT_END_OF_FILE;
1042 }
1043
1044 else
1045 {
1046 /* We matched some text prior to the EOB, first
1047 * process it.
1048 */
1049 return EOB_ACT_LAST_MATCH;
1050 }
1051 }
1052
1053 /* Try to read more data. */
1054
1055 /* First move last chars to start of buffer. */
1056 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1057
1058 for ( i = 0; i < number_to_move; ++i )
1059 *(dest++) = *(source++);
1060
1061 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1062 /* don't do the read, it's not guaranteed to return an EOF,
1063 * just force an EOF
1064 */
1065 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1066
1067 else
1068 {
1069 int num_to_read =
1070 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1071
1072 while ( num_to_read <= 0 )
1073 { /* Not enough room in the buffer - grow it. */
1074
1075 /* just a shorter name for the current buffer */
1076 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1077
1078 int yy_c_buf_p_offset =
1079 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1080
1081 if ( b->yy_is_our_buffer )
1082 {
1083 int new_size = b->yy_buf_size * 2;
1084
1085 if ( new_size <= 0 )
1086 b->yy_buf_size += b->yy_buf_size / 8;
1087 else
1088 b->yy_buf_size *= 2;
1089
1090 b->yy_ch_buf = (char *)
1091 /* Include room in for 2 EOB chars. */
1092 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1093 }
1094 else
1095 /* Can't grow it, we don't own it. */
1096 b->yy_ch_buf = 0;
1097
1098 if ( ! b->yy_ch_buf )
1099 YY_FATAL_ERROR(
1100 "fatal error - scanner input buffer overflow" );
1101
1102 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1103
1104 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1105 number_to_move - 1;
1106
1107 }
1108
1109 if ( num_to_read > YY_READ_BUF_SIZE )
1110 num_to_read = YY_READ_BUF_SIZE;
1111
1112 /* Read in more data. */
1113 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1114 (yy_n_chars), (size_t) num_to_read );
1115
1116 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1117 }
1118
1119 if ( (yy_n_chars) == 0 )
1120 {
1121 if ( number_to_move == YY_MORE_ADJ )
1122 {
1123 ret_val = EOB_ACT_END_OF_FILE;
1124 yyrestart(yyin );
1125 }
1126
1127 else
1128 {
1129 ret_val = EOB_ACT_LAST_MATCH;
1130 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1131 YY_BUFFER_EOF_PENDING;
1132 }
1133 }
1134
1135 else
1136 ret_val = EOB_ACT_CONTINUE_SCAN;
1137
1138 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1139 /* Extend the array by 50%, plus the number we really need. */
1140 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1141 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1142 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1143 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1144 }
1145
1146 (yy_n_chars) += number_to_move;
1147 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1148 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1149
1150 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1151
1152 return ret_val;
1153}
1154
1155/* yy_get_previous_state - get the state just before the EOB char was reached */
1156
1157 static yy_state_type yy_get_previous_state (void)
1158{
1159 register yy_state_type yy_current_state;
1160 register char *yy_cp;
1161
1162 yy_current_state = (yy_start);
1163
1164 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1165 {
1166 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1167 if ( yy_accept[yy_current_state] )
1168 {
1169 (yy_last_accepting_state) = yy_current_state;
1170 (yy_last_accepting_cpos) = yy_cp;
1171 }
1172 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1173 {
1174 yy_current_state = (int) yy_def[yy_current_state];
1175 if ( yy_current_state >= 36 )
1176 yy_c = yy_meta[(unsigned int) yy_c];
1177 }
1178 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1179 }
1180
1181 return yy_current_state;
1182}
1183
1184/* yy_try_NUL_trans - try to make a transition on the NUL character
1185 *
1186 * synopsis
1187 * next_state = yy_try_NUL_trans( current_state );
1188 */
1189 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1190{
1191 register int yy_is_jam;
1192 register char *yy_cp = (yy_c_buf_p);
1193
1194 register YY_CHAR yy_c = 1;
1195 if ( yy_accept[yy_current_state] )
1196 {
1197 (yy_last_accepting_state) = yy_current_state;
1198 (yy_last_accepting_cpos) = yy_cp;
1199 }
1200 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1201 {
1202 yy_current_state = (int) yy_def[yy_current_state];
1203 if ( yy_current_state >= 36 )
1204 yy_c = yy_meta[(unsigned int) yy_c];
1205 }
1206 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1207 yy_is_jam = (yy_current_state == 35);
1208
1209 return yy_is_jam ? 0 : yy_current_state;
1210}
1211
1212 static void yyunput (int c, register char * yy_bp )
1213{
1214 register char *yy_cp;
1215
1216 yy_cp = (yy_c_buf_p);
1217
1218 /* undo effects of setting up yytext */
1219 *yy_cp = (yy_hold_char);
1220
1221 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1222 { /* need to shift things up to make room */
1223 /* +2 for EOB chars. */
1224 register int number_to_move = (yy_n_chars) + 2;
1225 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1226 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1227 register char *source =
1228 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1229
1230 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1231 *--dest = *--source;
1232
1233 yy_cp += (int) (dest - source);
1234 yy_bp += (int) (dest - source);
1235 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1236 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1237
1238 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1239 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1240 }
1241
1242 *--yy_cp = (char) c;
1243
1244 (yytext_ptr) = yy_bp;
1245 (yy_hold_char) = *yy_cp;
1246 (yy_c_buf_p) = yy_cp;
1247}
1248
1249#ifndef YY_NO_INPUT
1250#ifdef __cplusplus
1251 static int yyinput (void)
1252#else
1253 static int input (void)
1254#endif
1255
1256{
1257 int c;
1258
1259 *(yy_c_buf_p) = (yy_hold_char);
1260
1261 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1262 {
1263 /* yy_c_buf_p now points to the character we want to return.
1264 * If this occurs *before* the EOB characters, then it's a
1265 * valid NUL; if not, then we've hit the end of the buffer.
1266 */
1267 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1268 /* This was really a NUL. */
1269 *(yy_c_buf_p) = '\0';
1270
1271 else
1272 { /* need more input */
1273 int offset = (yy_c_buf_p) - (yytext_ptr);
1274 ++(yy_c_buf_p);
1275
1276 switch ( yy_get_next_buffer( ) )
1277 {
1278 case EOB_ACT_LAST_MATCH:
1279 /* This happens because yy_g_n_b()
1280 * sees that we've accumulated a
1281 * token and flags that we need to
1282 * try matching the token before
1283 * proceeding. But for input(),
1284 * there's no matching to consider.
1285 * So convert the EOB_ACT_LAST_MATCH
1286 * to EOB_ACT_END_OF_FILE.
1287 */
1288
1289 /* Reset buffer status. */
1290 yyrestart(yyin );
1291
1292 /*FALLTHROUGH*/
1293
1294 case EOB_ACT_END_OF_FILE:
1295 {
1296 if ( yywrap( ) )
1297 return EOF;
1298
1299 if ( ! (yy_did_buffer_switch_on_eof) )
1300 YY_NEW_FILE;
1301#ifdef __cplusplus
1302 return yyinput();
1303#else
1304 return input();
1305#endif
1306 }
1307
1308 case EOB_ACT_CONTINUE_SCAN:
1309 (yy_c_buf_p) = (yytext_ptr) + offset;
1310 break;
1311 }
1312 }
1313 }
1314
1315 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1316 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1317 (yy_hold_char) = *++(yy_c_buf_p);
1318
1319 return c;
1320}
1321#endif /* ifndef YY_NO_INPUT */
1322
1323/** Immediately switch to a different input stream.
1324 * @param input_file A readable stream.
1325 *
1326 * @note This function does not reset the start condition to @c INITIAL .
1327 */
1328 void yyrestart (FILE * input_file )
1329{
1330
1331 if ( ! YY_CURRENT_BUFFER ){
1332 yyensure_buffer_stack ();
1333 YY_CURRENT_BUFFER_LVALUE =
1334 yy_create_buffer(yyin,YY_BUF_SIZE );
1335 }
1336
1337 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1338 yy_load_buffer_state( );
1339}
1340
1341/** Switch to a different input buffer.
1342 * @param new_buffer The new input buffer.
1343 *
1344 */
1345 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1346{
1347
1348 /* TODO. We should be able to replace this entire function body
1349 * with
1350 * yypop_buffer_state();
1351 * yypush_buffer_state(new_buffer);
1352 */
1353 yyensure_buffer_stack ();
1354 if ( YY_CURRENT_BUFFER == new_buffer )
1355 return;
1356
1357 if ( YY_CURRENT_BUFFER )
1358 {
1359 /* Flush out information for old buffer. */
1360 *(yy_c_buf_p) = (yy_hold_char);
1361 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1362 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1363 }
1364
1365 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1366 yy_load_buffer_state( );
1367
1368 /* We don't actually know whether we did this switch during
1369 * EOF (yywrap()) processing, but the only time this flag
1370 * is looked at is after yywrap() is called, so it's safe
1371 * to go ahead and always set it.
1372 */
1373 (yy_did_buffer_switch_on_eof) = 1;
1374}
1375
1376static void yy_load_buffer_state (void)
1377{
1378 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1379 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1380 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1381 (yy_hold_char) = *(yy_c_buf_p);
1382}
1383
1384/** Allocate and initialize an input buffer state.
1385 * @param file A readable stream.
1386 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1387 *
1388 * @return the allocated buffer state.
1389 */
1390 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1391{
1392 YY_BUFFER_STATE b;
1393
1394 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1395 if ( ! b )
1396 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1397
1398 b->yy_buf_size = size;
1399
1400 /* yy_ch_buf has to be 2 characters longer than the size given because
1401 * we need to put in 2 end-of-buffer characters.
1402 */
1403 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1404 if ( ! b->yy_ch_buf )
1405 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1406
1407 b->yy_is_our_buffer = 1;
1408
1409 yy_init_buffer(b,file );
1410
1411 return b;
1412}
1413
1414/** Destroy the buffer.
1415 * @param b a buffer created with yy_create_buffer()
1416 *
1417 */
1418 void yy_delete_buffer (YY_BUFFER_STATE b )
1419{
1420
1421 if ( ! b )
1422 return;
1423
1424 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1425 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1426
1427 if ( b->yy_is_our_buffer )
1428 yyfree((void *) b->yy_ch_buf );
1429
1430 yyfree((void *) b );
1431}
1432
1433#ifndef __cplusplus
1434extern int isatty (int );
1435#endif /* __cplusplus */
1436
1437/* Initializes or reinitializes a buffer.
1438 * This function is sometimes called more than once on the same buffer,
1439 * such as during a yyrestart() or at EOF.
1440 */
1441 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1442
1443{
1444 int oerrno = errno;
1445
1446 yy_flush_buffer(b );
1447
1448 b->yy_input_file = file;
1449 b->yy_fill_buffer = 1;
1450
1451 /* If b is the current buffer, then yy_init_buffer was _probably_
1452 * called from yyrestart() or through yy_get_next_buffer.
1453 * In that case, we don't want to reset the lineno or column.
1454 */
1455 if (b != YY_CURRENT_BUFFER){
1456 b->yy_bs_lineno = 1;
1457 b->yy_bs_column = 0;
1458 }
1459
1460 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1461
1462 errno = oerrno;
1463}
1464
1465/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1466 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1467 *
1468 */
1469 void yy_flush_buffer (YY_BUFFER_STATE b )
1470{
1471 if ( ! b )
1472 return;
1473
1474 b->yy_n_chars = 0;
1475
1476 /* We always need two end-of-buffer characters. The first causes
1477 * a transition to the end-of-buffer state. The second causes
1478 * a jam in that state.
1479 */
1480 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1481 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1482
1483 b->yy_buf_pos = &b->yy_ch_buf[0];
1484
1485 b->yy_at_bol = 1;
1486 b->yy_buffer_status = YY_BUFFER_NEW;
1487
1488 if ( b == YY_CURRENT_BUFFER )
1489 yy_load_buffer_state( );
1490}
1491
1492/** Pushes the new state onto the stack. The new state becomes
1493 * the current state. This function will allocate the stack
1494 * if necessary.
1495 * @param new_buffer The new state.
1496 *
1497 */
1498void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1499{
1500 if (new_buffer == NULL)
1501 return;
1502
1503 yyensure_buffer_stack();
1504
1505 /* This block is copied from yy_switch_to_buffer. */
1506 if ( YY_CURRENT_BUFFER )
1507 {
1508 /* Flush out information for old buffer. */
1509 *(yy_c_buf_p) = (yy_hold_char);
1510 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1511 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1512 }
1513
1514 /* Only push if top exists. Otherwise, replace top. */
1515 if (YY_CURRENT_BUFFER)
1516 (yy_buffer_stack_top)++;
1517 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1518
1519 /* copied from yy_switch_to_buffer. */
1520 yy_load_buffer_state( );
1521 (yy_did_buffer_switch_on_eof) = 1;
1522}
1523
1524/** Removes and deletes the top of the stack, if present.
1525 * The next element becomes the new top.
1526 *
1527 */
1528void yypop_buffer_state (void)
1529{
1530 if (!YY_CURRENT_BUFFER)
1531 return;
1532
1533 yy_delete_buffer(YY_CURRENT_BUFFER );
1534 YY_CURRENT_BUFFER_LVALUE = NULL;
1535 if ((yy_buffer_stack_top) > 0)
1536 --(yy_buffer_stack_top);
1537
1538 if (YY_CURRENT_BUFFER) {
1539 yy_load_buffer_state( );
1540 (yy_did_buffer_switch_on_eof) = 1;
1541 }
1542}
1543
1544/* Allocates the stack if it does not exist.
1545 * Guarantees space for at least one push.
1546 */
1547static void yyensure_buffer_stack (void)
1548{
1549 int num_to_alloc;
1550
1551 if (!(yy_buffer_stack)) {
1552
1553 /* First allocation is just for 2 elements, since we don't know if this
1554 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1555 * immediate realloc on the next call.
1556 */
1557 num_to_alloc = 1;
1558 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1559 (num_to_alloc * sizeof(struct yy_buffer_state*)
1560 );
1561 if ( ! (yy_buffer_stack) )
1562 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1563
1564 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1565
1566 (yy_buffer_stack_max) = num_to_alloc;
1567 (yy_buffer_stack_top) = 0;
1568 return;
1569 }
1570
1571 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1572
1573 /* Increase the buffer to prepare for a possible push. */
1574 int grow_size = 8 /* arbitrary grow size */;
1575
1576 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1577 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1578 ((yy_buffer_stack),
1579 num_to_alloc * sizeof(struct yy_buffer_state*)
1580 );
1581 if ( ! (yy_buffer_stack) )
1582 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1583
1584 /* zero only the new slots.*/
1585 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1586 (yy_buffer_stack_max) = num_to_alloc;
1587 }
1588}
1589
1590/** Setup the input buffer state to scan directly from a user-specified character buffer.
1591 * @param base the character buffer
1592 * @param size the size in bytes of the character buffer
1593 *
1594 * @return the newly allocated buffer state object.
1595 */
1596YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1597{
1598 YY_BUFFER_STATE b;
1599
1600 if ( size < 2 ||
1601 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1602 base[size-1] != YY_END_OF_BUFFER_CHAR )
1603 /* They forgot to leave room for the EOB's. */
1604 return 0;
1605
1606 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1607 if ( ! b )
1608 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1609
1610 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1611 b->yy_buf_pos = b->yy_ch_buf = base;
1612 b->yy_is_our_buffer = 0;
1613 b->yy_input_file = 0;
1614 b->yy_n_chars = b->yy_buf_size;
1615 b->yy_is_interactive = 0;
1616 b->yy_at_bol = 1;
1617 b->yy_fill_buffer = 0;
1618 b->yy_buffer_status = YY_BUFFER_NEW;
1619
1620 yy_switch_to_buffer(b );
1621
1622 return b;
1623}
1624
1625/** Setup the input buffer state to scan a string. The next call to yylex() will
1626 * scan from a @e copy of @a str.
1627 * @param yystr a NUL-terminated string to scan
1628 *
1629 * @return the newly allocated buffer state object.
1630 * @note If you want to scan bytes that may contain NUL values, then use
1631 * yy_scan_bytes() instead.
1632 */
1633YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1634{
1635
1636 return yy_scan_bytes(yystr,strlen(yystr) );
1637}
1638
1639/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1640 * scan from a @e copy of @a bytes.
1641 * @param yybytes the byte buffer to scan
1642 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1643 *
1644 * @return the newly allocated buffer state object.
1645 */
1646YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1647{
1648 YY_BUFFER_STATE b;
1649 char *buf;
1650 yy_size_t n;
1651 int i;
1652
1653 /* Get memory for full buffer, including space for trailing EOB's. */
1654 n = _yybytes_len + 2;
1655 buf = (char *) yyalloc(n );
1656 if ( ! buf )
1657 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1658
1659 for ( i = 0; i < _yybytes_len; ++i )
1660 buf[i] = yybytes[i];
1661
1662 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1663
1664 b = yy_scan_buffer(buf,n );
1665 if ( ! b )
1666 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1667
1668 /* It's okay to grow etc. this buffer, and we should throw it
1669 * away when we're done.
1670 */
1671 b->yy_is_our_buffer = 1;
1672
1673 return b;
1674}
1675
1676#ifndef YY_EXIT_FAILURE
1677#define YY_EXIT_FAILURE 2
1678#endif
1679
1680static void yy_fatal_error (yyconst char* msg )
1681{
1682 (void) fprintf( stderr, "%s\n", msg );
1683 exit( YY_EXIT_FAILURE );
1684}
1685
1686/* Redefine yyless() so it works in section 3 code. */
1687
1688#undef yyless
1689#define yyless(n) \
1690 do \
1691 { \
1692 /* Undo effects of setting up yytext. */ \
1693 int yyless_macro_arg = (n); \
1694 YY_LESS_LINENO(yyless_macro_arg);\
1695 yytext[yyleng] = (yy_hold_char); \
1696 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1697 (yy_hold_char) = *(yy_c_buf_p); \
1698 *(yy_c_buf_p) = '\0'; \
1699 yyleng = yyless_macro_arg; \
1700 } \
1701 while ( 0 )
1702
1703/* Accessor methods (get/set functions) to struct members. */
1704
1705/** Get the current line number.
1706 *
1707 */
1708int yyget_lineno (void)
1709{
1710
1711 return yylineno;
1712}
1713
1714/** Get the input stream.
1715 *
1716 */
1717FILE *yyget_in (void)
1718{
1719 return yyin;
1720}
1721
1722/** Get the output stream.
1723 *
1724 */
1725FILE *yyget_out (void)
1726{
1727 return yyout;
1728}
1729
1730/** Get the length of the current token.
1731 *
1732 */
1733int yyget_leng (void)
1734{
1735 return yyleng;
1736}
1737
1738/** Get the current token.
1739 *
1740 */
1741
1742char *yyget_text (void)
1743{
1744 return yytext;
1745}
1746
1747/** Set the current line number.
1748 * @param line_number
1749 *
1750 */
1751void yyset_lineno (int line_number )
1752{
1753
1754 yylineno = line_number;
1755}
1756
1757/** Set the input stream. This does not discard the current
1758 * input buffer.
1759 * @param in_str A readable stream.
1760 *
1761 * @see yy_switch_to_buffer
1762 */
1763void yyset_in (FILE * in_str )
1764{
1765 yyin = in_str ;
1766}
1767
1768void yyset_out (FILE * out_str )
1769{
1770 yyout = out_str ;
1771}
1772
1773int yyget_debug (void)
1774{
1775 return yy_flex_debug;
1776}
1777
1778void yyset_debug (int bdebug )
1779{
1780 yy_flex_debug = bdebug ;
1781}
1782
1783static int yy_init_globals (void)
1784{
1785 /* Initialization is the same as for the non-reentrant scanner.
1786 * This function is called from yylex_destroy(), so don't allocate here.
1787 */
1788
1789 (yy_buffer_stack) = 0;
1790 (yy_buffer_stack_top) = 0;
1791 (yy_buffer_stack_max) = 0;
1792 (yy_c_buf_p) = (char *) 0;
1793 (yy_init) = 0;
1794 (yy_start) = 0;
1795
1796/* Defined in main.c */
1797#ifdef YY_STDINIT
1798 yyin = stdin;
1799 yyout = stdout;
1800#else
1801 yyin = (FILE *) 0;
1802 yyout = (FILE *) 0;
1803#endif
1804
1805 /* For future reference: Set errno on error, since we are called by
1806 * yylex_init()
1807 */
1808 return 0;
1809}
1810
1811/* yylex_destroy is for both reentrant and non-reentrant scanners. */
1812int yylex_destroy (void)
1813{
1814
1815 /* Pop the buffer stack, destroying each element. */
1816 while(YY_CURRENT_BUFFER){
1817 yy_delete_buffer(YY_CURRENT_BUFFER );
1818 YY_CURRENT_BUFFER_LVALUE = NULL;
1819 yypop_buffer_state();
1820 }
1821
1822 /* Destroy the stack itself. */
1823 yyfree((yy_buffer_stack) );
1824 (yy_buffer_stack) = NULL;
1825
1826 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1827 * yylex() is called, initialization will occur. */
1828 yy_init_globals( );
1829
1830 return 0;
1831}
1832
1833/*
1834 * Internal utility routines.
1835 */
1836
1837#ifndef yytext_ptr
1838static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1839{
1840 register int i;
1841 for ( i = 0; i < n; ++i )
1842 s1[i] = s2[i];
1843}
1844#endif
1845
1846#ifdef YY_NEED_STRLEN
1847static int yy_flex_strlen (yyconst char * s )
1848{
1849 register int n;
1850 for ( n = 0; s[n]; ++n )
1851 ;
1852
1853 return n;
1854}
1855#endif
1856
1857void *yyalloc (yy_size_t size )
1858{
1859 return (void *) malloc( size );
1860}
1861
1862void *yyrealloc (void * ptr, yy_size_t size )
1863{
1864 /* The cast to (char *) in the following accommodates both
1865 * implementations that use char* generic pointers, and those
1866 * that use void* generic pointers. It works with the latter
1867 * because both ANSI C and C++ allow castless assignment from
1868 * any pointer type to void*, and deal with argument conversions
1869 * as though doing an assignment.
1870 */
1871 return (void *) realloc( (char *) ptr, size );
1872}
1873
1874void yyfree (void * ptr )
1875{
1876 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1877}
1878
1879#define YYTABLES_NAME "yytables"
1880
1881#line 85 "sel-lex.l"
1882
1883
1884
1885static char *
1886handle_string(void)
1887{
1888 char x[1024];
1889 int i = 0;
1890 int c;
1891 int quote = 0;
1892 while((c = input()) != EOF){
1893 if(quote) {
1894 x[i++] = '\\';
1895 x[i++] = c;
1896 quote = 0;
1897 continue;
1898 }
1899 if(c == '\n'){
1900 _hx509_sel_yyerror("unterminated string");
1901 lineno++;
1902 break;
1903 }
1904 if(c == '\\'){
1905 quote++;
1906 continue;
1907 }
1908 if(c == '\"')
1909 break;
1910 x[i++] = c;
1911 }
1912 x[i] = '\0';
1913 return strdup(x);
1914}
1915
1916int
1917yywrap ()
1918{
1919 return 1;
1920}
1921
1922static int
1923lex_input(char *buf, int max_size)
1924{
1925 int n;
1926
1927 n = _hx509_expr_input.length - _hx509_expr_input.offset;
1928 if (max_size < n)
1929 n = max_size;
1930 if (n <= 0)
1931 return YY_NULL;
1932
1933 memcpy(buf, _hx509_expr_input.buf + _hx509_expr_input.offset, n);
1934 _hx509_expr_input.offset += n;
1935
1936 return n;
1937}
1938
Note: See TracBrowser for help on using the repository browser.