1*f8e57f89SAlex Richardson #line 1 "tokenizer.c"
25bb9250eSAlex Richardson
3*f8e57f89SAlex Richardson #line 3 "tokenizer.c"
45bb9250eSAlex Richardson
55bb9250eSAlex Richardson #define YY_INT_ALIGNED short int
65bb9250eSAlex Richardson
75bb9250eSAlex Richardson /* A lexical scanner generated by flex */
85bb9250eSAlex Richardson
95bb9250eSAlex Richardson #define FLEX_SCANNER
105bb9250eSAlex Richardson #define YY_FLEX_MAJOR_VERSION 2
11*f8e57f89SAlex Richardson #define YY_FLEX_MINOR_VERSION 6
12*f8e57f89SAlex Richardson #define YY_FLEX_SUBMINOR_VERSION 4
135bb9250eSAlex Richardson #if YY_FLEX_SUBMINOR_VERSION > 0
145bb9250eSAlex Richardson #define FLEX_BETA
155bb9250eSAlex Richardson #endif
165bb9250eSAlex Richardson
175bb9250eSAlex Richardson /* First, we deal with platform-specific or compiler-specific issues. */
185bb9250eSAlex Richardson
195bb9250eSAlex Richardson /* begin standard C headers. */
205bb9250eSAlex Richardson #include <stdio.h>
215bb9250eSAlex Richardson #include <string.h>
225bb9250eSAlex Richardson #include <errno.h>
235bb9250eSAlex Richardson #include <stdlib.h>
245bb9250eSAlex Richardson
255bb9250eSAlex Richardson /* end standard C headers. */
265bb9250eSAlex Richardson
275bb9250eSAlex Richardson /* flex integer type definitions */
285bb9250eSAlex Richardson
295bb9250eSAlex Richardson #ifndef FLEXINT_H
305bb9250eSAlex Richardson #define FLEXINT_H
315bb9250eSAlex Richardson
325bb9250eSAlex Richardson /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
335bb9250eSAlex Richardson
345bb9250eSAlex Richardson #if defined(__FreeBSD__) || \
355bb9250eSAlex Richardson (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
365bb9250eSAlex Richardson
375bb9250eSAlex Richardson /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
385bb9250eSAlex Richardson * if you want the limit (max/min) macros for int types.
395bb9250eSAlex Richardson */
405bb9250eSAlex Richardson #ifndef __STDC_LIMIT_MACROS
415bb9250eSAlex Richardson #define __STDC_LIMIT_MACROS 1
425bb9250eSAlex Richardson #endif
435bb9250eSAlex Richardson
445bb9250eSAlex Richardson #include <inttypes.h>
455bb9250eSAlex Richardson typedef int8_t flex_int8_t;
465bb9250eSAlex Richardson typedef uint8_t flex_uint8_t;
475bb9250eSAlex Richardson typedef int16_t flex_int16_t;
485bb9250eSAlex Richardson typedef uint16_t flex_uint16_t;
495bb9250eSAlex Richardson typedef int32_t flex_int32_t;
505bb9250eSAlex Richardson typedef uint32_t flex_uint32_t;
515bb9250eSAlex Richardson #else
525bb9250eSAlex Richardson typedef signed char flex_int8_t;
535bb9250eSAlex Richardson typedef short int flex_int16_t;
545bb9250eSAlex Richardson typedef int flex_int32_t;
555bb9250eSAlex Richardson typedef unsigned char flex_uint8_t;
565bb9250eSAlex Richardson typedef unsigned short int flex_uint16_t;
575bb9250eSAlex Richardson typedef unsigned int flex_uint32_t;
585bb9250eSAlex Richardson
595bb9250eSAlex Richardson /* Limits of integral types. */
605bb9250eSAlex Richardson #ifndef INT8_MIN
615bb9250eSAlex Richardson #define INT8_MIN (-128)
625bb9250eSAlex Richardson #endif
635bb9250eSAlex Richardson #ifndef INT16_MIN
645bb9250eSAlex Richardson #define INT16_MIN (-32767-1)
655bb9250eSAlex Richardson #endif
665bb9250eSAlex Richardson #ifndef INT32_MIN
675bb9250eSAlex Richardson #define INT32_MIN (-2147483647-1)
685bb9250eSAlex Richardson #endif
695bb9250eSAlex Richardson #ifndef INT8_MAX
705bb9250eSAlex Richardson #define INT8_MAX (127)
715bb9250eSAlex Richardson #endif
725bb9250eSAlex Richardson #ifndef INT16_MAX
735bb9250eSAlex Richardson #define INT16_MAX (32767)
745bb9250eSAlex Richardson #endif
755bb9250eSAlex Richardson #ifndef INT32_MAX
765bb9250eSAlex Richardson #define INT32_MAX (2147483647)
775bb9250eSAlex Richardson #endif
785bb9250eSAlex Richardson #ifndef UINT8_MAX
795bb9250eSAlex Richardson #define UINT8_MAX (255U)
805bb9250eSAlex Richardson #endif
815bb9250eSAlex Richardson #ifndef UINT16_MAX
825bb9250eSAlex Richardson #define UINT16_MAX (65535U)
835bb9250eSAlex Richardson #endif
845bb9250eSAlex Richardson #ifndef UINT32_MAX
855bb9250eSAlex Richardson #define UINT32_MAX (4294967295U)
865bb9250eSAlex Richardson #endif
875bb9250eSAlex Richardson
88*f8e57f89SAlex Richardson #ifndef SIZE_MAX
89*f8e57f89SAlex Richardson #define SIZE_MAX (~(size_t)0)
90*f8e57f89SAlex Richardson #endif
91*f8e57f89SAlex Richardson
925bb9250eSAlex Richardson #endif /* ! C99 */
935bb9250eSAlex Richardson
945bb9250eSAlex Richardson #endif /* ! FLEXINT_H */
955bb9250eSAlex Richardson
96*f8e57f89SAlex Richardson /* begin standard C++ headers. */
975bb9250eSAlex Richardson
98*f8e57f89SAlex Richardson /* TODO: this is always defined, so inline it */
995bb9250eSAlex Richardson #define yyconst const
100*f8e57f89SAlex Richardson
101*f8e57f89SAlex Richardson #if defined(__GNUC__) && __GNUC__ >= 3
102*f8e57f89SAlex Richardson #define yynoreturn __attribute__((__noreturn__))
1035bb9250eSAlex Richardson #else
104*f8e57f89SAlex Richardson #define yynoreturn
1055bb9250eSAlex Richardson #endif
1065bb9250eSAlex Richardson
1075bb9250eSAlex Richardson /* Returned upon end-of-file. */
1085bb9250eSAlex Richardson #define YY_NULL 0
1095bb9250eSAlex Richardson
110*f8e57f89SAlex Richardson /* Promotes a possibly negative, possibly signed char to an
111*f8e57f89SAlex Richardson * integer in range [0..255] for use as an array index.
1125bb9250eSAlex Richardson */
113*f8e57f89SAlex Richardson #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
1145bb9250eSAlex Richardson
1155bb9250eSAlex Richardson /* Enter a start condition. This macro really ought to take a parameter,
1165bb9250eSAlex Richardson * but we do it the disgusting crufty way forced on us by the ()-less
1175bb9250eSAlex Richardson * definition of BEGIN.
1185bb9250eSAlex Richardson */
1195bb9250eSAlex Richardson #define BEGIN (yy_start) = 1 + 2 *
1205bb9250eSAlex Richardson /* Translate the current start state into a value that can be later handed
1215bb9250eSAlex Richardson * to BEGIN to return to the state. The YYSTATE alias is for lex
1225bb9250eSAlex Richardson * compatibility.
1235bb9250eSAlex Richardson */
1245bb9250eSAlex Richardson #define YY_START (((yy_start) - 1) / 2)
1255bb9250eSAlex Richardson #define YYSTATE YY_START
1265bb9250eSAlex Richardson /* Action number for EOF rule of a given start state. */
1275bb9250eSAlex Richardson #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
1285bb9250eSAlex Richardson /* Special action meaning "start processing a new file". */
1295bb9250eSAlex Richardson #define YY_NEW_FILE yyrestart( yyin )
1305bb9250eSAlex Richardson #define YY_END_OF_BUFFER_CHAR 0
1315bb9250eSAlex Richardson
1325bb9250eSAlex Richardson /* Size of default input buffer. */
1335bb9250eSAlex Richardson #ifndef YY_BUF_SIZE
134*f8e57f89SAlex Richardson #ifdef __ia64__
135*f8e57f89SAlex Richardson /* On IA-64, the buffer size is 16k, not 8k.
136*f8e57f89SAlex Richardson * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
137*f8e57f89SAlex Richardson * Ditto for the __ia64__ case accordingly.
138*f8e57f89SAlex Richardson */
139*f8e57f89SAlex Richardson #define YY_BUF_SIZE 32768
140*f8e57f89SAlex Richardson #else
1415bb9250eSAlex Richardson #define YY_BUF_SIZE 16384
142*f8e57f89SAlex Richardson #endif /* __ia64__ */
1435bb9250eSAlex Richardson #endif
1445bb9250eSAlex Richardson
1455bb9250eSAlex Richardson /* The state buf must be large enough to hold one state per character in the main buffer.
1465bb9250eSAlex Richardson */
1475bb9250eSAlex Richardson #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
1485bb9250eSAlex Richardson
1495bb9250eSAlex Richardson #ifndef YY_TYPEDEF_YY_BUFFER_STATE
1505bb9250eSAlex Richardson #define YY_TYPEDEF_YY_BUFFER_STATE
1515bb9250eSAlex Richardson typedef struct yy_buffer_state *YY_BUFFER_STATE;
1525bb9250eSAlex Richardson #endif
1535bb9250eSAlex Richardson
1545bb9250eSAlex Richardson #ifndef YY_TYPEDEF_YY_SIZE_T
1555bb9250eSAlex Richardson #define YY_TYPEDEF_YY_SIZE_T
1565bb9250eSAlex Richardson typedef size_t yy_size_t;
1575bb9250eSAlex Richardson #endif
1585bb9250eSAlex Richardson
159*f8e57f89SAlex Richardson extern int yyleng;
1605bb9250eSAlex Richardson
1615bb9250eSAlex Richardson extern FILE *yyin, *yyout;
1625bb9250eSAlex Richardson
1635bb9250eSAlex Richardson #define EOB_ACT_CONTINUE_SCAN 0
1645bb9250eSAlex Richardson #define EOB_ACT_END_OF_FILE 1
1655bb9250eSAlex Richardson #define EOB_ACT_LAST_MATCH 2
1665bb9250eSAlex Richardson
1675bb9250eSAlex Richardson #define YY_LESS_LINENO(n)
168*f8e57f89SAlex Richardson #define YY_LINENO_REWIND_TO(ptr)
1695bb9250eSAlex Richardson
1705bb9250eSAlex Richardson /* Return all but the first "n" matched characters back to the input stream. */
1715bb9250eSAlex Richardson #define yyless(n) \
1725bb9250eSAlex Richardson do \
1735bb9250eSAlex Richardson { \
1745bb9250eSAlex Richardson /* Undo effects of setting up yytext. */ \
1755bb9250eSAlex Richardson int yyless_macro_arg = (n); \
1765bb9250eSAlex Richardson YY_LESS_LINENO(yyless_macro_arg);\
1775bb9250eSAlex Richardson *yy_cp = (yy_hold_char); \
1785bb9250eSAlex Richardson YY_RESTORE_YY_MORE_OFFSET \
1795bb9250eSAlex Richardson (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
1805bb9250eSAlex Richardson YY_DO_BEFORE_ACTION; /* set up yytext again */ \
1815bb9250eSAlex Richardson } \
1825bb9250eSAlex Richardson while ( 0 )
1835bb9250eSAlex Richardson #define unput(c) yyunput( c, (yytext_ptr) )
1845bb9250eSAlex Richardson
1855bb9250eSAlex Richardson #ifndef YY_STRUCT_YY_BUFFER_STATE
1865bb9250eSAlex Richardson #define YY_STRUCT_YY_BUFFER_STATE
1875bb9250eSAlex Richardson struct yy_buffer_state
1885bb9250eSAlex Richardson {
1895bb9250eSAlex Richardson FILE *yy_input_file;
1905bb9250eSAlex Richardson
1915bb9250eSAlex Richardson char *yy_ch_buf; /* input buffer */
1925bb9250eSAlex Richardson char *yy_buf_pos; /* current position in input buffer */
1935bb9250eSAlex Richardson
1945bb9250eSAlex Richardson /* Size of input buffer in bytes, not including room for EOB
1955bb9250eSAlex Richardson * characters.
1965bb9250eSAlex Richardson */
197*f8e57f89SAlex Richardson int yy_buf_size;
1985bb9250eSAlex Richardson
1995bb9250eSAlex Richardson /* Number of characters read into yy_ch_buf, not including EOB
2005bb9250eSAlex Richardson * characters.
2015bb9250eSAlex Richardson */
202*f8e57f89SAlex Richardson int yy_n_chars;
2035bb9250eSAlex Richardson
2045bb9250eSAlex Richardson /* Whether we "own" the buffer - i.e., we know we created it,
2055bb9250eSAlex Richardson * and can realloc() it to grow it, and should free() it to
2065bb9250eSAlex Richardson * delete it.
2075bb9250eSAlex Richardson */
2085bb9250eSAlex Richardson int yy_is_our_buffer;
2095bb9250eSAlex Richardson
2105bb9250eSAlex Richardson /* Whether this is an "interactive" input source; if so, and
2115bb9250eSAlex Richardson * if we're using stdio for input, then we want to use getc()
2125bb9250eSAlex Richardson * instead of fread(), to make sure we stop fetching input after
2135bb9250eSAlex Richardson * each newline.
2145bb9250eSAlex Richardson */
2155bb9250eSAlex Richardson int yy_is_interactive;
2165bb9250eSAlex Richardson
2175bb9250eSAlex Richardson /* Whether we're considered to be at the beginning of a line.
2185bb9250eSAlex Richardson * If so, '^' rules will be active on the next match, otherwise
2195bb9250eSAlex Richardson * not.
2205bb9250eSAlex Richardson */
2215bb9250eSAlex Richardson int yy_at_bol;
2225bb9250eSAlex Richardson
2235bb9250eSAlex Richardson int yy_bs_lineno; /**< The line count. */
2245bb9250eSAlex Richardson int yy_bs_column; /**< The column count. */
2255bb9250eSAlex Richardson
2265bb9250eSAlex Richardson /* Whether to try to fill the input buffer when we reach the
2275bb9250eSAlex Richardson * end of it.
2285bb9250eSAlex Richardson */
2295bb9250eSAlex Richardson int yy_fill_buffer;
2305bb9250eSAlex Richardson
2315bb9250eSAlex Richardson int yy_buffer_status;
2325bb9250eSAlex Richardson
2335bb9250eSAlex Richardson #define YY_BUFFER_NEW 0
2345bb9250eSAlex Richardson #define YY_BUFFER_NORMAL 1
2355bb9250eSAlex Richardson /* When an EOF's been seen but there's still some text to process
2365bb9250eSAlex Richardson * then we mark the buffer as YY_EOF_PENDING, to indicate that we
2375bb9250eSAlex Richardson * shouldn't try reading from the input source any more. We might
2385bb9250eSAlex Richardson * still have a bunch of tokens to match, though, because of
2395bb9250eSAlex Richardson * possible backing-up.
2405bb9250eSAlex Richardson *
2415bb9250eSAlex Richardson * When we actually see the EOF, we change the status to "new"
2425bb9250eSAlex Richardson * (via yyrestart()), so that the user can continue scanning by
2435bb9250eSAlex Richardson * just pointing yyin at a new input file.
2445bb9250eSAlex Richardson */
2455bb9250eSAlex Richardson #define YY_BUFFER_EOF_PENDING 2
2465bb9250eSAlex Richardson
2475bb9250eSAlex Richardson };
2485bb9250eSAlex Richardson #endif /* !YY_STRUCT_YY_BUFFER_STATE */
2495bb9250eSAlex Richardson
2505bb9250eSAlex Richardson /* Stack of input buffers. */
2515bb9250eSAlex Richardson static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
2525bb9250eSAlex Richardson static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
253*f8e57f89SAlex Richardson static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
2545bb9250eSAlex Richardson
2555bb9250eSAlex Richardson /* We provide macros for accessing buffer states in case in the
2565bb9250eSAlex Richardson * future we want to put the buffer states in a more general
2575bb9250eSAlex Richardson * "scanner state".
2585bb9250eSAlex Richardson *
2595bb9250eSAlex Richardson * Returns the top of the stack, or NULL.
2605bb9250eSAlex Richardson */
2615bb9250eSAlex Richardson #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
2625bb9250eSAlex Richardson ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
2635bb9250eSAlex Richardson : NULL)
2645bb9250eSAlex Richardson #define yy_current_buffer YY_CURRENT_BUFFER
2655bb9250eSAlex Richardson /* Same as previous macro, but useful when we know that the buffer stack is not
2665bb9250eSAlex Richardson * NULL or when we need an lvalue. For internal use only.
2675bb9250eSAlex Richardson */
2685bb9250eSAlex Richardson #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
2695bb9250eSAlex Richardson
2705bb9250eSAlex Richardson /* yy_hold_char holds the character lost when yytext is formed. */
2715bb9250eSAlex Richardson static char yy_hold_char;
272*f8e57f89SAlex Richardson static int yy_n_chars; /* number of characters read into yy_ch_buf */
273*f8e57f89SAlex Richardson int yyleng;
2745bb9250eSAlex Richardson
2755bb9250eSAlex Richardson /* Points to current character in buffer. */
276*f8e57f89SAlex Richardson static char *yy_c_buf_p = NULL;
2775bb9250eSAlex Richardson static int yy_init = 0; /* whether we need to initialize */
2785bb9250eSAlex Richardson static int yy_start = 0; /* start state number */
2795bb9250eSAlex Richardson
2805bb9250eSAlex Richardson /* Flag which is used to allow yywrap()'s to do buffer switches
2815bb9250eSAlex Richardson * instead of setting up a fresh yyin. A bit of a hack ...
2825bb9250eSAlex Richardson */
2835bb9250eSAlex Richardson static int yy_did_buffer_switch_on_eof;
2845bb9250eSAlex Richardson
2855bb9250eSAlex Richardson void yyrestart ( FILE *input_file );
2865bb9250eSAlex Richardson void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
2875bb9250eSAlex Richardson YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
2885bb9250eSAlex Richardson void yy_delete_buffer ( YY_BUFFER_STATE b );
2895bb9250eSAlex Richardson void yy_flush_buffer ( YY_BUFFER_STATE b );
2905bb9250eSAlex Richardson void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
2915bb9250eSAlex Richardson void yypop_buffer_state ( void );
2925bb9250eSAlex Richardson
2935bb9250eSAlex Richardson static void yyensure_buffer_stack ( void );
2945bb9250eSAlex Richardson static void yy_load_buffer_state ( void );
2955bb9250eSAlex Richardson static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
2965bb9250eSAlex Richardson #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
2975bb9250eSAlex Richardson
2985bb9250eSAlex Richardson YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
299*f8e57f89SAlex Richardson YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
300*f8e57f89SAlex Richardson YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
3015bb9250eSAlex Richardson
3025bb9250eSAlex Richardson void *yyalloc ( yy_size_t );
3035bb9250eSAlex Richardson void *yyrealloc ( void *, yy_size_t );
3045bb9250eSAlex Richardson void yyfree ( void * );
3055bb9250eSAlex Richardson
3065bb9250eSAlex Richardson #define yy_new_buffer yy_create_buffer
3075bb9250eSAlex Richardson #define yy_set_interactive(is_interactive) \
3085bb9250eSAlex Richardson { \
3095bb9250eSAlex Richardson if ( ! YY_CURRENT_BUFFER ){ \
3105bb9250eSAlex Richardson yyensure_buffer_stack (); \
3115bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = \
3125bb9250eSAlex Richardson yy_create_buffer( yyin, YY_BUF_SIZE ); \
3135bb9250eSAlex Richardson } \
3145bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
3155bb9250eSAlex Richardson }
3165bb9250eSAlex Richardson #define yy_set_bol(at_bol) \
3175bb9250eSAlex Richardson { \
3185bb9250eSAlex Richardson if ( ! YY_CURRENT_BUFFER ){\
3195bb9250eSAlex Richardson yyensure_buffer_stack (); \
3205bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = \
3215bb9250eSAlex Richardson yy_create_buffer( yyin, YY_BUF_SIZE ); \
3225bb9250eSAlex Richardson } \
3235bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
3245bb9250eSAlex Richardson }
3255bb9250eSAlex Richardson #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
3265bb9250eSAlex Richardson
3275bb9250eSAlex Richardson /* Begin user sect3 */
3285bb9250eSAlex Richardson
329*f8e57f89SAlex Richardson #define yywrap() (/*CONSTCOND*/1)
3305bb9250eSAlex Richardson #define YY_SKIP_YYWRAP
331*f8e57f89SAlex Richardson typedef flex_uint8_t YY_CHAR;
3325bb9250eSAlex Richardson
333*f8e57f89SAlex Richardson FILE *yyin = NULL, *yyout = NULL;
3345bb9250eSAlex Richardson
3355bb9250eSAlex Richardson typedef int yy_state_type;
3365bb9250eSAlex Richardson
3375bb9250eSAlex Richardson extern int yylineno;
3385bb9250eSAlex Richardson int yylineno = 1;
3395bb9250eSAlex Richardson
3405bb9250eSAlex Richardson extern char *yytext;
341*f8e57f89SAlex Richardson #ifdef yytext_ptr
342*f8e57f89SAlex Richardson #undef yytext_ptr
343*f8e57f89SAlex Richardson #endif
3445bb9250eSAlex Richardson #define yytext_ptr yytext
3455bb9250eSAlex Richardson
3465bb9250eSAlex Richardson static yy_state_type yy_get_previous_state ( void );
3475bb9250eSAlex Richardson static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
3485bb9250eSAlex Richardson static int yy_get_next_buffer ( void );
349*f8e57f89SAlex Richardson static void yynoreturn yy_fatal_error ( const char* msg );
3505bb9250eSAlex Richardson
3515bb9250eSAlex Richardson /* Done after the current pattern has been matched and before the
3525bb9250eSAlex Richardson * corresponding action - sets up yytext.
3535bb9250eSAlex Richardson */
3545bb9250eSAlex Richardson #define YY_DO_BEFORE_ACTION \
3555bb9250eSAlex Richardson (yytext_ptr) = yy_bp; \
356*f8e57f89SAlex Richardson yyleng = (int) (yy_cp - yy_bp); \
3575bb9250eSAlex Richardson (yy_hold_char) = *yy_cp; \
3585bb9250eSAlex Richardson *yy_cp = '\0'; \
3595bb9250eSAlex Richardson (yy_c_buf_p) = yy_cp;
3605bb9250eSAlex Richardson #define YY_NUM_RULES 14
3615bb9250eSAlex Richardson #define YY_END_OF_BUFFER 15
3625bb9250eSAlex Richardson /* This struct is not used in this scanner,
3635bb9250eSAlex Richardson but its presence is necessary. */
3645bb9250eSAlex Richardson struct yy_trans_info
3655bb9250eSAlex Richardson {
3665bb9250eSAlex Richardson flex_int32_t yy_verify;
3675bb9250eSAlex Richardson flex_int32_t yy_nxt;
3685bb9250eSAlex Richardson };
369*f8e57f89SAlex Richardson static const flex_int16_t yy_accept[35] =
3705bb9250eSAlex Richardson { 0,
3715bb9250eSAlex Richardson 0, 0, 15, 13, 1, 1, 13, 13, 13, 2,
3725bb9250eSAlex Richardson 2, 13, 13, 13, 13, 1, 9, 10, 12, 2,
3735bb9250eSAlex Richardson 0, 0, 2, 6, 4, 8, 5, 7, 11, 0,
3745bb9250eSAlex Richardson 2, 0, 3, 0
3755bb9250eSAlex Richardson } ;
3765bb9250eSAlex Richardson
377*f8e57f89SAlex Richardson static const YY_CHAR yy_ec[256] =
3785bb9250eSAlex Richardson { 0,
3795bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
3805bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
3815bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
3825bb9250eSAlex Richardson 1, 2, 4, 1, 1, 1, 1, 5, 1, 1,
3835bb9250eSAlex Richardson 1, 6, 1, 1, 1, 1, 1, 7, 8, 8,
3845bb9250eSAlex Richardson 8, 8, 8, 8, 8, 9, 9, 10, 1, 11,
3855bb9250eSAlex Richardson 12, 13, 1, 1, 14, 14, 14, 14, 14, 14,
3865bb9250eSAlex Richardson 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
3875bb9250eSAlex Richardson 15, 16, 15, 15, 15, 15, 15, 17, 15, 15,
3885bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 14, 14, 14, 14,
3895bb9250eSAlex Richardson
3905bb9250eSAlex Richardson 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
3915bb9250eSAlex Richardson 15, 15, 15, 16, 15, 15, 15, 15, 15, 17,
3925bb9250eSAlex Richardson 15, 15, 1, 18, 1, 1, 1, 1, 1, 1,
3935bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
3945bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
3955bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
3965bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
3975bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
3985bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
3995bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
4005bb9250eSAlex Richardson
4015bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
4025bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
4035bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
4045bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
4055bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
4065bb9250eSAlex Richardson 1, 1, 1, 1, 1
4075bb9250eSAlex Richardson } ;
4085bb9250eSAlex Richardson
409*f8e57f89SAlex Richardson static const YY_CHAR yy_meta[19] =
4105bb9250eSAlex Richardson { 0,
4115bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 2, 2, 2, 1,
4125bb9250eSAlex Richardson 1, 1, 1, 3, 4, 4, 4, 1
4135bb9250eSAlex Richardson } ;
4145bb9250eSAlex Richardson
415*f8e57f89SAlex Richardson static const flex_int16_t yy_base[39] =
4165bb9250eSAlex Richardson { 0,
4175bb9250eSAlex Richardson 0, 0, 48, 49, 17, 19, 35, 41, 39, 16,
4185bb9250eSAlex Richardson 0, 14, 32, 15, 25, 27, 49, 49, 49, 27,
4195bb9250eSAlex Richardson 0, 0, 0, 49, 49, 49, 49, 49, 49, 32,
4205bb9250eSAlex Richardson 0, 0, 0, 49, 39, 29, 34, 36
4215bb9250eSAlex Richardson } ;
4225bb9250eSAlex Richardson
423*f8e57f89SAlex Richardson static const flex_int16_t yy_def[39] =
4245bb9250eSAlex Richardson { 0,
4255bb9250eSAlex Richardson 34, 1, 34, 34, 34, 34, 34, 34, 34, 34,
4265bb9250eSAlex Richardson 35, 34, 34, 34, 34, 34, 34, 34, 34, 34,
4275bb9250eSAlex Richardson 36, 37, 35, 34, 34, 34, 34, 34, 34, 36,
4285bb9250eSAlex Richardson 37, 38, 38, 0, 34, 34, 34, 34
4295bb9250eSAlex Richardson } ;
4305bb9250eSAlex Richardson
431*f8e57f89SAlex Richardson static const flex_int16_t yy_nxt[68] =
4325bb9250eSAlex Richardson { 0,
4335bb9250eSAlex Richardson 4, 5, 6, 7, 8, 9, 10, 11, 11, 4,
4345bb9250eSAlex Richardson 12, 13, 14, 4, 4, 4, 4, 15, 16, 16,
4355bb9250eSAlex Richardson 16, 16, 20, 20, 24, 25, 27, 28, 16, 16,
4365bb9250eSAlex Richardson 30, 21, 22, 20, 20, 31, 31, 33, 33, 33,
4375bb9250eSAlex Richardson 23, 32, 29, 26, 19, 18, 17, 34, 3, 34,
4385bb9250eSAlex Richardson 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
4395bb9250eSAlex Richardson 34, 34, 34, 34, 34, 34, 34
4405bb9250eSAlex Richardson } ;
4415bb9250eSAlex Richardson
442*f8e57f89SAlex Richardson static const flex_int16_t yy_chk[68] =
4435bb9250eSAlex Richardson { 0,
4445bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
4455bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 5, 5,
4465bb9250eSAlex Richardson 6, 6, 10, 10, 12, 12, 14, 14, 16, 16,
4475bb9250eSAlex Richardson 36, 10, 10, 20, 20, 37, 37, 38, 38, 38,
4485bb9250eSAlex Richardson 35, 30, 15, 13, 9, 8, 7, 3, 34, 34,
4495bb9250eSAlex Richardson 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
4505bb9250eSAlex Richardson 34, 34, 34, 34, 34, 34, 34
4515bb9250eSAlex Richardson } ;
4525bb9250eSAlex Richardson
4535bb9250eSAlex Richardson static yy_state_type yy_last_accepting_state;
4545bb9250eSAlex Richardson static char *yy_last_accepting_cpos;
4555bb9250eSAlex Richardson
4565bb9250eSAlex Richardson extern int yy_flex_debug;
4575bb9250eSAlex Richardson int yy_flex_debug = 0;
4585bb9250eSAlex Richardson
4595bb9250eSAlex Richardson /* The intent behind this definition is that it'll catch
4605bb9250eSAlex Richardson * any uses of REJECT which flex missed.
4615bb9250eSAlex Richardson */
4625bb9250eSAlex Richardson #define REJECT reject_used_but_not_detected
4635bb9250eSAlex Richardson #define yymore() yymore_used_but_not_detected
4645bb9250eSAlex Richardson #define YY_MORE_ADJ 0
4655bb9250eSAlex Richardson #define YY_RESTORE_YY_MORE_OFFSET
4665bb9250eSAlex Richardson char *yytext;
467*f8e57f89SAlex Richardson #line 1 "tokenizer.l"
4685bb9250eSAlex Richardson #define YY_NO_INPUT 1
469*f8e57f89SAlex Richardson #line 3 "tokenizer.l"
4705bb9250eSAlex Richardson /* $OpenBSD: tokenizer.l,v 1.9 2017/06/15 13:48:42 bcallah Exp $ */
4715bb9250eSAlex Richardson /*
4725bb9250eSAlex Richardson * Copyright (c) 2004 Marc Espie <espie@cvs.openbsd.org>
4735bb9250eSAlex Richardson *
4745bb9250eSAlex Richardson * Permission to use, copy, modify, and distribute this software for any
4755bb9250eSAlex Richardson * purpose with or without fee is hereby granted, provided that the above
4765bb9250eSAlex Richardson * copyright notice and this permission notice appear in all copies.
4775bb9250eSAlex Richardson *
4785bb9250eSAlex Richardson * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
4795bb9250eSAlex Richardson * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
4805bb9250eSAlex Richardson * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
4815bb9250eSAlex Richardson * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
4825bb9250eSAlex Richardson * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
4835bb9250eSAlex Richardson * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
4845bb9250eSAlex Richardson * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4855bb9250eSAlex Richardson */
4865bb9250eSAlex Richardson #include "parser.h"
4875bb9250eSAlex Richardson #include <assert.h>
4885bb9250eSAlex Richardson #include <stdlib.h>
4895bb9250eSAlex Richardson #include <errno.h>
4905bb9250eSAlex Richardson #include <stdint.h>
4915bb9250eSAlex Richardson #include <limits.h>
4925bb9250eSAlex Richardson
4935bb9250eSAlex Richardson extern void m4_warnx(const char *, ...);
4945bb9250eSAlex Richardson extern int mimic_gnu;
4955bb9250eSAlex Richardson extern int32_t yylval;
4965bb9250eSAlex Richardson
4975bb9250eSAlex Richardson int32_t number(void);
4985bb9250eSAlex Richardson int32_t parse_radix(void);
4995bb9250eSAlex Richardson extern int yylex(void);
5005bb9250eSAlex Richardson
5015bb9250eSAlex Richardson #define YY_DECL int yylex(void)
502*f8e57f89SAlex Richardson #line 504 "tokenizer.c"
503*f8e57f89SAlex Richardson #line 505 "tokenizer.c"
5045bb9250eSAlex Richardson
5055bb9250eSAlex Richardson #define INITIAL 0
5065bb9250eSAlex Richardson
5075bb9250eSAlex Richardson #ifndef YY_NO_UNISTD_H
5085bb9250eSAlex Richardson /* Special case for "unistd.h", since it is non-ANSI. We include it way
5095bb9250eSAlex Richardson * down here because we want the user's section 1 to have been scanned first.
5105bb9250eSAlex Richardson * The user has a chance to override it with an option.
5115bb9250eSAlex Richardson */
5125bb9250eSAlex Richardson #include <unistd.h>
5135bb9250eSAlex Richardson #endif
5145bb9250eSAlex Richardson
5155bb9250eSAlex Richardson #ifndef YY_EXTRA_TYPE
5165bb9250eSAlex Richardson #define YY_EXTRA_TYPE void *
5175bb9250eSAlex Richardson #endif
5185bb9250eSAlex Richardson
5195bb9250eSAlex Richardson static int yy_init_globals ( void );
5205bb9250eSAlex Richardson
5215bb9250eSAlex Richardson /* Accessor methods to globals.
5225bb9250eSAlex Richardson These are made visible to non-reentrant scanners for convenience. */
5235bb9250eSAlex Richardson
5245bb9250eSAlex Richardson int yylex_destroy ( void );
5255bb9250eSAlex Richardson
5265bb9250eSAlex Richardson int yyget_debug ( void );
5275bb9250eSAlex Richardson
5285bb9250eSAlex Richardson void yyset_debug ( int debug_flag );
5295bb9250eSAlex Richardson
5305bb9250eSAlex Richardson YY_EXTRA_TYPE yyget_extra ( void );
5315bb9250eSAlex Richardson
5325bb9250eSAlex Richardson void yyset_extra ( YY_EXTRA_TYPE user_defined );
5335bb9250eSAlex Richardson
5345bb9250eSAlex Richardson FILE *yyget_in ( void );
5355bb9250eSAlex Richardson
536*f8e57f89SAlex Richardson void yyset_in ( FILE * _in_str );
5375bb9250eSAlex Richardson
5385bb9250eSAlex Richardson FILE *yyget_out ( void );
5395bb9250eSAlex Richardson
540*f8e57f89SAlex Richardson void yyset_out ( FILE * _out_str );
5415bb9250eSAlex Richardson
542*f8e57f89SAlex Richardson int yyget_leng ( void );
5435bb9250eSAlex Richardson
5445bb9250eSAlex Richardson char *yyget_text ( void );
5455bb9250eSAlex Richardson
5465bb9250eSAlex Richardson int yyget_lineno ( void );
5475bb9250eSAlex Richardson
548*f8e57f89SAlex Richardson void yyset_lineno ( int _line_number );
5495bb9250eSAlex Richardson
5505bb9250eSAlex Richardson /* Macros after this point can all be overridden by user definitions in
5515bb9250eSAlex Richardson * section 1.
5525bb9250eSAlex Richardson */
5535bb9250eSAlex Richardson
5545bb9250eSAlex Richardson #ifndef YY_SKIP_YYWRAP
5555bb9250eSAlex Richardson #ifdef __cplusplus
5565bb9250eSAlex Richardson extern "C" int yywrap ( void );
5575bb9250eSAlex Richardson #else
5585bb9250eSAlex Richardson extern int yywrap ( void );
5595bb9250eSAlex Richardson #endif
5605bb9250eSAlex Richardson #endif
5615bb9250eSAlex Richardson
562*f8e57f89SAlex Richardson #ifndef YY_NO_UNPUT
563*f8e57f89SAlex Richardson
564*f8e57f89SAlex Richardson #endif
565*f8e57f89SAlex Richardson
5665bb9250eSAlex Richardson #ifndef yytext_ptr
567*f8e57f89SAlex Richardson static void yy_flex_strncpy ( char *, const char *, int );
5685bb9250eSAlex Richardson #endif
5695bb9250eSAlex Richardson
5705bb9250eSAlex Richardson #ifdef YY_NEED_STRLEN
571*f8e57f89SAlex Richardson static int yy_flex_strlen ( const char * );
5725bb9250eSAlex Richardson #endif
5735bb9250eSAlex Richardson
5745bb9250eSAlex Richardson #ifndef YY_NO_INPUT
5755bb9250eSAlex Richardson #ifdef __cplusplus
5765bb9250eSAlex Richardson static int yyinput ( void );
5775bb9250eSAlex Richardson #else
5785bb9250eSAlex Richardson static int input ( void );
5795bb9250eSAlex Richardson #endif
5805bb9250eSAlex Richardson
5815bb9250eSAlex Richardson #endif
5825bb9250eSAlex Richardson
5835bb9250eSAlex Richardson /* Amount of stuff to slurp up with each read. */
5845bb9250eSAlex Richardson #ifndef YY_READ_BUF_SIZE
585*f8e57f89SAlex Richardson #ifdef __ia64__
586*f8e57f89SAlex Richardson /* On IA-64, the buffer size is 16k, not 8k */
587*f8e57f89SAlex Richardson #define YY_READ_BUF_SIZE 16384
588*f8e57f89SAlex Richardson #else
5895bb9250eSAlex Richardson #define YY_READ_BUF_SIZE 8192
590*f8e57f89SAlex Richardson #endif /* __ia64__ */
5915bb9250eSAlex Richardson #endif
5925bb9250eSAlex Richardson
5935bb9250eSAlex Richardson /* Copy whatever the last rule matched to the standard output. */
5945bb9250eSAlex Richardson #ifndef ECHO
5955bb9250eSAlex Richardson /* This used to be an fputs(), but since the string might contain NUL's,
5965bb9250eSAlex Richardson * we now use fwrite().
5975bb9250eSAlex Richardson */
598*f8e57f89SAlex Richardson #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
5995bb9250eSAlex Richardson #endif
6005bb9250eSAlex Richardson
6015bb9250eSAlex Richardson /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
6025bb9250eSAlex Richardson * is returned in "result".
6035bb9250eSAlex Richardson */
6045bb9250eSAlex Richardson #ifndef YY_INPUT
6055bb9250eSAlex Richardson #define YY_INPUT(buf,result,max_size) \
6065bb9250eSAlex Richardson if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
6075bb9250eSAlex Richardson { \
6085bb9250eSAlex Richardson int c = '*'; \
609*f8e57f89SAlex Richardson int n; \
6105bb9250eSAlex Richardson for ( n = 0; n < max_size && \
6115bb9250eSAlex Richardson (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
6125bb9250eSAlex Richardson buf[n] = (char) c; \
6135bb9250eSAlex Richardson if ( c == '\n' ) \
6145bb9250eSAlex Richardson buf[n++] = (char) c; \
6155bb9250eSAlex Richardson if ( c == EOF && ferror( yyin ) ) \
6165bb9250eSAlex Richardson YY_FATAL_ERROR( "input in flex scanner failed" ); \
6175bb9250eSAlex Richardson result = n; \
6185bb9250eSAlex Richardson } \
6195bb9250eSAlex Richardson else \
6205bb9250eSAlex Richardson { \
6215bb9250eSAlex Richardson errno=0; \
622*f8e57f89SAlex Richardson while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
6235bb9250eSAlex Richardson { \
6245bb9250eSAlex Richardson if( errno != EINTR) \
6255bb9250eSAlex Richardson { \
6265bb9250eSAlex Richardson YY_FATAL_ERROR( "input in flex scanner failed" ); \
6275bb9250eSAlex Richardson break; \
6285bb9250eSAlex Richardson } \
6295bb9250eSAlex Richardson errno=0; \
6305bb9250eSAlex Richardson clearerr(yyin); \
6315bb9250eSAlex Richardson } \
6325bb9250eSAlex Richardson }\
6335bb9250eSAlex Richardson \
6345bb9250eSAlex Richardson
6355bb9250eSAlex Richardson #endif
6365bb9250eSAlex Richardson
6375bb9250eSAlex Richardson /* No semi-colon after return; correct usage is to write "yyterminate();" -
6385bb9250eSAlex Richardson * we don't want an extra ';' after the "return" because that will cause
6395bb9250eSAlex Richardson * some compilers to complain about unreachable statements.
6405bb9250eSAlex Richardson */
6415bb9250eSAlex Richardson #ifndef yyterminate
6425bb9250eSAlex Richardson #define yyterminate() return YY_NULL
6435bb9250eSAlex Richardson #endif
6445bb9250eSAlex Richardson
6455bb9250eSAlex Richardson /* Number of entries by which start-condition stack grows. */
6465bb9250eSAlex Richardson #ifndef YY_START_STACK_INCR
6475bb9250eSAlex Richardson #define YY_START_STACK_INCR 25
6485bb9250eSAlex Richardson #endif
6495bb9250eSAlex Richardson
6505bb9250eSAlex Richardson /* Report a fatal error. */
6515bb9250eSAlex Richardson #ifndef YY_FATAL_ERROR
6525bb9250eSAlex Richardson #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
6535bb9250eSAlex Richardson #endif
6545bb9250eSAlex Richardson
6555bb9250eSAlex Richardson /* end tables serialization structures and prototypes */
6565bb9250eSAlex Richardson
6575bb9250eSAlex Richardson /* Default declaration of generated scanner - a define so the user can
6585bb9250eSAlex Richardson * easily add parameters.
6595bb9250eSAlex Richardson */
6605bb9250eSAlex Richardson #ifndef YY_DECL
6615bb9250eSAlex Richardson #define YY_DECL_IS_OURS 1
6625bb9250eSAlex Richardson
6635bb9250eSAlex Richardson extern int yylex (void);
6645bb9250eSAlex Richardson
6655bb9250eSAlex Richardson #define YY_DECL int yylex (void)
6665bb9250eSAlex Richardson #endif /* !YY_DECL */
6675bb9250eSAlex Richardson
6685bb9250eSAlex Richardson /* Code executed at the beginning of each rule, after yytext and yyleng
6695bb9250eSAlex Richardson * have been set up.
6705bb9250eSAlex Richardson */
6715bb9250eSAlex Richardson #ifndef YY_USER_ACTION
6725bb9250eSAlex Richardson #define YY_USER_ACTION
6735bb9250eSAlex Richardson #endif
6745bb9250eSAlex Richardson
6755bb9250eSAlex Richardson /* Code executed at the end of each rule. */
6765bb9250eSAlex Richardson #ifndef YY_BREAK
677*f8e57f89SAlex Richardson #define YY_BREAK /*LINTED*/break;
6785bb9250eSAlex Richardson #endif
6795bb9250eSAlex Richardson
6805bb9250eSAlex Richardson #define YY_RULE_SETUP \
6815bb9250eSAlex Richardson YY_USER_ACTION
6825bb9250eSAlex Richardson
6835bb9250eSAlex Richardson /** The main scanner function which does all the work.
6845bb9250eSAlex Richardson */
6855bb9250eSAlex Richardson YY_DECL
6865bb9250eSAlex Richardson {
6875bb9250eSAlex Richardson yy_state_type yy_current_state;
6885bb9250eSAlex Richardson char *yy_cp, *yy_bp;
6895bb9250eSAlex Richardson int yy_act;
6905bb9250eSAlex Richardson
6915bb9250eSAlex Richardson if ( !(yy_init) )
6925bb9250eSAlex Richardson {
6935bb9250eSAlex Richardson (yy_init) = 1;
6945bb9250eSAlex Richardson
6955bb9250eSAlex Richardson #ifdef YY_USER_INIT
6965bb9250eSAlex Richardson YY_USER_INIT;
6975bb9250eSAlex Richardson #endif
6985bb9250eSAlex Richardson
6995bb9250eSAlex Richardson if ( ! (yy_start) )
7005bb9250eSAlex Richardson (yy_start) = 1; /* first start state */
7015bb9250eSAlex Richardson
7025bb9250eSAlex Richardson if ( ! yyin )
7035bb9250eSAlex Richardson yyin = stdin;
7045bb9250eSAlex Richardson
7055bb9250eSAlex Richardson if ( ! yyout )
7065bb9250eSAlex Richardson yyout = stdout;
7075bb9250eSAlex Richardson
7085bb9250eSAlex Richardson if ( ! YY_CURRENT_BUFFER ) {
7095bb9250eSAlex Richardson yyensure_buffer_stack ();
7105bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE =
7115bb9250eSAlex Richardson yy_create_buffer( yyin, YY_BUF_SIZE );
7125bb9250eSAlex Richardson }
7135bb9250eSAlex Richardson
7145bb9250eSAlex Richardson yy_load_buffer_state( );
7155bb9250eSAlex Richardson }
7165bb9250eSAlex Richardson
717*f8e57f89SAlex Richardson {
718*f8e57f89SAlex Richardson #line 48 "tokenizer.l"
719*f8e57f89SAlex Richardson
720*f8e57f89SAlex Richardson #line 722 "tokenizer.c"
721*f8e57f89SAlex Richardson
722*f8e57f89SAlex Richardson while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
7235bb9250eSAlex Richardson {
7245bb9250eSAlex Richardson yy_cp = (yy_c_buf_p);
7255bb9250eSAlex Richardson
7265bb9250eSAlex Richardson /* Support of yytext. */
7275bb9250eSAlex Richardson *yy_cp = (yy_hold_char);
7285bb9250eSAlex Richardson
7295bb9250eSAlex Richardson /* yy_bp points to the position in yy_ch_buf of the start of
7305bb9250eSAlex Richardson * the current run.
7315bb9250eSAlex Richardson */
7325bb9250eSAlex Richardson yy_bp = yy_cp;
7335bb9250eSAlex Richardson
7345bb9250eSAlex Richardson yy_current_state = (yy_start);
7355bb9250eSAlex Richardson yy_match:
7365bb9250eSAlex Richardson do
7375bb9250eSAlex Richardson {
7385bb9250eSAlex Richardson YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
7395bb9250eSAlex Richardson if ( yy_accept[yy_current_state] )
7405bb9250eSAlex Richardson {
7415bb9250eSAlex Richardson (yy_last_accepting_state) = yy_current_state;
7425bb9250eSAlex Richardson (yy_last_accepting_cpos) = yy_cp;
7435bb9250eSAlex Richardson }
7445bb9250eSAlex Richardson while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
7455bb9250eSAlex Richardson {
7465bb9250eSAlex Richardson yy_current_state = (int) yy_def[yy_current_state];
7475bb9250eSAlex Richardson if ( yy_current_state >= 35 )
748*f8e57f89SAlex Richardson yy_c = yy_meta[yy_c];
7495bb9250eSAlex Richardson }
750*f8e57f89SAlex Richardson yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
7515bb9250eSAlex Richardson ++yy_cp;
7525bb9250eSAlex Richardson }
7535bb9250eSAlex Richardson while ( yy_base[yy_current_state] != 49 );
7545bb9250eSAlex Richardson
7555bb9250eSAlex Richardson yy_find_action:
7565bb9250eSAlex Richardson yy_act = yy_accept[yy_current_state];
7575bb9250eSAlex Richardson if ( yy_act == 0 )
7585bb9250eSAlex Richardson { /* have to back up */
7595bb9250eSAlex Richardson yy_cp = (yy_last_accepting_cpos);
7605bb9250eSAlex Richardson yy_current_state = (yy_last_accepting_state);
7615bb9250eSAlex Richardson yy_act = yy_accept[yy_current_state];
7625bb9250eSAlex Richardson }
7635bb9250eSAlex Richardson
7645bb9250eSAlex Richardson YY_DO_BEFORE_ACTION;
7655bb9250eSAlex Richardson
7665bb9250eSAlex Richardson do_action: /* This label is used only to access EOF actions. */
7675bb9250eSAlex Richardson
7685bb9250eSAlex Richardson switch ( yy_act )
7695bb9250eSAlex Richardson { /* beginning of action switch */
7705bb9250eSAlex Richardson case 0: /* must back up */
7715bb9250eSAlex Richardson /* undo the effects of YY_DO_BEFORE_ACTION */
7725bb9250eSAlex Richardson *yy_cp = (yy_hold_char);
7735bb9250eSAlex Richardson yy_cp = (yy_last_accepting_cpos);
7745bb9250eSAlex Richardson yy_current_state = (yy_last_accepting_state);
7755bb9250eSAlex Richardson goto yy_find_action;
7765bb9250eSAlex Richardson
7775bb9250eSAlex Richardson case 1:
7785bb9250eSAlex Richardson /* rule 1 can match eol */
7795bb9250eSAlex Richardson YY_RULE_SETUP
780*f8e57f89SAlex Richardson #line 49 "tokenizer.l"
7815bb9250eSAlex Richardson {/* just skip it */}
7825bb9250eSAlex Richardson YY_BREAK
7835bb9250eSAlex Richardson case 2:
7845bb9250eSAlex Richardson YY_RULE_SETUP
785*f8e57f89SAlex Richardson #line 50 "tokenizer.l"
7865bb9250eSAlex Richardson { yylval = number(); return(NUMBER); }
7875bb9250eSAlex Richardson YY_BREAK
7885bb9250eSAlex Richardson case 3:
7895bb9250eSAlex Richardson YY_RULE_SETUP
790*f8e57f89SAlex Richardson #line 51 "tokenizer.l"
7915bb9250eSAlex Richardson { if (mimic_gnu) {
7925bb9250eSAlex Richardson yylval = parse_radix(); return(NUMBER);
7935bb9250eSAlex Richardson } else {
7945bb9250eSAlex Richardson return(ERROR);
7955bb9250eSAlex Richardson }
7965bb9250eSAlex Richardson }
7975bb9250eSAlex Richardson YY_BREAK
7985bb9250eSAlex Richardson case 4:
7995bb9250eSAlex Richardson YY_RULE_SETUP
800*f8e57f89SAlex Richardson #line 57 "tokenizer.l"
8015bb9250eSAlex Richardson { return(LE); }
8025bb9250eSAlex Richardson YY_BREAK
8035bb9250eSAlex Richardson case 5:
8045bb9250eSAlex Richardson YY_RULE_SETUP
805*f8e57f89SAlex Richardson #line 58 "tokenizer.l"
8065bb9250eSAlex Richardson { return(GE); }
8075bb9250eSAlex Richardson YY_BREAK
8085bb9250eSAlex Richardson case 6:
8095bb9250eSAlex Richardson YY_RULE_SETUP
810*f8e57f89SAlex Richardson #line 59 "tokenizer.l"
8115bb9250eSAlex Richardson { return(LSHIFT); }
8125bb9250eSAlex Richardson YY_BREAK
8135bb9250eSAlex Richardson case 7:
8145bb9250eSAlex Richardson YY_RULE_SETUP
815*f8e57f89SAlex Richardson #line 60 "tokenizer.l"
8165bb9250eSAlex Richardson { return(RSHIFT); }
8175bb9250eSAlex Richardson YY_BREAK
8185bb9250eSAlex Richardson case 8:
8195bb9250eSAlex Richardson YY_RULE_SETUP
820*f8e57f89SAlex Richardson #line 61 "tokenizer.l"
8215bb9250eSAlex Richardson { return(EQ); }
8225bb9250eSAlex Richardson YY_BREAK
8235bb9250eSAlex Richardson case 9:
8245bb9250eSAlex Richardson YY_RULE_SETUP
825*f8e57f89SAlex Richardson #line 62 "tokenizer.l"
8265bb9250eSAlex Richardson { return(NE); }
8275bb9250eSAlex Richardson YY_BREAK
8285bb9250eSAlex Richardson case 10:
8295bb9250eSAlex Richardson YY_RULE_SETUP
830*f8e57f89SAlex Richardson #line 63 "tokenizer.l"
8315bb9250eSAlex Richardson { return(LAND); }
8325bb9250eSAlex Richardson YY_BREAK
8335bb9250eSAlex Richardson case 11:
8345bb9250eSAlex Richardson YY_RULE_SETUP
835*f8e57f89SAlex Richardson #line 64 "tokenizer.l"
8365bb9250eSAlex Richardson { return(LOR); }
8375bb9250eSAlex Richardson YY_BREAK
8385bb9250eSAlex Richardson case 12:
8395bb9250eSAlex Richardson YY_RULE_SETUP
840*f8e57f89SAlex Richardson #line 65 "tokenizer.l"
8415bb9250eSAlex Richardson { if (mimic_gnu) { return (EXPONENT); } }
8425bb9250eSAlex Richardson YY_BREAK
8435bb9250eSAlex Richardson case 13:
8445bb9250eSAlex Richardson YY_RULE_SETUP
845*f8e57f89SAlex Richardson #line 66 "tokenizer.l"
8465bb9250eSAlex Richardson { return yytext[0]; }
8475bb9250eSAlex Richardson YY_BREAK
8485bb9250eSAlex Richardson case 14:
8495bb9250eSAlex Richardson YY_RULE_SETUP
850*f8e57f89SAlex Richardson #line 67 "tokenizer.l"
8515bb9250eSAlex Richardson ECHO;
8525bb9250eSAlex Richardson YY_BREAK
853*f8e57f89SAlex Richardson #line 855 "tokenizer.c"
8545bb9250eSAlex Richardson case YY_STATE_EOF(INITIAL):
8555bb9250eSAlex Richardson yyterminate();
8565bb9250eSAlex Richardson
8575bb9250eSAlex Richardson case YY_END_OF_BUFFER:
8585bb9250eSAlex Richardson {
8595bb9250eSAlex Richardson /* Amount of text matched not including the EOB char. */
8605bb9250eSAlex Richardson int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
8615bb9250eSAlex Richardson
8625bb9250eSAlex Richardson /* Undo the effects of YY_DO_BEFORE_ACTION. */
8635bb9250eSAlex Richardson *yy_cp = (yy_hold_char);
8645bb9250eSAlex Richardson YY_RESTORE_YY_MORE_OFFSET
8655bb9250eSAlex Richardson
8665bb9250eSAlex Richardson if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
8675bb9250eSAlex Richardson {
8685bb9250eSAlex Richardson /* We're scanning a new file or input source. It's
8695bb9250eSAlex Richardson * possible that this happened because the user
8705bb9250eSAlex Richardson * just pointed yyin at a new source and called
8715bb9250eSAlex Richardson * yylex(). If so, then we have to assure
8725bb9250eSAlex Richardson * consistency between YY_CURRENT_BUFFER and our
8735bb9250eSAlex Richardson * globals. Here is the right place to do so, because
8745bb9250eSAlex Richardson * this is the first action (other than possibly a
8755bb9250eSAlex Richardson * back-up) that will match for the new input source.
8765bb9250eSAlex Richardson */
8775bb9250eSAlex Richardson (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
8785bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
8795bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
8805bb9250eSAlex Richardson }
8815bb9250eSAlex Richardson
8825bb9250eSAlex Richardson /* Note that here we test for yy_c_buf_p "<=" to the position
8835bb9250eSAlex Richardson * of the first EOB in the buffer, since yy_c_buf_p will
8845bb9250eSAlex Richardson * already have been incremented past the NUL character
8855bb9250eSAlex Richardson * (since all states make transitions on EOB to the
8865bb9250eSAlex Richardson * end-of-buffer state). Contrast this with the test
8875bb9250eSAlex Richardson * in input().
8885bb9250eSAlex Richardson */
8895bb9250eSAlex Richardson if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
8905bb9250eSAlex Richardson { /* This was really a NUL. */
8915bb9250eSAlex Richardson yy_state_type yy_next_state;
8925bb9250eSAlex Richardson
8935bb9250eSAlex Richardson (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
8945bb9250eSAlex Richardson
8955bb9250eSAlex Richardson yy_current_state = yy_get_previous_state( );
8965bb9250eSAlex Richardson
8975bb9250eSAlex Richardson /* Okay, we're now positioned to make the NUL
8985bb9250eSAlex Richardson * transition. We couldn't have
8995bb9250eSAlex Richardson * yy_get_previous_state() go ahead and do it
9005bb9250eSAlex Richardson * for us because it doesn't know how to deal
9015bb9250eSAlex Richardson * with the possibility of jamming (and we don't
9025bb9250eSAlex Richardson * want to build jamming into it because then it
9035bb9250eSAlex Richardson * will run more slowly).
9045bb9250eSAlex Richardson */
9055bb9250eSAlex Richardson
9065bb9250eSAlex Richardson yy_next_state = yy_try_NUL_trans( yy_current_state );
9075bb9250eSAlex Richardson
9085bb9250eSAlex Richardson yy_bp = (yytext_ptr) + YY_MORE_ADJ;
9095bb9250eSAlex Richardson
9105bb9250eSAlex Richardson if ( yy_next_state )
9115bb9250eSAlex Richardson {
9125bb9250eSAlex Richardson /* Consume the NUL. */
9135bb9250eSAlex Richardson yy_cp = ++(yy_c_buf_p);
9145bb9250eSAlex Richardson yy_current_state = yy_next_state;
9155bb9250eSAlex Richardson goto yy_match;
9165bb9250eSAlex Richardson }
9175bb9250eSAlex Richardson
9185bb9250eSAlex Richardson else
9195bb9250eSAlex Richardson {
9205bb9250eSAlex Richardson yy_cp = (yy_c_buf_p);
9215bb9250eSAlex Richardson goto yy_find_action;
9225bb9250eSAlex Richardson }
9235bb9250eSAlex Richardson }
9245bb9250eSAlex Richardson
9255bb9250eSAlex Richardson else switch ( yy_get_next_buffer( ) )
9265bb9250eSAlex Richardson {
9275bb9250eSAlex Richardson case EOB_ACT_END_OF_FILE:
9285bb9250eSAlex Richardson {
9295bb9250eSAlex Richardson (yy_did_buffer_switch_on_eof) = 0;
9305bb9250eSAlex Richardson
9315bb9250eSAlex Richardson if ( yywrap( ) )
9325bb9250eSAlex Richardson {
9335bb9250eSAlex Richardson /* Note: because we've taken care in
9345bb9250eSAlex Richardson * yy_get_next_buffer() to have set up
9355bb9250eSAlex Richardson * yytext, we can now set up
9365bb9250eSAlex Richardson * yy_c_buf_p so that if some total
9375bb9250eSAlex Richardson * hoser (like flex itself) wants to
9385bb9250eSAlex Richardson * call the scanner after we return the
9395bb9250eSAlex Richardson * YY_NULL, it'll still work - another
9405bb9250eSAlex Richardson * YY_NULL will get returned.
9415bb9250eSAlex Richardson */
9425bb9250eSAlex Richardson (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
9435bb9250eSAlex Richardson
9445bb9250eSAlex Richardson yy_act = YY_STATE_EOF(YY_START);
9455bb9250eSAlex Richardson goto do_action;
9465bb9250eSAlex Richardson }
9475bb9250eSAlex Richardson
9485bb9250eSAlex Richardson else
9495bb9250eSAlex Richardson {
9505bb9250eSAlex Richardson if ( ! (yy_did_buffer_switch_on_eof) )
9515bb9250eSAlex Richardson YY_NEW_FILE;
9525bb9250eSAlex Richardson }
9535bb9250eSAlex Richardson break;
9545bb9250eSAlex Richardson }
9555bb9250eSAlex Richardson
9565bb9250eSAlex Richardson case EOB_ACT_CONTINUE_SCAN:
9575bb9250eSAlex Richardson (yy_c_buf_p) =
9585bb9250eSAlex Richardson (yytext_ptr) + yy_amount_of_matched_text;
9595bb9250eSAlex Richardson
9605bb9250eSAlex Richardson yy_current_state = yy_get_previous_state( );
9615bb9250eSAlex Richardson
9625bb9250eSAlex Richardson yy_cp = (yy_c_buf_p);
9635bb9250eSAlex Richardson yy_bp = (yytext_ptr) + YY_MORE_ADJ;
9645bb9250eSAlex Richardson goto yy_match;
9655bb9250eSAlex Richardson
9665bb9250eSAlex Richardson case EOB_ACT_LAST_MATCH:
9675bb9250eSAlex Richardson (yy_c_buf_p) =
9685bb9250eSAlex Richardson &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
9695bb9250eSAlex Richardson
9705bb9250eSAlex Richardson yy_current_state = yy_get_previous_state( );
9715bb9250eSAlex Richardson
9725bb9250eSAlex Richardson yy_cp = (yy_c_buf_p);
9735bb9250eSAlex Richardson yy_bp = (yytext_ptr) + YY_MORE_ADJ;
9745bb9250eSAlex Richardson goto yy_find_action;
9755bb9250eSAlex Richardson }
9765bb9250eSAlex Richardson break;
9775bb9250eSAlex Richardson }
9785bb9250eSAlex Richardson
9795bb9250eSAlex Richardson default:
9805bb9250eSAlex Richardson YY_FATAL_ERROR(
9815bb9250eSAlex Richardson "fatal flex scanner internal error--no action found" );
9825bb9250eSAlex Richardson } /* end of action switch */
9835bb9250eSAlex Richardson } /* end of scanning one token */
984*f8e57f89SAlex Richardson } /* end of user's declarations */
9855bb9250eSAlex Richardson } /* end of yylex */
9865bb9250eSAlex Richardson
9875bb9250eSAlex Richardson /* yy_get_next_buffer - try to read in a new buffer
9885bb9250eSAlex Richardson *
9895bb9250eSAlex Richardson * Returns a code representing an action:
9905bb9250eSAlex Richardson * EOB_ACT_LAST_MATCH -
9915bb9250eSAlex Richardson * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
9925bb9250eSAlex Richardson * EOB_ACT_END_OF_FILE - end of file
9935bb9250eSAlex Richardson */
yy_get_next_buffer(void)9945bb9250eSAlex Richardson static int yy_get_next_buffer (void)
9955bb9250eSAlex Richardson {
9965bb9250eSAlex Richardson char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
9975bb9250eSAlex Richardson char *source = (yytext_ptr);
9985bb9250eSAlex Richardson int number_to_move, i;
9995bb9250eSAlex Richardson int ret_val;
10005bb9250eSAlex Richardson
10015bb9250eSAlex Richardson if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
10025bb9250eSAlex Richardson YY_FATAL_ERROR(
10035bb9250eSAlex Richardson "fatal flex scanner internal error--end of buffer missed" );
10045bb9250eSAlex Richardson
10055bb9250eSAlex Richardson if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
10065bb9250eSAlex Richardson { /* Don't try to fill the buffer, so this is an EOF. */
10075bb9250eSAlex Richardson if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
10085bb9250eSAlex Richardson {
10095bb9250eSAlex Richardson /* We matched a single character, the EOB, so
10105bb9250eSAlex Richardson * treat this as a final EOF.
10115bb9250eSAlex Richardson */
10125bb9250eSAlex Richardson return EOB_ACT_END_OF_FILE;
10135bb9250eSAlex Richardson }
10145bb9250eSAlex Richardson
10155bb9250eSAlex Richardson else
10165bb9250eSAlex Richardson {
10175bb9250eSAlex Richardson /* We matched some text prior to the EOB, first
10185bb9250eSAlex Richardson * process it.
10195bb9250eSAlex Richardson */
10205bb9250eSAlex Richardson return EOB_ACT_LAST_MATCH;
10215bb9250eSAlex Richardson }
10225bb9250eSAlex Richardson }
10235bb9250eSAlex Richardson
10245bb9250eSAlex Richardson /* Try to read more data. */
10255bb9250eSAlex Richardson
10265bb9250eSAlex Richardson /* First move last chars to start of buffer. */
1027*f8e57f89SAlex Richardson number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
10285bb9250eSAlex Richardson
10295bb9250eSAlex Richardson for ( i = 0; i < number_to_move; ++i )
10305bb9250eSAlex Richardson *(dest++) = *(source++);
10315bb9250eSAlex Richardson
10325bb9250eSAlex Richardson if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
10335bb9250eSAlex Richardson /* don't do the read, it's not guaranteed to return an EOF,
10345bb9250eSAlex Richardson * just force an EOF
10355bb9250eSAlex Richardson */
10365bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
10375bb9250eSAlex Richardson
10385bb9250eSAlex Richardson else
10395bb9250eSAlex Richardson {
1040*f8e57f89SAlex Richardson int num_to_read =
10415bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
10425bb9250eSAlex Richardson
10435bb9250eSAlex Richardson while ( num_to_read <= 0 )
10445bb9250eSAlex Richardson { /* Not enough room in the buffer - grow it. */
10455bb9250eSAlex Richardson
10465bb9250eSAlex Richardson /* just a shorter name for the current buffer */
10475bb9250eSAlex Richardson YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
10485bb9250eSAlex Richardson
10495bb9250eSAlex Richardson int yy_c_buf_p_offset =
10505bb9250eSAlex Richardson (int) ((yy_c_buf_p) - b->yy_ch_buf);
10515bb9250eSAlex Richardson
10525bb9250eSAlex Richardson if ( b->yy_is_our_buffer )
10535bb9250eSAlex Richardson {
1054*f8e57f89SAlex Richardson int new_size = b->yy_buf_size * 2;
10555bb9250eSAlex Richardson
10565bb9250eSAlex Richardson if ( new_size <= 0 )
10575bb9250eSAlex Richardson b->yy_buf_size += b->yy_buf_size / 8;
10585bb9250eSAlex Richardson else
10595bb9250eSAlex Richardson b->yy_buf_size *= 2;
10605bb9250eSAlex Richardson
10615bb9250eSAlex Richardson b->yy_ch_buf = (char *)
10625bb9250eSAlex Richardson /* Include room in for 2 EOB chars. */
1063*f8e57f89SAlex Richardson yyrealloc( (void *) b->yy_ch_buf,
1064*f8e57f89SAlex Richardson (yy_size_t) (b->yy_buf_size + 2) );
10655bb9250eSAlex Richardson }
10665bb9250eSAlex Richardson else
10675bb9250eSAlex Richardson /* Can't grow it, we don't own it. */
1068*f8e57f89SAlex Richardson b->yy_ch_buf = NULL;
10695bb9250eSAlex Richardson
10705bb9250eSAlex Richardson if ( ! b->yy_ch_buf )
10715bb9250eSAlex Richardson YY_FATAL_ERROR(
10725bb9250eSAlex Richardson "fatal error - scanner input buffer overflow" );
10735bb9250eSAlex Richardson
10745bb9250eSAlex Richardson (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
10755bb9250eSAlex Richardson
10765bb9250eSAlex Richardson num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
10775bb9250eSAlex Richardson number_to_move - 1;
10785bb9250eSAlex Richardson
10795bb9250eSAlex Richardson }
10805bb9250eSAlex Richardson
10815bb9250eSAlex Richardson if ( num_to_read > YY_READ_BUF_SIZE )
10825bb9250eSAlex Richardson num_to_read = YY_READ_BUF_SIZE;
10835bb9250eSAlex Richardson
10845bb9250eSAlex Richardson /* Read in more data. */
10855bb9250eSAlex Richardson YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
10865bb9250eSAlex Richardson (yy_n_chars), num_to_read );
10875bb9250eSAlex Richardson
10885bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
10895bb9250eSAlex Richardson }
10905bb9250eSAlex Richardson
10915bb9250eSAlex Richardson if ( (yy_n_chars) == 0 )
10925bb9250eSAlex Richardson {
10935bb9250eSAlex Richardson if ( number_to_move == YY_MORE_ADJ )
10945bb9250eSAlex Richardson {
10955bb9250eSAlex Richardson ret_val = EOB_ACT_END_OF_FILE;
10965bb9250eSAlex Richardson yyrestart( yyin );
10975bb9250eSAlex Richardson }
10985bb9250eSAlex Richardson
10995bb9250eSAlex Richardson else
11005bb9250eSAlex Richardson {
11015bb9250eSAlex Richardson ret_val = EOB_ACT_LAST_MATCH;
11025bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
11035bb9250eSAlex Richardson YY_BUFFER_EOF_PENDING;
11045bb9250eSAlex Richardson }
11055bb9250eSAlex Richardson }
11065bb9250eSAlex Richardson
11075bb9250eSAlex Richardson else
11085bb9250eSAlex Richardson ret_val = EOB_ACT_CONTINUE_SCAN;
11095bb9250eSAlex Richardson
1110*f8e57f89SAlex Richardson if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
11115bb9250eSAlex Richardson /* Extend the array by 50%, plus the number we really need. */
1112*f8e57f89SAlex Richardson int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1113*f8e57f89SAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1114*f8e57f89SAlex Richardson (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
11155bb9250eSAlex Richardson if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
11165bb9250eSAlex Richardson YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1117*f8e57f89SAlex Richardson /* "- 2" to take care of EOB's */
1118*f8e57f89SAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
11195bb9250eSAlex Richardson }
11205bb9250eSAlex Richardson
11215bb9250eSAlex Richardson (yy_n_chars) += number_to_move;
11225bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
11235bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
11245bb9250eSAlex Richardson
11255bb9250eSAlex Richardson (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
11265bb9250eSAlex Richardson
11275bb9250eSAlex Richardson return ret_val;
11285bb9250eSAlex Richardson }
11295bb9250eSAlex Richardson
11305bb9250eSAlex Richardson /* yy_get_previous_state - get the state just before the EOB char was reached */
11315bb9250eSAlex Richardson
yy_get_previous_state(void)11325bb9250eSAlex Richardson static yy_state_type yy_get_previous_state (void)
11335bb9250eSAlex Richardson {
11345bb9250eSAlex Richardson yy_state_type yy_current_state;
11355bb9250eSAlex Richardson char *yy_cp;
11365bb9250eSAlex Richardson
11375bb9250eSAlex Richardson yy_current_state = (yy_start);
11385bb9250eSAlex Richardson
11395bb9250eSAlex Richardson for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
11405bb9250eSAlex Richardson {
11415bb9250eSAlex Richardson YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
11425bb9250eSAlex Richardson if ( yy_accept[yy_current_state] )
11435bb9250eSAlex Richardson {
11445bb9250eSAlex Richardson (yy_last_accepting_state) = yy_current_state;
11455bb9250eSAlex Richardson (yy_last_accepting_cpos) = yy_cp;
11465bb9250eSAlex Richardson }
11475bb9250eSAlex Richardson while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
11485bb9250eSAlex Richardson {
11495bb9250eSAlex Richardson yy_current_state = (int) yy_def[yy_current_state];
11505bb9250eSAlex Richardson if ( yy_current_state >= 35 )
1151*f8e57f89SAlex Richardson yy_c = yy_meta[yy_c];
11525bb9250eSAlex Richardson }
1153*f8e57f89SAlex Richardson yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
11545bb9250eSAlex Richardson }
11555bb9250eSAlex Richardson
11565bb9250eSAlex Richardson return yy_current_state;
11575bb9250eSAlex Richardson }
11585bb9250eSAlex Richardson
11595bb9250eSAlex Richardson /* yy_try_NUL_trans - try to make a transition on the NUL character
11605bb9250eSAlex Richardson *
11615bb9250eSAlex Richardson * synopsis
11625bb9250eSAlex Richardson * next_state = yy_try_NUL_trans( current_state );
11635bb9250eSAlex Richardson */
yy_try_NUL_trans(yy_state_type yy_current_state)11645bb9250eSAlex Richardson static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
11655bb9250eSAlex Richardson {
11665bb9250eSAlex Richardson int yy_is_jam;
11675bb9250eSAlex Richardson char *yy_cp = (yy_c_buf_p);
11685bb9250eSAlex Richardson
11695bb9250eSAlex Richardson YY_CHAR yy_c = 1;
11705bb9250eSAlex Richardson if ( yy_accept[yy_current_state] )
11715bb9250eSAlex Richardson {
11725bb9250eSAlex Richardson (yy_last_accepting_state) = yy_current_state;
11735bb9250eSAlex Richardson (yy_last_accepting_cpos) = yy_cp;
11745bb9250eSAlex Richardson }
11755bb9250eSAlex Richardson while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
11765bb9250eSAlex Richardson {
11775bb9250eSAlex Richardson yy_current_state = (int) yy_def[yy_current_state];
11785bb9250eSAlex Richardson if ( yy_current_state >= 35 )
1179*f8e57f89SAlex Richardson yy_c = yy_meta[yy_c];
11805bb9250eSAlex Richardson }
1181*f8e57f89SAlex Richardson yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
11825bb9250eSAlex Richardson yy_is_jam = (yy_current_state == 34);
11835bb9250eSAlex Richardson
11845bb9250eSAlex Richardson return yy_is_jam ? 0 : yy_current_state;
11855bb9250eSAlex Richardson }
11865bb9250eSAlex Richardson
1187*f8e57f89SAlex Richardson #ifndef YY_NO_UNPUT
1188*f8e57f89SAlex Richardson
1189*f8e57f89SAlex Richardson #endif
1190*f8e57f89SAlex Richardson
11915bb9250eSAlex Richardson #ifndef YY_NO_INPUT
11925bb9250eSAlex Richardson #ifdef __cplusplus
yyinput(void)11935bb9250eSAlex Richardson static int yyinput (void)
11945bb9250eSAlex Richardson #else
11955bb9250eSAlex Richardson static int input (void)
11965bb9250eSAlex Richardson #endif
11975bb9250eSAlex Richardson
11985bb9250eSAlex Richardson {
11995bb9250eSAlex Richardson int c;
12005bb9250eSAlex Richardson
12015bb9250eSAlex Richardson *(yy_c_buf_p) = (yy_hold_char);
12025bb9250eSAlex Richardson
12035bb9250eSAlex Richardson if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
12045bb9250eSAlex Richardson {
12055bb9250eSAlex Richardson /* yy_c_buf_p now points to the character we want to return.
12065bb9250eSAlex Richardson * If this occurs *before* the EOB characters, then it's a
12075bb9250eSAlex Richardson * valid NUL; if not, then we've hit the end of the buffer.
12085bb9250eSAlex Richardson */
12095bb9250eSAlex Richardson if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
12105bb9250eSAlex Richardson /* This was really a NUL. */
12115bb9250eSAlex Richardson *(yy_c_buf_p) = '\0';
12125bb9250eSAlex Richardson
12135bb9250eSAlex Richardson else
12145bb9250eSAlex Richardson { /* need more input */
1215*f8e57f89SAlex Richardson int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
12165bb9250eSAlex Richardson ++(yy_c_buf_p);
12175bb9250eSAlex Richardson
12185bb9250eSAlex Richardson switch ( yy_get_next_buffer( ) )
12195bb9250eSAlex Richardson {
12205bb9250eSAlex Richardson case EOB_ACT_LAST_MATCH:
12215bb9250eSAlex Richardson /* This happens because yy_g_n_b()
12225bb9250eSAlex Richardson * sees that we've accumulated a
12235bb9250eSAlex Richardson * token and flags that we need to
12245bb9250eSAlex Richardson * try matching the token before
12255bb9250eSAlex Richardson * proceeding. But for input(),
12265bb9250eSAlex Richardson * there's no matching to consider.
12275bb9250eSAlex Richardson * So convert the EOB_ACT_LAST_MATCH
12285bb9250eSAlex Richardson * to EOB_ACT_END_OF_FILE.
12295bb9250eSAlex Richardson */
12305bb9250eSAlex Richardson
12315bb9250eSAlex Richardson /* Reset buffer status. */
12325bb9250eSAlex Richardson yyrestart( yyin );
12335bb9250eSAlex Richardson
12345bb9250eSAlex Richardson /*FALLTHROUGH*/
12355bb9250eSAlex Richardson
12365bb9250eSAlex Richardson case EOB_ACT_END_OF_FILE:
12375bb9250eSAlex Richardson {
12385bb9250eSAlex Richardson if ( yywrap( ) )
1239*f8e57f89SAlex Richardson return 0;
12405bb9250eSAlex Richardson
12415bb9250eSAlex Richardson if ( ! (yy_did_buffer_switch_on_eof) )
12425bb9250eSAlex Richardson YY_NEW_FILE;
12435bb9250eSAlex Richardson #ifdef __cplusplus
12445bb9250eSAlex Richardson return yyinput();
12455bb9250eSAlex Richardson #else
12465bb9250eSAlex Richardson return input();
12475bb9250eSAlex Richardson #endif
12485bb9250eSAlex Richardson }
12495bb9250eSAlex Richardson
12505bb9250eSAlex Richardson case EOB_ACT_CONTINUE_SCAN:
12515bb9250eSAlex Richardson (yy_c_buf_p) = (yytext_ptr) + offset;
12525bb9250eSAlex Richardson break;
12535bb9250eSAlex Richardson }
12545bb9250eSAlex Richardson }
12555bb9250eSAlex Richardson }
12565bb9250eSAlex Richardson
12575bb9250eSAlex Richardson c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
12585bb9250eSAlex Richardson *(yy_c_buf_p) = '\0'; /* preserve yytext */
12595bb9250eSAlex Richardson (yy_hold_char) = *++(yy_c_buf_p);
12605bb9250eSAlex Richardson
12615bb9250eSAlex Richardson return c;
12625bb9250eSAlex Richardson }
12635bb9250eSAlex Richardson #endif /* ifndef YY_NO_INPUT */
12645bb9250eSAlex Richardson
12655bb9250eSAlex Richardson /** Immediately switch to a different input stream.
12665bb9250eSAlex Richardson * @param input_file A readable stream.
12675bb9250eSAlex Richardson *
12685bb9250eSAlex Richardson * @note This function does not reset the start condition to @c INITIAL .
12695bb9250eSAlex Richardson */
yyrestart(FILE * input_file)12705bb9250eSAlex Richardson void yyrestart (FILE * input_file )
12715bb9250eSAlex Richardson {
12725bb9250eSAlex Richardson
12735bb9250eSAlex Richardson if ( ! YY_CURRENT_BUFFER ){
12745bb9250eSAlex Richardson yyensure_buffer_stack ();
12755bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE =
12765bb9250eSAlex Richardson yy_create_buffer( yyin, YY_BUF_SIZE );
12775bb9250eSAlex Richardson }
12785bb9250eSAlex Richardson
12795bb9250eSAlex Richardson yy_init_buffer( YY_CURRENT_BUFFER, input_file );
12805bb9250eSAlex Richardson yy_load_buffer_state( );
12815bb9250eSAlex Richardson }
12825bb9250eSAlex Richardson
12835bb9250eSAlex Richardson /** Switch to a different input buffer.
12845bb9250eSAlex Richardson * @param new_buffer The new input buffer.
12855bb9250eSAlex Richardson *
12865bb9250eSAlex Richardson */
yy_switch_to_buffer(YY_BUFFER_STATE new_buffer)12875bb9250eSAlex Richardson void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
12885bb9250eSAlex Richardson {
12895bb9250eSAlex Richardson
12905bb9250eSAlex Richardson /* TODO. We should be able to replace this entire function body
12915bb9250eSAlex Richardson * with
12925bb9250eSAlex Richardson * yypop_buffer_state();
12935bb9250eSAlex Richardson * yypush_buffer_state(new_buffer);
12945bb9250eSAlex Richardson */
12955bb9250eSAlex Richardson yyensure_buffer_stack ();
12965bb9250eSAlex Richardson if ( YY_CURRENT_BUFFER == new_buffer )
12975bb9250eSAlex Richardson return;
12985bb9250eSAlex Richardson
12995bb9250eSAlex Richardson if ( YY_CURRENT_BUFFER )
13005bb9250eSAlex Richardson {
13015bb9250eSAlex Richardson /* Flush out information for old buffer. */
13025bb9250eSAlex Richardson *(yy_c_buf_p) = (yy_hold_char);
13035bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
13045bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
13055bb9250eSAlex Richardson }
13065bb9250eSAlex Richardson
13075bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = new_buffer;
13085bb9250eSAlex Richardson yy_load_buffer_state( );
13095bb9250eSAlex Richardson
13105bb9250eSAlex Richardson /* We don't actually know whether we did this switch during
13115bb9250eSAlex Richardson * EOF (yywrap()) processing, but the only time this flag
13125bb9250eSAlex Richardson * is looked at is after yywrap() is called, so it's safe
13135bb9250eSAlex Richardson * to go ahead and always set it.
13145bb9250eSAlex Richardson */
13155bb9250eSAlex Richardson (yy_did_buffer_switch_on_eof) = 1;
13165bb9250eSAlex Richardson }
13175bb9250eSAlex Richardson
yy_load_buffer_state(void)13185bb9250eSAlex Richardson static void yy_load_buffer_state (void)
13195bb9250eSAlex Richardson {
13205bb9250eSAlex Richardson (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
13215bb9250eSAlex Richardson (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
13225bb9250eSAlex Richardson yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
13235bb9250eSAlex Richardson (yy_hold_char) = *(yy_c_buf_p);
13245bb9250eSAlex Richardson }
13255bb9250eSAlex Richardson
13265bb9250eSAlex Richardson /** Allocate and initialize an input buffer state.
13275bb9250eSAlex Richardson * @param file A readable stream.
13285bb9250eSAlex Richardson * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
13295bb9250eSAlex Richardson *
13305bb9250eSAlex Richardson * @return the allocated buffer state.
13315bb9250eSAlex Richardson */
yy_create_buffer(FILE * file,int size)13325bb9250eSAlex Richardson YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
13335bb9250eSAlex Richardson {
13345bb9250eSAlex Richardson YY_BUFFER_STATE b;
13355bb9250eSAlex Richardson
13365bb9250eSAlex Richardson b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
13375bb9250eSAlex Richardson if ( ! b )
13385bb9250eSAlex Richardson YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
13395bb9250eSAlex Richardson
13405bb9250eSAlex Richardson b->yy_buf_size = size;
13415bb9250eSAlex Richardson
13425bb9250eSAlex Richardson /* yy_ch_buf has to be 2 characters longer than the size given because
13435bb9250eSAlex Richardson * we need to put in 2 end-of-buffer characters.
13445bb9250eSAlex Richardson */
1345*f8e57f89SAlex Richardson b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
13465bb9250eSAlex Richardson if ( ! b->yy_ch_buf )
13475bb9250eSAlex Richardson YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
13485bb9250eSAlex Richardson
13495bb9250eSAlex Richardson b->yy_is_our_buffer = 1;
13505bb9250eSAlex Richardson
13515bb9250eSAlex Richardson yy_init_buffer( b, file );
13525bb9250eSAlex Richardson
13535bb9250eSAlex Richardson return b;
13545bb9250eSAlex Richardson }
13555bb9250eSAlex Richardson
13565bb9250eSAlex Richardson /** Destroy the buffer.
13575bb9250eSAlex Richardson * @param b a buffer created with yy_create_buffer()
13585bb9250eSAlex Richardson *
13595bb9250eSAlex Richardson */
yy_delete_buffer(YY_BUFFER_STATE b)13605bb9250eSAlex Richardson void yy_delete_buffer (YY_BUFFER_STATE b )
13615bb9250eSAlex Richardson {
13625bb9250eSAlex Richardson
13635bb9250eSAlex Richardson if ( ! b )
13645bb9250eSAlex Richardson return;
13655bb9250eSAlex Richardson
13665bb9250eSAlex Richardson if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
13675bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
13685bb9250eSAlex Richardson
13695bb9250eSAlex Richardson if ( b->yy_is_our_buffer )
13705bb9250eSAlex Richardson yyfree( (void *) b->yy_ch_buf );
13715bb9250eSAlex Richardson
13725bb9250eSAlex Richardson yyfree( (void *) b );
13735bb9250eSAlex Richardson }
13745bb9250eSAlex Richardson
13755bb9250eSAlex Richardson /* Initializes or reinitializes a buffer.
13765bb9250eSAlex Richardson * This function is sometimes called more than once on the same buffer,
13775bb9250eSAlex Richardson * such as during a yyrestart() or at EOF.
13785bb9250eSAlex Richardson */
yy_init_buffer(YY_BUFFER_STATE b,FILE * file)13795bb9250eSAlex Richardson static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
13805bb9250eSAlex Richardson
13815bb9250eSAlex Richardson {
13825bb9250eSAlex Richardson int oerrno = errno;
13835bb9250eSAlex Richardson
13845bb9250eSAlex Richardson yy_flush_buffer( b );
13855bb9250eSAlex Richardson
13865bb9250eSAlex Richardson b->yy_input_file = file;
13875bb9250eSAlex Richardson b->yy_fill_buffer = 1;
13885bb9250eSAlex Richardson
13895bb9250eSAlex Richardson /* If b is the current buffer, then yy_init_buffer was _probably_
13905bb9250eSAlex Richardson * called from yyrestart() or through yy_get_next_buffer.
13915bb9250eSAlex Richardson * In that case, we don't want to reset the lineno or column.
13925bb9250eSAlex Richardson */
13935bb9250eSAlex Richardson if (b != YY_CURRENT_BUFFER){
13945bb9250eSAlex Richardson b->yy_bs_lineno = 1;
13955bb9250eSAlex Richardson b->yy_bs_column = 0;
13965bb9250eSAlex Richardson }
13975bb9250eSAlex Richardson
13985bb9250eSAlex Richardson b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
13995bb9250eSAlex Richardson
14005bb9250eSAlex Richardson errno = oerrno;
14015bb9250eSAlex Richardson }
14025bb9250eSAlex Richardson
14035bb9250eSAlex Richardson /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
14045bb9250eSAlex Richardson * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
14055bb9250eSAlex Richardson *
14065bb9250eSAlex Richardson */
yy_flush_buffer(YY_BUFFER_STATE b)14075bb9250eSAlex Richardson void yy_flush_buffer (YY_BUFFER_STATE b )
14085bb9250eSAlex Richardson {
14095bb9250eSAlex Richardson if ( ! b )
14105bb9250eSAlex Richardson return;
14115bb9250eSAlex Richardson
14125bb9250eSAlex Richardson b->yy_n_chars = 0;
14135bb9250eSAlex Richardson
14145bb9250eSAlex Richardson /* We always need two end-of-buffer characters. The first causes
14155bb9250eSAlex Richardson * a transition to the end-of-buffer state. The second causes
14165bb9250eSAlex Richardson * a jam in that state.
14175bb9250eSAlex Richardson */
14185bb9250eSAlex Richardson b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
14195bb9250eSAlex Richardson b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
14205bb9250eSAlex Richardson
14215bb9250eSAlex Richardson b->yy_buf_pos = &b->yy_ch_buf[0];
14225bb9250eSAlex Richardson
14235bb9250eSAlex Richardson b->yy_at_bol = 1;
14245bb9250eSAlex Richardson b->yy_buffer_status = YY_BUFFER_NEW;
14255bb9250eSAlex Richardson
14265bb9250eSAlex Richardson if ( b == YY_CURRENT_BUFFER )
14275bb9250eSAlex Richardson yy_load_buffer_state( );
14285bb9250eSAlex Richardson }
14295bb9250eSAlex Richardson
14305bb9250eSAlex Richardson /** Pushes the new state onto the stack. The new state becomes
14315bb9250eSAlex Richardson * the current state. This function will allocate the stack
14325bb9250eSAlex Richardson * if necessary.
14335bb9250eSAlex Richardson * @param new_buffer The new state.
14345bb9250eSAlex Richardson *
14355bb9250eSAlex Richardson */
yypush_buffer_state(YY_BUFFER_STATE new_buffer)14365bb9250eSAlex Richardson void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
14375bb9250eSAlex Richardson {
14385bb9250eSAlex Richardson if (new_buffer == NULL)
14395bb9250eSAlex Richardson return;
14405bb9250eSAlex Richardson
14415bb9250eSAlex Richardson yyensure_buffer_stack();
14425bb9250eSAlex Richardson
14435bb9250eSAlex Richardson /* This block is copied from yy_switch_to_buffer. */
14445bb9250eSAlex Richardson if ( YY_CURRENT_BUFFER )
14455bb9250eSAlex Richardson {
14465bb9250eSAlex Richardson /* Flush out information for old buffer. */
14475bb9250eSAlex Richardson *(yy_c_buf_p) = (yy_hold_char);
14485bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
14495bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
14505bb9250eSAlex Richardson }
14515bb9250eSAlex Richardson
14525bb9250eSAlex Richardson /* Only push if top exists. Otherwise, replace top. */
14535bb9250eSAlex Richardson if (YY_CURRENT_BUFFER)
14545bb9250eSAlex Richardson (yy_buffer_stack_top)++;
14555bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = new_buffer;
14565bb9250eSAlex Richardson
14575bb9250eSAlex Richardson /* copied from yy_switch_to_buffer. */
14585bb9250eSAlex Richardson yy_load_buffer_state( );
14595bb9250eSAlex Richardson (yy_did_buffer_switch_on_eof) = 1;
14605bb9250eSAlex Richardson }
14615bb9250eSAlex Richardson
14625bb9250eSAlex Richardson /** Removes and deletes the top of the stack, if present.
14635bb9250eSAlex Richardson * The next element becomes the new top.
14645bb9250eSAlex Richardson *
14655bb9250eSAlex Richardson */
yypop_buffer_state(void)14665bb9250eSAlex Richardson void yypop_buffer_state (void)
14675bb9250eSAlex Richardson {
14685bb9250eSAlex Richardson if (!YY_CURRENT_BUFFER)
14695bb9250eSAlex Richardson return;
14705bb9250eSAlex Richardson
14715bb9250eSAlex Richardson yy_delete_buffer(YY_CURRENT_BUFFER );
14725bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = NULL;
14735bb9250eSAlex Richardson if ((yy_buffer_stack_top) > 0)
14745bb9250eSAlex Richardson --(yy_buffer_stack_top);
14755bb9250eSAlex Richardson
14765bb9250eSAlex Richardson if (YY_CURRENT_BUFFER) {
14775bb9250eSAlex Richardson yy_load_buffer_state( );
14785bb9250eSAlex Richardson (yy_did_buffer_switch_on_eof) = 1;
14795bb9250eSAlex Richardson }
14805bb9250eSAlex Richardson }
14815bb9250eSAlex Richardson
14825bb9250eSAlex Richardson /* Allocates the stack if it does not exist.
14835bb9250eSAlex Richardson * Guarantees space for at least one push.
14845bb9250eSAlex Richardson */
yyensure_buffer_stack(void)14855bb9250eSAlex Richardson static void yyensure_buffer_stack (void)
14865bb9250eSAlex Richardson {
14875bb9250eSAlex Richardson yy_size_t num_to_alloc;
14885bb9250eSAlex Richardson
14895bb9250eSAlex Richardson if (!(yy_buffer_stack)) {
14905bb9250eSAlex Richardson
14915bb9250eSAlex Richardson /* First allocation is just for 2 elements, since we don't know if this
14925bb9250eSAlex Richardson * scanner will even need a stack. We use 2 instead of 1 to avoid an
14935bb9250eSAlex Richardson * immediate realloc on the next call.
14945bb9250eSAlex Richardson */
1495*f8e57f89SAlex Richardson num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
14965bb9250eSAlex Richardson (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
14975bb9250eSAlex Richardson (num_to_alloc * sizeof(struct yy_buffer_state*)
14985bb9250eSAlex Richardson );
14995bb9250eSAlex Richardson if ( ! (yy_buffer_stack) )
15005bb9250eSAlex Richardson YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
15015bb9250eSAlex Richardson
15025bb9250eSAlex Richardson memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
15035bb9250eSAlex Richardson
15045bb9250eSAlex Richardson (yy_buffer_stack_max) = num_to_alloc;
15055bb9250eSAlex Richardson (yy_buffer_stack_top) = 0;
15065bb9250eSAlex Richardson return;
15075bb9250eSAlex Richardson }
15085bb9250eSAlex Richardson
15095bb9250eSAlex Richardson if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
15105bb9250eSAlex Richardson
15115bb9250eSAlex Richardson /* Increase the buffer to prepare for a possible push. */
1512*f8e57f89SAlex Richardson yy_size_t grow_size = 8 /* arbitrary grow size */;
15135bb9250eSAlex Richardson
15145bb9250eSAlex Richardson num_to_alloc = (yy_buffer_stack_max) + grow_size;
15155bb9250eSAlex Richardson (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
15165bb9250eSAlex Richardson ((yy_buffer_stack),
15175bb9250eSAlex Richardson num_to_alloc * sizeof(struct yy_buffer_state*)
15185bb9250eSAlex Richardson );
15195bb9250eSAlex Richardson if ( ! (yy_buffer_stack) )
15205bb9250eSAlex Richardson YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
15215bb9250eSAlex Richardson
15225bb9250eSAlex Richardson /* zero only the new slots.*/
15235bb9250eSAlex Richardson memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
15245bb9250eSAlex Richardson (yy_buffer_stack_max) = num_to_alloc;
15255bb9250eSAlex Richardson }
15265bb9250eSAlex Richardson }
15275bb9250eSAlex Richardson
15285bb9250eSAlex Richardson /** Setup the input buffer state to scan directly from a user-specified character buffer.
15295bb9250eSAlex Richardson * @param base the character buffer
15305bb9250eSAlex Richardson * @param size the size in bytes of the character buffer
15315bb9250eSAlex Richardson *
15325bb9250eSAlex Richardson * @return the newly allocated buffer state object.
15335bb9250eSAlex Richardson */
yy_scan_buffer(char * base,yy_size_t size)15345bb9250eSAlex Richardson YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
15355bb9250eSAlex Richardson {
15365bb9250eSAlex Richardson YY_BUFFER_STATE b;
15375bb9250eSAlex Richardson
15385bb9250eSAlex Richardson if ( size < 2 ||
15395bb9250eSAlex Richardson base[size-2] != YY_END_OF_BUFFER_CHAR ||
15405bb9250eSAlex Richardson base[size-1] != YY_END_OF_BUFFER_CHAR )
15415bb9250eSAlex Richardson /* They forgot to leave room for the EOB's. */
1542*f8e57f89SAlex Richardson return NULL;
15435bb9250eSAlex Richardson
15445bb9250eSAlex Richardson b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
15455bb9250eSAlex Richardson if ( ! b )
15465bb9250eSAlex Richardson YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
15475bb9250eSAlex Richardson
1548*f8e57f89SAlex Richardson b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
15495bb9250eSAlex Richardson b->yy_buf_pos = b->yy_ch_buf = base;
15505bb9250eSAlex Richardson b->yy_is_our_buffer = 0;
1551*f8e57f89SAlex Richardson b->yy_input_file = NULL;
15525bb9250eSAlex Richardson b->yy_n_chars = b->yy_buf_size;
15535bb9250eSAlex Richardson b->yy_is_interactive = 0;
15545bb9250eSAlex Richardson b->yy_at_bol = 1;
15555bb9250eSAlex Richardson b->yy_fill_buffer = 0;
15565bb9250eSAlex Richardson b->yy_buffer_status = YY_BUFFER_NEW;
15575bb9250eSAlex Richardson
15585bb9250eSAlex Richardson yy_switch_to_buffer( b );
15595bb9250eSAlex Richardson
15605bb9250eSAlex Richardson return b;
15615bb9250eSAlex Richardson }
15625bb9250eSAlex Richardson
15635bb9250eSAlex Richardson /** Setup the input buffer state to scan a string. The next call to yylex() will
15645bb9250eSAlex Richardson * scan from a @e copy of @a str.
15655bb9250eSAlex Richardson * @param yystr a NUL-terminated string to scan
15665bb9250eSAlex Richardson *
15675bb9250eSAlex Richardson * @return the newly allocated buffer state object.
15685bb9250eSAlex Richardson * @note If you want to scan bytes that may contain NUL values, then use
15695bb9250eSAlex Richardson * yy_scan_bytes() instead.
15705bb9250eSAlex Richardson */
yy_scan_string(const char * yystr)1571*f8e57f89SAlex Richardson YY_BUFFER_STATE yy_scan_string (const char * yystr )
15725bb9250eSAlex Richardson {
15735bb9250eSAlex Richardson
1574*f8e57f89SAlex Richardson return yy_scan_bytes( yystr, (int) strlen(yystr) );
15755bb9250eSAlex Richardson }
15765bb9250eSAlex Richardson
15775bb9250eSAlex Richardson /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
15785bb9250eSAlex Richardson * scan from a @e copy of @a bytes.
15795bb9250eSAlex Richardson * @param yybytes the byte buffer to scan
15805bb9250eSAlex Richardson * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
15815bb9250eSAlex Richardson *
15825bb9250eSAlex Richardson * @return the newly allocated buffer state object.
15835bb9250eSAlex Richardson */
yy_scan_bytes(const char * yybytes,int _yybytes_len)1584*f8e57f89SAlex Richardson YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
15855bb9250eSAlex Richardson {
15865bb9250eSAlex Richardson YY_BUFFER_STATE b;
15875bb9250eSAlex Richardson char *buf;
15885bb9250eSAlex Richardson yy_size_t n;
1589*f8e57f89SAlex Richardson int i;
15905bb9250eSAlex Richardson
15915bb9250eSAlex Richardson /* Get memory for full buffer, including space for trailing EOB's. */
1592*f8e57f89SAlex Richardson n = (yy_size_t) (_yybytes_len + 2);
15935bb9250eSAlex Richardson buf = (char *) yyalloc( n );
15945bb9250eSAlex Richardson if ( ! buf )
15955bb9250eSAlex Richardson YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
15965bb9250eSAlex Richardson
15975bb9250eSAlex Richardson for ( i = 0; i < _yybytes_len; ++i )
15985bb9250eSAlex Richardson buf[i] = yybytes[i];
15995bb9250eSAlex Richardson
16005bb9250eSAlex Richardson buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
16015bb9250eSAlex Richardson
16025bb9250eSAlex Richardson b = yy_scan_buffer( buf, n );
16035bb9250eSAlex Richardson if ( ! b )
16045bb9250eSAlex Richardson YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
16055bb9250eSAlex Richardson
16065bb9250eSAlex Richardson /* It's okay to grow etc. this buffer, and we should throw it
16075bb9250eSAlex Richardson * away when we're done.
16085bb9250eSAlex Richardson */
16095bb9250eSAlex Richardson b->yy_is_our_buffer = 1;
16105bb9250eSAlex Richardson
16115bb9250eSAlex Richardson return b;
16125bb9250eSAlex Richardson }
16135bb9250eSAlex Richardson
16145bb9250eSAlex Richardson #ifndef YY_EXIT_FAILURE
16155bb9250eSAlex Richardson #define YY_EXIT_FAILURE 2
16165bb9250eSAlex Richardson #endif
16175bb9250eSAlex Richardson
yy_fatal_error(const char * msg)1618*f8e57f89SAlex Richardson static void yynoreturn yy_fatal_error (const char* msg )
16195bb9250eSAlex Richardson {
1620*f8e57f89SAlex Richardson fprintf( stderr, "%s\n", msg );
16215bb9250eSAlex Richardson exit( YY_EXIT_FAILURE );
16225bb9250eSAlex Richardson }
16235bb9250eSAlex Richardson
16245bb9250eSAlex Richardson /* Redefine yyless() so it works in section 3 code. */
16255bb9250eSAlex Richardson
16265bb9250eSAlex Richardson #undef yyless
16275bb9250eSAlex Richardson #define yyless(n) \
16285bb9250eSAlex Richardson do \
16295bb9250eSAlex Richardson { \
16305bb9250eSAlex Richardson /* Undo effects of setting up yytext. */ \
16315bb9250eSAlex Richardson int yyless_macro_arg = (n); \
16325bb9250eSAlex Richardson YY_LESS_LINENO(yyless_macro_arg);\
16335bb9250eSAlex Richardson yytext[yyleng] = (yy_hold_char); \
16345bb9250eSAlex Richardson (yy_c_buf_p) = yytext + yyless_macro_arg; \
16355bb9250eSAlex Richardson (yy_hold_char) = *(yy_c_buf_p); \
16365bb9250eSAlex Richardson *(yy_c_buf_p) = '\0'; \
16375bb9250eSAlex Richardson yyleng = yyless_macro_arg; \
16385bb9250eSAlex Richardson } \
16395bb9250eSAlex Richardson while ( 0 )
16405bb9250eSAlex Richardson
16415bb9250eSAlex Richardson /* Accessor methods (get/set functions) to struct members. */
16425bb9250eSAlex Richardson
16435bb9250eSAlex Richardson /** Get the current line number.
16445bb9250eSAlex Richardson *
16455bb9250eSAlex Richardson */
yyget_lineno(void)16465bb9250eSAlex Richardson int yyget_lineno (void)
16475bb9250eSAlex Richardson {
16485bb9250eSAlex Richardson
16495bb9250eSAlex Richardson return yylineno;
16505bb9250eSAlex Richardson }
16515bb9250eSAlex Richardson
16525bb9250eSAlex Richardson /** Get the input stream.
16535bb9250eSAlex Richardson *
16545bb9250eSAlex Richardson */
yyget_in(void)16555bb9250eSAlex Richardson FILE *yyget_in (void)
16565bb9250eSAlex Richardson {
16575bb9250eSAlex Richardson return yyin;
16585bb9250eSAlex Richardson }
16595bb9250eSAlex Richardson
16605bb9250eSAlex Richardson /** Get the output stream.
16615bb9250eSAlex Richardson *
16625bb9250eSAlex Richardson */
yyget_out(void)16635bb9250eSAlex Richardson FILE *yyget_out (void)
16645bb9250eSAlex Richardson {
16655bb9250eSAlex Richardson return yyout;
16665bb9250eSAlex Richardson }
16675bb9250eSAlex Richardson
16685bb9250eSAlex Richardson /** Get the length of the current token.
16695bb9250eSAlex Richardson *
16705bb9250eSAlex Richardson */
yyget_leng(void)1671*f8e57f89SAlex Richardson int yyget_leng (void)
16725bb9250eSAlex Richardson {
16735bb9250eSAlex Richardson return yyleng;
16745bb9250eSAlex Richardson }
16755bb9250eSAlex Richardson
16765bb9250eSAlex Richardson /** Get the current token.
16775bb9250eSAlex Richardson *
16785bb9250eSAlex Richardson */
16795bb9250eSAlex Richardson
yyget_text(void)16805bb9250eSAlex Richardson char *yyget_text (void)
16815bb9250eSAlex Richardson {
16825bb9250eSAlex Richardson return yytext;
16835bb9250eSAlex Richardson }
16845bb9250eSAlex Richardson
16855bb9250eSAlex Richardson /** Set the current line number.
1686*f8e57f89SAlex Richardson * @param _line_number line number
16875bb9250eSAlex Richardson *
16885bb9250eSAlex Richardson */
yyset_lineno(int _line_number)1689*f8e57f89SAlex Richardson void yyset_lineno (int _line_number )
16905bb9250eSAlex Richardson {
16915bb9250eSAlex Richardson
1692*f8e57f89SAlex Richardson yylineno = _line_number;
16935bb9250eSAlex Richardson }
16945bb9250eSAlex Richardson
16955bb9250eSAlex Richardson /** Set the input stream. This does not discard the current
16965bb9250eSAlex Richardson * input buffer.
1697*f8e57f89SAlex Richardson * @param _in_str A readable stream.
16985bb9250eSAlex Richardson *
16995bb9250eSAlex Richardson * @see yy_switch_to_buffer
17005bb9250eSAlex Richardson */
yyset_in(FILE * _in_str)1701*f8e57f89SAlex Richardson void yyset_in (FILE * _in_str )
17025bb9250eSAlex Richardson {
1703*f8e57f89SAlex Richardson yyin = _in_str ;
17045bb9250eSAlex Richardson }
17055bb9250eSAlex Richardson
yyset_out(FILE * _out_str)1706*f8e57f89SAlex Richardson void yyset_out (FILE * _out_str )
17075bb9250eSAlex Richardson {
1708*f8e57f89SAlex Richardson yyout = _out_str ;
17095bb9250eSAlex Richardson }
17105bb9250eSAlex Richardson
yyget_debug(void)17115bb9250eSAlex Richardson int yyget_debug (void)
17125bb9250eSAlex Richardson {
17135bb9250eSAlex Richardson return yy_flex_debug;
17145bb9250eSAlex Richardson }
17155bb9250eSAlex Richardson
yyset_debug(int _bdebug)1716*f8e57f89SAlex Richardson void yyset_debug (int _bdebug )
17175bb9250eSAlex Richardson {
1718*f8e57f89SAlex Richardson yy_flex_debug = _bdebug ;
17195bb9250eSAlex Richardson }
17205bb9250eSAlex Richardson
yy_init_globals(void)17215bb9250eSAlex Richardson static int yy_init_globals (void)
17225bb9250eSAlex Richardson {
17235bb9250eSAlex Richardson /* Initialization is the same as for the non-reentrant scanner.
17245bb9250eSAlex Richardson * This function is called from yylex_destroy(), so don't allocate here.
17255bb9250eSAlex Richardson */
17265bb9250eSAlex Richardson
1727*f8e57f89SAlex Richardson (yy_buffer_stack) = NULL;
17285bb9250eSAlex Richardson (yy_buffer_stack_top) = 0;
17295bb9250eSAlex Richardson (yy_buffer_stack_max) = 0;
1730*f8e57f89SAlex Richardson (yy_c_buf_p) = NULL;
17315bb9250eSAlex Richardson (yy_init) = 0;
17325bb9250eSAlex Richardson (yy_start) = 0;
17335bb9250eSAlex Richardson
17345bb9250eSAlex Richardson /* Defined in main.c */
17355bb9250eSAlex Richardson #ifdef YY_STDINIT
17365bb9250eSAlex Richardson yyin = stdin;
17375bb9250eSAlex Richardson yyout = stdout;
17385bb9250eSAlex Richardson #else
1739*f8e57f89SAlex Richardson yyin = NULL;
1740*f8e57f89SAlex Richardson yyout = NULL;
17415bb9250eSAlex Richardson #endif
17425bb9250eSAlex Richardson
17435bb9250eSAlex Richardson /* For future reference: Set errno on error, since we are called by
17445bb9250eSAlex Richardson * yylex_init()
17455bb9250eSAlex Richardson */
17465bb9250eSAlex Richardson return 0;
17475bb9250eSAlex Richardson }
17485bb9250eSAlex Richardson
17495bb9250eSAlex Richardson /* yylex_destroy is for both reentrant and non-reentrant scanners. */
yylex_destroy(void)17505bb9250eSAlex Richardson int yylex_destroy (void)
17515bb9250eSAlex Richardson {
17525bb9250eSAlex Richardson
17535bb9250eSAlex Richardson /* Pop the buffer stack, destroying each element. */
17545bb9250eSAlex Richardson while(YY_CURRENT_BUFFER){
17555bb9250eSAlex Richardson yy_delete_buffer( YY_CURRENT_BUFFER );
17565bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = NULL;
17575bb9250eSAlex Richardson yypop_buffer_state();
17585bb9250eSAlex Richardson }
17595bb9250eSAlex Richardson
17605bb9250eSAlex Richardson /* Destroy the stack itself. */
17615bb9250eSAlex Richardson yyfree((yy_buffer_stack) );
17625bb9250eSAlex Richardson (yy_buffer_stack) = NULL;
17635bb9250eSAlex Richardson
17645bb9250eSAlex Richardson /* Reset the globals. This is important in a non-reentrant scanner so the next time
17655bb9250eSAlex Richardson * yylex() is called, initialization will occur. */
17665bb9250eSAlex Richardson yy_init_globals( );
17675bb9250eSAlex Richardson
17685bb9250eSAlex Richardson return 0;
17695bb9250eSAlex Richardson }
17705bb9250eSAlex Richardson
17715bb9250eSAlex Richardson /*
17725bb9250eSAlex Richardson * Internal utility routines.
17735bb9250eSAlex Richardson */
17745bb9250eSAlex Richardson
17755bb9250eSAlex Richardson #ifndef yytext_ptr
yy_flex_strncpy(char * s1,const char * s2,int n)1776*f8e57f89SAlex Richardson static void yy_flex_strncpy (char* s1, const char * s2, int n )
17775bb9250eSAlex Richardson {
1778*f8e57f89SAlex Richardson
17795bb9250eSAlex Richardson int i;
17805bb9250eSAlex Richardson for ( i = 0; i < n; ++i )
17815bb9250eSAlex Richardson s1[i] = s2[i];
17825bb9250eSAlex Richardson }
17835bb9250eSAlex Richardson #endif
17845bb9250eSAlex Richardson
17855bb9250eSAlex Richardson #ifdef YY_NEED_STRLEN
yy_flex_strlen(const char * s)1786*f8e57f89SAlex Richardson static int yy_flex_strlen (const char * s )
17875bb9250eSAlex Richardson {
17885bb9250eSAlex Richardson int n;
17895bb9250eSAlex Richardson for ( n = 0; s[n]; ++n )
17905bb9250eSAlex Richardson ;
17915bb9250eSAlex Richardson
17925bb9250eSAlex Richardson return n;
17935bb9250eSAlex Richardson }
17945bb9250eSAlex Richardson #endif
17955bb9250eSAlex Richardson
yyalloc(yy_size_t size)17965bb9250eSAlex Richardson void *yyalloc (yy_size_t size )
17975bb9250eSAlex Richardson {
1798*f8e57f89SAlex Richardson return malloc(size);
17995bb9250eSAlex Richardson }
18005bb9250eSAlex Richardson
yyrealloc(void * ptr,yy_size_t size)18015bb9250eSAlex Richardson void *yyrealloc (void * ptr, yy_size_t size )
18025bb9250eSAlex Richardson {
1803*f8e57f89SAlex Richardson
18045bb9250eSAlex Richardson /* The cast to (char *) in the following accommodates both
18055bb9250eSAlex Richardson * implementations that use char* generic pointers, and those
18065bb9250eSAlex Richardson * that use void* generic pointers. It works with the latter
18075bb9250eSAlex Richardson * because both ANSI C and C++ allow castless assignment from
18085bb9250eSAlex Richardson * any pointer type to void*, and deal with argument conversions
18095bb9250eSAlex Richardson * as though doing an assignment.
18105bb9250eSAlex Richardson */
1811*f8e57f89SAlex Richardson return realloc(ptr, size);
18125bb9250eSAlex Richardson }
18135bb9250eSAlex Richardson
yyfree(void * ptr)18145bb9250eSAlex Richardson void yyfree (void * ptr )
18155bb9250eSAlex Richardson {
18165bb9250eSAlex Richardson free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
18175bb9250eSAlex Richardson }
18185bb9250eSAlex Richardson
18195bb9250eSAlex Richardson #define YYTABLES_NAME "yytables"
18205bb9250eSAlex Richardson
1821*f8e57f89SAlex Richardson #line 67 "tokenizer.l"
18225bb9250eSAlex Richardson
18235bb9250eSAlex Richardson
18245bb9250eSAlex Richardson int32_t
number(void)18255bb9250eSAlex Richardson number(void)
18265bb9250eSAlex Richardson {
18275bb9250eSAlex Richardson long l;
18285bb9250eSAlex Richardson
18295bb9250eSAlex Richardson errno = 0;
18305bb9250eSAlex Richardson l = strtol(yytext, NULL, 0);
18315bb9250eSAlex Richardson if (((l == LONG_MAX || l == LONG_MIN) && errno == ERANGE) ||
18325bb9250eSAlex Richardson l > INT32_MAX || l < INT32_MIN) {
18335bb9250eSAlex Richardson m4_warnx("numeric overflow in expr: %s", yytext);
18345bb9250eSAlex Richardson }
18355bb9250eSAlex Richardson return l;
18365bb9250eSAlex Richardson }
18375bb9250eSAlex Richardson
18385bb9250eSAlex Richardson int32_t
parse_radix(void)18395bb9250eSAlex Richardson parse_radix(void)
18405bb9250eSAlex Richardson {
18415bb9250eSAlex Richardson long base;
18425bb9250eSAlex Richardson char *next;
18435bb9250eSAlex Richardson long l;
18445bb9250eSAlex Richardson int d;
18455bb9250eSAlex Richardson
18465bb9250eSAlex Richardson l = 0;
18475bb9250eSAlex Richardson base = strtol(yytext+2, &next, 0);
18485bb9250eSAlex Richardson if (base > 36 || next == NULL) {
18495bb9250eSAlex Richardson m4_warnx("error in number %s", yytext);
18505bb9250eSAlex Richardson } else {
18515bb9250eSAlex Richardson next++;
18525bb9250eSAlex Richardson while (*next != 0) {
18535bb9250eSAlex Richardson if (*next >= '0' && *next <= '9')
18545bb9250eSAlex Richardson d = *next - '0';
18555bb9250eSAlex Richardson else if (*next >= 'a' && *next <= 'z')
18565bb9250eSAlex Richardson d = *next - 'a' + 10;
18575bb9250eSAlex Richardson else {
18585bb9250eSAlex Richardson assert(*next >= 'A' && *next <= 'Z');
18595bb9250eSAlex Richardson d = *next - 'A' + 10;
18605bb9250eSAlex Richardson }
18615bb9250eSAlex Richardson if (d >= base) {
18625bb9250eSAlex Richardson m4_warnx("error in number %s", yytext);
18635bb9250eSAlex Richardson return 0;
18645bb9250eSAlex Richardson }
18655bb9250eSAlex Richardson l = base * l + d;
18665bb9250eSAlex Richardson next++;
18675bb9250eSAlex Richardson }
18685bb9250eSAlex Richardson }
18695bb9250eSAlex Richardson return l;
18705bb9250eSAlex Richardson }
18715bb9250eSAlex Richardson
18725bb9250eSAlex Richardson
1873