5 #define YY_INT_ALIGNED short int
7 /* A lexical scanner generated by flex */
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 6
12 #define YY_FLEX_SUBMINOR_VERSION 4
13 #if YY_FLEX_SUBMINOR_VERSION > 0
17 /* First, we deal with platform-specific or compiler-specific issues. */
19 /* begin standard C headers. */
25 /* end standard C headers. */
27 /* flex integer type definitions */
32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
34 #if defined(__FreeBSD__) || \
35 (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
37 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
38 * if you want the limit (max/min) macros for int types.
40 #ifndef __STDC_LIMIT_MACROS
41 #define __STDC_LIMIT_MACROS 1
45 typedef int8_t flex_int8_t;
46 typedef uint8_t flex_uint8_t;
47 typedef int16_t flex_int16_t;
48 typedef uint16_t flex_uint16_t;
49 typedef int32_t flex_int32_t;
50 typedef uint32_t flex_uint32_t;
52 typedef signed char flex_int8_t;
53 typedef short int flex_int16_t;
54 typedef int flex_int32_t;
55 typedef unsigned char flex_uint8_t;
56 typedef unsigned short int flex_uint16_t;
57 typedef unsigned int flex_uint32_t;
59 /* Limits of integral types. */
61 #define INT8_MIN (-128)
64 #define INT16_MIN (-32767-1)
67 #define INT32_MIN (-2147483647-1)
70 #define INT8_MAX (127)
73 #define INT16_MAX (32767)
76 #define INT32_MAX (2147483647)
79 #define UINT8_MAX (255U)
82 #define UINT16_MAX (65535U)
85 #define UINT32_MAX (4294967295U)
89 #define SIZE_MAX (~(size_t)0)
94 #endif /* ! FLEXINT_H */
96 /* begin standard C++ headers. */
98 /* TODO: this is always defined, so inline it */
101 #if defined(__GNUC__) && __GNUC__ >= 3
102 #define yynoreturn __attribute__((__noreturn__))
107 /* Returned upon end-of-file. */
110 /* Promotes a possibly negative, possibly signed char to an
111 * integer in range [0..255] for use as an array index.
113 #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
115 /* Enter a start condition. This macro really ought to take a parameter,
116 * but we do it the disgusting crufty way forced on us by the ()-less
117 * definition of BEGIN.
119 #define BEGIN (yy_start) = 1 + 2 *
120 /* Translate the current start state into a value that can be later handed
121 * to BEGIN to return to the state. The YYSTATE alias is for lex
124 #define YY_START (((yy_start) - 1) / 2)
125 #define YYSTATE YY_START
126 /* Action number for EOF rule of a given start state. */
127 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
128 /* Special action meaning "start processing a new file". */
129 #define YY_NEW_FILE yyrestart( yyin )
130 #define YY_END_OF_BUFFER_CHAR 0
132 /* Size of default input buffer. */
135 /* On IA-64, the buffer size is 16k, not 8k.
136 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
137 * Ditto for the __ia64__ case accordingly.
139 #define YY_BUF_SIZE 32768
141 #define YY_BUF_SIZE 16384
142 #endif /* __ia64__ */
145 /* The state buf must be large enough to hold one state per character in the main buffer.
147 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
149 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
150 #define YY_TYPEDEF_YY_BUFFER_STATE
151 typedef struct yy_buffer_state *YY_BUFFER_STATE;
154 #ifndef YY_TYPEDEF_YY_SIZE_T
155 #define YY_TYPEDEF_YY_SIZE_T
156 typedef size_t yy_size_t;
161 extern FILE *yyin, *yyout;
163 #define EOB_ACT_CONTINUE_SCAN 0
164 #define EOB_ACT_END_OF_FILE 1
165 #define EOB_ACT_LAST_MATCH 2
167 #define YY_LESS_LINENO(n)
168 #define YY_LINENO_REWIND_TO(ptr)
170 /* Return all but the first "n" matched characters back to the input stream. */
174 /* Undo effects of setting up yytext. */ \
175 int yyless_macro_arg = (n); \
176 YY_LESS_LINENO(yyless_macro_arg);\
177 *yy_cp = (yy_hold_char); \
178 YY_RESTORE_YY_MORE_OFFSET \
179 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
180 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
183 #define unput(c) yyunput( c, (yytext_ptr) )
185 #ifndef YY_STRUCT_YY_BUFFER_STATE
186 #define YY_STRUCT_YY_BUFFER_STATE
187 struct yy_buffer_state
191 char *yy_ch_buf; /* input buffer */
192 char *yy_buf_pos; /* current position in input buffer */
194 /* Size of input buffer in bytes, not including room for EOB
199 /* Number of characters read into yy_ch_buf, not including EOB
204 /* Whether we "own" the buffer - i.e., we know we created it,
205 * and can realloc() it to grow it, and should free() it to
208 int yy_is_our_buffer;
210 /* Whether this is an "interactive" input source; if so, and
211 * if we're using stdio for input, then we want to use getc()
212 * instead of fread(), to make sure we stop fetching input after
215 int yy_is_interactive;
217 /* Whether we're considered to be at the beginning of a line.
218 * If so, '^' rules will be active on the next match, otherwise
223 int yy_bs_lineno; /**< The line count. */
224 int yy_bs_column; /**< The column count. */
226 /* Whether to try to fill the input buffer when we reach the
231 int yy_buffer_status;
233 #define YY_BUFFER_NEW 0
234 #define YY_BUFFER_NORMAL 1
235 /* When an EOF's been seen but there's still some text to process
236 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
237 * shouldn't try reading from the input source any more. We might
238 * still have a bunch of tokens to match, though, because of
239 * possible backing-up.
241 * When we actually see the EOF, we change the status to "new"
242 * (via yyrestart()), so that the user can continue scanning by
243 * just pointing yyin at a new input file.
245 #define YY_BUFFER_EOF_PENDING 2
248 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
250 /* Stack of input buffers. */
251 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
252 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
253 static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
255 /* We provide macros for accessing buffer states in case in the
256 * future we want to put the buffer states in a more general
259 * Returns the top of the stack, or NULL.
261 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
262 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
264 #define yy_current_buffer YY_CURRENT_BUFFER
265 /* Same as previous macro, but useful when we know that the buffer stack is not
266 * NULL or when we need an lvalue. For internal use only.
268 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
270 /* yy_hold_char holds the character lost when yytext is formed. */
271 static char yy_hold_char;
272 static int yy_n_chars; /* number of characters read into yy_ch_buf */
275 /* Points to current character in buffer. */
276 static char *yy_c_buf_p = NULL;
277 static int yy_init = 0; /* whether we need to initialize */
278 static int yy_start = 0; /* start state number */
280 /* Flag which is used to allow yywrap()'s to do buffer switches
281 * instead of setting up a fresh yyin. A bit of a hack ...
283 static int yy_did_buffer_switch_on_eof;
285 void yyrestart ( FILE *input_file );
286 void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
287 YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
288 void yy_delete_buffer ( YY_BUFFER_STATE b );
289 void yy_flush_buffer ( YY_BUFFER_STATE b );
290 void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
291 void yypop_buffer_state ( void );
293 static void yyensure_buffer_stack ( void );
294 static void yy_load_buffer_state ( void );
295 static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
296 #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
298 YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
299 YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
300 YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
302 void *yyalloc ( yy_size_t );
303 void *yyrealloc ( void *, yy_size_t );
304 void yyfree ( void * );
306 #define yy_new_buffer yy_create_buffer
307 #define yy_set_interactive(is_interactive) \
309 if ( ! YY_CURRENT_BUFFER ){ \
310 yyensure_buffer_stack (); \
311 YY_CURRENT_BUFFER_LVALUE = \
312 yy_create_buffer( yyin, YY_BUF_SIZE ); \
314 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
316 #define yy_set_bol(at_bol) \
318 if ( ! YY_CURRENT_BUFFER ){\
319 yyensure_buffer_stack (); \
320 YY_CURRENT_BUFFER_LVALUE = \
321 yy_create_buffer( yyin, YY_BUF_SIZE ); \
323 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
325 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
327 /* Begin user sect3 */
329 #define yywrap() (/*CONSTCOND*/1)
330 #define YY_SKIP_YYWRAP
331 typedef flex_uint8_t YY_CHAR;
333 FILE *yyin = NULL, *yyout = NULL;
335 typedef int yy_state_type;
344 #define yytext_ptr yytext
346 static yy_state_type yy_get_previous_state ( void );
347 static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
348 static int yy_get_next_buffer ( void );
349 static void yynoreturn yy_fatal_error ( const char* msg );
351 /* Done after the current pattern has been matched and before the
352 * corresponding action - sets up yytext.
354 #define YY_DO_BEFORE_ACTION \
355 (yytext_ptr) = yy_bp; \
356 yyleng = (int) (yy_cp - yy_bp); \
357 (yy_hold_char) = *yy_cp; \
359 (yy_c_buf_p) = yy_cp;
360 #define YY_NUM_RULES 14
361 #define YY_END_OF_BUFFER 15
362 /* This struct is not used in this scanner,
363 but its presence is necessary. */
366 flex_int32_t yy_verify;
369 static const flex_int16_t yy_accept[35] =
371 0, 0, 15, 13, 1, 1, 13, 13, 13, 2,
372 2, 13, 13, 13, 13, 1, 9, 10, 12, 2,
373 0, 0, 2, 6, 4, 8, 5, 7, 11, 0,
377 static const YY_CHAR yy_ec[256] =
379 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
380 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
381 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
382 1, 2, 4, 1, 1, 1, 1, 5, 1, 1,
383 1, 6, 1, 1, 1, 1, 1, 7, 8, 8,
384 8, 8, 8, 8, 8, 9, 9, 10, 1, 11,
385 12, 13, 1, 1, 14, 14, 14, 14, 14, 14,
386 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
387 15, 16, 15, 15, 15, 15, 15, 17, 15, 15,
388 1, 1, 1, 1, 1, 1, 14, 14, 14, 14,
390 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
391 15, 15, 15, 16, 15, 15, 15, 15, 15, 17,
392 15, 15, 1, 18, 1, 1, 1, 1, 1, 1,
393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
394 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
395 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
396 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
398 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
399 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 1, 1, 1, 1, 1, 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,
409 static const YY_CHAR yy_meta[19] =
411 1, 1, 1, 1, 1, 1, 2, 2, 2, 1,
412 1, 1, 1, 3, 4, 4, 4, 1
415 static const flex_int16_t yy_base[39] =
417 0, 0, 48, 49, 17, 19, 35, 41, 39, 16,
418 0, 14, 32, 15, 25, 27, 49, 49, 49, 27,
419 0, 0, 0, 49, 49, 49, 49, 49, 49, 32,
420 0, 0, 0, 49, 39, 29, 34, 36
423 static const flex_int16_t yy_def[39] =
425 34, 1, 34, 34, 34, 34, 34, 34, 34, 34,
426 35, 34, 34, 34, 34, 34, 34, 34, 34, 34,
427 36, 37, 35, 34, 34, 34, 34, 34, 34, 36,
428 37, 38, 38, 0, 34, 34, 34, 34
431 static const flex_int16_t yy_nxt[68] =
433 4, 5, 6, 7, 8, 9, 10, 11, 11, 4,
434 12, 13, 14, 4, 4, 4, 4, 15, 16, 16,
435 16, 16, 20, 20, 24, 25, 27, 28, 16, 16,
436 30, 21, 22, 20, 20, 31, 31, 33, 33, 33,
437 23, 32, 29, 26, 19, 18, 17, 34, 3, 34,
438 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
439 34, 34, 34, 34, 34, 34, 34
442 static const flex_int16_t yy_chk[68] =
444 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
445 1, 1, 1, 1, 1, 1, 1, 1, 5, 5,
446 6, 6, 10, 10, 12, 12, 14, 14, 16, 16,
447 36, 10, 10, 20, 20, 37, 37, 38, 38, 38,
448 35, 30, 15, 13, 9, 8, 7, 3, 34, 34,
449 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
450 34, 34, 34, 34, 34, 34, 34
453 static yy_state_type yy_last_accepting_state;
454 static char *yy_last_accepting_cpos;
456 extern int yy_flex_debug;
457 int yy_flex_debug = 0;
459 /* The intent behind this definition is that it'll catch
460 * any uses of REJECT which flex missed.
462 #define REJECT reject_used_but_not_detected
463 #define yymore() yymore_used_but_not_detected
464 #define YY_MORE_ADJ 0
465 #define YY_RESTORE_YY_MORE_OFFSET
467 #line 1 "tokenizer.l"
468 #define YY_NO_INPUT 1
469 #line 3 "tokenizer.l"
470 /* $OpenBSD: tokenizer.l,v 1.9 2017/06/15 13:48:42 bcallah Exp $ */
472 * Copyright (c) 2004 Marc Espie <espie@cvs.openbsd.org>
474 * Permission to use, copy, modify, and distribute this software for any
475 * purpose with or without fee is hereby granted, provided that the above
476 * copyright notice and this permission notice appear in all copies.
478 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
479 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
480 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
481 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
482 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
483 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
484 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
493 extern void m4_warnx(const char *, ...);
494 extern int mimic_gnu;
495 extern int32_t yylval;
497 int32_t number(void);
498 int32_t parse_radix(void);
499 extern int yylex(void);
501 #define YY_DECL int yylex(void)
502 #line 504 "tokenizer.c"
503 #line 505 "tokenizer.c"
507 #ifndef YY_NO_UNISTD_H
508 /* Special case for "unistd.h", since it is non-ANSI. We include it way
509 * down here because we want the user's section 1 to have been scanned first.
510 * The user has a chance to override it with an option.
515 #ifndef YY_EXTRA_TYPE
516 #define YY_EXTRA_TYPE void *
519 static int yy_init_globals ( void );
521 /* Accessor methods to globals.
522 These are made visible to non-reentrant scanners for convenience. */
524 int yylex_destroy ( void );
526 int yyget_debug ( void );
528 void yyset_debug ( int debug_flag );
530 YY_EXTRA_TYPE yyget_extra ( void );
532 void yyset_extra ( YY_EXTRA_TYPE user_defined );
534 FILE *yyget_in ( void );
536 void yyset_in ( FILE * _in_str );
538 FILE *yyget_out ( void );
540 void yyset_out ( FILE * _out_str );
542 int yyget_leng ( void );
544 char *yyget_text ( void );
546 int yyget_lineno ( void );
548 void yyset_lineno ( int _line_number );
550 /* Macros after this point can all be overridden by user definitions in
554 #ifndef YY_SKIP_YYWRAP
556 extern "C" int yywrap ( void );
558 extern int yywrap ( void );
567 static void yy_flex_strncpy ( char *, const char *, int );
570 #ifdef YY_NEED_STRLEN
571 static int yy_flex_strlen ( const char * );
576 static int yyinput ( void );
578 static int input ( void );
583 /* Amount of stuff to slurp up with each read. */
584 #ifndef YY_READ_BUF_SIZE
586 /* On IA-64, the buffer size is 16k, not 8k */
587 #define YY_READ_BUF_SIZE 16384
589 #define YY_READ_BUF_SIZE 8192
590 #endif /* __ia64__ */
593 /* Copy whatever the last rule matched to the standard output. */
595 /* This used to be an fputs(), but since the string might contain NUL's,
596 * we now use fwrite().
598 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
601 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
602 * is returned in "result".
605 #define YY_INPUT(buf,result,max_size) \
606 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
610 for ( n = 0; n < max_size && \
611 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
614 buf[n++] = (char) c; \
615 if ( c == EOF && ferror( yyin ) ) \
616 YY_FATAL_ERROR( "input in flex scanner failed" ); \
622 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
624 if( errno != EINTR) \
626 YY_FATAL_ERROR( "input in flex scanner failed" ); \
637 /* No semi-colon after return; correct usage is to write "yyterminate();" -
638 * we don't want an extra ';' after the "return" because that will cause
639 * some compilers to complain about unreachable statements.
642 #define yyterminate() return YY_NULL
645 /* Number of entries by which start-condition stack grows. */
646 #ifndef YY_START_STACK_INCR
647 #define YY_START_STACK_INCR 25
650 /* Report a fatal error. */
651 #ifndef YY_FATAL_ERROR
652 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
655 /* end tables serialization structures and prototypes */
657 /* Default declaration of generated scanner - a define so the user can
658 * easily add parameters.
661 #define YY_DECL_IS_OURS 1
663 extern int yylex (void);
665 #define YY_DECL int yylex (void)
666 #endif /* !YY_DECL */
668 /* Code executed at the beginning of each rule, after yytext and yyleng
671 #ifndef YY_USER_ACTION
672 #define YY_USER_ACTION
675 /* Code executed at the end of each rule. */
677 #define YY_BREAK /*LINTED*/break;
680 #define YY_RULE_SETUP \
683 /** The main scanner function which does all the work.
687 yy_state_type yy_current_state;
700 (yy_start) = 1; /* first start state */
708 if ( ! YY_CURRENT_BUFFER ) {
709 yyensure_buffer_stack ();
710 YY_CURRENT_BUFFER_LVALUE =
711 yy_create_buffer( yyin, YY_BUF_SIZE );
714 yy_load_buffer_state( );
718 #line 48 "tokenizer.l"
720 #line 722 "tokenizer.c"
722 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
724 yy_cp = (yy_c_buf_p);
726 /* Support of yytext. */
727 *yy_cp = (yy_hold_char);
729 /* yy_bp points to the position in yy_ch_buf of the start of
734 yy_current_state = (yy_start);
738 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
739 if ( yy_accept[yy_current_state] )
741 (yy_last_accepting_state) = yy_current_state;
742 (yy_last_accepting_cpos) = yy_cp;
744 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
746 yy_current_state = (int) yy_def[yy_current_state];
747 if ( yy_current_state >= 35 )
748 yy_c = yy_meta[yy_c];
750 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
753 while ( yy_base[yy_current_state] != 49 );
756 yy_act = yy_accept[yy_current_state];
758 { /* have to back up */
759 yy_cp = (yy_last_accepting_cpos);
760 yy_current_state = (yy_last_accepting_state);
761 yy_act = yy_accept[yy_current_state];
766 do_action: /* This label is used only to access EOF actions. */
769 { /* beginning of action switch */
770 case 0: /* must back up */
771 /* undo the effects of YY_DO_BEFORE_ACTION */
772 *yy_cp = (yy_hold_char);
773 yy_cp = (yy_last_accepting_cpos);
774 yy_current_state = (yy_last_accepting_state);
778 /* rule 1 can match eol */
780 #line 49 "tokenizer.l"
785 #line 50 "tokenizer.l"
786 { yylval = number(); return(NUMBER); }
790 #line 51 "tokenizer.l"
792 yylval = parse_radix(); return(NUMBER);
800 #line 57 "tokenizer.l"
805 #line 58 "tokenizer.l"
810 #line 59 "tokenizer.l"
815 #line 60 "tokenizer.l"
820 #line 61 "tokenizer.l"
825 #line 62 "tokenizer.l"
830 #line 63 "tokenizer.l"
835 #line 64 "tokenizer.l"
840 #line 65 "tokenizer.l"
841 { if (mimic_gnu) { return (EXPONENT); } }
845 #line 66 "tokenizer.l"
846 { return yytext[0]; }
850 #line 67 "tokenizer.l"
853 #line 855 "tokenizer.c"
854 case YY_STATE_EOF(INITIAL):
857 case YY_END_OF_BUFFER:
859 /* Amount of text matched not including the EOB char. */
860 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
862 /* Undo the effects of YY_DO_BEFORE_ACTION. */
863 *yy_cp = (yy_hold_char);
864 YY_RESTORE_YY_MORE_OFFSET
866 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
868 /* We're scanning a new file or input source. It's
869 * possible that this happened because the user
870 * just pointed yyin at a new source and called
871 * yylex(). If so, then we have to assure
872 * consistency between YY_CURRENT_BUFFER and our
873 * globals. Here is the right place to do so, because
874 * this is the first action (other than possibly a
875 * back-up) that will match for the new input source.
877 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
878 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
879 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
882 /* Note that here we test for yy_c_buf_p "<=" to the position
883 * of the first EOB in the buffer, since yy_c_buf_p will
884 * already have been incremented past the NUL character
885 * (since all states make transitions on EOB to the
886 * end-of-buffer state). Contrast this with the test
889 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
890 { /* This was really a NUL. */
891 yy_state_type yy_next_state;
893 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
895 yy_current_state = yy_get_previous_state( );
897 /* Okay, we're now positioned to make the NUL
898 * transition. We couldn't have
899 * yy_get_previous_state() go ahead and do it
900 * for us because it doesn't know how to deal
901 * with the possibility of jamming (and we don't
902 * want to build jamming into it because then it
903 * will run more slowly).
906 yy_next_state = yy_try_NUL_trans( yy_current_state );
908 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
912 /* Consume the NUL. */
913 yy_cp = ++(yy_c_buf_p);
914 yy_current_state = yy_next_state;
920 yy_cp = (yy_c_buf_p);
925 else switch ( yy_get_next_buffer( ) )
927 case EOB_ACT_END_OF_FILE:
929 (yy_did_buffer_switch_on_eof) = 0;
933 /* Note: because we've taken care in
934 * yy_get_next_buffer() to have set up
935 * yytext, we can now set up
936 * yy_c_buf_p so that if some total
937 * hoser (like flex itself) wants to
938 * call the scanner after we return the
939 * YY_NULL, it'll still work - another
940 * YY_NULL will get returned.
942 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
944 yy_act = YY_STATE_EOF(YY_START);
950 if ( ! (yy_did_buffer_switch_on_eof) )
956 case EOB_ACT_CONTINUE_SCAN:
958 (yytext_ptr) + yy_amount_of_matched_text;
960 yy_current_state = yy_get_previous_state( );
962 yy_cp = (yy_c_buf_p);
963 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
966 case EOB_ACT_LAST_MATCH:
968 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
970 yy_current_state = yy_get_previous_state( );
972 yy_cp = (yy_c_buf_p);
973 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
981 "fatal flex scanner internal error--no action found" );
982 } /* end of action switch */
983 } /* end of scanning one token */
984 } /* end of user's declarations */
987 /* yy_get_next_buffer - try to read in a new buffer
989 * Returns a code representing an action:
990 * EOB_ACT_LAST_MATCH -
991 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
992 * EOB_ACT_END_OF_FILE - end of file
994 static int yy_get_next_buffer (void)
996 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
997 char *source = (yytext_ptr);
998 int number_to_move, i;
1001 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1003 "fatal flex scanner internal error--end of buffer missed" );
1005 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1006 { /* Don't try to fill the buffer, so this is an EOF. */
1007 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1009 /* We matched a single character, the EOB, so
1010 * treat this as a final EOF.
1012 return EOB_ACT_END_OF_FILE;
1017 /* We matched some text prior to the EOB, first
1020 return EOB_ACT_LAST_MATCH;
1024 /* Try to read more data. */
1026 /* First move last chars to start of buffer. */
1027 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1029 for ( i = 0; i < number_to_move; ++i )
1030 *(dest++) = *(source++);
1032 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1033 /* don't do the read, it's not guaranteed to return an EOF,
1036 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1041 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1043 while ( num_to_read <= 0 )
1044 { /* Not enough room in the buffer - grow it. */
1046 /* just a shorter name for the current buffer */
1047 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1049 int yy_c_buf_p_offset =
1050 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1052 if ( b->yy_is_our_buffer )
1054 int new_size = b->yy_buf_size * 2;
1056 if ( new_size <= 0 )
1057 b->yy_buf_size += b->yy_buf_size / 8;
1059 b->yy_buf_size *= 2;
1061 b->yy_ch_buf = (char *)
1062 /* Include room in for 2 EOB chars. */
1063 yyrealloc( (void *) b->yy_ch_buf,
1064 (yy_size_t) (b->yy_buf_size + 2) );
1067 /* Can't grow it, we don't own it. */
1068 b->yy_ch_buf = NULL;
1070 if ( ! b->yy_ch_buf )
1072 "fatal error - scanner input buffer overflow" );
1074 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1076 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1081 if ( num_to_read > YY_READ_BUF_SIZE )
1082 num_to_read = YY_READ_BUF_SIZE;
1084 /* Read in more data. */
1085 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1086 (yy_n_chars), num_to_read );
1088 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1091 if ( (yy_n_chars) == 0 )
1093 if ( number_to_move == YY_MORE_ADJ )
1095 ret_val = EOB_ACT_END_OF_FILE;
1101 ret_val = EOB_ACT_LAST_MATCH;
1102 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1103 YY_BUFFER_EOF_PENDING;
1108 ret_val = EOB_ACT_CONTINUE_SCAN;
1110 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1111 /* Extend the array by 50%, plus the number we really need. */
1112 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1113 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1114 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1115 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1116 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1117 /* "- 2" to take care of EOB's */
1118 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1121 (yy_n_chars) += number_to_move;
1122 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1123 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1125 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1130 /* yy_get_previous_state - get the state just before the EOB char was reached */
1132 static yy_state_type yy_get_previous_state (void)
1134 yy_state_type yy_current_state;
1137 yy_current_state = (yy_start);
1139 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1141 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1142 if ( yy_accept[yy_current_state] )
1144 (yy_last_accepting_state) = yy_current_state;
1145 (yy_last_accepting_cpos) = yy_cp;
1147 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1149 yy_current_state = (int) yy_def[yy_current_state];
1150 if ( yy_current_state >= 35 )
1151 yy_c = yy_meta[yy_c];
1153 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1156 return yy_current_state;
1159 /* yy_try_NUL_trans - try to make a transition on the NUL character
1162 * next_state = yy_try_NUL_trans( current_state );
1164 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1167 char *yy_cp = (yy_c_buf_p);
1170 if ( yy_accept[yy_current_state] )
1172 (yy_last_accepting_state) = yy_current_state;
1173 (yy_last_accepting_cpos) = yy_cp;
1175 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1177 yy_current_state = (int) yy_def[yy_current_state];
1178 if ( yy_current_state >= 35 )
1179 yy_c = yy_meta[yy_c];
1181 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1182 yy_is_jam = (yy_current_state == 34);
1184 return yy_is_jam ? 0 : yy_current_state;
1193 static int yyinput (void)
1195 static int input (void)
1201 *(yy_c_buf_p) = (yy_hold_char);
1203 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1205 /* yy_c_buf_p now points to the character we want to return.
1206 * If this occurs *before* the EOB characters, then it's a
1207 * valid NUL; if not, then we've hit the end of the buffer.
1209 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1210 /* This was really a NUL. */
1211 *(yy_c_buf_p) = '\0';
1214 { /* need more input */
1215 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
1218 switch ( yy_get_next_buffer( ) )
1220 case EOB_ACT_LAST_MATCH:
1221 /* This happens because yy_g_n_b()
1222 * sees that we've accumulated a
1223 * token and flags that we need to
1224 * try matching the token before
1225 * proceeding. But for input(),
1226 * there's no matching to consider.
1227 * So convert the EOB_ACT_LAST_MATCH
1228 * to EOB_ACT_END_OF_FILE.
1231 /* Reset buffer status. */
1236 case EOB_ACT_END_OF_FILE:
1241 if ( ! (yy_did_buffer_switch_on_eof) )
1250 case EOB_ACT_CONTINUE_SCAN:
1251 (yy_c_buf_p) = (yytext_ptr) + offset;
1257 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1258 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1259 (yy_hold_char) = *++(yy_c_buf_p);
1263 #endif /* ifndef YY_NO_INPUT */
1265 /** Immediately switch to a different input stream.
1266 * @param input_file A readable stream.
1268 * @note This function does not reset the start condition to @c INITIAL .
1270 void yyrestart (FILE * input_file )
1273 if ( ! YY_CURRENT_BUFFER ){
1274 yyensure_buffer_stack ();
1275 YY_CURRENT_BUFFER_LVALUE =
1276 yy_create_buffer( yyin, YY_BUF_SIZE );
1279 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1280 yy_load_buffer_state( );
1283 /** Switch to a different input buffer.
1284 * @param new_buffer The new input buffer.
1287 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1290 /* TODO. We should be able to replace this entire function body
1292 * yypop_buffer_state();
1293 * yypush_buffer_state(new_buffer);
1295 yyensure_buffer_stack ();
1296 if ( YY_CURRENT_BUFFER == new_buffer )
1299 if ( YY_CURRENT_BUFFER )
1301 /* Flush out information for old buffer. */
1302 *(yy_c_buf_p) = (yy_hold_char);
1303 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1304 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1307 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1308 yy_load_buffer_state( );
1310 /* We don't actually know whether we did this switch during
1311 * EOF (yywrap()) processing, but the only time this flag
1312 * is looked at is after yywrap() is called, so it's safe
1313 * to go ahead and always set it.
1315 (yy_did_buffer_switch_on_eof) = 1;
1318 static void yy_load_buffer_state (void)
1320 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1321 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1322 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1323 (yy_hold_char) = *(yy_c_buf_p);
1326 /** Allocate and initialize an input buffer state.
1327 * @param file A readable stream.
1328 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1330 * @return the allocated buffer state.
1332 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1336 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1338 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1340 b->yy_buf_size = size;
1342 /* yy_ch_buf has to be 2 characters longer than the size given because
1343 * we need to put in 2 end-of-buffer characters.
1345 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
1346 if ( ! b->yy_ch_buf )
1347 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1349 b->yy_is_our_buffer = 1;
1351 yy_init_buffer( b, file );
1356 /** Destroy the buffer.
1357 * @param b a buffer created with yy_create_buffer()
1360 void yy_delete_buffer (YY_BUFFER_STATE b )
1366 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1367 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1369 if ( b->yy_is_our_buffer )
1370 yyfree( (void *) b->yy_ch_buf );
1372 yyfree( (void *) b );
1375 /* Initializes or reinitializes a buffer.
1376 * This function is sometimes called more than once on the same buffer,
1377 * such as during a yyrestart() or at EOF.
1379 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1384 yy_flush_buffer( b );
1386 b->yy_input_file = file;
1387 b->yy_fill_buffer = 1;
1389 /* If b is the current buffer, then yy_init_buffer was _probably_
1390 * called from yyrestart() or through yy_get_next_buffer.
1391 * In that case, we don't want to reset the lineno or column.
1393 if (b != YY_CURRENT_BUFFER){
1394 b->yy_bs_lineno = 1;
1395 b->yy_bs_column = 0;
1398 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1403 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1404 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1407 void yy_flush_buffer (YY_BUFFER_STATE b )
1414 /* We always need two end-of-buffer characters. The first causes
1415 * a transition to the end-of-buffer state. The second causes
1416 * a jam in that state.
1418 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1419 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1421 b->yy_buf_pos = &b->yy_ch_buf[0];
1424 b->yy_buffer_status = YY_BUFFER_NEW;
1426 if ( b == YY_CURRENT_BUFFER )
1427 yy_load_buffer_state( );
1430 /** Pushes the new state onto the stack. The new state becomes
1431 * the current state. This function will allocate the stack
1433 * @param new_buffer The new state.
1436 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1438 if (new_buffer == NULL)
1441 yyensure_buffer_stack();
1443 /* This block is copied from yy_switch_to_buffer. */
1444 if ( YY_CURRENT_BUFFER )
1446 /* Flush out information for old buffer. */
1447 *(yy_c_buf_p) = (yy_hold_char);
1448 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1449 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1452 /* Only push if top exists. Otherwise, replace top. */
1453 if (YY_CURRENT_BUFFER)
1454 (yy_buffer_stack_top)++;
1455 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1457 /* copied from yy_switch_to_buffer. */
1458 yy_load_buffer_state( );
1459 (yy_did_buffer_switch_on_eof) = 1;
1462 /** Removes and deletes the top of the stack, if present.
1463 * The next element becomes the new top.
1466 void yypop_buffer_state (void)
1468 if (!YY_CURRENT_BUFFER)
1471 yy_delete_buffer(YY_CURRENT_BUFFER );
1472 YY_CURRENT_BUFFER_LVALUE = NULL;
1473 if ((yy_buffer_stack_top) > 0)
1474 --(yy_buffer_stack_top);
1476 if (YY_CURRENT_BUFFER) {
1477 yy_load_buffer_state( );
1478 (yy_did_buffer_switch_on_eof) = 1;
1482 /* Allocates the stack if it does not exist.
1483 * Guarantees space for at least one push.
1485 static void yyensure_buffer_stack (void)
1487 yy_size_t num_to_alloc;
1489 if (!(yy_buffer_stack)) {
1491 /* First allocation is just for 2 elements, since we don't know if this
1492 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1493 * immediate realloc on the next call.
1495 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1496 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1497 (num_to_alloc * sizeof(struct yy_buffer_state*)
1499 if ( ! (yy_buffer_stack) )
1500 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1502 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1504 (yy_buffer_stack_max) = num_to_alloc;
1505 (yy_buffer_stack_top) = 0;
1509 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1511 /* Increase the buffer to prepare for a possible push. */
1512 yy_size_t grow_size = 8 /* arbitrary grow size */;
1514 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1515 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1517 num_to_alloc * sizeof(struct yy_buffer_state*)
1519 if ( ! (yy_buffer_stack) )
1520 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1522 /* zero only the new slots.*/
1523 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1524 (yy_buffer_stack_max) = num_to_alloc;
1528 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1529 * @param base the character buffer
1530 * @param size the size in bytes of the character buffer
1532 * @return the newly allocated buffer state object.
1534 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1539 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1540 base[size-1] != YY_END_OF_BUFFER_CHAR )
1541 /* They forgot to leave room for the EOB's. */
1544 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1546 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1548 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
1549 b->yy_buf_pos = b->yy_ch_buf = base;
1550 b->yy_is_our_buffer = 0;
1551 b->yy_input_file = NULL;
1552 b->yy_n_chars = b->yy_buf_size;
1553 b->yy_is_interactive = 0;
1555 b->yy_fill_buffer = 0;
1556 b->yy_buffer_status = YY_BUFFER_NEW;
1558 yy_switch_to_buffer( b );
1563 /** Setup the input buffer state to scan a string. The next call to yylex() will
1564 * scan from a @e copy of @a str.
1565 * @param yystr a NUL-terminated string to scan
1567 * @return the newly allocated buffer state object.
1568 * @note If you want to scan bytes that may contain NUL values, then use
1569 * yy_scan_bytes() instead.
1571 YY_BUFFER_STATE yy_scan_string (const char * yystr )
1574 return yy_scan_bytes( yystr, (int) strlen(yystr) );
1577 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1578 * scan from a @e copy of @a bytes.
1579 * @param yybytes the byte buffer to scan
1580 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1582 * @return the newly allocated buffer state object.
1584 YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
1591 /* Get memory for full buffer, including space for trailing EOB's. */
1592 n = (yy_size_t) (_yybytes_len + 2);
1593 buf = (char *) yyalloc( n );
1595 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1597 for ( i = 0; i < _yybytes_len; ++i )
1598 buf[i] = yybytes[i];
1600 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1602 b = yy_scan_buffer( buf, n );
1604 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1606 /* It's okay to grow etc. this buffer, and we should throw it
1607 * away when we're done.
1609 b->yy_is_our_buffer = 1;
1614 #ifndef YY_EXIT_FAILURE
1615 #define YY_EXIT_FAILURE 2
1618 static void yynoreturn yy_fatal_error (const char* msg )
1620 fprintf( stderr, "%s\n", msg );
1621 exit( YY_EXIT_FAILURE );
1624 /* Redefine yyless() so it works in section 3 code. */
1630 /* Undo effects of setting up yytext. */ \
1631 int yyless_macro_arg = (n); \
1632 YY_LESS_LINENO(yyless_macro_arg);\
1633 yytext[yyleng] = (yy_hold_char); \
1634 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1635 (yy_hold_char) = *(yy_c_buf_p); \
1636 *(yy_c_buf_p) = '\0'; \
1637 yyleng = yyless_macro_arg; \
1641 /* Accessor methods (get/set functions) to struct members. */
1643 /** Get the current line number.
1646 int yyget_lineno (void)
1652 /** Get the input stream.
1655 FILE *yyget_in (void)
1660 /** Get the output stream.
1663 FILE *yyget_out (void)
1668 /** Get the length of the current token.
1671 int yyget_leng (void)
1676 /** Get the current token.
1680 char *yyget_text (void)
1685 /** Set the current line number.
1686 * @param _line_number line number
1689 void yyset_lineno (int _line_number )
1692 yylineno = _line_number;
1695 /** Set the input stream. This does not discard the current
1697 * @param _in_str A readable stream.
1699 * @see yy_switch_to_buffer
1701 void yyset_in (FILE * _in_str )
1706 void yyset_out (FILE * _out_str )
1711 int yyget_debug (void)
1713 return yy_flex_debug;
1716 void yyset_debug (int _bdebug )
1718 yy_flex_debug = _bdebug ;
1721 static int yy_init_globals (void)
1723 /* Initialization is the same as for the non-reentrant scanner.
1724 * This function is called from yylex_destroy(), so don't allocate here.
1727 (yy_buffer_stack) = NULL;
1728 (yy_buffer_stack_top) = 0;
1729 (yy_buffer_stack_max) = 0;
1730 (yy_c_buf_p) = NULL;
1734 /* Defined in main.c */
1743 /* For future reference: Set errno on error, since we are called by
1749 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1750 int yylex_destroy (void)
1753 /* Pop the buffer stack, destroying each element. */
1754 while(YY_CURRENT_BUFFER){
1755 yy_delete_buffer( YY_CURRENT_BUFFER );
1756 YY_CURRENT_BUFFER_LVALUE = NULL;
1757 yypop_buffer_state();
1760 /* Destroy the stack itself. */
1761 yyfree((yy_buffer_stack) );
1762 (yy_buffer_stack) = NULL;
1764 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1765 * yylex() is called, initialization will occur. */
1772 * Internal utility routines.
1776 static void yy_flex_strncpy (char* s1, const char * s2, int n )
1780 for ( i = 0; i < n; ++i )
1785 #ifdef YY_NEED_STRLEN
1786 static int yy_flex_strlen (const char * s )
1789 for ( n = 0; s[n]; ++n )
1796 void *yyalloc (yy_size_t size )
1798 return malloc(size);
1801 void *yyrealloc (void * ptr, yy_size_t size )
1804 /* The cast to (char *) in the following accommodates both
1805 * implementations that use char* generic pointers, and those
1806 * that use void* generic pointers. It works with the latter
1807 * because both ANSI C and C++ allow castless assignment from
1808 * any pointer type to void*, and deal with argument conversions
1809 * as though doing an assignment.
1811 return realloc(ptr, size);
1814 void yyfree (void * ptr )
1816 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1819 #define YYTABLES_NAME "yytables"
1821 #line 67 "tokenizer.l"
1830 l = strtol(yytext, NULL, 0);
1831 if (((l == LONG_MAX || l == LONG_MIN) && errno == ERANGE) ||
1832 l > INT32_MAX || l < INT32_MIN) {
1833 m4_warnx("numeric overflow in expr: %s", yytext);
1847 base = strtol(yytext+2, &next, 0);
1848 if (base > 36 || next == NULL) {
1849 m4_warnx("error in number %s", yytext);
1852 while (*next != 0) {
1853 if (*next >= '0' && *next <= '9')
1855 else if (*next >= 'a' && *next <= 'z')
1856 d = *next - 'a' + 10;
1858 assert(*next >= 'A' && *next <= 'Z');
1859 d = *next - 'A' + 10;
1862 m4_warnx("error in number %s", yytext);