4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
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
16 /* First, we deal with platform-specific or compiler-specific issues. */
18 /* begin standard C headers. */
24 /* end standard C headers. */
26 /* flex integer type definitions */
31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36 * if you want the limit (max/min) macros for int types.
38 #ifndef __STDC_LIMIT_MACROS
39 #define __STDC_LIMIT_MACROS 1
43 typedef int8_t flex_int8_t;
44 typedef uint8_t flex_uint8_t;
45 typedef int16_t flex_int16_t;
46 typedef uint16_t flex_uint16_t;
47 typedef int32_t flex_int32_t;
48 typedef uint32_t flex_uint32_t;
50 typedef signed char flex_int8_t;
51 typedef short int flex_int16_t;
52 typedef int flex_int32_t;
53 typedef unsigned char flex_uint8_t;
54 typedef unsigned short int flex_uint16_t;
55 typedef unsigned int flex_uint32_t;
57 /* Limits of integral types. */
59 #define INT8_MIN (-128)
62 #define INT16_MIN (-32767-1)
65 #define INT32_MIN (-2147483647-1)
68 #define INT8_MAX (127)
71 #define INT16_MAX (32767)
74 #define INT32_MAX (2147483647)
77 #define UINT8_MAX (255U)
80 #define UINT16_MAX (65535U)
83 #define UINT32_MAX (4294967295U)
88 #endif /* ! FLEXINT_H */
92 /* The "const" storage-class-modifier is valid. */
95 #else /* ! __cplusplus */
97 /* C99 requires __STDC__ to be defined as 1. */
98 #if defined (__STDC__)
102 #endif /* defined (__STDC__) */
103 #endif /* ! __cplusplus */
106 #define yyconst const
111 /* Returned upon end-of-file. */
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
119 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
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.
125 #define BEGIN (yy_start) = 1 + 2 *
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
131 #define YY_START (((yy_start) - 1) / 2)
132 #define YYSTATE YY_START
134 /* Action number for EOF rule of a given start state. */
135 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
137 /* Special action meaning "start processing a new file". */
138 #define YY_NEW_FILE yyrestart(yyin )
140 #define YY_END_OF_BUFFER_CHAR 0
142 /* Size of default input buffer. */
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.
149 #define YY_BUF_SIZE 32768
151 #define YY_BUF_SIZE 16384
152 #endif /* __ia64__ */
155 /* The state buf must be large enough to hold one state per character in the main buffer.
157 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
159 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
160 #define YY_TYPEDEF_YY_BUFFER_STATE
161 typedef struct yy_buffer_state *YY_BUFFER_STATE;
166 extern FILE *yyin, *yyout;
168 #define EOB_ACT_CONTINUE_SCAN 0
169 #define EOB_ACT_END_OF_FILE 1
170 #define EOB_ACT_LAST_MATCH 2
172 #define YY_LESS_LINENO(n)
174 /* Return all but the first "n" matched characters back to the input stream. */
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 */ \
188 #define unput(c) yyunput( c, (yytext_ptr) )
190 #ifndef YY_TYPEDEF_YY_SIZE_T
191 #define YY_TYPEDEF_YY_SIZE_T
192 typedef size_t yy_size_t;
195 #ifndef YY_STRUCT_YY_BUFFER_STATE
196 #define YY_STRUCT_YY_BUFFER_STATE
197 struct yy_buffer_state
201 char *yy_ch_buf; /* input buffer */
202 char *yy_buf_pos; /* current position in input buffer */
204 /* Size of input buffer in bytes, not including room for EOB
207 yy_size_t yy_buf_size;
209 /* Number of characters read into yy_ch_buf, not including EOB
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
218 int yy_is_our_buffer;
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
225 int yy_is_interactive;
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
233 int yy_bs_lineno; /**< The line count. */
234 int yy_bs_column; /**< The column count. */
236 /* Whether to try to fill the input buffer when we reach the
241 int yy_buffer_status;
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.
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.
255 #define YY_BUFFER_EOF_PENDING 2
258 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
260 /* Stack of input buffers. */
261 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
262 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
263 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
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
269 * Returns the top of the stack, or NULL.
271 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
272 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
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.
278 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
280 /* yy_hold_char holds the character lost when yytext is formed. */
281 static char yy_hold_char;
282 static int yy_n_chars; /* number of characters read into yy_ch_buf */
285 /* Points to current character in buffer. */
286 static char *yy_c_buf_p = (char *) 0;
287 static int yy_init = 0; /* whether we need to initialize */
288 static int yy_start = 0; /* start state number */
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 ...
293 static int yy_did_buffer_switch_on_eof;
295 void yyrestart (FILE *input_file );
296 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
297 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
298 void yy_delete_buffer (YY_BUFFER_STATE b );
299 void yy_flush_buffer (YY_BUFFER_STATE b );
300 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
301 void yypop_buffer_state (void );
303 static void yyensure_buffer_stack (void );
304 static void yy_load_buffer_state (void );
305 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
307 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
309 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
310 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
311 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
313 void *yyalloc (yy_size_t );
314 void *yyrealloc (void *,yy_size_t );
315 void yyfree (void * );
317 #define yy_new_buffer yy_create_buffer
319 #define yy_set_interactive(is_interactive) \
321 if ( ! YY_CURRENT_BUFFER ){ \
322 yyensure_buffer_stack (); \
323 YY_CURRENT_BUFFER_LVALUE = \
324 yy_create_buffer(yyin,YY_BUF_SIZE ); \
326 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
329 #define yy_set_bol(at_bol) \
331 if ( ! YY_CURRENT_BUFFER ){\
332 yyensure_buffer_stack (); \
333 YY_CURRENT_BUFFER_LVALUE = \
334 yy_create_buffer(yyin,YY_BUF_SIZE ); \
336 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
339 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
341 /* Begin user sect3 */
343 typedef unsigned char YY_CHAR;
345 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
347 typedef int yy_state_type;
354 #define yytext_ptr yytext
356 static yy_state_type yy_get_previous_state (void );
357 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
358 static int yy_get_next_buffer (void );
359 static void yy_fatal_error (yyconst char msg[] );
361 /* Done after the current pattern has been matched and before the
362 * corresponding action - sets up yytext.
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; \
369 (yy_c_buf_p) = yy_cp;
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. */
377 flex_int32_t yy_verify;
380 static yyconst flex_int16_t yy_accept[36] =
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,
388 static yyconst flex_int32_t yy_ec[256] =
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,
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,
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,
420 static yyconst flex_int32_t yy_meta[23] =
422 1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
427 static yyconst flex_int16_t yy_base[37] =
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,
435 static yyconst flex_int16_t yy_def[37] =
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
443 static yyconst flex_int16_t yy_nxt[67] =
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
454 static yyconst flex_int16_t yy_chk[67] =
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
465 static yy_state_type yy_last_accepting_state;
466 static char *yy_last_accepting_cpos;
468 extern int yy_flex_debug;
469 int yy_flex_debug = 0;
471 /* The intent behind this definition is that it'll catch
472 * any uses of REJECT which flex missed.
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
482 * Copyright (c) 2004, 2008 Kungliga Tekniska Högskolan
483 * (Royal Institute of Technology, Stockholm, Sweden).
484 * All rights reserved.
486 * Redistribution and use in source and binary forms, with or without
487 * modification, are permitted provided that the following conditions
490 * 1. Redistributions of source code must retain the above copyright
491 * notice, this list of conditions and the following disclaimer.
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.
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.
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
527 #include "sel-gram.h"
530 static char * handle_string(void);
531 static int lex_input(char *, int);
533 struct hx_expr_input _hx509_expr_input;
539 #define YY_NO_UNPUT 1
542 #define YY_INPUT(buf,res,maxsize) (res = lex_input(buf, maxsize))
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.
558 #ifndef YY_EXTRA_TYPE
559 #define YY_EXTRA_TYPE void *
562 static int yy_init_globals (void );
564 /* Accessor methods to globals.
565 These are made visible to non-reentrant scanners for convenience. */
567 int yylex_destroy (void );
569 int yyget_debug (void );
571 void yyset_debug (int debug_flag );
573 YY_EXTRA_TYPE yyget_extra (void );
575 void yyset_extra (YY_EXTRA_TYPE user_defined );
577 FILE *yyget_in (void );
579 void yyset_in (FILE * in_str );
581 FILE *yyget_out (void );
583 void yyset_out (FILE * out_str );
585 int yyget_leng (void );
587 char *yyget_text (void );
589 int yyget_lineno (void );
591 void yyset_lineno (int line_number );
593 /* Macros after this point can all be overridden by user definitions in
597 #ifndef YY_SKIP_YYWRAP
599 extern "C" int yywrap (void );
601 extern int yywrap (void );
605 static void yyunput (int c,char *buf_ptr );
608 static void yy_flex_strncpy (char *,yyconst char *,int );
611 #ifdef YY_NEED_STRLEN
612 static int yy_flex_strlen (yyconst char * );
618 static int yyinput (void );
620 static int input (void );
625 /* Amount of stuff to slurp up with each read. */
626 #ifndef YY_READ_BUF_SIZE
628 /* On IA-64, the buffer size is 16k, not 8k */
629 #define YY_READ_BUF_SIZE 16384
631 #define YY_READ_BUF_SIZE 8192
632 #endif /* __ia64__ */
635 /* Copy whatever the last rule matched to the standard output. */
637 /* This used to be an fputs(), but since the string might contain NUL's,
638 * we now use fwrite().
640 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
643 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
644 * is returned in "result".
647 #define YY_INPUT(buf,result,max_size) \
648 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
652 for ( n = 0; n < max_size && \
653 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
656 buf[n++] = (char) c; \
657 if ( c == EOF && ferror( yyin ) ) \
658 YY_FATAL_ERROR( "input in flex scanner failed" ); \
664 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
666 if( errno != EINTR) \
668 YY_FATAL_ERROR( "input in flex scanner failed" ); \
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.
684 #define yyterminate() return YY_NULL
687 /* Number of entries by which start-condition stack grows. */
688 #ifndef YY_START_STACK_INCR
689 #define YY_START_STACK_INCR 25
692 /* Report a fatal error. */
693 #ifndef YY_FATAL_ERROR
694 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
697 /* end tables serialization structures and prototypes */
699 /* Default declaration of generated scanner - a define so the user can
700 * easily add parameters.
703 #define YY_DECL_IS_OURS 1
705 extern int yylex (void);
707 #define YY_DECL int yylex (void)
708 #endif /* !YY_DECL */
710 /* Code executed at the beginning of each rule, after yytext and yyleng
713 #ifndef YY_USER_ACTION
714 #define YY_USER_ACTION
717 /* Code executed at the end of each rule. */
719 #define YY_BREAK break;
722 #define YY_RULE_SETUP \
725 /** The main scanner function which does all the work.
729 register yy_state_type yy_current_state;
730 register char *yy_cp, *yy_bp;
747 (yy_start) = 1; /* first start state */
755 if ( ! YY_CURRENT_BUFFER ) {
756 yyensure_buffer_stack ();
757 YY_CURRENT_BUFFER_LVALUE =
758 yy_create_buffer(yyin,YY_BUF_SIZE );
761 yy_load_buffer_state( );
764 while ( 1 ) /* loops until end-of-file is reached */
766 yy_cp = (yy_c_buf_p);
768 /* Support of yytext. */
769 *yy_cp = (yy_hold_char);
771 /* yy_bp points to the position in yy_ch_buf of the start of
776 yy_current_state = (yy_start);
780 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
781 if ( yy_accept[yy_current_state] )
783 (yy_last_accepting_state) = yy_current_state;
784 (yy_last_accepting_cpos) = yy_cp;
786 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
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];
792 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
795 while ( yy_base[yy_current_state] != 44 );
798 yy_act = yy_accept[yy_current_state];
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];
808 do_action: /* This label is used only to access EOF actions. */
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);
847 { return kw_TAILMATCH; }
853 yylval.string = strdup ((const char *)yytext);
860 { yylval.string = handle_string(); return STRING; }
863 /* rule 9 can match eol */
884 case YY_STATE_EOF(INITIAL):
887 case YY_END_OF_BUFFER:
889 /* Amount of text matched not including the EOB char. */
890 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
892 /* Undo the effects of YY_DO_BEFORE_ACTION. */
893 *yy_cp = (yy_hold_char);
894 YY_RESTORE_YY_MORE_OFFSET
896 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
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.
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;
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
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;
923 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
925 yy_current_state = yy_get_previous_state( );
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).
936 yy_next_state = yy_try_NUL_trans( yy_current_state );
938 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
942 /* Consume the NUL. */
943 yy_cp = ++(yy_c_buf_p);
944 yy_current_state = yy_next_state;
950 yy_cp = (yy_c_buf_p);
955 else switch ( yy_get_next_buffer( ) )
957 case EOB_ACT_END_OF_FILE:
959 (yy_did_buffer_switch_on_eof) = 0;
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.
972 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
974 yy_act = YY_STATE_EOF(YY_START);
980 if ( ! (yy_did_buffer_switch_on_eof) )
986 case EOB_ACT_CONTINUE_SCAN:
988 (yytext_ptr) + yy_amount_of_matched_text;
990 yy_current_state = yy_get_previous_state( );
992 yy_cp = (yy_c_buf_p);
993 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
996 case EOB_ACT_LAST_MATCH:
998 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1000 yy_current_state = yy_get_previous_state( );
1002 yy_cp = (yy_c_buf_p);
1003 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1004 goto yy_find_action;
1011 "fatal flex scanner internal error--no action found" );
1012 } /* end of action switch */
1013 } /* end of scanning one token */
1014 } /* end of yylex */
1016 /* yy_get_next_buffer - try to read in a new buffer
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
1023 static int yy_get_next_buffer (void)
1025 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1026 register char *source = (yytext_ptr);
1027 register int number_to_move, i;
1030 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1032 "fatal flex scanner internal error--end of buffer missed" );
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 )
1038 /* We matched a single character, the EOB, so
1039 * treat this as a final EOF.
1041 return EOB_ACT_END_OF_FILE;
1046 /* We matched some text prior to the EOB, first
1049 return EOB_ACT_LAST_MATCH;
1053 /* Try to read more data. */
1055 /* First move last chars to start of buffer. */
1056 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1058 for ( i = 0; i < number_to_move; ++i )
1059 *(dest++) = *(source++);
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,
1065 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1070 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1072 while ( num_to_read <= 0 )
1073 { /* Not enough room in the buffer - grow it. */
1075 /* just a shorter name for the current buffer */
1076 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1078 int yy_c_buf_p_offset =
1079 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1081 if ( b->yy_is_our_buffer )
1083 int new_size = b->yy_buf_size * 2;
1085 if ( new_size <= 0 )
1086 b->yy_buf_size += b->yy_buf_size / 8;
1088 b->yy_buf_size *= 2;
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 );
1095 /* Can't grow it, we don't own it. */
1098 if ( ! b->yy_ch_buf )
1100 "fatal error - scanner input buffer overflow" );
1102 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1104 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1109 if ( num_to_read > YY_READ_BUF_SIZE )
1110 num_to_read = YY_READ_BUF_SIZE;
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 );
1116 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1119 if ( (yy_n_chars) == 0 )
1121 if ( number_to_move == YY_MORE_ADJ )
1123 ret_val = EOB_ACT_END_OF_FILE;
1129 ret_val = EOB_ACT_LAST_MATCH;
1130 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1131 YY_BUFFER_EOF_PENDING;
1136 ret_val = EOB_ACT_CONTINUE_SCAN;
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()" );
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;
1150 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1155 /* yy_get_previous_state - get the state just before the EOB char was reached */
1157 static yy_state_type yy_get_previous_state (void)
1159 register yy_state_type yy_current_state;
1160 register char *yy_cp;
1162 yy_current_state = (yy_start);
1164 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1166 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1167 if ( yy_accept[yy_current_state] )
1169 (yy_last_accepting_state) = yy_current_state;
1170 (yy_last_accepting_cpos) = yy_cp;
1172 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
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];
1178 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1181 return yy_current_state;
1184 /* yy_try_NUL_trans - try to make a transition on the NUL character
1187 * next_state = yy_try_NUL_trans( current_state );
1189 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1191 register int yy_is_jam;
1192 register char *yy_cp = (yy_c_buf_p);
1194 register YY_CHAR yy_c = 1;
1195 if ( yy_accept[yy_current_state] )
1197 (yy_last_accepting_state) = yy_current_state;
1198 (yy_last_accepting_cpos) = yy_cp;
1200 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
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];
1206 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1207 yy_is_jam = (yy_current_state == 35);
1209 return yy_is_jam ? 0 : yy_current_state;
1212 static void yyunput (int c, register char * yy_bp )
1214 register char *yy_cp;
1216 yy_cp = (yy_c_buf_p);
1218 /* undo effects of setting up yytext */
1219 *yy_cp = (yy_hold_char);
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];
1230 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1231 *--dest = *--source;
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;
1238 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1239 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1242 *--yy_cp = (char) c;
1244 (yytext_ptr) = yy_bp;
1245 (yy_hold_char) = *yy_cp;
1246 (yy_c_buf_p) = yy_cp;
1251 static int yyinput (void)
1253 static int input (void)
1259 *(yy_c_buf_p) = (yy_hold_char);
1261 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
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.
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';
1272 { /* need more input */
1273 int offset = (yy_c_buf_p) - (yytext_ptr);
1276 switch ( yy_get_next_buffer( ) )
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.
1289 /* Reset buffer status. */
1294 case EOB_ACT_END_OF_FILE:
1299 if ( ! (yy_did_buffer_switch_on_eof) )
1308 case EOB_ACT_CONTINUE_SCAN:
1309 (yy_c_buf_p) = (yytext_ptr) + offset;
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);
1321 #endif /* ifndef YY_NO_INPUT */
1323 /** Immediately switch to a different input stream.
1324 * @param input_file A readable stream.
1326 * @note This function does not reset the start condition to @c INITIAL .
1328 void yyrestart (FILE * input_file )
1331 if ( ! YY_CURRENT_BUFFER ){
1332 yyensure_buffer_stack ();
1333 YY_CURRENT_BUFFER_LVALUE =
1334 yy_create_buffer(yyin,YY_BUF_SIZE );
1337 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1338 yy_load_buffer_state( );
1341 /** Switch to a different input buffer.
1342 * @param new_buffer The new input buffer.
1345 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1348 /* TODO. We should be able to replace this entire function body
1350 * yypop_buffer_state();
1351 * yypush_buffer_state(new_buffer);
1353 yyensure_buffer_stack ();
1354 if ( YY_CURRENT_BUFFER == new_buffer )
1357 if ( YY_CURRENT_BUFFER )
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);
1365 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1366 yy_load_buffer_state( );
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.
1373 (yy_did_buffer_switch_on_eof) = 1;
1376 static void yy_load_buffer_state (void)
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);
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.
1388 * @return the allocated buffer state.
1390 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1394 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1396 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1398 b->yy_buf_size = size;
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.
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()" );
1407 b->yy_is_our_buffer = 1;
1409 yy_init_buffer(b,file );
1414 /** Destroy the buffer.
1415 * @param b a buffer created with yy_create_buffer()
1418 void yy_delete_buffer (YY_BUFFER_STATE b )
1424 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1425 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1427 if ( b->yy_is_our_buffer )
1428 yyfree((void *) b->yy_ch_buf );
1430 yyfree((void *) b );
1434 extern int isatty (int );
1435 #endif /* __cplusplus */
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.
1441 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1446 yy_flush_buffer(b );
1448 b->yy_input_file = file;
1449 b->yy_fill_buffer = 1;
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.
1455 if (b != YY_CURRENT_BUFFER){
1456 b->yy_bs_lineno = 1;
1457 b->yy_bs_column = 0;
1460 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
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.
1469 void yy_flush_buffer (YY_BUFFER_STATE b )
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.
1480 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1481 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1483 b->yy_buf_pos = &b->yy_ch_buf[0];
1486 b->yy_buffer_status = YY_BUFFER_NEW;
1488 if ( b == YY_CURRENT_BUFFER )
1489 yy_load_buffer_state( );
1492 /** Pushes the new state onto the stack. The new state becomes
1493 * the current state. This function will allocate the stack
1495 * @param new_buffer The new state.
1498 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1500 if (new_buffer == NULL)
1503 yyensure_buffer_stack();
1505 /* This block is copied from yy_switch_to_buffer. */
1506 if ( YY_CURRENT_BUFFER )
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);
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;
1519 /* copied from yy_switch_to_buffer. */
1520 yy_load_buffer_state( );
1521 (yy_did_buffer_switch_on_eof) = 1;
1524 /** Removes and deletes the top of the stack, if present.
1525 * The next element becomes the new top.
1528 void yypop_buffer_state (void)
1530 if (!YY_CURRENT_BUFFER)
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);
1538 if (YY_CURRENT_BUFFER) {
1539 yy_load_buffer_state( );
1540 (yy_did_buffer_switch_on_eof) = 1;
1544 /* Allocates the stack if it does not exist.
1545 * Guarantees space for at least one push.
1547 static void yyensure_buffer_stack (void)
1551 if (!(yy_buffer_stack)) {
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.
1558 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1559 (num_to_alloc * sizeof(struct yy_buffer_state*)
1561 if ( ! (yy_buffer_stack) )
1562 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1564 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1566 (yy_buffer_stack_max) = num_to_alloc;
1567 (yy_buffer_stack_top) = 0;
1571 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1573 /* Increase the buffer to prepare for a possible push. */
1574 int grow_size = 8 /* arbitrary grow size */;
1576 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1577 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1579 num_to_alloc * sizeof(struct yy_buffer_state*)
1581 if ( ! (yy_buffer_stack) )
1582 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
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;
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
1594 * @return the newly allocated buffer state object.
1596 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
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. */
1606 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1608 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
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;
1617 b->yy_fill_buffer = 0;
1618 b->yy_buffer_status = YY_BUFFER_NEW;
1620 yy_switch_to_buffer(b );
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
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.
1633 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1636 return yy_scan_bytes(yystr,strlen(yystr) );
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.
1644 * @return the newly allocated buffer state object.
1646 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1653 /* Get memory for full buffer, including space for trailing EOB's. */
1654 n = _yybytes_len + 2;
1655 buf = (char *) yyalloc(n );
1657 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1659 for ( i = 0; i < _yybytes_len; ++i )
1660 buf[i] = yybytes[i];
1662 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1664 b = yy_scan_buffer(buf,n );
1666 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1668 /* It's okay to grow etc. this buffer, and we should throw it
1669 * away when we're done.
1671 b->yy_is_our_buffer = 1;
1676 #ifndef YY_EXIT_FAILURE
1677 #define YY_EXIT_FAILURE 2
1680 static void yy_fatal_error (yyconst char* msg )
1682 (void) fprintf( stderr, "%s\n", msg );
1683 exit( YY_EXIT_FAILURE );
1686 /* Redefine yyless() so it works in section 3 code. */
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; \
1703 /* Accessor methods (get/set functions) to struct members. */
1705 /** Get the current line number.
1708 int yyget_lineno (void)
1714 /** Get the input stream.
1717 FILE *yyget_in (void)
1722 /** Get the output stream.
1725 FILE *yyget_out (void)
1730 /** Get the length of the current token.
1733 int yyget_leng (void)
1738 /** Get the current token.
1742 char *yyget_text (void)
1747 /** Set the current line number.
1748 * @param line_number
1751 void yyset_lineno (int line_number )
1754 yylineno = line_number;
1757 /** Set the input stream. This does not discard the current
1759 * @param in_str A readable stream.
1761 * @see yy_switch_to_buffer
1763 void yyset_in (FILE * in_str )
1768 void yyset_out (FILE * out_str )
1773 int yyget_debug (void)
1775 return yy_flex_debug;
1778 void yyset_debug (int bdebug )
1780 yy_flex_debug = bdebug ;
1783 static int yy_init_globals (void)
1785 /* Initialization is the same as for the non-reentrant scanner.
1786 * This function is called from yylex_destroy(), so don't allocate here.
1789 (yy_buffer_stack) = 0;
1790 (yy_buffer_stack_top) = 0;
1791 (yy_buffer_stack_max) = 0;
1792 (yy_c_buf_p) = (char *) 0;
1796 /* Defined in main.c */
1805 /* For future reference: Set errno on error, since we are called by
1811 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1812 int yylex_destroy (void)
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();
1822 /* Destroy the stack itself. */
1823 yyfree((yy_buffer_stack) );
1824 (yy_buffer_stack) = NULL;
1826 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1827 * yylex() is called, initialization will occur. */
1834 * Internal utility routines.
1838 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1841 for ( i = 0; i < n; ++i )
1846 #ifdef YY_NEED_STRLEN
1847 static int yy_flex_strlen (yyconst char * s )
1850 for ( n = 0; s[n]; ++n )
1857 void *yyalloc (yy_size_t size )
1859 return (void *) malloc( size );
1862 void *yyrealloc (void * ptr, yy_size_t size )
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.
1871 return (void *) realloc( (char *) ptr, size );
1874 void yyfree (void * ptr )
1876 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1879 #define YYTABLES_NAME "yytables"
1881 #line 85 "sel-lex.l"
1892 while((c = input()) != EOF){
1900 _hx509_sel_yyerror("unterminated string");
1923 lex_input(char *buf, int max_size)
1927 n = _hx509_expr_input.length - _hx509_expr_input.offset;
1933 memcpy(buf, _hx509_expr_input.buf + _hx509_expr_input.offset, n);
1934 _hx509_expr_input.offset += n;