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.
495 extern void m4_warnx(const char *, ...);
496 extern int mimic_gnu;
497 extern int32_t yylval;
499 int32_t number(void);
500 int32_t parse_radix(void);
501 extern int yylex(void);
503 #define YY_DECL int yylex(void)
504 #line 504 "tokenizer.c"
505 #line 505 "tokenizer.c"
509 #ifndef YY_NO_UNISTD_H
510 /* Special case for "unistd.h", since it is non-ANSI. We include it way
511 * down here because we want the user's section 1 to have been scanned first.
512 * The user has a chance to override it with an option.
517 #ifndef YY_EXTRA_TYPE
518 #define YY_EXTRA_TYPE void *
521 static int yy_init_globals ( void );
523 /* Accessor methods to globals.
524 These are made visible to non-reentrant scanners for convenience. */
526 int yylex_destroy ( void );
528 int yyget_debug ( void );
530 void yyset_debug ( int debug_flag );
532 YY_EXTRA_TYPE yyget_extra ( void );
534 void yyset_extra ( YY_EXTRA_TYPE user_defined );
536 FILE *yyget_in ( void );
538 void yyset_in ( FILE * _in_str );
540 FILE *yyget_out ( void );
542 void yyset_out ( FILE * _out_str );
544 int yyget_leng ( void );
546 char *yyget_text ( void );
548 int yyget_lineno ( void );
550 void yyset_lineno ( int _line_number );
552 /* Macros after this point can all be overridden by user definitions in
556 #ifndef YY_SKIP_YYWRAP
558 extern "C" int yywrap ( void );
560 extern int yywrap ( void );
569 static void yy_flex_strncpy ( char *, const char *, int );
572 #ifdef YY_NEED_STRLEN
573 static int yy_flex_strlen ( const char * );
578 static int yyinput ( void );
580 static int input ( void );
585 /* Amount of stuff to slurp up with each read. */
586 #ifndef YY_READ_BUF_SIZE
588 /* On IA-64, the buffer size is 16k, not 8k */
589 #define YY_READ_BUF_SIZE 16384
591 #define YY_READ_BUF_SIZE 8192
592 #endif /* __ia64__ */
595 /* Copy whatever the last rule matched to the standard output. */
597 /* This used to be an fputs(), but since the string might contain NUL's,
598 * we now use fwrite().
600 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
603 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
604 * is returned in "result".
607 #define YY_INPUT(buf,result,max_size) \
608 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
612 for ( n = 0; n < max_size && \
613 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
616 buf[n++] = (char) c; \
617 if ( c == EOF && ferror( yyin ) ) \
618 YY_FATAL_ERROR( "input in flex scanner failed" ); \
624 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
626 if( errno != EINTR) \
628 YY_FATAL_ERROR( "input in flex scanner failed" ); \
639 /* No semi-colon after return; correct usage is to write "yyterminate();" -
640 * we don't want an extra ';' after the "return" because that will cause
641 * some compilers to complain about unreachable statements.
644 #define yyterminate() return YY_NULL
647 /* Number of entries by which start-condition stack grows. */
648 #ifndef YY_START_STACK_INCR
649 #define YY_START_STACK_INCR 25
652 /* Report a fatal error. */
653 #ifndef YY_FATAL_ERROR
654 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
657 /* end tables serialization structures and prototypes */
659 /* Default declaration of generated scanner - a define so the user can
660 * easily add parameters.
663 #define YY_DECL_IS_OURS 1
665 extern int yylex (void);
667 #define YY_DECL int yylex (void)
668 #endif /* !YY_DECL */
670 /* Code executed at the beginning of each rule, after yytext and yyleng
673 #ifndef YY_USER_ACTION
674 #define YY_USER_ACTION
677 /* Code executed at the end of each rule. */
679 #define YY_BREAK /*LINTED*/break;
682 #define YY_RULE_SETUP \
685 /** The main scanner function which does all the work.
689 yy_state_type yy_current_state;
702 (yy_start) = 1; /* first start state */
710 if ( ! YY_CURRENT_BUFFER ) {
711 yyensure_buffer_stack ();
712 YY_CURRENT_BUFFER_LVALUE =
713 yy_create_buffer( yyin, YY_BUF_SIZE );
716 yy_load_buffer_state( );
720 #line 48 "tokenizer.l"
722 #line 722 "tokenizer.c"
724 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
726 yy_cp = (yy_c_buf_p);
728 /* Support of yytext. */
729 *yy_cp = (yy_hold_char);
731 /* yy_bp points to the position in yy_ch_buf of the start of
736 yy_current_state = (yy_start);
740 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
741 if ( yy_accept[yy_current_state] )
743 (yy_last_accepting_state) = yy_current_state;
744 (yy_last_accepting_cpos) = yy_cp;
746 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
748 yy_current_state = (int) yy_def[yy_current_state];
749 if ( yy_current_state >= 35 )
750 yy_c = yy_meta[yy_c];
752 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
755 while ( yy_base[yy_current_state] != 49 );
758 yy_act = yy_accept[yy_current_state];
760 { /* have to back up */
761 yy_cp = (yy_last_accepting_cpos);
762 yy_current_state = (yy_last_accepting_state);
763 yy_act = yy_accept[yy_current_state];
768 do_action: /* This label is used only to access EOF actions. */
771 { /* beginning of action switch */
772 case 0: /* must back up */
773 /* undo the effects of YY_DO_BEFORE_ACTION */
774 *yy_cp = (yy_hold_char);
775 yy_cp = (yy_last_accepting_cpos);
776 yy_current_state = (yy_last_accepting_state);
780 /* rule 1 can match eol */
782 #line 49 "tokenizer.l"
787 #line 50 "tokenizer.l"
788 { yylval = number(); return(NUMBER); }
792 #line 51 "tokenizer.l"
794 yylval = parse_radix(); return(NUMBER);
802 #line 57 "tokenizer.l"
807 #line 58 "tokenizer.l"
812 #line 59 "tokenizer.l"
817 #line 60 "tokenizer.l"
822 #line 61 "tokenizer.l"
827 #line 62 "tokenizer.l"
832 #line 63 "tokenizer.l"
837 #line 64 "tokenizer.l"
842 #line 65 "tokenizer.l"
843 { if (mimic_gnu) { return (EXPONENT); } }
847 #line 66 "tokenizer.l"
848 { return yytext[0]; }
852 #line 67 "tokenizer.l"
855 #line 855 "tokenizer.c"
856 case YY_STATE_EOF(INITIAL):
859 case YY_END_OF_BUFFER:
861 /* Amount of text matched not including the EOB char. */
862 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
864 /* Undo the effects of YY_DO_BEFORE_ACTION. */
865 *yy_cp = (yy_hold_char);
866 YY_RESTORE_YY_MORE_OFFSET
868 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
870 /* We're scanning a new file or input source. It's
871 * possible that this happened because the user
872 * just pointed yyin at a new source and called
873 * yylex(). If so, then we have to assure
874 * consistency between YY_CURRENT_BUFFER and our
875 * globals. Here is the right place to do so, because
876 * this is the first action (other than possibly a
877 * back-up) that will match for the new input source.
879 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
880 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
881 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
884 /* Note that here we test for yy_c_buf_p "<=" to the position
885 * of the first EOB in the buffer, since yy_c_buf_p will
886 * already have been incremented past the NUL character
887 * (since all states make transitions on EOB to the
888 * end-of-buffer state). Contrast this with the test
891 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
892 { /* This was really a NUL. */
893 yy_state_type yy_next_state;
895 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
897 yy_current_state = yy_get_previous_state( );
899 /* Okay, we're now positioned to make the NUL
900 * transition. We couldn't have
901 * yy_get_previous_state() go ahead and do it
902 * for us because it doesn't know how to deal
903 * with the possibility of jamming (and we don't
904 * want to build jamming into it because then it
905 * will run more slowly).
908 yy_next_state = yy_try_NUL_trans( yy_current_state );
910 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
914 /* Consume the NUL. */
915 yy_cp = ++(yy_c_buf_p);
916 yy_current_state = yy_next_state;
922 yy_cp = (yy_c_buf_p);
927 else switch ( yy_get_next_buffer( ) )
929 case EOB_ACT_END_OF_FILE:
931 (yy_did_buffer_switch_on_eof) = 0;
935 /* Note: because we've taken care in
936 * yy_get_next_buffer() to have set up
937 * yytext, we can now set up
938 * yy_c_buf_p so that if some total
939 * hoser (like flex itself) wants to
940 * call the scanner after we return the
941 * YY_NULL, it'll still work - another
942 * YY_NULL will get returned.
944 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
946 yy_act = YY_STATE_EOF(YY_START);
952 if ( ! (yy_did_buffer_switch_on_eof) )
958 case EOB_ACT_CONTINUE_SCAN:
960 (yytext_ptr) + yy_amount_of_matched_text;
962 yy_current_state = yy_get_previous_state( );
964 yy_cp = (yy_c_buf_p);
965 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
968 case EOB_ACT_LAST_MATCH:
970 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
972 yy_current_state = yy_get_previous_state( );
974 yy_cp = (yy_c_buf_p);
975 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
983 "fatal flex scanner internal error--no action found" );
984 } /* end of action switch */
985 } /* end of scanning one token */
986 } /* end of user's declarations */
989 /* yy_get_next_buffer - try to read in a new buffer
991 * Returns a code representing an action:
992 * EOB_ACT_LAST_MATCH -
993 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
994 * EOB_ACT_END_OF_FILE - end of file
996 static int yy_get_next_buffer (void)
998 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
999 char *source = (yytext_ptr);
1000 int number_to_move, i;
1003 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1005 "fatal flex scanner internal error--end of buffer missed" );
1007 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1008 { /* Don't try to fill the buffer, so this is an EOF. */
1009 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1011 /* We matched a single character, the EOB, so
1012 * treat this as a final EOF.
1014 return EOB_ACT_END_OF_FILE;
1019 /* We matched some text prior to the EOB, first
1022 return EOB_ACT_LAST_MATCH;
1026 /* Try to read more data. */
1028 /* First move last chars to start of buffer. */
1029 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1031 for ( i = 0; i < number_to_move; ++i )
1032 *(dest++) = *(source++);
1034 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1035 /* don't do the read, it's not guaranteed to return an EOF,
1038 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1043 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1045 while ( num_to_read <= 0 )
1046 { /* Not enough room in the buffer - grow it. */
1048 /* just a shorter name for the current buffer */
1049 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1051 int yy_c_buf_p_offset =
1052 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1054 if ( b->yy_is_our_buffer )
1056 int new_size = b->yy_buf_size * 2;
1058 if ( new_size <= 0 )
1059 b->yy_buf_size += b->yy_buf_size / 8;
1061 b->yy_buf_size *= 2;
1063 b->yy_ch_buf = (char *)
1064 /* Include room in for 2 EOB chars. */
1065 yyrealloc( (void *) b->yy_ch_buf,
1066 (yy_size_t) (b->yy_buf_size + 2) );
1069 /* Can't grow it, we don't own it. */
1070 b->yy_ch_buf = NULL;
1072 if ( ! b->yy_ch_buf )
1074 "fatal error - scanner input buffer overflow" );
1076 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1078 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1083 if ( num_to_read > YY_READ_BUF_SIZE )
1084 num_to_read = YY_READ_BUF_SIZE;
1086 /* Read in more data. */
1087 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1088 (yy_n_chars), num_to_read );
1090 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1093 if ( (yy_n_chars) == 0 )
1095 if ( number_to_move == YY_MORE_ADJ )
1097 ret_val = EOB_ACT_END_OF_FILE;
1103 ret_val = EOB_ACT_LAST_MATCH;
1104 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1105 YY_BUFFER_EOF_PENDING;
1110 ret_val = EOB_ACT_CONTINUE_SCAN;
1112 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1113 /* Extend the array by 50%, plus the number we really need. */
1114 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1115 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1116 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1117 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1118 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1119 /* "- 2" to take care of EOB's */
1120 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1123 (yy_n_chars) += number_to_move;
1124 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1125 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1127 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1132 /* yy_get_previous_state - get the state just before the EOB char was reached */
1134 static yy_state_type yy_get_previous_state (void)
1136 yy_state_type yy_current_state;
1139 yy_current_state = (yy_start);
1141 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1143 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1144 if ( yy_accept[yy_current_state] )
1146 (yy_last_accepting_state) = yy_current_state;
1147 (yy_last_accepting_cpos) = yy_cp;
1149 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1151 yy_current_state = (int) yy_def[yy_current_state];
1152 if ( yy_current_state >= 35 )
1153 yy_c = yy_meta[yy_c];
1155 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1158 return yy_current_state;
1161 /* yy_try_NUL_trans - try to make a transition on the NUL character
1164 * next_state = yy_try_NUL_trans( current_state );
1166 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1169 char *yy_cp = (yy_c_buf_p);
1172 if ( yy_accept[yy_current_state] )
1174 (yy_last_accepting_state) = yy_current_state;
1175 (yy_last_accepting_cpos) = yy_cp;
1177 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1179 yy_current_state = (int) yy_def[yy_current_state];
1180 if ( yy_current_state >= 35 )
1181 yy_c = yy_meta[yy_c];
1183 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1184 yy_is_jam = (yy_current_state == 34);
1186 return yy_is_jam ? 0 : yy_current_state;
1195 static int yyinput (void)
1197 static int input (void)
1203 *(yy_c_buf_p) = (yy_hold_char);
1205 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1207 /* yy_c_buf_p now points to the character we want to return.
1208 * If this occurs *before* the EOB characters, then it's a
1209 * valid NUL; if not, then we've hit the end of the buffer.
1211 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1212 /* This was really a NUL. */
1213 *(yy_c_buf_p) = '\0';
1216 { /* need more input */
1217 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
1220 switch ( yy_get_next_buffer( ) )
1222 case EOB_ACT_LAST_MATCH:
1223 /* This happens because yy_g_n_b()
1224 * sees that we've accumulated a
1225 * token and flags that we need to
1226 * try matching the token before
1227 * proceeding. But for input(),
1228 * there's no matching to consider.
1229 * So convert the EOB_ACT_LAST_MATCH
1230 * to EOB_ACT_END_OF_FILE.
1233 /* Reset buffer status. */
1238 case EOB_ACT_END_OF_FILE:
1243 if ( ! (yy_did_buffer_switch_on_eof) )
1252 case EOB_ACT_CONTINUE_SCAN:
1253 (yy_c_buf_p) = (yytext_ptr) + offset;
1259 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1260 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1261 (yy_hold_char) = *++(yy_c_buf_p);
1265 #endif /* ifndef YY_NO_INPUT */
1267 /** Immediately switch to a different input stream.
1268 * @param input_file A readable stream.
1270 * @note This function does not reset the start condition to @c INITIAL .
1272 void yyrestart (FILE * input_file )
1275 if ( ! YY_CURRENT_BUFFER ){
1276 yyensure_buffer_stack ();
1277 YY_CURRENT_BUFFER_LVALUE =
1278 yy_create_buffer( yyin, YY_BUF_SIZE );
1281 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1282 yy_load_buffer_state( );
1285 /** Switch to a different input buffer.
1286 * @param new_buffer The new input buffer.
1289 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1292 /* TODO. We should be able to replace this entire function body
1294 * yypop_buffer_state();
1295 * yypush_buffer_state(new_buffer);
1297 yyensure_buffer_stack ();
1298 if ( YY_CURRENT_BUFFER == new_buffer )
1301 if ( YY_CURRENT_BUFFER )
1303 /* Flush out information for old buffer. */
1304 *(yy_c_buf_p) = (yy_hold_char);
1305 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1306 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1309 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1310 yy_load_buffer_state( );
1312 /* We don't actually know whether we did this switch during
1313 * EOF (yywrap()) processing, but the only time this flag
1314 * is looked at is after yywrap() is called, so it's safe
1315 * to go ahead and always set it.
1317 (yy_did_buffer_switch_on_eof) = 1;
1320 static void yy_load_buffer_state (void)
1322 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1323 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1324 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1325 (yy_hold_char) = *(yy_c_buf_p);
1328 /** Allocate and initialize an input buffer state.
1329 * @param file A readable stream.
1330 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1332 * @return the allocated buffer state.
1334 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1338 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1340 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1342 b->yy_buf_size = size;
1344 /* yy_ch_buf has to be 2 characters longer than the size given because
1345 * we need to put in 2 end-of-buffer characters.
1347 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
1348 if ( ! b->yy_ch_buf )
1349 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1351 b->yy_is_our_buffer = 1;
1353 yy_init_buffer( b, file );
1358 /** Destroy the buffer.
1359 * @param b a buffer created with yy_create_buffer()
1362 void yy_delete_buffer (YY_BUFFER_STATE b )
1368 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1369 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1371 if ( b->yy_is_our_buffer )
1372 yyfree( (void *) b->yy_ch_buf );
1374 yyfree( (void *) b );
1377 /* Initializes or reinitializes a buffer.
1378 * This function is sometimes called more than once on the same buffer,
1379 * such as during a yyrestart() or at EOF.
1381 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1386 yy_flush_buffer( b );
1388 b->yy_input_file = file;
1389 b->yy_fill_buffer = 1;
1391 /* If b is the current buffer, then yy_init_buffer was _probably_
1392 * called from yyrestart() or through yy_get_next_buffer.
1393 * In that case, we don't want to reset the lineno or column.
1395 if (b != YY_CURRENT_BUFFER){
1396 b->yy_bs_lineno = 1;
1397 b->yy_bs_column = 0;
1400 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1405 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1406 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1409 void yy_flush_buffer (YY_BUFFER_STATE b )
1416 /* We always need two end-of-buffer characters. The first causes
1417 * a transition to the end-of-buffer state. The second causes
1418 * a jam in that state.
1420 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1421 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1423 b->yy_buf_pos = &b->yy_ch_buf[0];
1426 b->yy_buffer_status = YY_BUFFER_NEW;
1428 if ( b == YY_CURRENT_BUFFER )
1429 yy_load_buffer_state( );
1432 /** Pushes the new state onto the stack. The new state becomes
1433 * the current state. This function will allocate the stack
1435 * @param new_buffer The new state.
1438 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1440 if (new_buffer == NULL)
1443 yyensure_buffer_stack();
1445 /* This block is copied from yy_switch_to_buffer. */
1446 if ( YY_CURRENT_BUFFER )
1448 /* Flush out information for old buffer. */
1449 *(yy_c_buf_p) = (yy_hold_char);
1450 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1451 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1454 /* Only push if top exists. Otherwise, replace top. */
1455 if (YY_CURRENT_BUFFER)
1456 (yy_buffer_stack_top)++;
1457 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1459 /* copied from yy_switch_to_buffer. */
1460 yy_load_buffer_state( );
1461 (yy_did_buffer_switch_on_eof) = 1;
1464 /** Removes and deletes the top of the stack, if present.
1465 * The next element becomes the new top.
1468 void yypop_buffer_state (void)
1470 if (!YY_CURRENT_BUFFER)
1473 yy_delete_buffer(YY_CURRENT_BUFFER );
1474 YY_CURRENT_BUFFER_LVALUE = NULL;
1475 if ((yy_buffer_stack_top) > 0)
1476 --(yy_buffer_stack_top);
1478 if (YY_CURRENT_BUFFER) {
1479 yy_load_buffer_state( );
1480 (yy_did_buffer_switch_on_eof) = 1;
1484 /* Allocates the stack if it does not exist.
1485 * Guarantees space for at least one push.
1487 static void yyensure_buffer_stack (void)
1489 yy_size_t num_to_alloc;
1491 if (!(yy_buffer_stack)) {
1493 /* First allocation is just for 2 elements, since we don't know if this
1494 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1495 * immediate realloc on the next call.
1497 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1498 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1499 (num_to_alloc * sizeof(struct yy_buffer_state*)
1501 if ( ! (yy_buffer_stack) )
1502 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1504 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1506 (yy_buffer_stack_max) = num_to_alloc;
1507 (yy_buffer_stack_top) = 0;
1511 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1513 /* Increase the buffer to prepare for a possible push. */
1514 yy_size_t grow_size = 8 /* arbitrary grow size */;
1516 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1517 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1519 num_to_alloc * sizeof(struct yy_buffer_state*)
1521 if ( ! (yy_buffer_stack) )
1522 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1524 /* zero only the new slots.*/
1525 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1526 (yy_buffer_stack_max) = num_to_alloc;
1530 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1531 * @param base the character buffer
1532 * @param size the size in bytes of the character buffer
1534 * @return the newly allocated buffer state object.
1536 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1541 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1542 base[size-1] != YY_END_OF_BUFFER_CHAR )
1543 /* They forgot to leave room for the EOB's. */
1546 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1548 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1550 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
1551 b->yy_buf_pos = b->yy_ch_buf = base;
1552 b->yy_is_our_buffer = 0;
1553 b->yy_input_file = NULL;
1554 b->yy_n_chars = b->yy_buf_size;
1555 b->yy_is_interactive = 0;
1557 b->yy_fill_buffer = 0;
1558 b->yy_buffer_status = YY_BUFFER_NEW;
1560 yy_switch_to_buffer( b );
1565 /** Setup the input buffer state to scan a string. The next call to yylex() will
1566 * scan from a @e copy of @a str.
1567 * @param yystr a NUL-terminated string to scan
1569 * @return the newly allocated buffer state object.
1570 * @note If you want to scan bytes that may contain NUL values, then use
1571 * yy_scan_bytes() instead.
1573 YY_BUFFER_STATE yy_scan_string (const char * yystr )
1576 return yy_scan_bytes( yystr, (int) strlen(yystr) );
1579 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1580 * scan from a @e copy of @a bytes.
1581 * @param yybytes the byte buffer to scan
1582 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1584 * @return the newly allocated buffer state object.
1586 YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
1593 /* Get memory for full buffer, including space for trailing EOB's. */
1594 n = (yy_size_t) (_yybytes_len + 2);
1595 buf = (char *) yyalloc( n );
1597 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1599 for ( i = 0; i < _yybytes_len; ++i )
1600 buf[i] = yybytes[i];
1602 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1604 b = yy_scan_buffer( buf, n );
1606 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1608 /* It's okay to grow etc. this buffer, and we should throw it
1609 * away when we're done.
1611 b->yy_is_our_buffer = 1;
1616 #ifndef YY_EXIT_FAILURE
1617 #define YY_EXIT_FAILURE 2
1620 static void yynoreturn yy_fatal_error (const char* msg )
1622 fprintf( stderr, "%s\n", msg );
1623 exit( YY_EXIT_FAILURE );
1626 /* Redefine yyless() so it works in section 3 code. */
1632 /* Undo effects of setting up yytext. */ \
1633 int yyless_macro_arg = (n); \
1634 YY_LESS_LINENO(yyless_macro_arg);\
1635 yytext[yyleng] = (yy_hold_char); \
1636 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1637 (yy_hold_char) = *(yy_c_buf_p); \
1638 *(yy_c_buf_p) = '\0'; \
1639 yyleng = yyless_macro_arg; \
1643 /* Accessor methods (get/set functions) to struct members. */
1645 /** Get the current line number.
1648 int yyget_lineno (void)
1654 /** Get the input stream.
1657 FILE *yyget_in (void)
1662 /** Get the output stream.
1665 FILE *yyget_out (void)
1670 /** Get the length of the current token.
1673 int yyget_leng (void)
1678 /** Get the current token.
1682 char *yyget_text (void)
1687 /** Set the current line number.
1688 * @param _line_number line number
1691 void yyset_lineno (int _line_number )
1694 yylineno = _line_number;
1697 /** Set the input stream. This does not discard the current
1699 * @param _in_str A readable stream.
1701 * @see yy_switch_to_buffer
1703 void yyset_in (FILE * _in_str )
1708 void yyset_out (FILE * _out_str )
1713 int yyget_debug (void)
1715 return yy_flex_debug;
1718 void yyset_debug (int _bdebug )
1720 yy_flex_debug = _bdebug ;
1723 static int yy_init_globals (void)
1725 /* Initialization is the same as for the non-reentrant scanner.
1726 * This function is called from yylex_destroy(), so don't allocate here.
1729 (yy_buffer_stack) = NULL;
1730 (yy_buffer_stack_top) = 0;
1731 (yy_buffer_stack_max) = 0;
1732 (yy_c_buf_p) = NULL;
1736 /* Defined in main.c */
1745 /* For future reference: Set errno on error, since we are called by
1751 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1752 int yylex_destroy (void)
1755 /* Pop the buffer stack, destroying each element. */
1756 while(YY_CURRENT_BUFFER){
1757 yy_delete_buffer( YY_CURRENT_BUFFER );
1758 YY_CURRENT_BUFFER_LVALUE = NULL;
1759 yypop_buffer_state();
1762 /* Destroy the stack itself. */
1763 yyfree((yy_buffer_stack) );
1764 (yy_buffer_stack) = NULL;
1766 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1767 * yylex() is called, initialization will occur. */
1774 * Internal utility routines.
1778 static void yy_flex_strncpy (char* s1, const char * s2, int n )
1782 for ( i = 0; i < n; ++i )
1787 #ifdef YY_NEED_STRLEN
1788 static int yy_flex_strlen (const char * s )
1791 for ( n = 0; s[n]; ++n )
1798 void *yyalloc (yy_size_t size )
1800 return malloc(size);
1803 void *yyrealloc (void * ptr, yy_size_t size )
1806 /* The cast to (char *) in the following accommodates both
1807 * implementations that use char* generic pointers, and those
1808 * that use void* generic pointers. It works with the latter
1809 * because both ANSI C and C++ allow castless assignment from
1810 * any pointer type to void*, and deal with argument conversions
1811 * as though doing an assignment.
1813 return realloc(ptr, size);
1816 void yyfree (void * ptr )
1818 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1821 #define YYTABLES_NAME "yytables"
1823 #line 67 "tokenizer.l"
1832 l = strtol(yytext, NULL, 0);
1833 if (((l == LONG_MAX || l == LONG_MIN) && errno == ERANGE) ||
1834 l > INT32_MAX || l < INT32_MIN) {
1835 m4_warnx("numeric overflow in expr: %s", yytext);
1849 base = strtol(yytext+2, &next, 0);
1850 if (base > 36 || next == NULL) {
1851 m4_warnx("error in number %s", yytext);
1854 while (*next != 0) {
1855 if (*next >= '0' && *next <= '9')
1857 else if (*next >= 'a' && *next <= 'z')
1858 d = *next - 'a' + 10;
1860 assert(*next >= 'A' && *next <= 'Z');
1861 d = *next - 'A' + 10;
1864 m4_warnx("error in number %s", yytext);