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 * $FreeBSD$ 4875bb9250eSAlex Richardson */ 4885bb9250eSAlex Richardson #include "parser.h" 4895bb9250eSAlex Richardson #include <assert.h> 4905bb9250eSAlex Richardson #include <stdlib.h> 4915bb9250eSAlex Richardson #include <errno.h> 4925bb9250eSAlex Richardson #include <stdint.h> 4935bb9250eSAlex Richardson #include <limits.h> 4945bb9250eSAlex Richardson 4955bb9250eSAlex Richardson extern void m4_warnx(const char *, ...); 4965bb9250eSAlex Richardson extern int mimic_gnu; 4975bb9250eSAlex Richardson extern int32_t yylval; 4985bb9250eSAlex Richardson 4995bb9250eSAlex Richardson int32_t number(void); 5005bb9250eSAlex Richardson int32_t parse_radix(void); 5015bb9250eSAlex Richardson extern int yylex(void); 5025bb9250eSAlex Richardson 5035bb9250eSAlex Richardson #define YY_DECL int yylex(void) 504*f8e57f89SAlex Richardson #line 504 "tokenizer.c" 505*f8e57f89SAlex Richardson #line 505 "tokenizer.c" 5065bb9250eSAlex Richardson 5075bb9250eSAlex Richardson #define INITIAL 0 5085bb9250eSAlex Richardson 5095bb9250eSAlex Richardson #ifndef YY_NO_UNISTD_H 5105bb9250eSAlex Richardson /* Special case for "unistd.h", since it is non-ANSI. We include it way 5115bb9250eSAlex Richardson * down here because we want the user's section 1 to have been scanned first. 5125bb9250eSAlex Richardson * The user has a chance to override it with an option. 5135bb9250eSAlex Richardson */ 5145bb9250eSAlex Richardson #include <unistd.h> 5155bb9250eSAlex Richardson #endif 5165bb9250eSAlex Richardson 5175bb9250eSAlex Richardson #ifndef YY_EXTRA_TYPE 5185bb9250eSAlex Richardson #define YY_EXTRA_TYPE void * 5195bb9250eSAlex Richardson #endif 5205bb9250eSAlex Richardson 5215bb9250eSAlex Richardson static int yy_init_globals ( void ); 5225bb9250eSAlex Richardson 5235bb9250eSAlex Richardson /* Accessor methods to globals. 5245bb9250eSAlex Richardson These are made visible to non-reentrant scanners for convenience. */ 5255bb9250eSAlex Richardson 5265bb9250eSAlex Richardson int yylex_destroy ( void ); 5275bb9250eSAlex Richardson 5285bb9250eSAlex Richardson int yyget_debug ( void ); 5295bb9250eSAlex Richardson 5305bb9250eSAlex Richardson void yyset_debug ( int debug_flag ); 5315bb9250eSAlex Richardson 5325bb9250eSAlex Richardson YY_EXTRA_TYPE yyget_extra ( void ); 5335bb9250eSAlex Richardson 5345bb9250eSAlex Richardson void yyset_extra ( YY_EXTRA_TYPE user_defined ); 5355bb9250eSAlex Richardson 5365bb9250eSAlex Richardson FILE *yyget_in ( void ); 5375bb9250eSAlex Richardson 538*f8e57f89SAlex Richardson void yyset_in ( FILE * _in_str ); 5395bb9250eSAlex Richardson 5405bb9250eSAlex Richardson FILE *yyget_out ( void ); 5415bb9250eSAlex Richardson 542*f8e57f89SAlex Richardson void yyset_out ( FILE * _out_str ); 5435bb9250eSAlex Richardson 544*f8e57f89SAlex Richardson int yyget_leng ( void ); 5455bb9250eSAlex Richardson 5465bb9250eSAlex Richardson char *yyget_text ( void ); 5475bb9250eSAlex Richardson 5485bb9250eSAlex Richardson int yyget_lineno ( void ); 5495bb9250eSAlex Richardson 550*f8e57f89SAlex Richardson void yyset_lineno ( int _line_number ); 5515bb9250eSAlex Richardson 5525bb9250eSAlex Richardson /* Macros after this point can all be overridden by user definitions in 5535bb9250eSAlex Richardson * section 1. 5545bb9250eSAlex Richardson */ 5555bb9250eSAlex Richardson 5565bb9250eSAlex Richardson #ifndef YY_SKIP_YYWRAP 5575bb9250eSAlex Richardson #ifdef __cplusplus 5585bb9250eSAlex Richardson extern "C" int yywrap ( void ); 5595bb9250eSAlex Richardson #else 5605bb9250eSAlex Richardson extern int yywrap ( void ); 5615bb9250eSAlex Richardson #endif 5625bb9250eSAlex Richardson #endif 5635bb9250eSAlex Richardson 564*f8e57f89SAlex Richardson #ifndef YY_NO_UNPUT 565*f8e57f89SAlex Richardson 566*f8e57f89SAlex Richardson #endif 567*f8e57f89SAlex Richardson 5685bb9250eSAlex Richardson #ifndef yytext_ptr 569*f8e57f89SAlex Richardson static void yy_flex_strncpy ( char *, const char *, int ); 5705bb9250eSAlex Richardson #endif 5715bb9250eSAlex Richardson 5725bb9250eSAlex Richardson #ifdef YY_NEED_STRLEN 573*f8e57f89SAlex Richardson static int yy_flex_strlen ( const char * ); 5745bb9250eSAlex Richardson #endif 5755bb9250eSAlex Richardson 5765bb9250eSAlex Richardson #ifndef YY_NO_INPUT 5775bb9250eSAlex Richardson #ifdef __cplusplus 5785bb9250eSAlex Richardson static int yyinput ( void ); 5795bb9250eSAlex Richardson #else 5805bb9250eSAlex Richardson static int input ( void ); 5815bb9250eSAlex Richardson #endif 5825bb9250eSAlex Richardson 5835bb9250eSAlex Richardson #endif 5845bb9250eSAlex Richardson 5855bb9250eSAlex Richardson /* Amount of stuff to slurp up with each read. */ 5865bb9250eSAlex Richardson #ifndef YY_READ_BUF_SIZE 587*f8e57f89SAlex Richardson #ifdef __ia64__ 588*f8e57f89SAlex Richardson /* On IA-64, the buffer size is 16k, not 8k */ 589*f8e57f89SAlex Richardson #define YY_READ_BUF_SIZE 16384 590*f8e57f89SAlex Richardson #else 5915bb9250eSAlex Richardson #define YY_READ_BUF_SIZE 8192 592*f8e57f89SAlex Richardson #endif /* __ia64__ */ 5935bb9250eSAlex Richardson #endif 5945bb9250eSAlex Richardson 5955bb9250eSAlex Richardson /* Copy whatever the last rule matched to the standard output. */ 5965bb9250eSAlex Richardson #ifndef ECHO 5975bb9250eSAlex Richardson /* This used to be an fputs(), but since the string might contain NUL's, 5985bb9250eSAlex Richardson * we now use fwrite(). 5995bb9250eSAlex Richardson */ 600*f8e57f89SAlex Richardson #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) 6015bb9250eSAlex Richardson #endif 6025bb9250eSAlex Richardson 6035bb9250eSAlex Richardson /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 6045bb9250eSAlex Richardson * is returned in "result". 6055bb9250eSAlex Richardson */ 6065bb9250eSAlex Richardson #ifndef YY_INPUT 6075bb9250eSAlex Richardson #define YY_INPUT(buf,result,max_size) \ 6085bb9250eSAlex Richardson if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 6095bb9250eSAlex Richardson { \ 6105bb9250eSAlex Richardson int c = '*'; \ 611*f8e57f89SAlex Richardson int n; \ 6125bb9250eSAlex Richardson for ( n = 0; n < max_size && \ 6135bb9250eSAlex Richardson (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 6145bb9250eSAlex Richardson buf[n] = (char) c; \ 6155bb9250eSAlex Richardson if ( c == '\n' ) \ 6165bb9250eSAlex Richardson buf[n++] = (char) c; \ 6175bb9250eSAlex Richardson if ( c == EOF && ferror( yyin ) ) \ 6185bb9250eSAlex Richardson YY_FATAL_ERROR( "input in flex scanner failed" ); \ 6195bb9250eSAlex Richardson result = n; \ 6205bb9250eSAlex Richardson } \ 6215bb9250eSAlex Richardson else \ 6225bb9250eSAlex Richardson { \ 6235bb9250eSAlex Richardson errno=0; \ 624*f8e57f89SAlex Richardson while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ 6255bb9250eSAlex Richardson { \ 6265bb9250eSAlex Richardson if( errno != EINTR) \ 6275bb9250eSAlex Richardson { \ 6285bb9250eSAlex Richardson YY_FATAL_ERROR( "input in flex scanner failed" ); \ 6295bb9250eSAlex Richardson break; \ 6305bb9250eSAlex Richardson } \ 6315bb9250eSAlex Richardson errno=0; \ 6325bb9250eSAlex Richardson clearerr(yyin); \ 6335bb9250eSAlex Richardson } \ 6345bb9250eSAlex Richardson }\ 6355bb9250eSAlex Richardson \ 6365bb9250eSAlex Richardson 6375bb9250eSAlex Richardson #endif 6385bb9250eSAlex Richardson 6395bb9250eSAlex Richardson /* No semi-colon after return; correct usage is to write "yyterminate();" - 6405bb9250eSAlex Richardson * we don't want an extra ';' after the "return" because that will cause 6415bb9250eSAlex Richardson * some compilers to complain about unreachable statements. 6425bb9250eSAlex Richardson */ 6435bb9250eSAlex Richardson #ifndef yyterminate 6445bb9250eSAlex Richardson #define yyterminate() return YY_NULL 6455bb9250eSAlex Richardson #endif 6465bb9250eSAlex Richardson 6475bb9250eSAlex Richardson /* Number of entries by which start-condition stack grows. */ 6485bb9250eSAlex Richardson #ifndef YY_START_STACK_INCR 6495bb9250eSAlex Richardson #define YY_START_STACK_INCR 25 6505bb9250eSAlex Richardson #endif 6515bb9250eSAlex Richardson 6525bb9250eSAlex Richardson /* Report a fatal error. */ 6535bb9250eSAlex Richardson #ifndef YY_FATAL_ERROR 6545bb9250eSAlex Richardson #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 6555bb9250eSAlex Richardson #endif 6565bb9250eSAlex Richardson 6575bb9250eSAlex Richardson /* end tables serialization structures and prototypes */ 6585bb9250eSAlex Richardson 6595bb9250eSAlex Richardson /* Default declaration of generated scanner - a define so the user can 6605bb9250eSAlex Richardson * easily add parameters. 6615bb9250eSAlex Richardson */ 6625bb9250eSAlex Richardson #ifndef YY_DECL 6635bb9250eSAlex Richardson #define YY_DECL_IS_OURS 1 6645bb9250eSAlex Richardson 6655bb9250eSAlex Richardson extern int yylex (void); 6665bb9250eSAlex Richardson 6675bb9250eSAlex Richardson #define YY_DECL int yylex (void) 6685bb9250eSAlex Richardson #endif /* !YY_DECL */ 6695bb9250eSAlex Richardson 6705bb9250eSAlex Richardson /* Code executed at the beginning of each rule, after yytext and yyleng 6715bb9250eSAlex Richardson * have been set up. 6725bb9250eSAlex Richardson */ 6735bb9250eSAlex Richardson #ifndef YY_USER_ACTION 6745bb9250eSAlex Richardson #define YY_USER_ACTION 6755bb9250eSAlex Richardson #endif 6765bb9250eSAlex Richardson 6775bb9250eSAlex Richardson /* Code executed at the end of each rule. */ 6785bb9250eSAlex Richardson #ifndef YY_BREAK 679*f8e57f89SAlex Richardson #define YY_BREAK /*LINTED*/break; 6805bb9250eSAlex Richardson #endif 6815bb9250eSAlex Richardson 6825bb9250eSAlex Richardson #define YY_RULE_SETUP \ 6835bb9250eSAlex Richardson YY_USER_ACTION 6845bb9250eSAlex Richardson 6855bb9250eSAlex Richardson /** The main scanner function which does all the work. 6865bb9250eSAlex Richardson */ 6875bb9250eSAlex Richardson YY_DECL 6885bb9250eSAlex Richardson { 6895bb9250eSAlex Richardson yy_state_type yy_current_state; 6905bb9250eSAlex Richardson char *yy_cp, *yy_bp; 6915bb9250eSAlex Richardson int yy_act; 6925bb9250eSAlex Richardson 6935bb9250eSAlex Richardson if ( !(yy_init) ) 6945bb9250eSAlex Richardson { 6955bb9250eSAlex Richardson (yy_init) = 1; 6965bb9250eSAlex Richardson 6975bb9250eSAlex Richardson #ifdef YY_USER_INIT 6985bb9250eSAlex Richardson YY_USER_INIT; 6995bb9250eSAlex Richardson #endif 7005bb9250eSAlex Richardson 7015bb9250eSAlex Richardson if ( ! (yy_start) ) 7025bb9250eSAlex Richardson (yy_start) = 1; /* first start state */ 7035bb9250eSAlex Richardson 7045bb9250eSAlex Richardson if ( ! yyin ) 7055bb9250eSAlex Richardson yyin = stdin; 7065bb9250eSAlex Richardson 7075bb9250eSAlex Richardson if ( ! yyout ) 7085bb9250eSAlex Richardson yyout = stdout; 7095bb9250eSAlex Richardson 7105bb9250eSAlex Richardson if ( ! YY_CURRENT_BUFFER ) { 7115bb9250eSAlex Richardson yyensure_buffer_stack (); 7125bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = 7135bb9250eSAlex Richardson yy_create_buffer( yyin, YY_BUF_SIZE ); 7145bb9250eSAlex Richardson } 7155bb9250eSAlex Richardson 7165bb9250eSAlex Richardson yy_load_buffer_state( ); 7175bb9250eSAlex Richardson } 7185bb9250eSAlex Richardson 719*f8e57f89SAlex Richardson { 720*f8e57f89SAlex Richardson #line 48 "tokenizer.l" 721*f8e57f89SAlex Richardson 722*f8e57f89SAlex Richardson #line 722 "tokenizer.c" 723*f8e57f89SAlex Richardson 724*f8e57f89SAlex Richardson while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ 7255bb9250eSAlex Richardson { 7265bb9250eSAlex Richardson yy_cp = (yy_c_buf_p); 7275bb9250eSAlex Richardson 7285bb9250eSAlex Richardson /* Support of yytext. */ 7295bb9250eSAlex Richardson *yy_cp = (yy_hold_char); 7305bb9250eSAlex Richardson 7315bb9250eSAlex Richardson /* yy_bp points to the position in yy_ch_buf of the start of 7325bb9250eSAlex Richardson * the current run. 7335bb9250eSAlex Richardson */ 7345bb9250eSAlex Richardson yy_bp = yy_cp; 7355bb9250eSAlex Richardson 7365bb9250eSAlex Richardson yy_current_state = (yy_start); 7375bb9250eSAlex Richardson yy_match: 7385bb9250eSAlex Richardson do 7395bb9250eSAlex Richardson { 7405bb9250eSAlex Richardson YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; 7415bb9250eSAlex Richardson if ( yy_accept[yy_current_state] ) 7425bb9250eSAlex Richardson { 7435bb9250eSAlex Richardson (yy_last_accepting_state) = yy_current_state; 7445bb9250eSAlex Richardson (yy_last_accepting_cpos) = yy_cp; 7455bb9250eSAlex Richardson } 7465bb9250eSAlex Richardson while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 7475bb9250eSAlex Richardson { 7485bb9250eSAlex Richardson yy_current_state = (int) yy_def[yy_current_state]; 7495bb9250eSAlex Richardson if ( yy_current_state >= 35 ) 750*f8e57f89SAlex Richardson yy_c = yy_meta[yy_c]; 7515bb9250eSAlex Richardson } 752*f8e57f89SAlex Richardson yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; 7535bb9250eSAlex Richardson ++yy_cp; 7545bb9250eSAlex Richardson } 7555bb9250eSAlex Richardson while ( yy_base[yy_current_state] != 49 ); 7565bb9250eSAlex Richardson 7575bb9250eSAlex Richardson yy_find_action: 7585bb9250eSAlex Richardson yy_act = yy_accept[yy_current_state]; 7595bb9250eSAlex Richardson if ( yy_act == 0 ) 7605bb9250eSAlex Richardson { /* have to back up */ 7615bb9250eSAlex Richardson yy_cp = (yy_last_accepting_cpos); 7625bb9250eSAlex Richardson yy_current_state = (yy_last_accepting_state); 7635bb9250eSAlex Richardson yy_act = yy_accept[yy_current_state]; 7645bb9250eSAlex Richardson } 7655bb9250eSAlex Richardson 7665bb9250eSAlex Richardson YY_DO_BEFORE_ACTION; 7675bb9250eSAlex Richardson 7685bb9250eSAlex Richardson do_action: /* This label is used only to access EOF actions. */ 7695bb9250eSAlex Richardson 7705bb9250eSAlex Richardson switch ( yy_act ) 7715bb9250eSAlex Richardson { /* beginning of action switch */ 7725bb9250eSAlex Richardson case 0: /* must back up */ 7735bb9250eSAlex Richardson /* undo the effects of YY_DO_BEFORE_ACTION */ 7745bb9250eSAlex Richardson *yy_cp = (yy_hold_char); 7755bb9250eSAlex Richardson yy_cp = (yy_last_accepting_cpos); 7765bb9250eSAlex Richardson yy_current_state = (yy_last_accepting_state); 7775bb9250eSAlex Richardson goto yy_find_action; 7785bb9250eSAlex Richardson 7795bb9250eSAlex Richardson case 1: 7805bb9250eSAlex Richardson /* rule 1 can match eol */ 7815bb9250eSAlex Richardson YY_RULE_SETUP 782*f8e57f89SAlex Richardson #line 49 "tokenizer.l" 7835bb9250eSAlex Richardson {/* just skip it */} 7845bb9250eSAlex Richardson YY_BREAK 7855bb9250eSAlex Richardson case 2: 7865bb9250eSAlex Richardson YY_RULE_SETUP 787*f8e57f89SAlex Richardson #line 50 "tokenizer.l" 7885bb9250eSAlex Richardson { yylval = number(); return(NUMBER); } 7895bb9250eSAlex Richardson YY_BREAK 7905bb9250eSAlex Richardson case 3: 7915bb9250eSAlex Richardson YY_RULE_SETUP 792*f8e57f89SAlex Richardson #line 51 "tokenizer.l" 7935bb9250eSAlex Richardson { if (mimic_gnu) { 7945bb9250eSAlex Richardson yylval = parse_radix(); return(NUMBER); 7955bb9250eSAlex Richardson } else { 7965bb9250eSAlex Richardson return(ERROR); 7975bb9250eSAlex Richardson } 7985bb9250eSAlex Richardson } 7995bb9250eSAlex Richardson YY_BREAK 8005bb9250eSAlex Richardson case 4: 8015bb9250eSAlex Richardson YY_RULE_SETUP 802*f8e57f89SAlex Richardson #line 57 "tokenizer.l" 8035bb9250eSAlex Richardson { return(LE); } 8045bb9250eSAlex Richardson YY_BREAK 8055bb9250eSAlex Richardson case 5: 8065bb9250eSAlex Richardson YY_RULE_SETUP 807*f8e57f89SAlex Richardson #line 58 "tokenizer.l" 8085bb9250eSAlex Richardson { return(GE); } 8095bb9250eSAlex Richardson YY_BREAK 8105bb9250eSAlex Richardson case 6: 8115bb9250eSAlex Richardson YY_RULE_SETUP 812*f8e57f89SAlex Richardson #line 59 "tokenizer.l" 8135bb9250eSAlex Richardson { return(LSHIFT); } 8145bb9250eSAlex Richardson YY_BREAK 8155bb9250eSAlex Richardson case 7: 8165bb9250eSAlex Richardson YY_RULE_SETUP 817*f8e57f89SAlex Richardson #line 60 "tokenizer.l" 8185bb9250eSAlex Richardson { return(RSHIFT); } 8195bb9250eSAlex Richardson YY_BREAK 8205bb9250eSAlex Richardson case 8: 8215bb9250eSAlex Richardson YY_RULE_SETUP 822*f8e57f89SAlex Richardson #line 61 "tokenizer.l" 8235bb9250eSAlex Richardson { return(EQ); } 8245bb9250eSAlex Richardson YY_BREAK 8255bb9250eSAlex Richardson case 9: 8265bb9250eSAlex Richardson YY_RULE_SETUP 827*f8e57f89SAlex Richardson #line 62 "tokenizer.l" 8285bb9250eSAlex Richardson { return(NE); } 8295bb9250eSAlex Richardson YY_BREAK 8305bb9250eSAlex Richardson case 10: 8315bb9250eSAlex Richardson YY_RULE_SETUP 832*f8e57f89SAlex Richardson #line 63 "tokenizer.l" 8335bb9250eSAlex Richardson { return(LAND); } 8345bb9250eSAlex Richardson YY_BREAK 8355bb9250eSAlex Richardson case 11: 8365bb9250eSAlex Richardson YY_RULE_SETUP 837*f8e57f89SAlex Richardson #line 64 "tokenizer.l" 8385bb9250eSAlex Richardson { return(LOR); } 8395bb9250eSAlex Richardson YY_BREAK 8405bb9250eSAlex Richardson case 12: 8415bb9250eSAlex Richardson YY_RULE_SETUP 842*f8e57f89SAlex Richardson #line 65 "tokenizer.l" 8435bb9250eSAlex Richardson { if (mimic_gnu) { return (EXPONENT); } } 8445bb9250eSAlex Richardson YY_BREAK 8455bb9250eSAlex Richardson case 13: 8465bb9250eSAlex Richardson YY_RULE_SETUP 847*f8e57f89SAlex Richardson #line 66 "tokenizer.l" 8485bb9250eSAlex Richardson { return yytext[0]; } 8495bb9250eSAlex Richardson YY_BREAK 8505bb9250eSAlex Richardson case 14: 8515bb9250eSAlex Richardson YY_RULE_SETUP 852*f8e57f89SAlex Richardson #line 67 "tokenizer.l" 8535bb9250eSAlex Richardson ECHO; 8545bb9250eSAlex Richardson YY_BREAK 855*f8e57f89SAlex Richardson #line 855 "tokenizer.c" 8565bb9250eSAlex Richardson case YY_STATE_EOF(INITIAL): 8575bb9250eSAlex Richardson yyterminate(); 8585bb9250eSAlex Richardson 8595bb9250eSAlex Richardson case YY_END_OF_BUFFER: 8605bb9250eSAlex Richardson { 8615bb9250eSAlex Richardson /* Amount of text matched not including the EOB char. */ 8625bb9250eSAlex Richardson int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; 8635bb9250eSAlex Richardson 8645bb9250eSAlex Richardson /* Undo the effects of YY_DO_BEFORE_ACTION. */ 8655bb9250eSAlex Richardson *yy_cp = (yy_hold_char); 8665bb9250eSAlex Richardson YY_RESTORE_YY_MORE_OFFSET 8675bb9250eSAlex Richardson 8685bb9250eSAlex Richardson if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) 8695bb9250eSAlex Richardson { 8705bb9250eSAlex Richardson /* We're scanning a new file or input source. It's 8715bb9250eSAlex Richardson * possible that this happened because the user 8725bb9250eSAlex Richardson * just pointed yyin at a new source and called 8735bb9250eSAlex Richardson * yylex(). If so, then we have to assure 8745bb9250eSAlex Richardson * consistency between YY_CURRENT_BUFFER and our 8755bb9250eSAlex Richardson * globals. Here is the right place to do so, because 8765bb9250eSAlex Richardson * this is the first action (other than possibly a 8775bb9250eSAlex Richardson * back-up) that will match for the new input source. 8785bb9250eSAlex Richardson */ 8795bb9250eSAlex Richardson (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 8805bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; 8815bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; 8825bb9250eSAlex Richardson } 8835bb9250eSAlex Richardson 8845bb9250eSAlex Richardson /* Note that here we test for yy_c_buf_p "<=" to the position 8855bb9250eSAlex Richardson * of the first EOB in the buffer, since yy_c_buf_p will 8865bb9250eSAlex Richardson * already have been incremented past the NUL character 8875bb9250eSAlex Richardson * (since all states make transitions on EOB to the 8885bb9250eSAlex Richardson * end-of-buffer state). Contrast this with the test 8895bb9250eSAlex Richardson * in input(). 8905bb9250eSAlex Richardson */ 8915bb9250eSAlex Richardson if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 8925bb9250eSAlex Richardson { /* This was really a NUL. */ 8935bb9250eSAlex Richardson yy_state_type yy_next_state; 8945bb9250eSAlex Richardson 8955bb9250eSAlex Richardson (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; 8965bb9250eSAlex Richardson 8975bb9250eSAlex Richardson yy_current_state = yy_get_previous_state( ); 8985bb9250eSAlex Richardson 8995bb9250eSAlex Richardson /* Okay, we're now positioned to make the NUL 9005bb9250eSAlex Richardson * transition. We couldn't have 9015bb9250eSAlex Richardson * yy_get_previous_state() go ahead and do it 9025bb9250eSAlex Richardson * for us because it doesn't know how to deal 9035bb9250eSAlex Richardson * with the possibility of jamming (and we don't 9045bb9250eSAlex Richardson * want to build jamming into it because then it 9055bb9250eSAlex Richardson * will run more slowly). 9065bb9250eSAlex Richardson */ 9075bb9250eSAlex Richardson 9085bb9250eSAlex Richardson yy_next_state = yy_try_NUL_trans( yy_current_state ); 9095bb9250eSAlex Richardson 9105bb9250eSAlex Richardson yy_bp = (yytext_ptr) + YY_MORE_ADJ; 9115bb9250eSAlex Richardson 9125bb9250eSAlex Richardson if ( yy_next_state ) 9135bb9250eSAlex Richardson { 9145bb9250eSAlex Richardson /* Consume the NUL. */ 9155bb9250eSAlex Richardson yy_cp = ++(yy_c_buf_p); 9165bb9250eSAlex Richardson yy_current_state = yy_next_state; 9175bb9250eSAlex Richardson goto yy_match; 9185bb9250eSAlex Richardson } 9195bb9250eSAlex Richardson 9205bb9250eSAlex Richardson else 9215bb9250eSAlex Richardson { 9225bb9250eSAlex Richardson yy_cp = (yy_c_buf_p); 9235bb9250eSAlex Richardson goto yy_find_action; 9245bb9250eSAlex Richardson } 9255bb9250eSAlex Richardson } 9265bb9250eSAlex Richardson 9275bb9250eSAlex Richardson else switch ( yy_get_next_buffer( ) ) 9285bb9250eSAlex Richardson { 9295bb9250eSAlex Richardson case EOB_ACT_END_OF_FILE: 9305bb9250eSAlex Richardson { 9315bb9250eSAlex Richardson (yy_did_buffer_switch_on_eof) = 0; 9325bb9250eSAlex Richardson 9335bb9250eSAlex Richardson if ( yywrap( ) ) 9345bb9250eSAlex Richardson { 9355bb9250eSAlex Richardson /* Note: because we've taken care in 9365bb9250eSAlex Richardson * yy_get_next_buffer() to have set up 9375bb9250eSAlex Richardson * yytext, we can now set up 9385bb9250eSAlex Richardson * yy_c_buf_p so that if some total 9395bb9250eSAlex Richardson * hoser (like flex itself) wants to 9405bb9250eSAlex Richardson * call the scanner after we return the 9415bb9250eSAlex Richardson * YY_NULL, it'll still work - another 9425bb9250eSAlex Richardson * YY_NULL will get returned. 9435bb9250eSAlex Richardson */ 9445bb9250eSAlex Richardson (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; 9455bb9250eSAlex Richardson 9465bb9250eSAlex Richardson yy_act = YY_STATE_EOF(YY_START); 9475bb9250eSAlex Richardson goto do_action; 9485bb9250eSAlex Richardson } 9495bb9250eSAlex Richardson 9505bb9250eSAlex Richardson else 9515bb9250eSAlex Richardson { 9525bb9250eSAlex Richardson if ( ! (yy_did_buffer_switch_on_eof) ) 9535bb9250eSAlex Richardson YY_NEW_FILE; 9545bb9250eSAlex Richardson } 9555bb9250eSAlex Richardson break; 9565bb9250eSAlex Richardson } 9575bb9250eSAlex Richardson 9585bb9250eSAlex Richardson case EOB_ACT_CONTINUE_SCAN: 9595bb9250eSAlex Richardson (yy_c_buf_p) = 9605bb9250eSAlex Richardson (yytext_ptr) + yy_amount_of_matched_text; 9615bb9250eSAlex Richardson 9625bb9250eSAlex Richardson yy_current_state = yy_get_previous_state( ); 9635bb9250eSAlex Richardson 9645bb9250eSAlex Richardson yy_cp = (yy_c_buf_p); 9655bb9250eSAlex Richardson yy_bp = (yytext_ptr) + YY_MORE_ADJ; 9665bb9250eSAlex Richardson goto yy_match; 9675bb9250eSAlex Richardson 9685bb9250eSAlex Richardson case EOB_ACT_LAST_MATCH: 9695bb9250eSAlex Richardson (yy_c_buf_p) = 9705bb9250eSAlex Richardson &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; 9715bb9250eSAlex Richardson 9725bb9250eSAlex Richardson yy_current_state = yy_get_previous_state( ); 9735bb9250eSAlex Richardson 9745bb9250eSAlex Richardson yy_cp = (yy_c_buf_p); 9755bb9250eSAlex Richardson yy_bp = (yytext_ptr) + YY_MORE_ADJ; 9765bb9250eSAlex Richardson goto yy_find_action; 9775bb9250eSAlex Richardson } 9785bb9250eSAlex Richardson break; 9795bb9250eSAlex Richardson } 9805bb9250eSAlex Richardson 9815bb9250eSAlex Richardson default: 9825bb9250eSAlex Richardson YY_FATAL_ERROR( 9835bb9250eSAlex Richardson "fatal flex scanner internal error--no action found" ); 9845bb9250eSAlex Richardson } /* end of action switch */ 9855bb9250eSAlex Richardson } /* end of scanning one token */ 986*f8e57f89SAlex Richardson } /* end of user's declarations */ 9875bb9250eSAlex Richardson } /* end of yylex */ 9885bb9250eSAlex Richardson 9895bb9250eSAlex Richardson /* yy_get_next_buffer - try to read in a new buffer 9905bb9250eSAlex Richardson * 9915bb9250eSAlex Richardson * Returns a code representing an action: 9925bb9250eSAlex Richardson * EOB_ACT_LAST_MATCH - 9935bb9250eSAlex Richardson * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 9945bb9250eSAlex Richardson * EOB_ACT_END_OF_FILE - end of file 9955bb9250eSAlex Richardson */ 9965bb9250eSAlex Richardson static int yy_get_next_buffer (void) 9975bb9250eSAlex Richardson { 9985bb9250eSAlex Richardson char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; 9995bb9250eSAlex Richardson char *source = (yytext_ptr); 10005bb9250eSAlex Richardson int number_to_move, i; 10015bb9250eSAlex Richardson int ret_val; 10025bb9250eSAlex Richardson 10035bb9250eSAlex Richardson if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) 10045bb9250eSAlex Richardson YY_FATAL_ERROR( 10055bb9250eSAlex Richardson "fatal flex scanner internal error--end of buffer missed" ); 10065bb9250eSAlex Richardson 10075bb9250eSAlex Richardson if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) 10085bb9250eSAlex Richardson { /* Don't try to fill the buffer, so this is an EOF. */ 10095bb9250eSAlex Richardson if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) 10105bb9250eSAlex Richardson { 10115bb9250eSAlex Richardson /* We matched a single character, the EOB, so 10125bb9250eSAlex Richardson * treat this as a final EOF. 10135bb9250eSAlex Richardson */ 10145bb9250eSAlex Richardson return EOB_ACT_END_OF_FILE; 10155bb9250eSAlex Richardson } 10165bb9250eSAlex Richardson 10175bb9250eSAlex Richardson else 10185bb9250eSAlex Richardson { 10195bb9250eSAlex Richardson /* We matched some text prior to the EOB, first 10205bb9250eSAlex Richardson * process it. 10215bb9250eSAlex Richardson */ 10225bb9250eSAlex Richardson return EOB_ACT_LAST_MATCH; 10235bb9250eSAlex Richardson } 10245bb9250eSAlex Richardson } 10255bb9250eSAlex Richardson 10265bb9250eSAlex Richardson /* Try to read more data. */ 10275bb9250eSAlex Richardson 10285bb9250eSAlex Richardson /* First move last chars to start of buffer. */ 1029*f8e57f89SAlex Richardson number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); 10305bb9250eSAlex Richardson 10315bb9250eSAlex Richardson for ( i = 0; i < number_to_move; ++i ) 10325bb9250eSAlex Richardson *(dest++) = *(source++); 10335bb9250eSAlex Richardson 10345bb9250eSAlex Richardson if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 10355bb9250eSAlex Richardson /* don't do the read, it's not guaranteed to return an EOF, 10365bb9250eSAlex Richardson * just force an EOF 10375bb9250eSAlex Richardson */ 10385bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; 10395bb9250eSAlex Richardson 10405bb9250eSAlex Richardson else 10415bb9250eSAlex Richardson { 1042*f8e57f89SAlex Richardson int num_to_read = 10435bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; 10445bb9250eSAlex Richardson 10455bb9250eSAlex Richardson while ( num_to_read <= 0 ) 10465bb9250eSAlex Richardson { /* Not enough room in the buffer - grow it. */ 10475bb9250eSAlex Richardson 10485bb9250eSAlex Richardson /* just a shorter name for the current buffer */ 10495bb9250eSAlex Richardson YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; 10505bb9250eSAlex Richardson 10515bb9250eSAlex Richardson int yy_c_buf_p_offset = 10525bb9250eSAlex Richardson (int) ((yy_c_buf_p) - b->yy_ch_buf); 10535bb9250eSAlex Richardson 10545bb9250eSAlex Richardson if ( b->yy_is_our_buffer ) 10555bb9250eSAlex Richardson { 1056*f8e57f89SAlex Richardson int new_size = b->yy_buf_size * 2; 10575bb9250eSAlex Richardson 10585bb9250eSAlex Richardson if ( new_size <= 0 ) 10595bb9250eSAlex Richardson b->yy_buf_size += b->yy_buf_size / 8; 10605bb9250eSAlex Richardson else 10615bb9250eSAlex Richardson b->yy_buf_size *= 2; 10625bb9250eSAlex Richardson 10635bb9250eSAlex Richardson b->yy_ch_buf = (char *) 10645bb9250eSAlex Richardson /* Include room in for 2 EOB chars. */ 1065*f8e57f89SAlex Richardson yyrealloc( (void *) b->yy_ch_buf, 1066*f8e57f89SAlex Richardson (yy_size_t) (b->yy_buf_size + 2) ); 10675bb9250eSAlex Richardson } 10685bb9250eSAlex Richardson else 10695bb9250eSAlex Richardson /* Can't grow it, we don't own it. */ 1070*f8e57f89SAlex Richardson b->yy_ch_buf = NULL; 10715bb9250eSAlex Richardson 10725bb9250eSAlex Richardson if ( ! b->yy_ch_buf ) 10735bb9250eSAlex Richardson YY_FATAL_ERROR( 10745bb9250eSAlex Richardson "fatal error - scanner input buffer overflow" ); 10755bb9250eSAlex Richardson 10765bb9250eSAlex Richardson (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; 10775bb9250eSAlex Richardson 10785bb9250eSAlex Richardson num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - 10795bb9250eSAlex Richardson number_to_move - 1; 10805bb9250eSAlex Richardson 10815bb9250eSAlex Richardson } 10825bb9250eSAlex Richardson 10835bb9250eSAlex Richardson if ( num_to_read > YY_READ_BUF_SIZE ) 10845bb9250eSAlex Richardson num_to_read = YY_READ_BUF_SIZE; 10855bb9250eSAlex Richardson 10865bb9250eSAlex Richardson /* Read in more data. */ 10875bb9250eSAlex Richardson YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), 10885bb9250eSAlex Richardson (yy_n_chars), num_to_read ); 10895bb9250eSAlex Richardson 10905bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 10915bb9250eSAlex Richardson } 10925bb9250eSAlex Richardson 10935bb9250eSAlex Richardson if ( (yy_n_chars) == 0 ) 10945bb9250eSAlex Richardson { 10955bb9250eSAlex Richardson if ( number_to_move == YY_MORE_ADJ ) 10965bb9250eSAlex Richardson { 10975bb9250eSAlex Richardson ret_val = EOB_ACT_END_OF_FILE; 10985bb9250eSAlex Richardson yyrestart( yyin ); 10995bb9250eSAlex Richardson } 11005bb9250eSAlex Richardson 11015bb9250eSAlex Richardson else 11025bb9250eSAlex Richardson { 11035bb9250eSAlex Richardson ret_val = EOB_ACT_LAST_MATCH; 11045bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = 11055bb9250eSAlex Richardson YY_BUFFER_EOF_PENDING; 11065bb9250eSAlex Richardson } 11075bb9250eSAlex Richardson } 11085bb9250eSAlex Richardson 11095bb9250eSAlex Richardson else 11105bb9250eSAlex Richardson ret_val = EOB_ACT_CONTINUE_SCAN; 11115bb9250eSAlex Richardson 1112*f8e57f89SAlex Richardson if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { 11135bb9250eSAlex Richardson /* Extend the array by 50%, plus the number we really need. */ 1114*f8e57f89SAlex Richardson int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); 1115*f8e57f89SAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( 1116*f8e57f89SAlex Richardson (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); 11175bb9250eSAlex Richardson if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 11185bb9250eSAlex Richardson YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); 1119*f8e57f89SAlex Richardson /* "- 2" to take care of EOB's */ 1120*f8e57f89SAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); 11215bb9250eSAlex Richardson } 11225bb9250eSAlex Richardson 11235bb9250eSAlex Richardson (yy_n_chars) += number_to_move; 11245bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; 11255bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; 11265bb9250eSAlex Richardson 11275bb9250eSAlex Richardson (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; 11285bb9250eSAlex Richardson 11295bb9250eSAlex Richardson return ret_val; 11305bb9250eSAlex Richardson } 11315bb9250eSAlex Richardson 11325bb9250eSAlex Richardson /* yy_get_previous_state - get the state just before the EOB char was reached */ 11335bb9250eSAlex Richardson 11345bb9250eSAlex Richardson static yy_state_type yy_get_previous_state (void) 11355bb9250eSAlex Richardson { 11365bb9250eSAlex Richardson yy_state_type yy_current_state; 11375bb9250eSAlex Richardson char *yy_cp; 11385bb9250eSAlex Richardson 11395bb9250eSAlex Richardson yy_current_state = (yy_start); 11405bb9250eSAlex Richardson 11415bb9250eSAlex Richardson for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) 11425bb9250eSAlex Richardson { 11435bb9250eSAlex Richardson YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 11445bb9250eSAlex Richardson if ( yy_accept[yy_current_state] ) 11455bb9250eSAlex Richardson { 11465bb9250eSAlex Richardson (yy_last_accepting_state) = yy_current_state; 11475bb9250eSAlex Richardson (yy_last_accepting_cpos) = yy_cp; 11485bb9250eSAlex Richardson } 11495bb9250eSAlex Richardson while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 11505bb9250eSAlex Richardson { 11515bb9250eSAlex Richardson yy_current_state = (int) yy_def[yy_current_state]; 11525bb9250eSAlex Richardson if ( yy_current_state >= 35 ) 1153*f8e57f89SAlex Richardson yy_c = yy_meta[yy_c]; 11545bb9250eSAlex Richardson } 1155*f8e57f89SAlex Richardson yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; 11565bb9250eSAlex Richardson } 11575bb9250eSAlex Richardson 11585bb9250eSAlex Richardson return yy_current_state; 11595bb9250eSAlex Richardson } 11605bb9250eSAlex Richardson 11615bb9250eSAlex Richardson /* yy_try_NUL_trans - try to make a transition on the NUL character 11625bb9250eSAlex Richardson * 11635bb9250eSAlex Richardson * synopsis 11645bb9250eSAlex Richardson * next_state = yy_try_NUL_trans( current_state ); 11655bb9250eSAlex Richardson */ 11665bb9250eSAlex Richardson static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) 11675bb9250eSAlex Richardson { 11685bb9250eSAlex Richardson int yy_is_jam; 11695bb9250eSAlex Richardson char *yy_cp = (yy_c_buf_p); 11705bb9250eSAlex Richardson 11715bb9250eSAlex Richardson YY_CHAR yy_c = 1; 11725bb9250eSAlex Richardson if ( yy_accept[yy_current_state] ) 11735bb9250eSAlex Richardson { 11745bb9250eSAlex Richardson (yy_last_accepting_state) = yy_current_state; 11755bb9250eSAlex Richardson (yy_last_accepting_cpos) = yy_cp; 11765bb9250eSAlex Richardson } 11775bb9250eSAlex Richardson while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 11785bb9250eSAlex Richardson { 11795bb9250eSAlex Richardson yy_current_state = (int) yy_def[yy_current_state]; 11805bb9250eSAlex Richardson if ( yy_current_state >= 35 ) 1181*f8e57f89SAlex Richardson yy_c = yy_meta[yy_c]; 11825bb9250eSAlex Richardson } 1183*f8e57f89SAlex Richardson yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; 11845bb9250eSAlex Richardson yy_is_jam = (yy_current_state == 34); 11855bb9250eSAlex Richardson 11865bb9250eSAlex Richardson return yy_is_jam ? 0 : yy_current_state; 11875bb9250eSAlex Richardson } 11885bb9250eSAlex Richardson 1189*f8e57f89SAlex Richardson #ifndef YY_NO_UNPUT 1190*f8e57f89SAlex Richardson 1191*f8e57f89SAlex Richardson #endif 1192*f8e57f89SAlex Richardson 11935bb9250eSAlex Richardson #ifndef YY_NO_INPUT 11945bb9250eSAlex Richardson #ifdef __cplusplus 11955bb9250eSAlex Richardson static int yyinput (void) 11965bb9250eSAlex Richardson #else 11975bb9250eSAlex Richardson static int input (void) 11985bb9250eSAlex Richardson #endif 11995bb9250eSAlex Richardson 12005bb9250eSAlex Richardson { 12015bb9250eSAlex Richardson int c; 12025bb9250eSAlex Richardson 12035bb9250eSAlex Richardson *(yy_c_buf_p) = (yy_hold_char); 12045bb9250eSAlex Richardson 12055bb9250eSAlex Richardson if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) 12065bb9250eSAlex Richardson { 12075bb9250eSAlex Richardson /* yy_c_buf_p now points to the character we want to return. 12085bb9250eSAlex Richardson * If this occurs *before* the EOB characters, then it's a 12095bb9250eSAlex Richardson * valid NUL; if not, then we've hit the end of the buffer. 12105bb9250eSAlex Richardson */ 12115bb9250eSAlex Richardson if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 12125bb9250eSAlex Richardson /* This was really a NUL. */ 12135bb9250eSAlex Richardson *(yy_c_buf_p) = '\0'; 12145bb9250eSAlex Richardson 12155bb9250eSAlex Richardson else 12165bb9250eSAlex Richardson { /* need more input */ 1217*f8e57f89SAlex Richardson int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); 12185bb9250eSAlex Richardson ++(yy_c_buf_p); 12195bb9250eSAlex Richardson 12205bb9250eSAlex Richardson switch ( yy_get_next_buffer( ) ) 12215bb9250eSAlex Richardson { 12225bb9250eSAlex Richardson case EOB_ACT_LAST_MATCH: 12235bb9250eSAlex Richardson /* This happens because yy_g_n_b() 12245bb9250eSAlex Richardson * sees that we've accumulated a 12255bb9250eSAlex Richardson * token and flags that we need to 12265bb9250eSAlex Richardson * try matching the token before 12275bb9250eSAlex Richardson * proceeding. But for input(), 12285bb9250eSAlex Richardson * there's no matching to consider. 12295bb9250eSAlex Richardson * So convert the EOB_ACT_LAST_MATCH 12305bb9250eSAlex Richardson * to EOB_ACT_END_OF_FILE. 12315bb9250eSAlex Richardson */ 12325bb9250eSAlex Richardson 12335bb9250eSAlex Richardson /* Reset buffer status. */ 12345bb9250eSAlex Richardson yyrestart( yyin ); 12355bb9250eSAlex Richardson 12365bb9250eSAlex Richardson /*FALLTHROUGH*/ 12375bb9250eSAlex Richardson 12385bb9250eSAlex Richardson case EOB_ACT_END_OF_FILE: 12395bb9250eSAlex Richardson { 12405bb9250eSAlex Richardson if ( yywrap( ) ) 1241*f8e57f89SAlex Richardson return 0; 12425bb9250eSAlex Richardson 12435bb9250eSAlex Richardson if ( ! (yy_did_buffer_switch_on_eof) ) 12445bb9250eSAlex Richardson YY_NEW_FILE; 12455bb9250eSAlex Richardson #ifdef __cplusplus 12465bb9250eSAlex Richardson return yyinput(); 12475bb9250eSAlex Richardson #else 12485bb9250eSAlex Richardson return input(); 12495bb9250eSAlex Richardson #endif 12505bb9250eSAlex Richardson } 12515bb9250eSAlex Richardson 12525bb9250eSAlex Richardson case EOB_ACT_CONTINUE_SCAN: 12535bb9250eSAlex Richardson (yy_c_buf_p) = (yytext_ptr) + offset; 12545bb9250eSAlex Richardson break; 12555bb9250eSAlex Richardson } 12565bb9250eSAlex Richardson } 12575bb9250eSAlex Richardson } 12585bb9250eSAlex Richardson 12595bb9250eSAlex Richardson c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ 12605bb9250eSAlex Richardson *(yy_c_buf_p) = '\0'; /* preserve yytext */ 12615bb9250eSAlex Richardson (yy_hold_char) = *++(yy_c_buf_p); 12625bb9250eSAlex Richardson 12635bb9250eSAlex Richardson return c; 12645bb9250eSAlex Richardson } 12655bb9250eSAlex Richardson #endif /* ifndef YY_NO_INPUT */ 12665bb9250eSAlex Richardson 12675bb9250eSAlex Richardson /** Immediately switch to a different input stream. 12685bb9250eSAlex Richardson * @param input_file A readable stream. 12695bb9250eSAlex Richardson * 12705bb9250eSAlex Richardson * @note This function does not reset the start condition to @c INITIAL . 12715bb9250eSAlex Richardson */ 12725bb9250eSAlex Richardson void yyrestart (FILE * input_file ) 12735bb9250eSAlex Richardson { 12745bb9250eSAlex Richardson 12755bb9250eSAlex Richardson if ( ! YY_CURRENT_BUFFER ){ 12765bb9250eSAlex Richardson yyensure_buffer_stack (); 12775bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = 12785bb9250eSAlex Richardson yy_create_buffer( yyin, YY_BUF_SIZE ); 12795bb9250eSAlex Richardson } 12805bb9250eSAlex Richardson 12815bb9250eSAlex Richardson yy_init_buffer( YY_CURRENT_BUFFER, input_file ); 12825bb9250eSAlex Richardson yy_load_buffer_state( ); 12835bb9250eSAlex Richardson } 12845bb9250eSAlex Richardson 12855bb9250eSAlex Richardson /** Switch to a different input buffer. 12865bb9250eSAlex Richardson * @param new_buffer The new input buffer. 12875bb9250eSAlex Richardson * 12885bb9250eSAlex Richardson */ 12895bb9250eSAlex Richardson void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) 12905bb9250eSAlex Richardson { 12915bb9250eSAlex Richardson 12925bb9250eSAlex Richardson /* TODO. We should be able to replace this entire function body 12935bb9250eSAlex Richardson * with 12945bb9250eSAlex Richardson * yypop_buffer_state(); 12955bb9250eSAlex Richardson * yypush_buffer_state(new_buffer); 12965bb9250eSAlex Richardson */ 12975bb9250eSAlex Richardson yyensure_buffer_stack (); 12985bb9250eSAlex Richardson if ( YY_CURRENT_BUFFER == new_buffer ) 12995bb9250eSAlex Richardson return; 13005bb9250eSAlex Richardson 13015bb9250eSAlex Richardson if ( YY_CURRENT_BUFFER ) 13025bb9250eSAlex Richardson { 13035bb9250eSAlex Richardson /* Flush out information for old buffer. */ 13045bb9250eSAlex Richardson *(yy_c_buf_p) = (yy_hold_char); 13055bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 13065bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 13075bb9250eSAlex Richardson } 13085bb9250eSAlex Richardson 13095bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = new_buffer; 13105bb9250eSAlex Richardson yy_load_buffer_state( ); 13115bb9250eSAlex Richardson 13125bb9250eSAlex Richardson /* We don't actually know whether we did this switch during 13135bb9250eSAlex Richardson * EOF (yywrap()) processing, but the only time this flag 13145bb9250eSAlex Richardson * is looked at is after yywrap() is called, so it's safe 13155bb9250eSAlex Richardson * to go ahead and always set it. 13165bb9250eSAlex Richardson */ 13175bb9250eSAlex Richardson (yy_did_buffer_switch_on_eof) = 1; 13185bb9250eSAlex Richardson } 13195bb9250eSAlex Richardson 13205bb9250eSAlex Richardson static void yy_load_buffer_state (void) 13215bb9250eSAlex Richardson { 13225bb9250eSAlex Richardson (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 13235bb9250eSAlex Richardson (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; 13245bb9250eSAlex Richardson yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; 13255bb9250eSAlex Richardson (yy_hold_char) = *(yy_c_buf_p); 13265bb9250eSAlex Richardson } 13275bb9250eSAlex Richardson 13285bb9250eSAlex Richardson /** Allocate and initialize an input buffer state. 13295bb9250eSAlex Richardson * @param file A readable stream. 13305bb9250eSAlex Richardson * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. 13315bb9250eSAlex Richardson * 13325bb9250eSAlex Richardson * @return the allocated buffer state. 13335bb9250eSAlex Richardson */ 13345bb9250eSAlex Richardson YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) 13355bb9250eSAlex Richardson { 13365bb9250eSAlex Richardson YY_BUFFER_STATE b; 13375bb9250eSAlex Richardson 13385bb9250eSAlex Richardson b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); 13395bb9250eSAlex Richardson if ( ! b ) 13405bb9250eSAlex Richardson YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 13415bb9250eSAlex Richardson 13425bb9250eSAlex Richardson b->yy_buf_size = size; 13435bb9250eSAlex Richardson 13445bb9250eSAlex Richardson /* yy_ch_buf has to be 2 characters longer than the size given because 13455bb9250eSAlex Richardson * we need to put in 2 end-of-buffer characters. 13465bb9250eSAlex Richardson */ 1347*f8e57f89SAlex Richardson b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); 13485bb9250eSAlex Richardson if ( ! b->yy_ch_buf ) 13495bb9250eSAlex Richardson YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 13505bb9250eSAlex Richardson 13515bb9250eSAlex Richardson b->yy_is_our_buffer = 1; 13525bb9250eSAlex Richardson 13535bb9250eSAlex Richardson yy_init_buffer( b, file ); 13545bb9250eSAlex Richardson 13555bb9250eSAlex Richardson return b; 13565bb9250eSAlex Richardson } 13575bb9250eSAlex Richardson 13585bb9250eSAlex Richardson /** Destroy the buffer. 13595bb9250eSAlex Richardson * @param b a buffer created with yy_create_buffer() 13605bb9250eSAlex Richardson * 13615bb9250eSAlex Richardson */ 13625bb9250eSAlex Richardson void yy_delete_buffer (YY_BUFFER_STATE b ) 13635bb9250eSAlex Richardson { 13645bb9250eSAlex Richardson 13655bb9250eSAlex Richardson if ( ! b ) 13665bb9250eSAlex Richardson return; 13675bb9250eSAlex Richardson 13685bb9250eSAlex Richardson if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ 13695bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; 13705bb9250eSAlex Richardson 13715bb9250eSAlex Richardson if ( b->yy_is_our_buffer ) 13725bb9250eSAlex Richardson yyfree( (void *) b->yy_ch_buf ); 13735bb9250eSAlex Richardson 13745bb9250eSAlex Richardson yyfree( (void *) b ); 13755bb9250eSAlex Richardson } 13765bb9250eSAlex Richardson 13775bb9250eSAlex Richardson /* Initializes or reinitializes a buffer. 13785bb9250eSAlex Richardson * This function is sometimes called more than once on the same buffer, 13795bb9250eSAlex Richardson * such as during a yyrestart() or at EOF. 13805bb9250eSAlex Richardson */ 13815bb9250eSAlex Richardson static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) 13825bb9250eSAlex Richardson 13835bb9250eSAlex Richardson { 13845bb9250eSAlex Richardson int oerrno = errno; 13855bb9250eSAlex Richardson 13865bb9250eSAlex Richardson yy_flush_buffer( b ); 13875bb9250eSAlex Richardson 13885bb9250eSAlex Richardson b->yy_input_file = file; 13895bb9250eSAlex Richardson b->yy_fill_buffer = 1; 13905bb9250eSAlex Richardson 13915bb9250eSAlex Richardson /* If b is the current buffer, then yy_init_buffer was _probably_ 13925bb9250eSAlex Richardson * called from yyrestart() or through yy_get_next_buffer. 13935bb9250eSAlex Richardson * In that case, we don't want to reset the lineno or column. 13945bb9250eSAlex Richardson */ 13955bb9250eSAlex Richardson if (b != YY_CURRENT_BUFFER){ 13965bb9250eSAlex Richardson b->yy_bs_lineno = 1; 13975bb9250eSAlex Richardson b->yy_bs_column = 0; 13985bb9250eSAlex Richardson } 13995bb9250eSAlex Richardson 14005bb9250eSAlex Richardson b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 14015bb9250eSAlex Richardson 14025bb9250eSAlex Richardson errno = oerrno; 14035bb9250eSAlex Richardson } 14045bb9250eSAlex Richardson 14055bb9250eSAlex Richardson /** Discard all buffered characters. On the next scan, YY_INPUT will be called. 14065bb9250eSAlex Richardson * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. 14075bb9250eSAlex Richardson * 14085bb9250eSAlex Richardson */ 14095bb9250eSAlex Richardson void yy_flush_buffer (YY_BUFFER_STATE b ) 14105bb9250eSAlex Richardson { 14115bb9250eSAlex Richardson if ( ! b ) 14125bb9250eSAlex Richardson return; 14135bb9250eSAlex Richardson 14145bb9250eSAlex Richardson b->yy_n_chars = 0; 14155bb9250eSAlex Richardson 14165bb9250eSAlex Richardson /* We always need two end-of-buffer characters. The first causes 14175bb9250eSAlex Richardson * a transition to the end-of-buffer state. The second causes 14185bb9250eSAlex Richardson * a jam in that state. 14195bb9250eSAlex Richardson */ 14205bb9250eSAlex Richardson b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 14215bb9250eSAlex Richardson b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 14225bb9250eSAlex Richardson 14235bb9250eSAlex Richardson b->yy_buf_pos = &b->yy_ch_buf[0]; 14245bb9250eSAlex Richardson 14255bb9250eSAlex Richardson b->yy_at_bol = 1; 14265bb9250eSAlex Richardson b->yy_buffer_status = YY_BUFFER_NEW; 14275bb9250eSAlex Richardson 14285bb9250eSAlex Richardson if ( b == YY_CURRENT_BUFFER ) 14295bb9250eSAlex Richardson yy_load_buffer_state( ); 14305bb9250eSAlex Richardson } 14315bb9250eSAlex Richardson 14325bb9250eSAlex Richardson /** Pushes the new state onto the stack. The new state becomes 14335bb9250eSAlex Richardson * the current state. This function will allocate the stack 14345bb9250eSAlex Richardson * if necessary. 14355bb9250eSAlex Richardson * @param new_buffer The new state. 14365bb9250eSAlex Richardson * 14375bb9250eSAlex Richardson */ 14385bb9250eSAlex Richardson void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) 14395bb9250eSAlex Richardson { 14405bb9250eSAlex Richardson if (new_buffer == NULL) 14415bb9250eSAlex Richardson return; 14425bb9250eSAlex Richardson 14435bb9250eSAlex Richardson yyensure_buffer_stack(); 14445bb9250eSAlex Richardson 14455bb9250eSAlex Richardson /* This block is copied from yy_switch_to_buffer. */ 14465bb9250eSAlex Richardson if ( YY_CURRENT_BUFFER ) 14475bb9250eSAlex Richardson { 14485bb9250eSAlex Richardson /* Flush out information for old buffer. */ 14495bb9250eSAlex Richardson *(yy_c_buf_p) = (yy_hold_char); 14505bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 14515bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 14525bb9250eSAlex Richardson } 14535bb9250eSAlex Richardson 14545bb9250eSAlex Richardson /* Only push if top exists. Otherwise, replace top. */ 14555bb9250eSAlex Richardson if (YY_CURRENT_BUFFER) 14565bb9250eSAlex Richardson (yy_buffer_stack_top)++; 14575bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = new_buffer; 14585bb9250eSAlex Richardson 14595bb9250eSAlex Richardson /* copied from yy_switch_to_buffer. */ 14605bb9250eSAlex Richardson yy_load_buffer_state( ); 14615bb9250eSAlex Richardson (yy_did_buffer_switch_on_eof) = 1; 14625bb9250eSAlex Richardson } 14635bb9250eSAlex Richardson 14645bb9250eSAlex Richardson /** Removes and deletes the top of the stack, if present. 14655bb9250eSAlex Richardson * The next element becomes the new top. 14665bb9250eSAlex Richardson * 14675bb9250eSAlex Richardson */ 14685bb9250eSAlex Richardson void yypop_buffer_state (void) 14695bb9250eSAlex Richardson { 14705bb9250eSAlex Richardson if (!YY_CURRENT_BUFFER) 14715bb9250eSAlex Richardson return; 14725bb9250eSAlex Richardson 14735bb9250eSAlex Richardson yy_delete_buffer(YY_CURRENT_BUFFER ); 14745bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = NULL; 14755bb9250eSAlex Richardson if ((yy_buffer_stack_top) > 0) 14765bb9250eSAlex Richardson --(yy_buffer_stack_top); 14775bb9250eSAlex Richardson 14785bb9250eSAlex Richardson if (YY_CURRENT_BUFFER) { 14795bb9250eSAlex Richardson yy_load_buffer_state( ); 14805bb9250eSAlex Richardson (yy_did_buffer_switch_on_eof) = 1; 14815bb9250eSAlex Richardson } 14825bb9250eSAlex Richardson } 14835bb9250eSAlex Richardson 14845bb9250eSAlex Richardson /* Allocates the stack if it does not exist. 14855bb9250eSAlex Richardson * Guarantees space for at least one push. 14865bb9250eSAlex Richardson */ 14875bb9250eSAlex Richardson static void yyensure_buffer_stack (void) 14885bb9250eSAlex Richardson { 14895bb9250eSAlex Richardson yy_size_t num_to_alloc; 14905bb9250eSAlex Richardson 14915bb9250eSAlex Richardson if (!(yy_buffer_stack)) { 14925bb9250eSAlex Richardson 14935bb9250eSAlex Richardson /* First allocation is just for 2 elements, since we don't know if this 14945bb9250eSAlex Richardson * scanner will even need a stack. We use 2 instead of 1 to avoid an 14955bb9250eSAlex Richardson * immediate realloc on the next call. 14965bb9250eSAlex Richardson */ 1497*f8e57f89SAlex Richardson num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ 14985bb9250eSAlex Richardson (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc 14995bb9250eSAlex Richardson (num_to_alloc * sizeof(struct yy_buffer_state*) 15005bb9250eSAlex Richardson ); 15015bb9250eSAlex Richardson if ( ! (yy_buffer_stack) ) 15025bb9250eSAlex Richardson YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); 15035bb9250eSAlex Richardson 15045bb9250eSAlex Richardson memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 15055bb9250eSAlex Richardson 15065bb9250eSAlex Richardson (yy_buffer_stack_max) = num_to_alloc; 15075bb9250eSAlex Richardson (yy_buffer_stack_top) = 0; 15085bb9250eSAlex Richardson return; 15095bb9250eSAlex Richardson } 15105bb9250eSAlex Richardson 15115bb9250eSAlex Richardson if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ 15125bb9250eSAlex Richardson 15135bb9250eSAlex Richardson /* Increase the buffer to prepare for a possible push. */ 1514*f8e57f89SAlex Richardson yy_size_t grow_size = 8 /* arbitrary grow size */; 15155bb9250eSAlex Richardson 15165bb9250eSAlex Richardson num_to_alloc = (yy_buffer_stack_max) + grow_size; 15175bb9250eSAlex Richardson (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc 15185bb9250eSAlex Richardson ((yy_buffer_stack), 15195bb9250eSAlex Richardson num_to_alloc * sizeof(struct yy_buffer_state*) 15205bb9250eSAlex Richardson ); 15215bb9250eSAlex Richardson if ( ! (yy_buffer_stack) ) 15225bb9250eSAlex Richardson YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); 15235bb9250eSAlex Richardson 15245bb9250eSAlex Richardson /* zero only the new slots.*/ 15255bb9250eSAlex Richardson memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); 15265bb9250eSAlex Richardson (yy_buffer_stack_max) = num_to_alloc; 15275bb9250eSAlex Richardson } 15285bb9250eSAlex Richardson } 15295bb9250eSAlex Richardson 15305bb9250eSAlex Richardson /** Setup the input buffer state to scan directly from a user-specified character buffer. 15315bb9250eSAlex Richardson * @param base the character buffer 15325bb9250eSAlex Richardson * @param size the size in bytes of the character buffer 15335bb9250eSAlex Richardson * 15345bb9250eSAlex Richardson * @return the newly allocated buffer state object. 15355bb9250eSAlex Richardson */ 15365bb9250eSAlex Richardson YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) 15375bb9250eSAlex Richardson { 15385bb9250eSAlex Richardson YY_BUFFER_STATE b; 15395bb9250eSAlex Richardson 15405bb9250eSAlex Richardson if ( size < 2 || 15415bb9250eSAlex Richardson base[size-2] != YY_END_OF_BUFFER_CHAR || 15425bb9250eSAlex Richardson base[size-1] != YY_END_OF_BUFFER_CHAR ) 15435bb9250eSAlex Richardson /* They forgot to leave room for the EOB's. */ 1544*f8e57f89SAlex Richardson return NULL; 15455bb9250eSAlex Richardson 15465bb9250eSAlex Richardson b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); 15475bb9250eSAlex Richardson if ( ! b ) 15485bb9250eSAlex Richardson YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); 15495bb9250eSAlex Richardson 1550*f8e57f89SAlex Richardson b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ 15515bb9250eSAlex Richardson b->yy_buf_pos = b->yy_ch_buf = base; 15525bb9250eSAlex Richardson b->yy_is_our_buffer = 0; 1553*f8e57f89SAlex Richardson b->yy_input_file = NULL; 15545bb9250eSAlex Richardson b->yy_n_chars = b->yy_buf_size; 15555bb9250eSAlex Richardson b->yy_is_interactive = 0; 15565bb9250eSAlex Richardson b->yy_at_bol = 1; 15575bb9250eSAlex Richardson b->yy_fill_buffer = 0; 15585bb9250eSAlex Richardson b->yy_buffer_status = YY_BUFFER_NEW; 15595bb9250eSAlex Richardson 15605bb9250eSAlex Richardson yy_switch_to_buffer( b ); 15615bb9250eSAlex Richardson 15625bb9250eSAlex Richardson return b; 15635bb9250eSAlex Richardson } 15645bb9250eSAlex Richardson 15655bb9250eSAlex Richardson /** Setup the input buffer state to scan a string. The next call to yylex() will 15665bb9250eSAlex Richardson * scan from a @e copy of @a str. 15675bb9250eSAlex Richardson * @param yystr a NUL-terminated string to scan 15685bb9250eSAlex Richardson * 15695bb9250eSAlex Richardson * @return the newly allocated buffer state object. 15705bb9250eSAlex Richardson * @note If you want to scan bytes that may contain NUL values, then use 15715bb9250eSAlex Richardson * yy_scan_bytes() instead. 15725bb9250eSAlex Richardson */ 1573*f8e57f89SAlex Richardson YY_BUFFER_STATE yy_scan_string (const char * yystr ) 15745bb9250eSAlex Richardson { 15755bb9250eSAlex Richardson 1576*f8e57f89SAlex Richardson return yy_scan_bytes( yystr, (int) strlen(yystr) ); 15775bb9250eSAlex Richardson } 15785bb9250eSAlex Richardson 15795bb9250eSAlex Richardson /** Setup the input buffer state to scan the given bytes. The next call to yylex() will 15805bb9250eSAlex Richardson * scan from a @e copy of @a bytes. 15815bb9250eSAlex Richardson * @param yybytes the byte buffer to scan 15825bb9250eSAlex Richardson * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. 15835bb9250eSAlex Richardson * 15845bb9250eSAlex Richardson * @return the newly allocated buffer state object. 15855bb9250eSAlex Richardson */ 1586*f8e57f89SAlex Richardson YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) 15875bb9250eSAlex Richardson { 15885bb9250eSAlex Richardson YY_BUFFER_STATE b; 15895bb9250eSAlex Richardson char *buf; 15905bb9250eSAlex Richardson yy_size_t n; 1591*f8e57f89SAlex Richardson int i; 15925bb9250eSAlex Richardson 15935bb9250eSAlex Richardson /* Get memory for full buffer, including space for trailing EOB's. */ 1594*f8e57f89SAlex Richardson n = (yy_size_t) (_yybytes_len + 2); 15955bb9250eSAlex Richardson buf = (char *) yyalloc( n ); 15965bb9250eSAlex Richardson if ( ! buf ) 15975bb9250eSAlex Richardson YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); 15985bb9250eSAlex Richardson 15995bb9250eSAlex Richardson for ( i = 0; i < _yybytes_len; ++i ) 16005bb9250eSAlex Richardson buf[i] = yybytes[i]; 16015bb9250eSAlex Richardson 16025bb9250eSAlex Richardson buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; 16035bb9250eSAlex Richardson 16045bb9250eSAlex Richardson b = yy_scan_buffer( buf, n ); 16055bb9250eSAlex Richardson if ( ! b ) 16065bb9250eSAlex Richardson YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); 16075bb9250eSAlex Richardson 16085bb9250eSAlex Richardson /* It's okay to grow etc. this buffer, and we should throw it 16095bb9250eSAlex Richardson * away when we're done. 16105bb9250eSAlex Richardson */ 16115bb9250eSAlex Richardson b->yy_is_our_buffer = 1; 16125bb9250eSAlex Richardson 16135bb9250eSAlex Richardson return b; 16145bb9250eSAlex Richardson } 16155bb9250eSAlex Richardson 16165bb9250eSAlex Richardson #ifndef YY_EXIT_FAILURE 16175bb9250eSAlex Richardson #define YY_EXIT_FAILURE 2 16185bb9250eSAlex Richardson #endif 16195bb9250eSAlex Richardson 1620*f8e57f89SAlex Richardson static void yynoreturn yy_fatal_error (const char* msg ) 16215bb9250eSAlex Richardson { 1622*f8e57f89SAlex Richardson fprintf( stderr, "%s\n", msg ); 16235bb9250eSAlex Richardson exit( YY_EXIT_FAILURE ); 16245bb9250eSAlex Richardson } 16255bb9250eSAlex Richardson 16265bb9250eSAlex Richardson /* Redefine yyless() so it works in section 3 code. */ 16275bb9250eSAlex Richardson 16285bb9250eSAlex Richardson #undef yyless 16295bb9250eSAlex Richardson #define yyless(n) \ 16305bb9250eSAlex Richardson do \ 16315bb9250eSAlex Richardson { \ 16325bb9250eSAlex Richardson /* Undo effects of setting up yytext. */ \ 16335bb9250eSAlex Richardson int yyless_macro_arg = (n); \ 16345bb9250eSAlex Richardson YY_LESS_LINENO(yyless_macro_arg);\ 16355bb9250eSAlex Richardson yytext[yyleng] = (yy_hold_char); \ 16365bb9250eSAlex Richardson (yy_c_buf_p) = yytext + yyless_macro_arg; \ 16375bb9250eSAlex Richardson (yy_hold_char) = *(yy_c_buf_p); \ 16385bb9250eSAlex Richardson *(yy_c_buf_p) = '\0'; \ 16395bb9250eSAlex Richardson yyleng = yyless_macro_arg; \ 16405bb9250eSAlex Richardson } \ 16415bb9250eSAlex Richardson while ( 0 ) 16425bb9250eSAlex Richardson 16435bb9250eSAlex Richardson /* Accessor methods (get/set functions) to struct members. */ 16445bb9250eSAlex Richardson 16455bb9250eSAlex Richardson /** Get the current line number. 16465bb9250eSAlex Richardson * 16475bb9250eSAlex Richardson */ 16485bb9250eSAlex Richardson int yyget_lineno (void) 16495bb9250eSAlex Richardson { 16505bb9250eSAlex Richardson 16515bb9250eSAlex Richardson return yylineno; 16525bb9250eSAlex Richardson } 16535bb9250eSAlex Richardson 16545bb9250eSAlex Richardson /** Get the input stream. 16555bb9250eSAlex Richardson * 16565bb9250eSAlex Richardson */ 16575bb9250eSAlex Richardson FILE *yyget_in (void) 16585bb9250eSAlex Richardson { 16595bb9250eSAlex Richardson return yyin; 16605bb9250eSAlex Richardson } 16615bb9250eSAlex Richardson 16625bb9250eSAlex Richardson /** Get the output stream. 16635bb9250eSAlex Richardson * 16645bb9250eSAlex Richardson */ 16655bb9250eSAlex Richardson FILE *yyget_out (void) 16665bb9250eSAlex Richardson { 16675bb9250eSAlex Richardson return yyout; 16685bb9250eSAlex Richardson } 16695bb9250eSAlex Richardson 16705bb9250eSAlex Richardson /** Get the length of the current token. 16715bb9250eSAlex Richardson * 16725bb9250eSAlex Richardson */ 1673*f8e57f89SAlex Richardson int yyget_leng (void) 16745bb9250eSAlex Richardson { 16755bb9250eSAlex Richardson return yyleng; 16765bb9250eSAlex Richardson } 16775bb9250eSAlex Richardson 16785bb9250eSAlex Richardson /** Get the current token. 16795bb9250eSAlex Richardson * 16805bb9250eSAlex Richardson */ 16815bb9250eSAlex Richardson 16825bb9250eSAlex Richardson char *yyget_text (void) 16835bb9250eSAlex Richardson { 16845bb9250eSAlex Richardson return yytext; 16855bb9250eSAlex Richardson } 16865bb9250eSAlex Richardson 16875bb9250eSAlex Richardson /** Set the current line number. 1688*f8e57f89SAlex Richardson * @param _line_number line number 16895bb9250eSAlex Richardson * 16905bb9250eSAlex Richardson */ 1691*f8e57f89SAlex Richardson void yyset_lineno (int _line_number ) 16925bb9250eSAlex Richardson { 16935bb9250eSAlex Richardson 1694*f8e57f89SAlex Richardson yylineno = _line_number; 16955bb9250eSAlex Richardson } 16965bb9250eSAlex Richardson 16975bb9250eSAlex Richardson /** Set the input stream. This does not discard the current 16985bb9250eSAlex Richardson * input buffer. 1699*f8e57f89SAlex Richardson * @param _in_str A readable stream. 17005bb9250eSAlex Richardson * 17015bb9250eSAlex Richardson * @see yy_switch_to_buffer 17025bb9250eSAlex Richardson */ 1703*f8e57f89SAlex Richardson void yyset_in (FILE * _in_str ) 17045bb9250eSAlex Richardson { 1705*f8e57f89SAlex Richardson yyin = _in_str ; 17065bb9250eSAlex Richardson } 17075bb9250eSAlex Richardson 1708*f8e57f89SAlex Richardson void yyset_out (FILE * _out_str ) 17095bb9250eSAlex Richardson { 1710*f8e57f89SAlex Richardson yyout = _out_str ; 17115bb9250eSAlex Richardson } 17125bb9250eSAlex Richardson 17135bb9250eSAlex Richardson int yyget_debug (void) 17145bb9250eSAlex Richardson { 17155bb9250eSAlex Richardson return yy_flex_debug; 17165bb9250eSAlex Richardson } 17175bb9250eSAlex Richardson 1718*f8e57f89SAlex Richardson void yyset_debug (int _bdebug ) 17195bb9250eSAlex Richardson { 1720*f8e57f89SAlex Richardson yy_flex_debug = _bdebug ; 17215bb9250eSAlex Richardson } 17225bb9250eSAlex Richardson 17235bb9250eSAlex Richardson static int yy_init_globals (void) 17245bb9250eSAlex Richardson { 17255bb9250eSAlex Richardson /* Initialization is the same as for the non-reentrant scanner. 17265bb9250eSAlex Richardson * This function is called from yylex_destroy(), so don't allocate here. 17275bb9250eSAlex Richardson */ 17285bb9250eSAlex Richardson 1729*f8e57f89SAlex Richardson (yy_buffer_stack) = NULL; 17305bb9250eSAlex Richardson (yy_buffer_stack_top) = 0; 17315bb9250eSAlex Richardson (yy_buffer_stack_max) = 0; 1732*f8e57f89SAlex Richardson (yy_c_buf_p) = NULL; 17335bb9250eSAlex Richardson (yy_init) = 0; 17345bb9250eSAlex Richardson (yy_start) = 0; 17355bb9250eSAlex Richardson 17365bb9250eSAlex Richardson /* Defined in main.c */ 17375bb9250eSAlex Richardson #ifdef YY_STDINIT 17385bb9250eSAlex Richardson yyin = stdin; 17395bb9250eSAlex Richardson yyout = stdout; 17405bb9250eSAlex Richardson #else 1741*f8e57f89SAlex Richardson yyin = NULL; 1742*f8e57f89SAlex Richardson yyout = NULL; 17435bb9250eSAlex Richardson #endif 17445bb9250eSAlex Richardson 17455bb9250eSAlex Richardson /* For future reference: Set errno on error, since we are called by 17465bb9250eSAlex Richardson * yylex_init() 17475bb9250eSAlex Richardson */ 17485bb9250eSAlex Richardson return 0; 17495bb9250eSAlex Richardson } 17505bb9250eSAlex Richardson 17515bb9250eSAlex Richardson /* yylex_destroy is for both reentrant and non-reentrant scanners. */ 17525bb9250eSAlex Richardson int yylex_destroy (void) 17535bb9250eSAlex Richardson { 17545bb9250eSAlex Richardson 17555bb9250eSAlex Richardson /* Pop the buffer stack, destroying each element. */ 17565bb9250eSAlex Richardson while(YY_CURRENT_BUFFER){ 17575bb9250eSAlex Richardson yy_delete_buffer( YY_CURRENT_BUFFER ); 17585bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = NULL; 17595bb9250eSAlex Richardson yypop_buffer_state(); 17605bb9250eSAlex Richardson } 17615bb9250eSAlex Richardson 17625bb9250eSAlex Richardson /* Destroy the stack itself. */ 17635bb9250eSAlex Richardson yyfree((yy_buffer_stack) ); 17645bb9250eSAlex Richardson (yy_buffer_stack) = NULL; 17655bb9250eSAlex Richardson 17665bb9250eSAlex Richardson /* Reset the globals. This is important in a non-reentrant scanner so the next time 17675bb9250eSAlex Richardson * yylex() is called, initialization will occur. */ 17685bb9250eSAlex Richardson yy_init_globals( ); 17695bb9250eSAlex Richardson 17705bb9250eSAlex Richardson return 0; 17715bb9250eSAlex Richardson } 17725bb9250eSAlex Richardson 17735bb9250eSAlex Richardson /* 17745bb9250eSAlex Richardson * Internal utility routines. 17755bb9250eSAlex Richardson */ 17765bb9250eSAlex Richardson 17775bb9250eSAlex Richardson #ifndef yytext_ptr 1778*f8e57f89SAlex Richardson static void yy_flex_strncpy (char* s1, const char * s2, int n ) 17795bb9250eSAlex Richardson { 1780*f8e57f89SAlex Richardson 17815bb9250eSAlex Richardson int i; 17825bb9250eSAlex Richardson for ( i = 0; i < n; ++i ) 17835bb9250eSAlex Richardson s1[i] = s2[i]; 17845bb9250eSAlex Richardson } 17855bb9250eSAlex Richardson #endif 17865bb9250eSAlex Richardson 17875bb9250eSAlex Richardson #ifdef YY_NEED_STRLEN 1788*f8e57f89SAlex Richardson static int yy_flex_strlen (const char * s ) 17895bb9250eSAlex Richardson { 17905bb9250eSAlex Richardson int n; 17915bb9250eSAlex Richardson for ( n = 0; s[n]; ++n ) 17925bb9250eSAlex Richardson ; 17935bb9250eSAlex Richardson 17945bb9250eSAlex Richardson return n; 17955bb9250eSAlex Richardson } 17965bb9250eSAlex Richardson #endif 17975bb9250eSAlex Richardson 17985bb9250eSAlex Richardson void *yyalloc (yy_size_t size ) 17995bb9250eSAlex Richardson { 1800*f8e57f89SAlex Richardson return malloc(size); 18015bb9250eSAlex Richardson } 18025bb9250eSAlex Richardson 18035bb9250eSAlex Richardson void *yyrealloc (void * ptr, yy_size_t size ) 18045bb9250eSAlex Richardson { 1805*f8e57f89SAlex Richardson 18065bb9250eSAlex Richardson /* The cast to (char *) in the following accommodates both 18075bb9250eSAlex Richardson * implementations that use char* generic pointers, and those 18085bb9250eSAlex Richardson * that use void* generic pointers. It works with the latter 18095bb9250eSAlex Richardson * because both ANSI C and C++ allow castless assignment from 18105bb9250eSAlex Richardson * any pointer type to void*, and deal with argument conversions 18115bb9250eSAlex Richardson * as though doing an assignment. 18125bb9250eSAlex Richardson */ 1813*f8e57f89SAlex Richardson return realloc(ptr, size); 18145bb9250eSAlex Richardson } 18155bb9250eSAlex Richardson 18165bb9250eSAlex Richardson void yyfree (void * ptr ) 18175bb9250eSAlex Richardson { 18185bb9250eSAlex Richardson free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ 18195bb9250eSAlex Richardson } 18205bb9250eSAlex Richardson 18215bb9250eSAlex Richardson #define YYTABLES_NAME "yytables" 18225bb9250eSAlex Richardson 1823*f8e57f89SAlex Richardson #line 67 "tokenizer.l" 18245bb9250eSAlex Richardson 18255bb9250eSAlex Richardson 18265bb9250eSAlex Richardson int32_t 18275bb9250eSAlex Richardson number(void) 18285bb9250eSAlex Richardson { 18295bb9250eSAlex Richardson long l; 18305bb9250eSAlex Richardson 18315bb9250eSAlex Richardson errno = 0; 18325bb9250eSAlex Richardson l = strtol(yytext, NULL, 0); 18335bb9250eSAlex Richardson if (((l == LONG_MAX || l == LONG_MIN) && errno == ERANGE) || 18345bb9250eSAlex Richardson l > INT32_MAX || l < INT32_MIN) { 18355bb9250eSAlex Richardson m4_warnx("numeric overflow in expr: %s", yytext); 18365bb9250eSAlex Richardson } 18375bb9250eSAlex Richardson return l; 18385bb9250eSAlex Richardson } 18395bb9250eSAlex Richardson 18405bb9250eSAlex Richardson int32_t 18415bb9250eSAlex Richardson parse_radix(void) 18425bb9250eSAlex Richardson { 18435bb9250eSAlex Richardson long base; 18445bb9250eSAlex Richardson char *next; 18455bb9250eSAlex Richardson long l; 18465bb9250eSAlex Richardson int d; 18475bb9250eSAlex Richardson 18485bb9250eSAlex Richardson l = 0; 18495bb9250eSAlex Richardson base = strtol(yytext+2, &next, 0); 18505bb9250eSAlex Richardson if (base > 36 || next == NULL) { 18515bb9250eSAlex Richardson m4_warnx("error in number %s", yytext); 18525bb9250eSAlex Richardson } else { 18535bb9250eSAlex Richardson next++; 18545bb9250eSAlex Richardson while (*next != 0) { 18555bb9250eSAlex Richardson if (*next >= '0' && *next <= '9') 18565bb9250eSAlex Richardson d = *next - '0'; 18575bb9250eSAlex Richardson else if (*next >= 'a' && *next <= 'z') 18585bb9250eSAlex Richardson d = *next - 'a' + 10; 18595bb9250eSAlex Richardson else { 18605bb9250eSAlex Richardson assert(*next >= 'A' && *next <= 'Z'); 18615bb9250eSAlex Richardson d = *next - 'A' + 10; 18625bb9250eSAlex Richardson } 18635bb9250eSAlex Richardson if (d >= base) { 18645bb9250eSAlex Richardson m4_warnx("error in number %s", yytext); 18655bb9250eSAlex Richardson return 0; 18665bb9250eSAlex Richardson } 18675bb9250eSAlex Richardson l = base * l + d; 18685bb9250eSAlex Richardson next++; 18695bb9250eSAlex Richardson } 18705bb9250eSAlex Richardson } 18715bb9250eSAlex Richardson return l; 18725bb9250eSAlex Richardson } 18735bb9250eSAlex Richardson 18745bb9250eSAlex Richardson 1875