1*5bb9250eSAlex Richardson 2*5bb9250eSAlex Richardson 3*5bb9250eSAlex Richardson #define YY_INT_ALIGNED short int 4*5bb9250eSAlex Richardson 5*5bb9250eSAlex Richardson /* A lexical scanner generated by flex */ 6*5bb9250eSAlex Richardson 7*5bb9250eSAlex Richardson #define FLEX_SCANNER 8*5bb9250eSAlex Richardson #define YY_FLEX_MAJOR_VERSION 2 9*5bb9250eSAlex Richardson #define YY_FLEX_MINOR_VERSION 5 10*5bb9250eSAlex Richardson #define YY_FLEX_SUBMINOR_VERSION 37 11*5bb9250eSAlex Richardson #if YY_FLEX_SUBMINOR_VERSION > 0 12*5bb9250eSAlex Richardson #define FLEX_BETA 13*5bb9250eSAlex Richardson #endif 14*5bb9250eSAlex Richardson 15*5bb9250eSAlex Richardson /* First, we deal with platform-specific or compiler-specific issues. */ 16*5bb9250eSAlex Richardson 17*5bb9250eSAlex Richardson #if defined(__FreeBSD__) 18*5bb9250eSAlex Richardson #ifndef __STDC_LIMIT_MACROS 19*5bb9250eSAlex Richardson #define __STDC_LIMIT_MACROS 20*5bb9250eSAlex Richardson #endif 21*5bb9250eSAlex Richardson #include <sys/cdefs.h> 22*5bb9250eSAlex Richardson #include <stdint.h> 23*5bb9250eSAlex Richardson #else 24*5bb9250eSAlex Richardson #define __dead2 25*5bb9250eSAlex Richardson #endif 26*5bb9250eSAlex Richardson 27*5bb9250eSAlex Richardson /* begin standard C headers. */ 28*5bb9250eSAlex Richardson #include <stdio.h> 29*5bb9250eSAlex Richardson #include <string.h> 30*5bb9250eSAlex Richardson #include <errno.h> 31*5bb9250eSAlex Richardson #include <stdlib.h> 32*5bb9250eSAlex Richardson 33*5bb9250eSAlex Richardson /* end standard C headers. */ 34*5bb9250eSAlex Richardson 35*5bb9250eSAlex Richardson /* flex integer type definitions */ 36*5bb9250eSAlex Richardson 37*5bb9250eSAlex Richardson #ifndef FLEXINT_H 38*5bb9250eSAlex Richardson #define FLEXINT_H 39*5bb9250eSAlex Richardson 40*5bb9250eSAlex Richardson /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ 41*5bb9250eSAlex Richardson 42*5bb9250eSAlex Richardson #if defined(__FreeBSD__) || \ 43*5bb9250eSAlex Richardson (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) 44*5bb9250eSAlex Richardson 45*5bb9250eSAlex Richardson /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, 46*5bb9250eSAlex Richardson * if you want the limit (max/min) macros for int types. 47*5bb9250eSAlex Richardson */ 48*5bb9250eSAlex Richardson #ifndef __STDC_LIMIT_MACROS 49*5bb9250eSAlex Richardson #define __STDC_LIMIT_MACROS 1 50*5bb9250eSAlex Richardson #endif 51*5bb9250eSAlex Richardson 52*5bb9250eSAlex Richardson #include <inttypes.h> 53*5bb9250eSAlex Richardson typedef int8_t flex_int8_t; 54*5bb9250eSAlex Richardson typedef uint8_t flex_uint8_t; 55*5bb9250eSAlex Richardson typedef int16_t flex_int16_t; 56*5bb9250eSAlex Richardson typedef uint16_t flex_uint16_t; 57*5bb9250eSAlex Richardson typedef int32_t flex_int32_t; 58*5bb9250eSAlex Richardson typedef uint32_t flex_uint32_t; 59*5bb9250eSAlex Richardson #else 60*5bb9250eSAlex Richardson typedef signed char flex_int8_t; 61*5bb9250eSAlex Richardson typedef short int flex_int16_t; 62*5bb9250eSAlex Richardson typedef int flex_int32_t; 63*5bb9250eSAlex Richardson typedef unsigned char flex_uint8_t; 64*5bb9250eSAlex Richardson typedef unsigned short int flex_uint16_t; 65*5bb9250eSAlex Richardson typedef unsigned int flex_uint32_t; 66*5bb9250eSAlex Richardson 67*5bb9250eSAlex Richardson /* Limits of integral types. */ 68*5bb9250eSAlex Richardson #ifndef INT8_MIN 69*5bb9250eSAlex Richardson #define INT8_MIN (-128) 70*5bb9250eSAlex Richardson #endif 71*5bb9250eSAlex Richardson #ifndef INT16_MIN 72*5bb9250eSAlex Richardson #define INT16_MIN (-32767-1) 73*5bb9250eSAlex Richardson #endif 74*5bb9250eSAlex Richardson #ifndef INT32_MIN 75*5bb9250eSAlex Richardson #define INT32_MIN (-2147483647-1) 76*5bb9250eSAlex Richardson #endif 77*5bb9250eSAlex Richardson #ifndef INT8_MAX 78*5bb9250eSAlex Richardson #define INT8_MAX (127) 79*5bb9250eSAlex Richardson #endif 80*5bb9250eSAlex Richardson #ifndef INT16_MAX 81*5bb9250eSAlex Richardson #define INT16_MAX (32767) 82*5bb9250eSAlex Richardson #endif 83*5bb9250eSAlex Richardson #ifndef INT32_MAX 84*5bb9250eSAlex Richardson #define INT32_MAX (2147483647) 85*5bb9250eSAlex Richardson #endif 86*5bb9250eSAlex Richardson #ifndef UINT8_MAX 87*5bb9250eSAlex Richardson #define UINT8_MAX (255U) 88*5bb9250eSAlex Richardson #endif 89*5bb9250eSAlex Richardson #ifndef UINT16_MAX 90*5bb9250eSAlex Richardson #define UINT16_MAX (65535U) 91*5bb9250eSAlex Richardson #endif 92*5bb9250eSAlex Richardson #ifndef UINT32_MAX 93*5bb9250eSAlex Richardson #define UINT32_MAX (4294967295U) 94*5bb9250eSAlex Richardson #endif 95*5bb9250eSAlex Richardson 96*5bb9250eSAlex Richardson #endif /* ! C99 */ 97*5bb9250eSAlex Richardson 98*5bb9250eSAlex Richardson #endif /* ! FLEXINT_H */ 99*5bb9250eSAlex Richardson 100*5bb9250eSAlex Richardson #ifdef __cplusplus 101*5bb9250eSAlex Richardson 102*5bb9250eSAlex Richardson /* The "const" storage-class-modifier is valid. */ 103*5bb9250eSAlex Richardson #define YY_USE_CONST 104*5bb9250eSAlex Richardson 105*5bb9250eSAlex Richardson #else /* ! __cplusplus */ 106*5bb9250eSAlex Richardson 107*5bb9250eSAlex Richardson /* C99 requires __STDC__ to be defined as 1. */ 108*5bb9250eSAlex Richardson #if defined (__STDC__) 109*5bb9250eSAlex Richardson 110*5bb9250eSAlex Richardson #define YY_USE_CONST 111*5bb9250eSAlex Richardson 112*5bb9250eSAlex Richardson #endif /* defined (__STDC__) */ 113*5bb9250eSAlex Richardson #endif /* ! __cplusplus */ 114*5bb9250eSAlex Richardson 115*5bb9250eSAlex Richardson #ifdef YY_USE_CONST 116*5bb9250eSAlex Richardson #define yyconst const 117*5bb9250eSAlex Richardson #else 118*5bb9250eSAlex Richardson #define yyconst 119*5bb9250eSAlex Richardson #endif 120*5bb9250eSAlex Richardson 121*5bb9250eSAlex Richardson /* Returned upon end-of-file. */ 122*5bb9250eSAlex Richardson #define YY_NULL 0 123*5bb9250eSAlex Richardson 124*5bb9250eSAlex Richardson /* Promotes a possibly negative, possibly signed char to an unsigned 125*5bb9250eSAlex Richardson * integer for use as an array index. If the signed char is negative, 126*5bb9250eSAlex Richardson * we want to instead treat it as an 8-bit unsigned char, hence the 127*5bb9250eSAlex Richardson * double cast. 128*5bb9250eSAlex Richardson */ 129*5bb9250eSAlex Richardson #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) 130*5bb9250eSAlex Richardson 131*5bb9250eSAlex Richardson /* Enter a start condition. This macro really ought to take a parameter, 132*5bb9250eSAlex Richardson * but we do it the disgusting crufty way forced on us by the ()-less 133*5bb9250eSAlex Richardson * definition of BEGIN. 134*5bb9250eSAlex Richardson */ 135*5bb9250eSAlex Richardson #define BEGIN (yy_start) = 1 + 2 * 136*5bb9250eSAlex Richardson 137*5bb9250eSAlex Richardson /* Translate the current start state into a value that can be later handed 138*5bb9250eSAlex Richardson * to BEGIN to return to the state. The YYSTATE alias is for lex 139*5bb9250eSAlex Richardson * compatibility. 140*5bb9250eSAlex Richardson */ 141*5bb9250eSAlex Richardson #define YY_START (((yy_start) - 1) / 2) 142*5bb9250eSAlex Richardson #define YYSTATE YY_START 143*5bb9250eSAlex Richardson 144*5bb9250eSAlex Richardson /* Action number for EOF rule of a given start state. */ 145*5bb9250eSAlex Richardson #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 146*5bb9250eSAlex Richardson 147*5bb9250eSAlex Richardson /* Special action meaning "start processing a new file". */ 148*5bb9250eSAlex Richardson #define YY_NEW_FILE yyrestart(yyin ) 149*5bb9250eSAlex Richardson 150*5bb9250eSAlex Richardson #define YY_END_OF_BUFFER_CHAR 0 151*5bb9250eSAlex Richardson 152*5bb9250eSAlex Richardson /* Size of default input buffer. */ 153*5bb9250eSAlex Richardson #ifndef YY_BUF_SIZE 154*5bb9250eSAlex Richardson #define YY_BUF_SIZE 16384 155*5bb9250eSAlex Richardson #endif 156*5bb9250eSAlex Richardson 157*5bb9250eSAlex Richardson /* The state buf must be large enough to hold one state per character in the main buffer. 158*5bb9250eSAlex Richardson */ 159*5bb9250eSAlex Richardson #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) 160*5bb9250eSAlex Richardson 161*5bb9250eSAlex Richardson #ifndef YY_TYPEDEF_YY_BUFFER_STATE 162*5bb9250eSAlex Richardson #define YY_TYPEDEF_YY_BUFFER_STATE 163*5bb9250eSAlex Richardson typedef struct yy_buffer_state *YY_BUFFER_STATE; 164*5bb9250eSAlex Richardson #endif 165*5bb9250eSAlex Richardson 166*5bb9250eSAlex Richardson #ifndef YY_TYPEDEF_YY_SIZE_T 167*5bb9250eSAlex Richardson #define YY_TYPEDEF_YY_SIZE_T 168*5bb9250eSAlex Richardson typedef size_t yy_size_t; 169*5bb9250eSAlex Richardson #endif 170*5bb9250eSAlex Richardson 171*5bb9250eSAlex Richardson extern yy_size_t yyleng; 172*5bb9250eSAlex Richardson 173*5bb9250eSAlex Richardson extern FILE *yyin, *yyout; 174*5bb9250eSAlex Richardson 175*5bb9250eSAlex Richardson #define EOB_ACT_CONTINUE_SCAN 0 176*5bb9250eSAlex Richardson #define EOB_ACT_END_OF_FILE 1 177*5bb9250eSAlex Richardson #define EOB_ACT_LAST_MATCH 2 178*5bb9250eSAlex Richardson 179*5bb9250eSAlex Richardson #define YY_LESS_LINENO(n) 180*5bb9250eSAlex Richardson 181*5bb9250eSAlex Richardson /* Return all but the first "n" matched characters back to the input stream. */ 182*5bb9250eSAlex Richardson #define yyless(n) \ 183*5bb9250eSAlex Richardson do \ 184*5bb9250eSAlex Richardson { \ 185*5bb9250eSAlex Richardson /* Undo effects of setting up yytext. */ \ 186*5bb9250eSAlex Richardson int yyless_macro_arg = (n); \ 187*5bb9250eSAlex Richardson YY_LESS_LINENO(yyless_macro_arg);\ 188*5bb9250eSAlex Richardson *yy_cp = (yy_hold_char); \ 189*5bb9250eSAlex Richardson YY_RESTORE_YY_MORE_OFFSET \ 190*5bb9250eSAlex Richardson (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ 191*5bb9250eSAlex Richardson YY_DO_BEFORE_ACTION; /* set up yytext again */ \ 192*5bb9250eSAlex Richardson } \ 193*5bb9250eSAlex Richardson while ( 0 ) 194*5bb9250eSAlex Richardson 195*5bb9250eSAlex Richardson #define unput(c) yyunput( c, (yytext_ptr) ) 196*5bb9250eSAlex Richardson 197*5bb9250eSAlex Richardson #ifndef YY_STRUCT_YY_BUFFER_STATE 198*5bb9250eSAlex Richardson #define YY_STRUCT_YY_BUFFER_STATE 199*5bb9250eSAlex Richardson struct yy_buffer_state 200*5bb9250eSAlex Richardson { 201*5bb9250eSAlex Richardson FILE *yy_input_file; 202*5bb9250eSAlex Richardson 203*5bb9250eSAlex Richardson char *yy_ch_buf; /* input buffer */ 204*5bb9250eSAlex Richardson char *yy_buf_pos; /* current position in input buffer */ 205*5bb9250eSAlex Richardson 206*5bb9250eSAlex Richardson /* Size of input buffer in bytes, not including room for EOB 207*5bb9250eSAlex Richardson * characters. 208*5bb9250eSAlex Richardson */ 209*5bb9250eSAlex Richardson yy_size_t yy_buf_size; 210*5bb9250eSAlex Richardson 211*5bb9250eSAlex Richardson /* Number of characters read into yy_ch_buf, not including EOB 212*5bb9250eSAlex Richardson * characters. 213*5bb9250eSAlex Richardson */ 214*5bb9250eSAlex Richardson yy_size_t yy_n_chars; 215*5bb9250eSAlex Richardson 216*5bb9250eSAlex Richardson /* Whether we "own" the buffer - i.e., we know we created it, 217*5bb9250eSAlex Richardson * and can realloc() it to grow it, and should free() it to 218*5bb9250eSAlex Richardson * delete it. 219*5bb9250eSAlex Richardson */ 220*5bb9250eSAlex Richardson int yy_is_our_buffer; 221*5bb9250eSAlex Richardson 222*5bb9250eSAlex Richardson /* Whether this is an "interactive" input source; if so, and 223*5bb9250eSAlex Richardson * if we're using stdio for input, then we want to use getc() 224*5bb9250eSAlex Richardson * instead of fread(), to make sure we stop fetching input after 225*5bb9250eSAlex Richardson * each newline. 226*5bb9250eSAlex Richardson */ 227*5bb9250eSAlex Richardson int yy_is_interactive; 228*5bb9250eSAlex Richardson 229*5bb9250eSAlex Richardson /* Whether we're considered to be at the beginning of a line. 230*5bb9250eSAlex Richardson * If so, '^' rules will be active on the next match, otherwise 231*5bb9250eSAlex Richardson * not. 232*5bb9250eSAlex Richardson */ 233*5bb9250eSAlex Richardson int yy_at_bol; 234*5bb9250eSAlex Richardson 235*5bb9250eSAlex Richardson int yy_bs_lineno; /**< The line count. */ 236*5bb9250eSAlex Richardson int yy_bs_column; /**< The column count. */ 237*5bb9250eSAlex Richardson 238*5bb9250eSAlex Richardson /* Whether to try to fill the input buffer when we reach the 239*5bb9250eSAlex Richardson * end of it. 240*5bb9250eSAlex Richardson */ 241*5bb9250eSAlex Richardson int yy_fill_buffer; 242*5bb9250eSAlex Richardson 243*5bb9250eSAlex Richardson int yy_buffer_status; 244*5bb9250eSAlex Richardson 245*5bb9250eSAlex Richardson #define YY_BUFFER_NEW 0 246*5bb9250eSAlex Richardson #define YY_BUFFER_NORMAL 1 247*5bb9250eSAlex Richardson /* When an EOF's been seen but there's still some text to process 248*5bb9250eSAlex Richardson * then we mark the buffer as YY_EOF_PENDING, to indicate that we 249*5bb9250eSAlex Richardson * shouldn't try reading from the input source any more. We might 250*5bb9250eSAlex Richardson * still have a bunch of tokens to match, though, because of 251*5bb9250eSAlex Richardson * possible backing-up. 252*5bb9250eSAlex Richardson * 253*5bb9250eSAlex Richardson * When we actually see the EOF, we change the status to "new" 254*5bb9250eSAlex Richardson * (via yyrestart()), so that the user can continue scanning by 255*5bb9250eSAlex Richardson * just pointing yyin at a new input file. 256*5bb9250eSAlex Richardson */ 257*5bb9250eSAlex Richardson #define YY_BUFFER_EOF_PENDING 2 258*5bb9250eSAlex Richardson 259*5bb9250eSAlex Richardson }; 260*5bb9250eSAlex Richardson #endif /* !YY_STRUCT_YY_BUFFER_STATE */ 261*5bb9250eSAlex Richardson 262*5bb9250eSAlex Richardson /* Stack of input buffers. */ 263*5bb9250eSAlex Richardson static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ 264*5bb9250eSAlex Richardson static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ 265*5bb9250eSAlex Richardson static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ 266*5bb9250eSAlex Richardson 267*5bb9250eSAlex Richardson /* We provide macros for accessing buffer states in case in the 268*5bb9250eSAlex Richardson * future we want to put the buffer states in a more general 269*5bb9250eSAlex Richardson * "scanner state". 270*5bb9250eSAlex Richardson * 271*5bb9250eSAlex Richardson * Returns the top of the stack, or NULL. 272*5bb9250eSAlex Richardson */ 273*5bb9250eSAlex Richardson #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ 274*5bb9250eSAlex Richardson ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ 275*5bb9250eSAlex Richardson : NULL) 276*5bb9250eSAlex Richardson #define yy_current_buffer YY_CURRENT_BUFFER 277*5bb9250eSAlex Richardson 278*5bb9250eSAlex Richardson /* Same as previous macro, but useful when we know that the buffer stack is not 279*5bb9250eSAlex Richardson * NULL or when we need an lvalue. For internal use only. 280*5bb9250eSAlex Richardson */ 281*5bb9250eSAlex Richardson #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] 282*5bb9250eSAlex Richardson 283*5bb9250eSAlex Richardson /* yy_hold_char holds the character lost when yytext is formed. */ 284*5bb9250eSAlex Richardson static char yy_hold_char; 285*5bb9250eSAlex Richardson static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ 286*5bb9250eSAlex Richardson yy_size_t yyleng; 287*5bb9250eSAlex Richardson 288*5bb9250eSAlex Richardson /* Points to current character in buffer. */ 289*5bb9250eSAlex Richardson static char *yy_c_buf_p = (char *) 0; 290*5bb9250eSAlex Richardson static int yy_init = 0; /* whether we need to initialize */ 291*5bb9250eSAlex Richardson static int yy_start = 0; /* start state number */ 292*5bb9250eSAlex Richardson 293*5bb9250eSAlex Richardson /* Flag which is used to allow yywrap()'s to do buffer switches 294*5bb9250eSAlex Richardson * instead of setting up a fresh yyin. A bit of a hack ... 295*5bb9250eSAlex Richardson */ 296*5bb9250eSAlex Richardson static int yy_did_buffer_switch_on_eof; 297*5bb9250eSAlex Richardson 298*5bb9250eSAlex Richardson void yyrestart (FILE *input_file ); 299*5bb9250eSAlex Richardson void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); 300*5bb9250eSAlex Richardson YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); 301*5bb9250eSAlex Richardson void yy_delete_buffer (YY_BUFFER_STATE b ); 302*5bb9250eSAlex Richardson void yy_flush_buffer (YY_BUFFER_STATE b ); 303*5bb9250eSAlex Richardson void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); 304*5bb9250eSAlex Richardson void yypop_buffer_state (void ); 305*5bb9250eSAlex Richardson 306*5bb9250eSAlex Richardson static void yyensure_buffer_stack (void ); 307*5bb9250eSAlex Richardson static void yy_load_buffer_state (void ); 308*5bb9250eSAlex Richardson static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); 309*5bb9250eSAlex Richardson 310*5bb9250eSAlex Richardson #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) 311*5bb9250eSAlex Richardson 312*5bb9250eSAlex Richardson YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); 313*5bb9250eSAlex Richardson YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); 314*5bb9250eSAlex Richardson YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); 315*5bb9250eSAlex Richardson 316*5bb9250eSAlex Richardson void *yyalloc (yy_size_t ); 317*5bb9250eSAlex Richardson void *yyrealloc (void *,yy_size_t ); 318*5bb9250eSAlex Richardson void yyfree (void * ); 319*5bb9250eSAlex Richardson 320*5bb9250eSAlex Richardson #define yy_new_buffer yy_create_buffer 321*5bb9250eSAlex Richardson 322*5bb9250eSAlex Richardson #define yy_set_interactive(is_interactive) \ 323*5bb9250eSAlex Richardson { \ 324*5bb9250eSAlex Richardson if ( ! YY_CURRENT_BUFFER ){ \ 325*5bb9250eSAlex Richardson yyensure_buffer_stack (); \ 326*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = \ 327*5bb9250eSAlex Richardson yy_create_buffer(yyin,YY_BUF_SIZE ); \ 328*5bb9250eSAlex Richardson } \ 329*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ 330*5bb9250eSAlex Richardson } 331*5bb9250eSAlex Richardson 332*5bb9250eSAlex Richardson #define yy_set_bol(at_bol) \ 333*5bb9250eSAlex Richardson { \ 334*5bb9250eSAlex Richardson if ( ! YY_CURRENT_BUFFER ){\ 335*5bb9250eSAlex Richardson yyensure_buffer_stack (); \ 336*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = \ 337*5bb9250eSAlex Richardson yy_create_buffer(yyin,YY_BUF_SIZE ); \ 338*5bb9250eSAlex Richardson } \ 339*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ 340*5bb9250eSAlex Richardson } 341*5bb9250eSAlex Richardson 342*5bb9250eSAlex Richardson #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 343*5bb9250eSAlex Richardson 344*5bb9250eSAlex Richardson /* Begin user sect3 */ 345*5bb9250eSAlex Richardson 346*5bb9250eSAlex Richardson #define yywrap() 1 347*5bb9250eSAlex Richardson #define YY_SKIP_YYWRAP 348*5bb9250eSAlex Richardson 349*5bb9250eSAlex Richardson typedef unsigned char YY_CHAR; 350*5bb9250eSAlex Richardson 351*5bb9250eSAlex Richardson FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; 352*5bb9250eSAlex Richardson 353*5bb9250eSAlex Richardson typedef int yy_state_type; 354*5bb9250eSAlex Richardson 355*5bb9250eSAlex Richardson extern int yylineno; 356*5bb9250eSAlex Richardson 357*5bb9250eSAlex Richardson int yylineno = 1; 358*5bb9250eSAlex Richardson 359*5bb9250eSAlex Richardson extern char *yytext; 360*5bb9250eSAlex Richardson #define yytext_ptr yytext 361*5bb9250eSAlex Richardson 362*5bb9250eSAlex Richardson static yy_state_type yy_get_previous_state (void ); 363*5bb9250eSAlex Richardson static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); 364*5bb9250eSAlex Richardson static int yy_get_next_buffer (void ); 365*5bb9250eSAlex Richardson static void yy_fatal_error (yyconst char msg[] ) __dead2; 366*5bb9250eSAlex Richardson 367*5bb9250eSAlex Richardson /* Done after the current pattern has been matched and before the 368*5bb9250eSAlex Richardson * corresponding action - sets up yytext. 369*5bb9250eSAlex Richardson */ 370*5bb9250eSAlex Richardson #define YY_DO_BEFORE_ACTION \ 371*5bb9250eSAlex Richardson (yytext_ptr) = yy_bp; \ 372*5bb9250eSAlex Richardson yyleng = (size_t) (yy_cp - yy_bp); \ 373*5bb9250eSAlex Richardson (yy_hold_char) = *yy_cp; \ 374*5bb9250eSAlex Richardson *yy_cp = '\0'; \ 375*5bb9250eSAlex Richardson (yy_c_buf_p) = yy_cp; 376*5bb9250eSAlex Richardson 377*5bb9250eSAlex Richardson #define YY_NUM_RULES 14 378*5bb9250eSAlex Richardson #define YY_END_OF_BUFFER 15 379*5bb9250eSAlex Richardson /* This struct is not used in this scanner, 380*5bb9250eSAlex Richardson but its presence is necessary. */ 381*5bb9250eSAlex Richardson struct yy_trans_info 382*5bb9250eSAlex Richardson { 383*5bb9250eSAlex Richardson flex_int32_t yy_verify; 384*5bb9250eSAlex Richardson flex_int32_t yy_nxt; 385*5bb9250eSAlex Richardson }; 386*5bb9250eSAlex Richardson static yyconst flex_int16_t yy_accept[35] = 387*5bb9250eSAlex Richardson { 0, 388*5bb9250eSAlex Richardson 0, 0, 15, 13, 1, 1, 13, 13, 13, 2, 389*5bb9250eSAlex Richardson 2, 13, 13, 13, 13, 1, 9, 10, 12, 2, 390*5bb9250eSAlex Richardson 0, 0, 2, 6, 4, 8, 5, 7, 11, 0, 391*5bb9250eSAlex Richardson 2, 0, 3, 0 392*5bb9250eSAlex Richardson } ; 393*5bb9250eSAlex Richardson 394*5bb9250eSAlex Richardson static yyconst flex_int32_t yy_ec[256] = 395*5bb9250eSAlex Richardson { 0, 396*5bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 397*5bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 398*5bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 399*5bb9250eSAlex Richardson 1, 2, 4, 1, 1, 1, 1, 5, 1, 1, 400*5bb9250eSAlex Richardson 1, 6, 1, 1, 1, 1, 1, 7, 8, 8, 401*5bb9250eSAlex Richardson 8, 8, 8, 8, 8, 9, 9, 10, 1, 11, 402*5bb9250eSAlex Richardson 12, 13, 1, 1, 14, 14, 14, 14, 14, 14, 403*5bb9250eSAlex Richardson 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 404*5bb9250eSAlex Richardson 15, 16, 15, 15, 15, 15, 15, 17, 15, 15, 405*5bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 14, 14, 14, 14, 406*5bb9250eSAlex Richardson 407*5bb9250eSAlex Richardson 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 408*5bb9250eSAlex Richardson 15, 15, 15, 16, 15, 15, 15, 15, 15, 17, 409*5bb9250eSAlex Richardson 15, 15, 1, 18, 1, 1, 1, 1, 1, 1, 410*5bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 411*5bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 412*5bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 413*5bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 414*5bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 415*5bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 416*5bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 417*5bb9250eSAlex Richardson 418*5bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 419*5bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 420*5bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 421*5bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 422*5bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 423*5bb9250eSAlex Richardson 1, 1, 1, 1, 1 424*5bb9250eSAlex Richardson } ; 425*5bb9250eSAlex Richardson 426*5bb9250eSAlex Richardson static yyconst flex_int32_t yy_meta[19] = 427*5bb9250eSAlex Richardson { 0, 428*5bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 429*5bb9250eSAlex Richardson 1, 1, 1, 3, 4, 4, 4, 1 430*5bb9250eSAlex Richardson } ; 431*5bb9250eSAlex Richardson 432*5bb9250eSAlex Richardson static yyconst flex_int16_t yy_base[39] = 433*5bb9250eSAlex Richardson { 0, 434*5bb9250eSAlex Richardson 0, 0, 48, 49, 17, 19, 35, 41, 39, 16, 435*5bb9250eSAlex Richardson 0, 14, 32, 15, 25, 27, 49, 49, 49, 27, 436*5bb9250eSAlex Richardson 0, 0, 0, 49, 49, 49, 49, 49, 49, 32, 437*5bb9250eSAlex Richardson 0, 0, 0, 49, 39, 29, 34, 36 438*5bb9250eSAlex Richardson } ; 439*5bb9250eSAlex Richardson 440*5bb9250eSAlex Richardson static yyconst flex_int16_t yy_def[39] = 441*5bb9250eSAlex Richardson { 0, 442*5bb9250eSAlex Richardson 34, 1, 34, 34, 34, 34, 34, 34, 34, 34, 443*5bb9250eSAlex Richardson 35, 34, 34, 34, 34, 34, 34, 34, 34, 34, 444*5bb9250eSAlex Richardson 36, 37, 35, 34, 34, 34, 34, 34, 34, 36, 445*5bb9250eSAlex Richardson 37, 38, 38, 0, 34, 34, 34, 34 446*5bb9250eSAlex Richardson } ; 447*5bb9250eSAlex Richardson 448*5bb9250eSAlex Richardson static yyconst flex_int16_t yy_nxt[68] = 449*5bb9250eSAlex Richardson { 0, 450*5bb9250eSAlex Richardson 4, 5, 6, 7, 8, 9, 10, 11, 11, 4, 451*5bb9250eSAlex Richardson 12, 13, 14, 4, 4, 4, 4, 15, 16, 16, 452*5bb9250eSAlex Richardson 16, 16, 20, 20, 24, 25, 27, 28, 16, 16, 453*5bb9250eSAlex Richardson 30, 21, 22, 20, 20, 31, 31, 33, 33, 33, 454*5bb9250eSAlex Richardson 23, 32, 29, 26, 19, 18, 17, 34, 3, 34, 455*5bb9250eSAlex Richardson 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 456*5bb9250eSAlex Richardson 34, 34, 34, 34, 34, 34, 34 457*5bb9250eSAlex Richardson } ; 458*5bb9250eSAlex Richardson 459*5bb9250eSAlex Richardson static yyconst flex_int16_t yy_chk[68] = 460*5bb9250eSAlex Richardson { 0, 461*5bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 462*5bb9250eSAlex Richardson 1, 1, 1, 1, 1, 1, 1, 1, 5, 5, 463*5bb9250eSAlex Richardson 6, 6, 10, 10, 12, 12, 14, 14, 16, 16, 464*5bb9250eSAlex Richardson 36, 10, 10, 20, 20, 37, 37, 38, 38, 38, 465*5bb9250eSAlex Richardson 35, 30, 15, 13, 9, 8, 7, 3, 34, 34, 466*5bb9250eSAlex Richardson 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 467*5bb9250eSAlex Richardson 34, 34, 34, 34, 34, 34, 34 468*5bb9250eSAlex Richardson } ; 469*5bb9250eSAlex Richardson 470*5bb9250eSAlex Richardson static yy_state_type yy_last_accepting_state; 471*5bb9250eSAlex Richardson static char *yy_last_accepting_cpos; 472*5bb9250eSAlex Richardson 473*5bb9250eSAlex Richardson extern int yy_flex_debug; 474*5bb9250eSAlex Richardson int yy_flex_debug = 0; 475*5bb9250eSAlex Richardson 476*5bb9250eSAlex Richardson /* The intent behind this definition is that it'll catch 477*5bb9250eSAlex Richardson * any uses of REJECT which flex missed. 478*5bb9250eSAlex Richardson */ 479*5bb9250eSAlex Richardson #define REJECT reject_used_but_not_detected 480*5bb9250eSAlex Richardson #define yymore() yymore_used_but_not_detected 481*5bb9250eSAlex Richardson #define YY_MORE_ADJ 0 482*5bb9250eSAlex Richardson #define YY_RESTORE_YY_MORE_OFFSET 483*5bb9250eSAlex Richardson char *yytext; 484*5bb9250eSAlex Richardson #define YY_NO_INPUT 1 485*5bb9250eSAlex Richardson /* $OpenBSD: tokenizer.l,v 1.9 2017/06/15 13:48:42 bcallah Exp $ */ 486*5bb9250eSAlex Richardson /* 487*5bb9250eSAlex Richardson * Copyright (c) 2004 Marc Espie <espie@cvs.openbsd.org> 488*5bb9250eSAlex Richardson * 489*5bb9250eSAlex Richardson * Permission to use, copy, modify, and distribute this software for any 490*5bb9250eSAlex Richardson * purpose with or without fee is hereby granted, provided that the above 491*5bb9250eSAlex Richardson * copyright notice and this permission notice appear in all copies. 492*5bb9250eSAlex Richardson * 493*5bb9250eSAlex Richardson * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 494*5bb9250eSAlex Richardson * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 495*5bb9250eSAlex Richardson * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 496*5bb9250eSAlex Richardson * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 497*5bb9250eSAlex Richardson * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 498*5bb9250eSAlex Richardson * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 499*5bb9250eSAlex Richardson * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 500*5bb9250eSAlex Richardson * 501*5bb9250eSAlex Richardson * $FreeBSD$ 502*5bb9250eSAlex Richardson */ 503*5bb9250eSAlex Richardson #include "parser.h" 504*5bb9250eSAlex Richardson #include <assert.h> 505*5bb9250eSAlex Richardson #include <stdlib.h> 506*5bb9250eSAlex Richardson #include <errno.h> 507*5bb9250eSAlex Richardson #include <stdint.h> 508*5bb9250eSAlex Richardson #include <limits.h> 509*5bb9250eSAlex Richardson 510*5bb9250eSAlex Richardson extern void m4_warnx(const char *, ...); 511*5bb9250eSAlex Richardson extern int mimic_gnu; 512*5bb9250eSAlex Richardson extern int32_t yylval; 513*5bb9250eSAlex Richardson 514*5bb9250eSAlex Richardson int32_t number(void); 515*5bb9250eSAlex Richardson int32_t parse_radix(void); 516*5bb9250eSAlex Richardson extern int yylex(void); 517*5bb9250eSAlex Richardson 518*5bb9250eSAlex Richardson #define YY_DECL int yylex(void) 519*5bb9250eSAlex Richardson 520*5bb9250eSAlex Richardson #define INITIAL 0 521*5bb9250eSAlex Richardson 522*5bb9250eSAlex Richardson #ifndef YY_NO_UNISTD_H 523*5bb9250eSAlex Richardson /* Special case for "unistd.h", since it is non-ANSI. We include it way 524*5bb9250eSAlex Richardson * down here because we want the user's section 1 to have been scanned first. 525*5bb9250eSAlex Richardson * The user has a chance to override it with an option. 526*5bb9250eSAlex Richardson */ 527*5bb9250eSAlex Richardson #include <unistd.h> 528*5bb9250eSAlex Richardson #endif 529*5bb9250eSAlex Richardson 530*5bb9250eSAlex Richardson #ifndef YY_EXTRA_TYPE 531*5bb9250eSAlex Richardson #define YY_EXTRA_TYPE void * 532*5bb9250eSAlex Richardson #endif 533*5bb9250eSAlex Richardson 534*5bb9250eSAlex Richardson static int yy_init_globals (void ); 535*5bb9250eSAlex Richardson 536*5bb9250eSAlex Richardson /* Accessor methods to globals. 537*5bb9250eSAlex Richardson These are made visible to non-reentrant scanners for convenience. */ 538*5bb9250eSAlex Richardson 539*5bb9250eSAlex Richardson int yylex_destroy (void ); 540*5bb9250eSAlex Richardson 541*5bb9250eSAlex Richardson int yyget_debug (void ); 542*5bb9250eSAlex Richardson 543*5bb9250eSAlex Richardson void yyset_debug (int debug_flag ); 544*5bb9250eSAlex Richardson 545*5bb9250eSAlex Richardson YY_EXTRA_TYPE yyget_extra (void ); 546*5bb9250eSAlex Richardson 547*5bb9250eSAlex Richardson void yyset_extra (YY_EXTRA_TYPE user_defined ); 548*5bb9250eSAlex Richardson 549*5bb9250eSAlex Richardson FILE *yyget_in (void ); 550*5bb9250eSAlex Richardson 551*5bb9250eSAlex Richardson void yyset_in (FILE * in_str ); 552*5bb9250eSAlex Richardson 553*5bb9250eSAlex Richardson FILE *yyget_out (void ); 554*5bb9250eSAlex Richardson 555*5bb9250eSAlex Richardson void yyset_out (FILE * out_str ); 556*5bb9250eSAlex Richardson 557*5bb9250eSAlex Richardson yy_size_t yyget_leng (void ); 558*5bb9250eSAlex Richardson 559*5bb9250eSAlex Richardson char *yyget_text (void ); 560*5bb9250eSAlex Richardson 561*5bb9250eSAlex Richardson int yyget_lineno (void ); 562*5bb9250eSAlex Richardson 563*5bb9250eSAlex Richardson void yyset_lineno (int line_number ); 564*5bb9250eSAlex Richardson 565*5bb9250eSAlex Richardson /* Macros after this point can all be overridden by user definitions in 566*5bb9250eSAlex Richardson * section 1. 567*5bb9250eSAlex Richardson */ 568*5bb9250eSAlex Richardson 569*5bb9250eSAlex Richardson #ifndef YY_SKIP_YYWRAP 570*5bb9250eSAlex Richardson #ifdef __cplusplus 571*5bb9250eSAlex Richardson extern "C" int yywrap (void ); 572*5bb9250eSAlex Richardson #else 573*5bb9250eSAlex Richardson extern int yywrap (void ); 574*5bb9250eSAlex Richardson #endif 575*5bb9250eSAlex Richardson #endif 576*5bb9250eSAlex Richardson 577*5bb9250eSAlex Richardson #ifndef yytext_ptr 578*5bb9250eSAlex Richardson static void yy_flex_strncpy (char *,yyconst char *,int ); 579*5bb9250eSAlex Richardson #endif 580*5bb9250eSAlex Richardson 581*5bb9250eSAlex Richardson #ifdef YY_NEED_STRLEN 582*5bb9250eSAlex Richardson static int yy_flex_strlen (yyconst char * ); 583*5bb9250eSAlex Richardson #endif 584*5bb9250eSAlex Richardson 585*5bb9250eSAlex Richardson #ifndef YY_NO_INPUT 586*5bb9250eSAlex Richardson 587*5bb9250eSAlex Richardson #ifdef __cplusplus 588*5bb9250eSAlex Richardson static int yyinput (void ); 589*5bb9250eSAlex Richardson #else 590*5bb9250eSAlex Richardson static int input (void ); 591*5bb9250eSAlex Richardson #endif 592*5bb9250eSAlex Richardson 593*5bb9250eSAlex Richardson #endif 594*5bb9250eSAlex Richardson 595*5bb9250eSAlex Richardson /* Amount of stuff to slurp up with each read. */ 596*5bb9250eSAlex Richardson #ifndef YY_READ_BUF_SIZE 597*5bb9250eSAlex Richardson #define YY_READ_BUF_SIZE 8192 598*5bb9250eSAlex Richardson #endif 599*5bb9250eSAlex Richardson 600*5bb9250eSAlex Richardson /* Copy whatever the last rule matched to the standard output. */ 601*5bb9250eSAlex Richardson #ifndef ECHO 602*5bb9250eSAlex Richardson /* This used to be an fputs(), but since the string might contain NUL's, 603*5bb9250eSAlex Richardson * we now use fwrite(). 604*5bb9250eSAlex Richardson */ 605*5bb9250eSAlex Richardson #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) 606*5bb9250eSAlex Richardson #endif 607*5bb9250eSAlex Richardson 608*5bb9250eSAlex Richardson /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 609*5bb9250eSAlex Richardson * is returned in "result". 610*5bb9250eSAlex Richardson */ 611*5bb9250eSAlex Richardson #ifndef YY_INPUT 612*5bb9250eSAlex Richardson #define YY_INPUT(buf,result,max_size) \ 613*5bb9250eSAlex Richardson if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 614*5bb9250eSAlex Richardson { \ 615*5bb9250eSAlex Richardson int c = '*'; \ 616*5bb9250eSAlex Richardson size_t n; \ 617*5bb9250eSAlex Richardson for ( n = 0; n < max_size && \ 618*5bb9250eSAlex Richardson (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 619*5bb9250eSAlex Richardson buf[n] = (char) c; \ 620*5bb9250eSAlex Richardson if ( c == '\n' ) \ 621*5bb9250eSAlex Richardson buf[n++] = (char) c; \ 622*5bb9250eSAlex Richardson if ( c == EOF && ferror( yyin ) ) \ 623*5bb9250eSAlex Richardson YY_FATAL_ERROR( "input in flex scanner failed" ); \ 624*5bb9250eSAlex Richardson result = n; \ 625*5bb9250eSAlex Richardson } \ 626*5bb9250eSAlex Richardson else \ 627*5bb9250eSAlex Richardson { \ 628*5bb9250eSAlex Richardson errno=0; \ 629*5bb9250eSAlex Richardson while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ 630*5bb9250eSAlex Richardson { \ 631*5bb9250eSAlex Richardson if( errno != EINTR) \ 632*5bb9250eSAlex Richardson { \ 633*5bb9250eSAlex Richardson YY_FATAL_ERROR( "input in flex scanner failed" ); \ 634*5bb9250eSAlex Richardson break; \ 635*5bb9250eSAlex Richardson } \ 636*5bb9250eSAlex Richardson errno=0; \ 637*5bb9250eSAlex Richardson clearerr(yyin); \ 638*5bb9250eSAlex Richardson } \ 639*5bb9250eSAlex Richardson }\ 640*5bb9250eSAlex Richardson \ 641*5bb9250eSAlex Richardson 642*5bb9250eSAlex Richardson #endif 643*5bb9250eSAlex Richardson 644*5bb9250eSAlex Richardson /* No semi-colon after return; correct usage is to write "yyterminate();" - 645*5bb9250eSAlex Richardson * we don't want an extra ';' after the "return" because that will cause 646*5bb9250eSAlex Richardson * some compilers to complain about unreachable statements. 647*5bb9250eSAlex Richardson */ 648*5bb9250eSAlex Richardson #ifndef yyterminate 649*5bb9250eSAlex Richardson #define yyterminate() return YY_NULL 650*5bb9250eSAlex Richardson #endif 651*5bb9250eSAlex Richardson 652*5bb9250eSAlex Richardson /* Number of entries by which start-condition stack grows. */ 653*5bb9250eSAlex Richardson #ifndef YY_START_STACK_INCR 654*5bb9250eSAlex Richardson #define YY_START_STACK_INCR 25 655*5bb9250eSAlex Richardson #endif 656*5bb9250eSAlex Richardson 657*5bb9250eSAlex Richardson /* Report a fatal error. */ 658*5bb9250eSAlex Richardson #ifndef YY_FATAL_ERROR 659*5bb9250eSAlex Richardson #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 660*5bb9250eSAlex Richardson #endif 661*5bb9250eSAlex Richardson 662*5bb9250eSAlex Richardson /* end tables serialization structures and prototypes */ 663*5bb9250eSAlex Richardson 664*5bb9250eSAlex Richardson /* Default declaration of generated scanner - a define so the user can 665*5bb9250eSAlex Richardson * easily add parameters. 666*5bb9250eSAlex Richardson */ 667*5bb9250eSAlex Richardson #ifndef YY_DECL 668*5bb9250eSAlex Richardson #define YY_DECL_IS_OURS 1 669*5bb9250eSAlex Richardson 670*5bb9250eSAlex Richardson extern int yylex (void); 671*5bb9250eSAlex Richardson 672*5bb9250eSAlex Richardson #define YY_DECL int yylex (void) 673*5bb9250eSAlex Richardson #endif /* !YY_DECL */ 674*5bb9250eSAlex Richardson 675*5bb9250eSAlex Richardson /* Code executed at the beginning of each rule, after yytext and yyleng 676*5bb9250eSAlex Richardson * have been set up. 677*5bb9250eSAlex Richardson */ 678*5bb9250eSAlex Richardson #ifndef YY_USER_ACTION 679*5bb9250eSAlex Richardson #define YY_USER_ACTION 680*5bb9250eSAlex Richardson #endif 681*5bb9250eSAlex Richardson 682*5bb9250eSAlex Richardson /* Code executed at the end of each rule. */ 683*5bb9250eSAlex Richardson #ifndef YY_BREAK 684*5bb9250eSAlex Richardson #define YY_BREAK break; 685*5bb9250eSAlex Richardson #endif 686*5bb9250eSAlex Richardson 687*5bb9250eSAlex Richardson #define YY_RULE_SETUP \ 688*5bb9250eSAlex Richardson YY_USER_ACTION 689*5bb9250eSAlex Richardson 690*5bb9250eSAlex Richardson /** The main scanner function which does all the work. 691*5bb9250eSAlex Richardson */ 692*5bb9250eSAlex Richardson YY_DECL 693*5bb9250eSAlex Richardson { 694*5bb9250eSAlex Richardson yy_state_type yy_current_state; 695*5bb9250eSAlex Richardson char *yy_cp, *yy_bp; 696*5bb9250eSAlex Richardson int yy_act; 697*5bb9250eSAlex Richardson 698*5bb9250eSAlex Richardson 699*5bb9250eSAlex Richardson 700*5bb9250eSAlex Richardson if ( !(yy_init) ) 701*5bb9250eSAlex Richardson { 702*5bb9250eSAlex Richardson (yy_init) = 1; 703*5bb9250eSAlex Richardson 704*5bb9250eSAlex Richardson #ifdef YY_USER_INIT 705*5bb9250eSAlex Richardson YY_USER_INIT; 706*5bb9250eSAlex Richardson #endif 707*5bb9250eSAlex Richardson 708*5bb9250eSAlex Richardson if ( ! (yy_start) ) 709*5bb9250eSAlex Richardson (yy_start) = 1; /* first start state */ 710*5bb9250eSAlex Richardson 711*5bb9250eSAlex Richardson if ( ! yyin ) 712*5bb9250eSAlex Richardson yyin = stdin; 713*5bb9250eSAlex Richardson 714*5bb9250eSAlex Richardson if ( ! yyout ) 715*5bb9250eSAlex Richardson yyout = stdout; 716*5bb9250eSAlex Richardson 717*5bb9250eSAlex Richardson if ( ! YY_CURRENT_BUFFER ) { 718*5bb9250eSAlex Richardson yyensure_buffer_stack (); 719*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = 720*5bb9250eSAlex Richardson yy_create_buffer(yyin,YY_BUF_SIZE ); 721*5bb9250eSAlex Richardson } 722*5bb9250eSAlex Richardson 723*5bb9250eSAlex Richardson yy_load_buffer_state( ); 724*5bb9250eSAlex Richardson } 725*5bb9250eSAlex Richardson 726*5bb9250eSAlex Richardson while ( 1 ) /* loops until end-of-file is reached */ 727*5bb9250eSAlex Richardson { 728*5bb9250eSAlex Richardson yy_cp = (yy_c_buf_p); 729*5bb9250eSAlex Richardson 730*5bb9250eSAlex Richardson /* Support of yytext. */ 731*5bb9250eSAlex Richardson *yy_cp = (yy_hold_char); 732*5bb9250eSAlex Richardson 733*5bb9250eSAlex Richardson /* yy_bp points to the position in yy_ch_buf of the start of 734*5bb9250eSAlex Richardson * the current run. 735*5bb9250eSAlex Richardson */ 736*5bb9250eSAlex Richardson yy_bp = yy_cp; 737*5bb9250eSAlex Richardson 738*5bb9250eSAlex Richardson yy_current_state = (yy_start); 739*5bb9250eSAlex Richardson yy_match: 740*5bb9250eSAlex Richardson do 741*5bb9250eSAlex Richardson { 742*5bb9250eSAlex Richardson YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; 743*5bb9250eSAlex Richardson if ( yy_accept[yy_current_state] ) 744*5bb9250eSAlex Richardson { 745*5bb9250eSAlex Richardson (yy_last_accepting_state) = yy_current_state; 746*5bb9250eSAlex Richardson (yy_last_accepting_cpos) = yy_cp; 747*5bb9250eSAlex Richardson } 748*5bb9250eSAlex Richardson while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 749*5bb9250eSAlex Richardson { 750*5bb9250eSAlex Richardson yy_current_state = (int) yy_def[yy_current_state]; 751*5bb9250eSAlex Richardson if ( yy_current_state >= 35 ) 752*5bb9250eSAlex Richardson yy_c = yy_meta[(unsigned int) yy_c]; 753*5bb9250eSAlex Richardson } 754*5bb9250eSAlex Richardson yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 755*5bb9250eSAlex Richardson ++yy_cp; 756*5bb9250eSAlex Richardson } 757*5bb9250eSAlex Richardson while ( yy_base[yy_current_state] != 49 ); 758*5bb9250eSAlex Richardson 759*5bb9250eSAlex Richardson yy_find_action: 760*5bb9250eSAlex Richardson yy_act = yy_accept[yy_current_state]; 761*5bb9250eSAlex Richardson if ( yy_act == 0 ) 762*5bb9250eSAlex Richardson { /* have to back up */ 763*5bb9250eSAlex Richardson yy_cp = (yy_last_accepting_cpos); 764*5bb9250eSAlex Richardson yy_current_state = (yy_last_accepting_state); 765*5bb9250eSAlex Richardson yy_act = yy_accept[yy_current_state]; 766*5bb9250eSAlex Richardson } 767*5bb9250eSAlex Richardson 768*5bb9250eSAlex Richardson YY_DO_BEFORE_ACTION; 769*5bb9250eSAlex Richardson 770*5bb9250eSAlex Richardson do_action: /* This label is used only to access EOF actions. */ 771*5bb9250eSAlex Richardson 772*5bb9250eSAlex Richardson switch ( yy_act ) 773*5bb9250eSAlex Richardson { /* beginning of action switch */ 774*5bb9250eSAlex Richardson case 0: /* must back up */ 775*5bb9250eSAlex Richardson /* undo the effects of YY_DO_BEFORE_ACTION */ 776*5bb9250eSAlex Richardson *yy_cp = (yy_hold_char); 777*5bb9250eSAlex Richardson yy_cp = (yy_last_accepting_cpos); 778*5bb9250eSAlex Richardson yy_current_state = (yy_last_accepting_state); 779*5bb9250eSAlex Richardson goto yy_find_action; 780*5bb9250eSAlex Richardson 781*5bb9250eSAlex Richardson case 1: 782*5bb9250eSAlex Richardson /* rule 1 can match eol */ 783*5bb9250eSAlex Richardson YY_RULE_SETUP 784*5bb9250eSAlex Richardson {/* just skip it */} 785*5bb9250eSAlex Richardson YY_BREAK 786*5bb9250eSAlex Richardson case 2: 787*5bb9250eSAlex Richardson YY_RULE_SETUP 788*5bb9250eSAlex Richardson { yylval = number(); return(NUMBER); } 789*5bb9250eSAlex Richardson YY_BREAK 790*5bb9250eSAlex Richardson case 3: 791*5bb9250eSAlex Richardson YY_RULE_SETUP 792*5bb9250eSAlex Richardson { if (mimic_gnu) { 793*5bb9250eSAlex Richardson yylval = parse_radix(); return(NUMBER); 794*5bb9250eSAlex Richardson } else { 795*5bb9250eSAlex Richardson return(ERROR); 796*5bb9250eSAlex Richardson } 797*5bb9250eSAlex Richardson } 798*5bb9250eSAlex Richardson YY_BREAK 799*5bb9250eSAlex Richardson case 4: 800*5bb9250eSAlex Richardson YY_RULE_SETUP 801*5bb9250eSAlex Richardson { return(LE); } 802*5bb9250eSAlex Richardson YY_BREAK 803*5bb9250eSAlex Richardson case 5: 804*5bb9250eSAlex Richardson YY_RULE_SETUP 805*5bb9250eSAlex Richardson { return(GE); } 806*5bb9250eSAlex Richardson YY_BREAK 807*5bb9250eSAlex Richardson case 6: 808*5bb9250eSAlex Richardson YY_RULE_SETUP 809*5bb9250eSAlex Richardson { return(LSHIFT); } 810*5bb9250eSAlex Richardson YY_BREAK 811*5bb9250eSAlex Richardson case 7: 812*5bb9250eSAlex Richardson YY_RULE_SETUP 813*5bb9250eSAlex Richardson { return(RSHIFT); } 814*5bb9250eSAlex Richardson YY_BREAK 815*5bb9250eSAlex Richardson case 8: 816*5bb9250eSAlex Richardson YY_RULE_SETUP 817*5bb9250eSAlex Richardson { return(EQ); } 818*5bb9250eSAlex Richardson YY_BREAK 819*5bb9250eSAlex Richardson case 9: 820*5bb9250eSAlex Richardson YY_RULE_SETUP 821*5bb9250eSAlex Richardson { return(NE); } 822*5bb9250eSAlex Richardson YY_BREAK 823*5bb9250eSAlex Richardson case 10: 824*5bb9250eSAlex Richardson YY_RULE_SETUP 825*5bb9250eSAlex Richardson { return(LAND); } 826*5bb9250eSAlex Richardson YY_BREAK 827*5bb9250eSAlex Richardson case 11: 828*5bb9250eSAlex Richardson YY_RULE_SETUP 829*5bb9250eSAlex Richardson { return(LOR); } 830*5bb9250eSAlex Richardson YY_BREAK 831*5bb9250eSAlex Richardson case 12: 832*5bb9250eSAlex Richardson YY_RULE_SETUP 833*5bb9250eSAlex Richardson { if (mimic_gnu) { return (EXPONENT); } } 834*5bb9250eSAlex Richardson YY_BREAK 835*5bb9250eSAlex Richardson case 13: 836*5bb9250eSAlex Richardson YY_RULE_SETUP 837*5bb9250eSAlex Richardson { return yytext[0]; } 838*5bb9250eSAlex Richardson YY_BREAK 839*5bb9250eSAlex Richardson case 14: 840*5bb9250eSAlex Richardson YY_RULE_SETUP 841*5bb9250eSAlex Richardson ECHO; 842*5bb9250eSAlex Richardson YY_BREAK 843*5bb9250eSAlex Richardson case YY_STATE_EOF(INITIAL): 844*5bb9250eSAlex Richardson yyterminate(); 845*5bb9250eSAlex Richardson 846*5bb9250eSAlex Richardson case YY_END_OF_BUFFER: 847*5bb9250eSAlex Richardson { 848*5bb9250eSAlex Richardson /* Amount of text matched not including the EOB char. */ 849*5bb9250eSAlex Richardson int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; 850*5bb9250eSAlex Richardson 851*5bb9250eSAlex Richardson /* Undo the effects of YY_DO_BEFORE_ACTION. */ 852*5bb9250eSAlex Richardson *yy_cp = (yy_hold_char); 853*5bb9250eSAlex Richardson YY_RESTORE_YY_MORE_OFFSET 854*5bb9250eSAlex Richardson 855*5bb9250eSAlex Richardson if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) 856*5bb9250eSAlex Richardson { 857*5bb9250eSAlex Richardson /* We're scanning a new file or input source. It's 858*5bb9250eSAlex Richardson * possible that this happened because the user 859*5bb9250eSAlex Richardson * just pointed yyin at a new source and called 860*5bb9250eSAlex Richardson * yylex(). If so, then we have to assure 861*5bb9250eSAlex Richardson * consistency between YY_CURRENT_BUFFER and our 862*5bb9250eSAlex Richardson * globals. Here is the right place to do so, because 863*5bb9250eSAlex Richardson * this is the first action (other than possibly a 864*5bb9250eSAlex Richardson * back-up) that will match for the new input source. 865*5bb9250eSAlex Richardson */ 866*5bb9250eSAlex Richardson (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 867*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; 868*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; 869*5bb9250eSAlex Richardson } 870*5bb9250eSAlex Richardson 871*5bb9250eSAlex Richardson /* Note that here we test for yy_c_buf_p "<=" to the position 872*5bb9250eSAlex Richardson * of the first EOB in the buffer, since yy_c_buf_p will 873*5bb9250eSAlex Richardson * already have been incremented past the NUL character 874*5bb9250eSAlex Richardson * (since all states make transitions on EOB to the 875*5bb9250eSAlex Richardson * end-of-buffer state). Contrast this with the test 876*5bb9250eSAlex Richardson * in input(). 877*5bb9250eSAlex Richardson */ 878*5bb9250eSAlex Richardson if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 879*5bb9250eSAlex Richardson { /* This was really a NUL. */ 880*5bb9250eSAlex Richardson yy_state_type yy_next_state; 881*5bb9250eSAlex Richardson 882*5bb9250eSAlex Richardson (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; 883*5bb9250eSAlex Richardson 884*5bb9250eSAlex Richardson yy_current_state = yy_get_previous_state( ); 885*5bb9250eSAlex Richardson 886*5bb9250eSAlex Richardson /* Okay, we're now positioned to make the NUL 887*5bb9250eSAlex Richardson * transition. We couldn't have 888*5bb9250eSAlex Richardson * yy_get_previous_state() go ahead and do it 889*5bb9250eSAlex Richardson * for us because it doesn't know how to deal 890*5bb9250eSAlex Richardson * with the possibility of jamming (and we don't 891*5bb9250eSAlex Richardson * want to build jamming into it because then it 892*5bb9250eSAlex Richardson * will run more slowly). 893*5bb9250eSAlex Richardson */ 894*5bb9250eSAlex Richardson 895*5bb9250eSAlex Richardson yy_next_state = yy_try_NUL_trans( yy_current_state ); 896*5bb9250eSAlex Richardson 897*5bb9250eSAlex Richardson yy_bp = (yytext_ptr) + YY_MORE_ADJ; 898*5bb9250eSAlex Richardson 899*5bb9250eSAlex Richardson if ( yy_next_state ) 900*5bb9250eSAlex Richardson { 901*5bb9250eSAlex Richardson /* Consume the NUL. */ 902*5bb9250eSAlex Richardson yy_cp = ++(yy_c_buf_p); 903*5bb9250eSAlex Richardson yy_current_state = yy_next_state; 904*5bb9250eSAlex Richardson goto yy_match; 905*5bb9250eSAlex Richardson } 906*5bb9250eSAlex Richardson 907*5bb9250eSAlex Richardson else 908*5bb9250eSAlex Richardson { 909*5bb9250eSAlex Richardson yy_cp = (yy_c_buf_p); 910*5bb9250eSAlex Richardson goto yy_find_action; 911*5bb9250eSAlex Richardson } 912*5bb9250eSAlex Richardson } 913*5bb9250eSAlex Richardson 914*5bb9250eSAlex Richardson else switch ( yy_get_next_buffer( ) ) 915*5bb9250eSAlex Richardson { 916*5bb9250eSAlex Richardson case EOB_ACT_END_OF_FILE: 917*5bb9250eSAlex Richardson { 918*5bb9250eSAlex Richardson (yy_did_buffer_switch_on_eof) = 0; 919*5bb9250eSAlex Richardson 920*5bb9250eSAlex Richardson if ( yywrap( ) ) 921*5bb9250eSAlex Richardson { 922*5bb9250eSAlex Richardson /* Note: because we've taken care in 923*5bb9250eSAlex Richardson * yy_get_next_buffer() to have set up 924*5bb9250eSAlex Richardson * yytext, we can now set up 925*5bb9250eSAlex Richardson * yy_c_buf_p so that if some total 926*5bb9250eSAlex Richardson * hoser (like flex itself) wants to 927*5bb9250eSAlex Richardson * call the scanner after we return the 928*5bb9250eSAlex Richardson * YY_NULL, it'll still work - another 929*5bb9250eSAlex Richardson * YY_NULL will get returned. 930*5bb9250eSAlex Richardson */ 931*5bb9250eSAlex Richardson (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; 932*5bb9250eSAlex Richardson 933*5bb9250eSAlex Richardson yy_act = YY_STATE_EOF(YY_START); 934*5bb9250eSAlex Richardson goto do_action; 935*5bb9250eSAlex Richardson } 936*5bb9250eSAlex Richardson 937*5bb9250eSAlex Richardson else 938*5bb9250eSAlex Richardson { 939*5bb9250eSAlex Richardson if ( ! (yy_did_buffer_switch_on_eof) ) 940*5bb9250eSAlex Richardson YY_NEW_FILE; 941*5bb9250eSAlex Richardson } 942*5bb9250eSAlex Richardson break; 943*5bb9250eSAlex Richardson } 944*5bb9250eSAlex Richardson 945*5bb9250eSAlex Richardson case EOB_ACT_CONTINUE_SCAN: 946*5bb9250eSAlex Richardson (yy_c_buf_p) = 947*5bb9250eSAlex Richardson (yytext_ptr) + yy_amount_of_matched_text; 948*5bb9250eSAlex Richardson 949*5bb9250eSAlex Richardson yy_current_state = yy_get_previous_state( ); 950*5bb9250eSAlex Richardson 951*5bb9250eSAlex Richardson yy_cp = (yy_c_buf_p); 952*5bb9250eSAlex Richardson yy_bp = (yytext_ptr) + YY_MORE_ADJ; 953*5bb9250eSAlex Richardson goto yy_match; 954*5bb9250eSAlex Richardson 955*5bb9250eSAlex Richardson case EOB_ACT_LAST_MATCH: 956*5bb9250eSAlex Richardson (yy_c_buf_p) = 957*5bb9250eSAlex Richardson &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; 958*5bb9250eSAlex Richardson 959*5bb9250eSAlex Richardson yy_current_state = yy_get_previous_state( ); 960*5bb9250eSAlex Richardson 961*5bb9250eSAlex Richardson yy_cp = (yy_c_buf_p); 962*5bb9250eSAlex Richardson yy_bp = (yytext_ptr) + YY_MORE_ADJ; 963*5bb9250eSAlex Richardson goto yy_find_action; 964*5bb9250eSAlex Richardson } 965*5bb9250eSAlex Richardson break; 966*5bb9250eSAlex Richardson } 967*5bb9250eSAlex Richardson 968*5bb9250eSAlex Richardson default: 969*5bb9250eSAlex Richardson YY_FATAL_ERROR( 970*5bb9250eSAlex Richardson "fatal flex scanner internal error--no action found" ); 971*5bb9250eSAlex Richardson } /* end of action switch */ 972*5bb9250eSAlex Richardson } /* end of scanning one token */ 973*5bb9250eSAlex Richardson } /* end of yylex */ 974*5bb9250eSAlex Richardson 975*5bb9250eSAlex Richardson /* yy_get_next_buffer - try to read in a new buffer 976*5bb9250eSAlex Richardson * 977*5bb9250eSAlex Richardson * Returns a code representing an action: 978*5bb9250eSAlex Richardson * EOB_ACT_LAST_MATCH - 979*5bb9250eSAlex Richardson * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 980*5bb9250eSAlex Richardson * EOB_ACT_END_OF_FILE - end of file 981*5bb9250eSAlex Richardson */ 982*5bb9250eSAlex Richardson static int yy_get_next_buffer (void) 983*5bb9250eSAlex Richardson { 984*5bb9250eSAlex Richardson char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; 985*5bb9250eSAlex Richardson char *source = (yytext_ptr); 986*5bb9250eSAlex Richardson int number_to_move, i; 987*5bb9250eSAlex Richardson int ret_val; 988*5bb9250eSAlex Richardson 989*5bb9250eSAlex Richardson if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) 990*5bb9250eSAlex Richardson YY_FATAL_ERROR( 991*5bb9250eSAlex Richardson "fatal flex scanner internal error--end of buffer missed" ); 992*5bb9250eSAlex Richardson 993*5bb9250eSAlex Richardson if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) 994*5bb9250eSAlex Richardson { /* Don't try to fill the buffer, so this is an EOF. */ 995*5bb9250eSAlex Richardson if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) 996*5bb9250eSAlex Richardson { 997*5bb9250eSAlex Richardson /* We matched a single character, the EOB, so 998*5bb9250eSAlex Richardson * treat this as a final EOF. 999*5bb9250eSAlex Richardson */ 1000*5bb9250eSAlex Richardson return EOB_ACT_END_OF_FILE; 1001*5bb9250eSAlex Richardson } 1002*5bb9250eSAlex Richardson 1003*5bb9250eSAlex Richardson else 1004*5bb9250eSAlex Richardson { 1005*5bb9250eSAlex Richardson /* We matched some text prior to the EOB, first 1006*5bb9250eSAlex Richardson * process it. 1007*5bb9250eSAlex Richardson */ 1008*5bb9250eSAlex Richardson return EOB_ACT_LAST_MATCH; 1009*5bb9250eSAlex Richardson } 1010*5bb9250eSAlex Richardson } 1011*5bb9250eSAlex Richardson 1012*5bb9250eSAlex Richardson /* Try to read more data. */ 1013*5bb9250eSAlex Richardson 1014*5bb9250eSAlex Richardson /* First move last chars to start of buffer. */ 1015*5bb9250eSAlex Richardson number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; 1016*5bb9250eSAlex Richardson 1017*5bb9250eSAlex Richardson for ( i = 0; i < number_to_move; ++i ) 1018*5bb9250eSAlex Richardson *(dest++) = *(source++); 1019*5bb9250eSAlex Richardson 1020*5bb9250eSAlex Richardson if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 1021*5bb9250eSAlex Richardson /* don't do the read, it's not guaranteed to return an EOF, 1022*5bb9250eSAlex Richardson * just force an EOF 1023*5bb9250eSAlex Richardson */ 1024*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; 1025*5bb9250eSAlex Richardson 1026*5bb9250eSAlex Richardson else 1027*5bb9250eSAlex Richardson { 1028*5bb9250eSAlex Richardson yy_size_t num_to_read = 1029*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; 1030*5bb9250eSAlex Richardson 1031*5bb9250eSAlex Richardson while ( num_to_read <= 0 ) 1032*5bb9250eSAlex Richardson { /* Not enough room in the buffer - grow it. */ 1033*5bb9250eSAlex Richardson 1034*5bb9250eSAlex Richardson /* just a shorter name for the current buffer */ 1035*5bb9250eSAlex Richardson YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; 1036*5bb9250eSAlex Richardson 1037*5bb9250eSAlex Richardson int yy_c_buf_p_offset = 1038*5bb9250eSAlex Richardson (int) ((yy_c_buf_p) - b->yy_ch_buf); 1039*5bb9250eSAlex Richardson 1040*5bb9250eSAlex Richardson if ( b->yy_is_our_buffer ) 1041*5bb9250eSAlex Richardson { 1042*5bb9250eSAlex Richardson yy_size_t new_size = b->yy_buf_size * 2; 1043*5bb9250eSAlex Richardson 1044*5bb9250eSAlex Richardson if ( new_size <= 0 ) 1045*5bb9250eSAlex Richardson b->yy_buf_size += b->yy_buf_size / 8; 1046*5bb9250eSAlex Richardson else 1047*5bb9250eSAlex Richardson b->yy_buf_size *= 2; 1048*5bb9250eSAlex Richardson 1049*5bb9250eSAlex Richardson b->yy_ch_buf = (char *) 1050*5bb9250eSAlex Richardson /* Include room in for 2 EOB chars. */ 1051*5bb9250eSAlex Richardson yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); 1052*5bb9250eSAlex Richardson } 1053*5bb9250eSAlex Richardson else 1054*5bb9250eSAlex Richardson /* Can't grow it, we don't own it. */ 1055*5bb9250eSAlex Richardson b->yy_ch_buf = 0; 1056*5bb9250eSAlex Richardson 1057*5bb9250eSAlex Richardson if ( ! b->yy_ch_buf ) 1058*5bb9250eSAlex Richardson YY_FATAL_ERROR( 1059*5bb9250eSAlex Richardson "fatal error - scanner input buffer overflow" ); 1060*5bb9250eSAlex Richardson 1061*5bb9250eSAlex Richardson (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; 1062*5bb9250eSAlex Richardson 1063*5bb9250eSAlex Richardson num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - 1064*5bb9250eSAlex Richardson number_to_move - 1; 1065*5bb9250eSAlex Richardson 1066*5bb9250eSAlex Richardson } 1067*5bb9250eSAlex Richardson 1068*5bb9250eSAlex Richardson if ( num_to_read > YY_READ_BUF_SIZE ) 1069*5bb9250eSAlex Richardson num_to_read = YY_READ_BUF_SIZE; 1070*5bb9250eSAlex Richardson 1071*5bb9250eSAlex Richardson /* Read in more data. */ 1072*5bb9250eSAlex Richardson YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), 1073*5bb9250eSAlex Richardson (yy_n_chars), num_to_read ); 1074*5bb9250eSAlex Richardson 1075*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 1076*5bb9250eSAlex Richardson } 1077*5bb9250eSAlex Richardson 1078*5bb9250eSAlex Richardson if ( (yy_n_chars) == 0 ) 1079*5bb9250eSAlex Richardson { 1080*5bb9250eSAlex Richardson if ( number_to_move == YY_MORE_ADJ ) 1081*5bb9250eSAlex Richardson { 1082*5bb9250eSAlex Richardson ret_val = EOB_ACT_END_OF_FILE; 1083*5bb9250eSAlex Richardson yyrestart(yyin ); 1084*5bb9250eSAlex Richardson } 1085*5bb9250eSAlex Richardson 1086*5bb9250eSAlex Richardson else 1087*5bb9250eSAlex Richardson { 1088*5bb9250eSAlex Richardson ret_val = EOB_ACT_LAST_MATCH; 1089*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = 1090*5bb9250eSAlex Richardson YY_BUFFER_EOF_PENDING; 1091*5bb9250eSAlex Richardson } 1092*5bb9250eSAlex Richardson } 1093*5bb9250eSAlex Richardson 1094*5bb9250eSAlex Richardson else 1095*5bb9250eSAlex Richardson ret_val = EOB_ACT_CONTINUE_SCAN; 1096*5bb9250eSAlex Richardson 1097*5bb9250eSAlex Richardson if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { 1098*5bb9250eSAlex Richardson /* Extend the array by 50%, plus the number we really need. */ 1099*5bb9250eSAlex Richardson yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); 1100*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); 1101*5bb9250eSAlex Richardson if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 1102*5bb9250eSAlex Richardson YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); 1103*5bb9250eSAlex Richardson } 1104*5bb9250eSAlex Richardson 1105*5bb9250eSAlex Richardson (yy_n_chars) += number_to_move; 1106*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; 1107*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; 1108*5bb9250eSAlex Richardson 1109*5bb9250eSAlex Richardson (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; 1110*5bb9250eSAlex Richardson 1111*5bb9250eSAlex Richardson return ret_val; 1112*5bb9250eSAlex Richardson } 1113*5bb9250eSAlex Richardson 1114*5bb9250eSAlex Richardson /* yy_get_previous_state - get the state just before the EOB char was reached */ 1115*5bb9250eSAlex Richardson 1116*5bb9250eSAlex Richardson static yy_state_type yy_get_previous_state (void) 1117*5bb9250eSAlex Richardson { 1118*5bb9250eSAlex Richardson yy_state_type yy_current_state; 1119*5bb9250eSAlex Richardson char *yy_cp; 1120*5bb9250eSAlex Richardson 1121*5bb9250eSAlex Richardson yy_current_state = (yy_start); 1122*5bb9250eSAlex Richardson 1123*5bb9250eSAlex Richardson for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) 1124*5bb9250eSAlex Richardson { 1125*5bb9250eSAlex Richardson YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 1126*5bb9250eSAlex Richardson if ( yy_accept[yy_current_state] ) 1127*5bb9250eSAlex Richardson { 1128*5bb9250eSAlex Richardson (yy_last_accepting_state) = yy_current_state; 1129*5bb9250eSAlex Richardson (yy_last_accepting_cpos) = yy_cp; 1130*5bb9250eSAlex Richardson } 1131*5bb9250eSAlex Richardson while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1132*5bb9250eSAlex Richardson { 1133*5bb9250eSAlex Richardson yy_current_state = (int) yy_def[yy_current_state]; 1134*5bb9250eSAlex Richardson if ( yy_current_state >= 35 ) 1135*5bb9250eSAlex Richardson yy_c = yy_meta[(unsigned int) yy_c]; 1136*5bb9250eSAlex Richardson } 1137*5bb9250eSAlex Richardson yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1138*5bb9250eSAlex Richardson } 1139*5bb9250eSAlex Richardson 1140*5bb9250eSAlex Richardson return yy_current_state; 1141*5bb9250eSAlex Richardson } 1142*5bb9250eSAlex Richardson 1143*5bb9250eSAlex Richardson /* yy_try_NUL_trans - try to make a transition on the NUL character 1144*5bb9250eSAlex Richardson * 1145*5bb9250eSAlex Richardson * synopsis 1146*5bb9250eSAlex Richardson * next_state = yy_try_NUL_trans( current_state ); 1147*5bb9250eSAlex Richardson */ 1148*5bb9250eSAlex Richardson static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) 1149*5bb9250eSAlex Richardson { 1150*5bb9250eSAlex Richardson int yy_is_jam; 1151*5bb9250eSAlex Richardson char *yy_cp = (yy_c_buf_p); 1152*5bb9250eSAlex Richardson 1153*5bb9250eSAlex Richardson YY_CHAR yy_c = 1; 1154*5bb9250eSAlex Richardson if ( yy_accept[yy_current_state] ) 1155*5bb9250eSAlex Richardson { 1156*5bb9250eSAlex Richardson (yy_last_accepting_state) = yy_current_state; 1157*5bb9250eSAlex Richardson (yy_last_accepting_cpos) = yy_cp; 1158*5bb9250eSAlex Richardson } 1159*5bb9250eSAlex Richardson while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1160*5bb9250eSAlex Richardson { 1161*5bb9250eSAlex Richardson yy_current_state = (int) yy_def[yy_current_state]; 1162*5bb9250eSAlex Richardson if ( yy_current_state >= 35 ) 1163*5bb9250eSAlex Richardson yy_c = yy_meta[(unsigned int) yy_c]; 1164*5bb9250eSAlex Richardson } 1165*5bb9250eSAlex Richardson yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1166*5bb9250eSAlex Richardson yy_is_jam = (yy_current_state == 34); 1167*5bb9250eSAlex Richardson 1168*5bb9250eSAlex Richardson return yy_is_jam ? 0 : yy_current_state; 1169*5bb9250eSAlex Richardson } 1170*5bb9250eSAlex Richardson 1171*5bb9250eSAlex Richardson #ifndef YY_NO_INPUT 1172*5bb9250eSAlex Richardson #ifdef __cplusplus 1173*5bb9250eSAlex Richardson static int yyinput (void) 1174*5bb9250eSAlex Richardson #else 1175*5bb9250eSAlex Richardson static int input (void) 1176*5bb9250eSAlex Richardson #endif 1177*5bb9250eSAlex Richardson 1178*5bb9250eSAlex Richardson { 1179*5bb9250eSAlex Richardson int c; 1180*5bb9250eSAlex Richardson 1181*5bb9250eSAlex Richardson *(yy_c_buf_p) = (yy_hold_char); 1182*5bb9250eSAlex Richardson 1183*5bb9250eSAlex Richardson if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) 1184*5bb9250eSAlex Richardson { 1185*5bb9250eSAlex Richardson /* yy_c_buf_p now points to the character we want to return. 1186*5bb9250eSAlex Richardson * If this occurs *before* the EOB characters, then it's a 1187*5bb9250eSAlex Richardson * valid NUL; if not, then we've hit the end of the buffer. 1188*5bb9250eSAlex Richardson */ 1189*5bb9250eSAlex Richardson if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 1190*5bb9250eSAlex Richardson /* This was really a NUL. */ 1191*5bb9250eSAlex Richardson *(yy_c_buf_p) = '\0'; 1192*5bb9250eSAlex Richardson 1193*5bb9250eSAlex Richardson else 1194*5bb9250eSAlex Richardson { /* need more input */ 1195*5bb9250eSAlex Richardson yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); 1196*5bb9250eSAlex Richardson ++(yy_c_buf_p); 1197*5bb9250eSAlex Richardson 1198*5bb9250eSAlex Richardson switch ( yy_get_next_buffer( ) ) 1199*5bb9250eSAlex Richardson { 1200*5bb9250eSAlex Richardson case EOB_ACT_LAST_MATCH: 1201*5bb9250eSAlex Richardson /* This happens because yy_g_n_b() 1202*5bb9250eSAlex Richardson * sees that we've accumulated a 1203*5bb9250eSAlex Richardson * token and flags that we need to 1204*5bb9250eSAlex Richardson * try matching the token before 1205*5bb9250eSAlex Richardson * proceeding. But for input(), 1206*5bb9250eSAlex Richardson * there's no matching to consider. 1207*5bb9250eSAlex Richardson * So convert the EOB_ACT_LAST_MATCH 1208*5bb9250eSAlex Richardson * to EOB_ACT_END_OF_FILE. 1209*5bb9250eSAlex Richardson */ 1210*5bb9250eSAlex Richardson 1211*5bb9250eSAlex Richardson /* Reset buffer status. */ 1212*5bb9250eSAlex Richardson yyrestart(yyin ); 1213*5bb9250eSAlex Richardson 1214*5bb9250eSAlex Richardson /*FALLTHROUGH*/ 1215*5bb9250eSAlex Richardson 1216*5bb9250eSAlex Richardson case EOB_ACT_END_OF_FILE: 1217*5bb9250eSAlex Richardson { 1218*5bb9250eSAlex Richardson if ( yywrap( ) ) 1219*5bb9250eSAlex Richardson return EOF; 1220*5bb9250eSAlex Richardson 1221*5bb9250eSAlex Richardson if ( ! (yy_did_buffer_switch_on_eof) ) 1222*5bb9250eSAlex Richardson YY_NEW_FILE; 1223*5bb9250eSAlex Richardson #ifdef __cplusplus 1224*5bb9250eSAlex Richardson return yyinput(); 1225*5bb9250eSAlex Richardson #else 1226*5bb9250eSAlex Richardson return input(); 1227*5bb9250eSAlex Richardson #endif 1228*5bb9250eSAlex Richardson } 1229*5bb9250eSAlex Richardson 1230*5bb9250eSAlex Richardson case EOB_ACT_CONTINUE_SCAN: 1231*5bb9250eSAlex Richardson (yy_c_buf_p) = (yytext_ptr) + offset; 1232*5bb9250eSAlex Richardson break; 1233*5bb9250eSAlex Richardson } 1234*5bb9250eSAlex Richardson } 1235*5bb9250eSAlex Richardson } 1236*5bb9250eSAlex Richardson 1237*5bb9250eSAlex Richardson c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ 1238*5bb9250eSAlex Richardson *(yy_c_buf_p) = '\0'; /* preserve yytext */ 1239*5bb9250eSAlex Richardson (yy_hold_char) = *++(yy_c_buf_p); 1240*5bb9250eSAlex Richardson 1241*5bb9250eSAlex Richardson return c; 1242*5bb9250eSAlex Richardson } 1243*5bb9250eSAlex Richardson #endif /* ifndef YY_NO_INPUT */ 1244*5bb9250eSAlex Richardson 1245*5bb9250eSAlex Richardson /** Immediately switch to a different input stream. 1246*5bb9250eSAlex Richardson * @param input_file A readable stream. 1247*5bb9250eSAlex Richardson * 1248*5bb9250eSAlex Richardson * @note This function does not reset the start condition to @c INITIAL . 1249*5bb9250eSAlex Richardson */ 1250*5bb9250eSAlex Richardson void yyrestart (FILE * input_file ) 1251*5bb9250eSAlex Richardson { 1252*5bb9250eSAlex Richardson 1253*5bb9250eSAlex Richardson if ( ! YY_CURRENT_BUFFER ){ 1254*5bb9250eSAlex Richardson yyensure_buffer_stack (); 1255*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = 1256*5bb9250eSAlex Richardson yy_create_buffer(yyin,YY_BUF_SIZE ); 1257*5bb9250eSAlex Richardson } 1258*5bb9250eSAlex Richardson 1259*5bb9250eSAlex Richardson yy_init_buffer(YY_CURRENT_BUFFER,input_file ); 1260*5bb9250eSAlex Richardson yy_load_buffer_state( ); 1261*5bb9250eSAlex Richardson } 1262*5bb9250eSAlex Richardson 1263*5bb9250eSAlex Richardson /** Switch to a different input buffer. 1264*5bb9250eSAlex Richardson * @param new_buffer The new input buffer. 1265*5bb9250eSAlex Richardson * 1266*5bb9250eSAlex Richardson */ 1267*5bb9250eSAlex Richardson void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) 1268*5bb9250eSAlex Richardson { 1269*5bb9250eSAlex Richardson 1270*5bb9250eSAlex Richardson /* TODO. We should be able to replace this entire function body 1271*5bb9250eSAlex Richardson * with 1272*5bb9250eSAlex Richardson * yypop_buffer_state(); 1273*5bb9250eSAlex Richardson * yypush_buffer_state(new_buffer); 1274*5bb9250eSAlex Richardson */ 1275*5bb9250eSAlex Richardson yyensure_buffer_stack (); 1276*5bb9250eSAlex Richardson if ( YY_CURRENT_BUFFER == new_buffer ) 1277*5bb9250eSAlex Richardson return; 1278*5bb9250eSAlex Richardson 1279*5bb9250eSAlex Richardson if ( YY_CURRENT_BUFFER ) 1280*5bb9250eSAlex Richardson { 1281*5bb9250eSAlex Richardson /* Flush out information for old buffer. */ 1282*5bb9250eSAlex Richardson *(yy_c_buf_p) = (yy_hold_char); 1283*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 1284*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 1285*5bb9250eSAlex Richardson } 1286*5bb9250eSAlex Richardson 1287*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = new_buffer; 1288*5bb9250eSAlex Richardson yy_load_buffer_state( ); 1289*5bb9250eSAlex Richardson 1290*5bb9250eSAlex Richardson /* We don't actually know whether we did this switch during 1291*5bb9250eSAlex Richardson * EOF (yywrap()) processing, but the only time this flag 1292*5bb9250eSAlex Richardson * is looked at is after yywrap() is called, so it's safe 1293*5bb9250eSAlex Richardson * to go ahead and always set it. 1294*5bb9250eSAlex Richardson */ 1295*5bb9250eSAlex Richardson (yy_did_buffer_switch_on_eof) = 1; 1296*5bb9250eSAlex Richardson } 1297*5bb9250eSAlex Richardson 1298*5bb9250eSAlex Richardson static void yy_load_buffer_state (void) 1299*5bb9250eSAlex Richardson { 1300*5bb9250eSAlex Richardson (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 1301*5bb9250eSAlex Richardson (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; 1302*5bb9250eSAlex Richardson yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; 1303*5bb9250eSAlex Richardson (yy_hold_char) = *(yy_c_buf_p); 1304*5bb9250eSAlex Richardson } 1305*5bb9250eSAlex Richardson 1306*5bb9250eSAlex Richardson /** Allocate and initialize an input buffer state. 1307*5bb9250eSAlex Richardson * @param file A readable stream. 1308*5bb9250eSAlex Richardson * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. 1309*5bb9250eSAlex Richardson * 1310*5bb9250eSAlex Richardson * @return the allocated buffer state. 1311*5bb9250eSAlex Richardson */ 1312*5bb9250eSAlex Richardson YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) 1313*5bb9250eSAlex Richardson { 1314*5bb9250eSAlex Richardson YY_BUFFER_STATE b; 1315*5bb9250eSAlex Richardson 1316*5bb9250eSAlex Richardson b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); 1317*5bb9250eSAlex Richardson if ( ! b ) 1318*5bb9250eSAlex Richardson YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 1319*5bb9250eSAlex Richardson 1320*5bb9250eSAlex Richardson b->yy_buf_size = size; 1321*5bb9250eSAlex Richardson 1322*5bb9250eSAlex Richardson /* yy_ch_buf has to be 2 characters longer than the size given because 1323*5bb9250eSAlex Richardson * we need to put in 2 end-of-buffer characters. 1324*5bb9250eSAlex Richardson */ 1325*5bb9250eSAlex Richardson b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); 1326*5bb9250eSAlex Richardson if ( ! b->yy_ch_buf ) 1327*5bb9250eSAlex Richardson YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 1328*5bb9250eSAlex Richardson 1329*5bb9250eSAlex Richardson b->yy_is_our_buffer = 1; 1330*5bb9250eSAlex Richardson 1331*5bb9250eSAlex Richardson yy_init_buffer(b,file ); 1332*5bb9250eSAlex Richardson 1333*5bb9250eSAlex Richardson return b; 1334*5bb9250eSAlex Richardson } 1335*5bb9250eSAlex Richardson 1336*5bb9250eSAlex Richardson /** Destroy the buffer. 1337*5bb9250eSAlex Richardson * @param b a buffer created with yy_create_buffer() 1338*5bb9250eSAlex Richardson * 1339*5bb9250eSAlex Richardson */ 1340*5bb9250eSAlex Richardson void yy_delete_buffer (YY_BUFFER_STATE b ) 1341*5bb9250eSAlex Richardson { 1342*5bb9250eSAlex Richardson 1343*5bb9250eSAlex Richardson if ( ! b ) 1344*5bb9250eSAlex Richardson return; 1345*5bb9250eSAlex Richardson 1346*5bb9250eSAlex Richardson if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ 1347*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; 1348*5bb9250eSAlex Richardson 1349*5bb9250eSAlex Richardson if ( b->yy_is_our_buffer ) 1350*5bb9250eSAlex Richardson yyfree((void *) b->yy_ch_buf ); 1351*5bb9250eSAlex Richardson 1352*5bb9250eSAlex Richardson yyfree((void *) b ); 1353*5bb9250eSAlex Richardson } 1354*5bb9250eSAlex Richardson 1355*5bb9250eSAlex Richardson /* Initializes or reinitializes a buffer. 1356*5bb9250eSAlex Richardson * This function is sometimes called more than once on the same buffer, 1357*5bb9250eSAlex Richardson * such as during a yyrestart() or at EOF. 1358*5bb9250eSAlex Richardson */ 1359*5bb9250eSAlex Richardson static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) 1360*5bb9250eSAlex Richardson 1361*5bb9250eSAlex Richardson { 1362*5bb9250eSAlex Richardson int oerrno = errno; 1363*5bb9250eSAlex Richardson 1364*5bb9250eSAlex Richardson yy_flush_buffer(b ); 1365*5bb9250eSAlex Richardson 1366*5bb9250eSAlex Richardson b->yy_input_file = file; 1367*5bb9250eSAlex Richardson b->yy_fill_buffer = 1; 1368*5bb9250eSAlex Richardson 1369*5bb9250eSAlex Richardson /* If b is the current buffer, then yy_init_buffer was _probably_ 1370*5bb9250eSAlex Richardson * called from yyrestart() or through yy_get_next_buffer. 1371*5bb9250eSAlex Richardson * In that case, we don't want to reset the lineno or column. 1372*5bb9250eSAlex Richardson */ 1373*5bb9250eSAlex Richardson if (b != YY_CURRENT_BUFFER){ 1374*5bb9250eSAlex Richardson b->yy_bs_lineno = 1; 1375*5bb9250eSAlex Richardson b->yy_bs_column = 0; 1376*5bb9250eSAlex Richardson } 1377*5bb9250eSAlex Richardson 1378*5bb9250eSAlex Richardson b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 1379*5bb9250eSAlex Richardson 1380*5bb9250eSAlex Richardson errno = oerrno; 1381*5bb9250eSAlex Richardson } 1382*5bb9250eSAlex Richardson 1383*5bb9250eSAlex Richardson /** Discard all buffered characters. On the next scan, YY_INPUT will be called. 1384*5bb9250eSAlex Richardson * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. 1385*5bb9250eSAlex Richardson * 1386*5bb9250eSAlex Richardson */ 1387*5bb9250eSAlex Richardson void yy_flush_buffer (YY_BUFFER_STATE b ) 1388*5bb9250eSAlex Richardson { 1389*5bb9250eSAlex Richardson if ( ! b ) 1390*5bb9250eSAlex Richardson return; 1391*5bb9250eSAlex Richardson 1392*5bb9250eSAlex Richardson b->yy_n_chars = 0; 1393*5bb9250eSAlex Richardson 1394*5bb9250eSAlex Richardson /* We always need two end-of-buffer characters. The first causes 1395*5bb9250eSAlex Richardson * a transition to the end-of-buffer state. The second causes 1396*5bb9250eSAlex Richardson * a jam in that state. 1397*5bb9250eSAlex Richardson */ 1398*5bb9250eSAlex Richardson b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 1399*5bb9250eSAlex Richardson b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 1400*5bb9250eSAlex Richardson 1401*5bb9250eSAlex Richardson b->yy_buf_pos = &b->yy_ch_buf[0]; 1402*5bb9250eSAlex Richardson 1403*5bb9250eSAlex Richardson b->yy_at_bol = 1; 1404*5bb9250eSAlex Richardson b->yy_buffer_status = YY_BUFFER_NEW; 1405*5bb9250eSAlex Richardson 1406*5bb9250eSAlex Richardson if ( b == YY_CURRENT_BUFFER ) 1407*5bb9250eSAlex Richardson yy_load_buffer_state( ); 1408*5bb9250eSAlex Richardson } 1409*5bb9250eSAlex Richardson 1410*5bb9250eSAlex Richardson /** Pushes the new state onto the stack. The new state becomes 1411*5bb9250eSAlex Richardson * the current state. This function will allocate the stack 1412*5bb9250eSAlex Richardson * if necessary. 1413*5bb9250eSAlex Richardson * @param new_buffer The new state. 1414*5bb9250eSAlex Richardson * 1415*5bb9250eSAlex Richardson */ 1416*5bb9250eSAlex Richardson void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) 1417*5bb9250eSAlex Richardson { 1418*5bb9250eSAlex Richardson if (new_buffer == NULL) 1419*5bb9250eSAlex Richardson return; 1420*5bb9250eSAlex Richardson 1421*5bb9250eSAlex Richardson yyensure_buffer_stack(); 1422*5bb9250eSAlex Richardson 1423*5bb9250eSAlex Richardson /* This block is copied from yy_switch_to_buffer. */ 1424*5bb9250eSAlex Richardson if ( YY_CURRENT_BUFFER ) 1425*5bb9250eSAlex Richardson { 1426*5bb9250eSAlex Richardson /* Flush out information for old buffer. */ 1427*5bb9250eSAlex Richardson *(yy_c_buf_p) = (yy_hold_char); 1428*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 1429*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 1430*5bb9250eSAlex Richardson } 1431*5bb9250eSAlex Richardson 1432*5bb9250eSAlex Richardson /* Only push if top exists. Otherwise, replace top. */ 1433*5bb9250eSAlex Richardson if (YY_CURRENT_BUFFER) 1434*5bb9250eSAlex Richardson (yy_buffer_stack_top)++; 1435*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = new_buffer; 1436*5bb9250eSAlex Richardson 1437*5bb9250eSAlex Richardson /* copied from yy_switch_to_buffer. */ 1438*5bb9250eSAlex Richardson yy_load_buffer_state( ); 1439*5bb9250eSAlex Richardson (yy_did_buffer_switch_on_eof) = 1; 1440*5bb9250eSAlex Richardson } 1441*5bb9250eSAlex Richardson 1442*5bb9250eSAlex Richardson /** Removes and deletes the top of the stack, if present. 1443*5bb9250eSAlex Richardson * The next element becomes the new top. 1444*5bb9250eSAlex Richardson * 1445*5bb9250eSAlex Richardson */ 1446*5bb9250eSAlex Richardson void yypop_buffer_state (void) 1447*5bb9250eSAlex Richardson { 1448*5bb9250eSAlex Richardson if (!YY_CURRENT_BUFFER) 1449*5bb9250eSAlex Richardson return; 1450*5bb9250eSAlex Richardson 1451*5bb9250eSAlex Richardson yy_delete_buffer(YY_CURRENT_BUFFER ); 1452*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = NULL; 1453*5bb9250eSAlex Richardson if ((yy_buffer_stack_top) > 0) 1454*5bb9250eSAlex Richardson --(yy_buffer_stack_top); 1455*5bb9250eSAlex Richardson 1456*5bb9250eSAlex Richardson if (YY_CURRENT_BUFFER) { 1457*5bb9250eSAlex Richardson yy_load_buffer_state( ); 1458*5bb9250eSAlex Richardson (yy_did_buffer_switch_on_eof) = 1; 1459*5bb9250eSAlex Richardson } 1460*5bb9250eSAlex Richardson } 1461*5bb9250eSAlex Richardson 1462*5bb9250eSAlex Richardson /* Allocates the stack if it does not exist. 1463*5bb9250eSAlex Richardson * Guarantees space for at least one push. 1464*5bb9250eSAlex Richardson */ 1465*5bb9250eSAlex Richardson static void yyensure_buffer_stack (void) 1466*5bb9250eSAlex Richardson { 1467*5bb9250eSAlex Richardson yy_size_t num_to_alloc; 1468*5bb9250eSAlex Richardson 1469*5bb9250eSAlex Richardson if (!(yy_buffer_stack)) { 1470*5bb9250eSAlex Richardson 1471*5bb9250eSAlex Richardson /* First allocation is just for 2 elements, since we don't know if this 1472*5bb9250eSAlex Richardson * scanner will even need a stack. We use 2 instead of 1 to avoid an 1473*5bb9250eSAlex Richardson * immediate realloc on the next call. 1474*5bb9250eSAlex Richardson */ 1475*5bb9250eSAlex Richardson num_to_alloc = 1; 1476*5bb9250eSAlex Richardson (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc 1477*5bb9250eSAlex Richardson (num_to_alloc * sizeof(struct yy_buffer_state*) 1478*5bb9250eSAlex Richardson ); 1479*5bb9250eSAlex Richardson if ( ! (yy_buffer_stack) ) 1480*5bb9250eSAlex Richardson YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); 1481*5bb9250eSAlex Richardson 1482*5bb9250eSAlex Richardson memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 1483*5bb9250eSAlex Richardson 1484*5bb9250eSAlex Richardson (yy_buffer_stack_max) = num_to_alloc; 1485*5bb9250eSAlex Richardson (yy_buffer_stack_top) = 0; 1486*5bb9250eSAlex Richardson return; 1487*5bb9250eSAlex Richardson } 1488*5bb9250eSAlex Richardson 1489*5bb9250eSAlex Richardson if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ 1490*5bb9250eSAlex Richardson 1491*5bb9250eSAlex Richardson /* Increase the buffer to prepare for a possible push. */ 1492*5bb9250eSAlex Richardson int grow_size = 8 /* arbitrary grow size */; 1493*5bb9250eSAlex Richardson 1494*5bb9250eSAlex Richardson num_to_alloc = (yy_buffer_stack_max) + grow_size; 1495*5bb9250eSAlex Richardson (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc 1496*5bb9250eSAlex Richardson ((yy_buffer_stack), 1497*5bb9250eSAlex Richardson num_to_alloc * sizeof(struct yy_buffer_state*) 1498*5bb9250eSAlex Richardson ); 1499*5bb9250eSAlex Richardson if ( ! (yy_buffer_stack) ) 1500*5bb9250eSAlex Richardson YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); 1501*5bb9250eSAlex Richardson 1502*5bb9250eSAlex Richardson /* zero only the new slots.*/ 1503*5bb9250eSAlex Richardson memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); 1504*5bb9250eSAlex Richardson (yy_buffer_stack_max) = num_to_alloc; 1505*5bb9250eSAlex Richardson } 1506*5bb9250eSAlex Richardson } 1507*5bb9250eSAlex Richardson 1508*5bb9250eSAlex Richardson /** Setup the input buffer state to scan directly from a user-specified character buffer. 1509*5bb9250eSAlex Richardson * @param base the character buffer 1510*5bb9250eSAlex Richardson * @param size the size in bytes of the character buffer 1511*5bb9250eSAlex Richardson * 1512*5bb9250eSAlex Richardson * @return the newly allocated buffer state object. 1513*5bb9250eSAlex Richardson */ 1514*5bb9250eSAlex Richardson YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) 1515*5bb9250eSAlex Richardson { 1516*5bb9250eSAlex Richardson YY_BUFFER_STATE b; 1517*5bb9250eSAlex Richardson 1518*5bb9250eSAlex Richardson if ( size < 2 || 1519*5bb9250eSAlex Richardson base[size-2] != YY_END_OF_BUFFER_CHAR || 1520*5bb9250eSAlex Richardson base[size-1] != YY_END_OF_BUFFER_CHAR ) 1521*5bb9250eSAlex Richardson /* They forgot to leave room for the EOB's. */ 1522*5bb9250eSAlex Richardson return 0; 1523*5bb9250eSAlex Richardson 1524*5bb9250eSAlex Richardson b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); 1525*5bb9250eSAlex Richardson if ( ! b ) 1526*5bb9250eSAlex Richardson YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); 1527*5bb9250eSAlex Richardson 1528*5bb9250eSAlex Richardson b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ 1529*5bb9250eSAlex Richardson b->yy_buf_pos = b->yy_ch_buf = base; 1530*5bb9250eSAlex Richardson b->yy_is_our_buffer = 0; 1531*5bb9250eSAlex Richardson b->yy_input_file = 0; 1532*5bb9250eSAlex Richardson b->yy_n_chars = b->yy_buf_size; 1533*5bb9250eSAlex Richardson b->yy_is_interactive = 0; 1534*5bb9250eSAlex Richardson b->yy_at_bol = 1; 1535*5bb9250eSAlex Richardson b->yy_fill_buffer = 0; 1536*5bb9250eSAlex Richardson b->yy_buffer_status = YY_BUFFER_NEW; 1537*5bb9250eSAlex Richardson 1538*5bb9250eSAlex Richardson yy_switch_to_buffer(b ); 1539*5bb9250eSAlex Richardson 1540*5bb9250eSAlex Richardson return b; 1541*5bb9250eSAlex Richardson } 1542*5bb9250eSAlex Richardson 1543*5bb9250eSAlex Richardson /** Setup the input buffer state to scan a string. The next call to yylex() will 1544*5bb9250eSAlex Richardson * scan from a @e copy of @a str. 1545*5bb9250eSAlex Richardson * @param yystr a NUL-terminated string to scan 1546*5bb9250eSAlex Richardson * 1547*5bb9250eSAlex Richardson * @return the newly allocated buffer state object. 1548*5bb9250eSAlex Richardson * @note If you want to scan bytes that may contain NUL values, then use 1549*5bb9250eSAlex Richardson * yy_scan_bytes() instead. 1550*5bb9250eSAlex Richardson */ 1551*5bb9250eSAlex Richardson YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) 1552*5bb9250eSAlex Richardson { 1553*5bb9250eSAlex Richardson 1554*5bb9250eSAlex Richardson return yy_scan_bytes(yystr,strlen(yystr) ); 1555*5bb9250eSAlex Richardson } 1556*5bb9250eSAlex Richardson 1557*5bb9250eSAlex Richardson /** Setup the input buffer state to scan the given bytes. The next call to yylex() will 1558*5bb9250eSAlex Richardson * scan from a @e copy of @a bytes. 1559*5bb9250eSAlex Richardson * @param yybytes the byte buffer to scan 1560*5bb9250eSAlex Richardson * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. 1561*5bb9250eSAlex Richardson * 1562*5bb9250eSAlex Richardson * @return the newly allocated buffer state object. 1563*5bb9250eSAlex Richardson */ 1564*5bb9250eSAlex Richardson YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) 1565*5bb9250eSAlex Richardson { 1566*5bb9250eSAlex Richardson YY_BUFFER_STATE b; 1567*5bb9250eSAlex Richardson char *buf; 1568*5bb9250eSAlex Richardson yy_size_t n; 1569*5bb9250eSAlex Richardson yy_size_t i; 1570*5bb9250eSAlex Richardson 1571*5bb9250eSAlex Richardson /* Get memory for full buffer, including space for trailing EOB's. */ 1572*5bb9250eSAlex Richardson n = _yybytes_len + 2; 1573*5bb9250eSAlex Richardson buf = (char *) yyalloc(n ); 1574*5bb9250eSAlex Richardson if ( ! buf ) 1575*5bb9250eSAlex Richardson YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); 1576*5bb9250eSAlex Richardson 1577*5bb9250eSAlex Richardson for ( i = 0; i < _yybytes_len; ++i ) 1578*5bb9250eSAlex Richardson buf[i] = yybytes[i]; 1579*5bb9250eSAlex Richardson 1580*5bb9250eSAlex Richardson buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; 1581*5bb9250eSAlex Richardson 1582*5bb9250eSAlex Richardson b = yy_scan_buffer(buf,n ); 1583*5bb9250eSAlex Richardson if ( ! b ) 1584*5bb9250eSAlex Richardson YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); 1585*5bb9250eSAlex Richardson 1586*5bb9250eSAlex Richardson /* It's okay to grow etc. this buffer, and we should throw it 1587*5bb9250eSAlex Richardson * away when we're done. 1588*5bb9250eSAlex Richardson */ 1589*5bb9250eSAlex Richardson b->yy_is_our_buffer = 1; 1590*5bb9250eSAlex Richardson 1591*5bb9250eSAlex Richardson return b; 1592*5bb9250eSAlex Richardson } 1593*5bb9250eSAlex Richardson 1594*5bb9250eSAlex Richardson #ifndef YY_EXIT_FAILURE 1595*5bb9250eSAlex Richardson #define YY_EXIT_FAILURE 2 1596*5bb9250eSAlex Richardson #endif 1597*5bb9250eSAlex Richardson 1598*5bb9250eSAlex Richardson static void yy_fatal_error (yyconst char* msg ) 1599*5bb9250eSAlex Richardson { 1600*5bb9250eSAlex Richardson (void) fprintf( stderr, "%s\n", msg ); 1601*5bb9250eSAlex Richardson exit( YY_EXIT_FAILURE ); 1602*5bb9250eSAlex Richardson } 1603*5bb9250eSAlex Richardson 1604*5bb9250eSAlex Richardson /* Redefine yyless() so it works in section 3 code. */ 1605*5bb9250eSAlex Richardson 1606*5bb9250eSAlex Richardson #undef yyless 1607*5bb9250eSAlex Richardson #define yyless(n) \ 1608*5bb9250eSAlex Richardson do \ 1609*5bb9250eSAlex Richardson { \ 1610*5bb9250eSAlex Richardson /* Undo effects of setting up yytext. */ \ 1611*5bb9250eSAlex Richardson int yyless_macro_arg = (n); \ 1612*5bb9250eSAlex Richardson YY_LESS_LINENO(yyless_macro_arg);\ 1613*5bb9250eSAlex Richardson yytext[yyleng] = (yy_hold_char); \ 1614*5bb9250eSAlex Richardson (yy_c_buf_p) = yytext + yyless_macro_arg; \ 1615*5bb9250eSAlex Richardson (yy_hold_char) = *(yy_c_buf_p); \ 1616*5bb9250eSAlex Richardson *(yy_c_buf_p) = '\0'; \ 1617*5bb9250eSAlex Richardson yyleng = yyless_macro_arg; \ 1618*5bb9250eSAlex Richardson } \ 1619*5bb9250eSAlex Richardson while ( 0 ) 1620*5bb9250eSAlex Richardson 1621*5bb9250eSAlex Richardson /* Accessor methods (get/set functions) to struct members. */ 1622*5bb9250eSAlex Richardson 1623*5bb9250eSAlex Richardson /** Get the current line number. 1624*5bb9250eSAlex Richardson * 1625*5bb9250eSAlex Richardson */ 1626*5bb9250eSAlex Richardson int yyget_lineno (void) 1627*5bb9250eSAlex Richardson { 1628*5bb9250eSAlex Richardson 1629*5bb9250eSAlex Richardson return yylineno; 1630*5bb9250eSAlex Richardson } 1631*5bb9250eSAlex Richardson 1632*5bb9250eSAlex Richardson /** Get the input stream. 1633*5bb9250eSAlex Richardson * 1634*5bb9250eSAlex Richardson */ 1635*5bb9250eSAlex Richardson FILE *yyget_in (void) 1636*5bb9250eSAlex Richardson { 1637*5bb9250eSAlex Richardson return yyin; 1638*5bb9250eSAlex Richardson } 1639*5bb9250eSAlex Richardson 1640*5bb9250eSAlex Richardson /** Get the output stream. 1641*5bb9250eSAlex Richardson * 1642*5bb9250eSAlex Richardson */ 1643*5bb9250eSAlex Richardson FILE *yyget_out (void) 1644*5bb9250eSAlex Richardson { 1645*5bb9250eSAlex Richardson return yyout; 1646*5bb9250eSAlex Richardson } 1647*5bb9250eSAlex Richardson 1648*5bb9250eSAlex Richardson /** Get the length of the current token. 1649*5bb9250eSAlex Richardson * 1650*5bb9250eSAlex Richardson */ 1651*5bb9250eSAlex Richardson yy_size_t yyget_leng (void) 1652*5bb9250eSAlex Richardson { 1653*5bb9250eSAlex Richardson return yyleng; 1654*5bb9250eSAlex Richardson } 1655*5bb9250eSAlex Richardson 1656*5bb9250eSAlex Richardson /** Get the current token. 1657*5bb9250eSAlex Richardson * 1658*5bb9250eSAlex Richardson */ 1659*5bb9250eSAlex Richardson 1660*5bb9250eSAlex Richardson char *yyget_text (void) 1661*5bb9250eSAlex Richardson { 1662*5bb9250eSAlex Richardson return yytext; 1663*5bb9250eSAlex Richardson } 1664*5bb9250eSAlex Richardson 1665*5bb9250eSAlex Richardson /** Set the current line number. 1666*5bb9250eSAlex Richardson * @param line_number 1667*5bb9250eSAlex Richardson * 1668*5bb9250eSAlex Richardson */ 1669*5bb9250eSAlex Richardson void yyset_lineno (int line_number ) 1670*5bb9250eSAlex Richardson { 1671*5bb9250eSAlex Richardson 1672*5bb9250eSAlex Richardson yylineno = line_number; 1673*5bb9250eSAlex Richardson } 1674*5bb9250eSAlex Richardson 1675*5bb9250eSAlex Richardson /** Set the input stream. This does not discard the current 1676*5bb9250eSAlex Richardson * input buffer. 1677*5bb9250eSAlex Richardson * @param in_str A readable stream. 1678*5bb9250eSAlex Richardson * 1679*5bb9250eSAlex Richardson * @see yy_switch_to_buffer 1680*5bb9250eSAlex Richardson */ 1681*5bb9250eSAlex Richardson void yyset_in (FILE * in_str ) 1682*5bb9250eSAlex Richardson { 1683*5bb9250eSAlex Richardson yyin = in_str ; 1684*5bb9250eSAlex Richardson } 1685*5bb9250eSAlex Richardson 1686*5bb9250eSAlex Richardson void yyset_out (FILE * out_str ) 1687*5bb9250eSAlex Richardson { 1688*5bb9250eSAlex Richardson yyout = out_str ; 1689*5bb9250eSAlex Richardson } 1690*5bb9250eSAlex Richardson 1691*5bb9250eSAlex Richardson int yyget_debug (void) 1692*5bb9250eSAlex Richardson { 1693*5bb9250eSAlex Richardson return yy_flex_debug; 1694*5bb9250eSAlex Richardson } 1695*5bb9250eSAlex Richardson 1696*5bb9250eSAlex Richardson void yyset_debug (int bdebug ) 1697*5bb9250eSAlex Richardson { 1698*5bb9250eSAlex Richardson yy_flex_debug = bdebug ; 1699*5bb9250eSAlex Richardson } 1700*5bb9250eSAlex Richardson 1701*5bb9250eSAlex Richardson static int yy_init_globals (void) 1702*5bb9250eSAlex Richardson { 1703*5bb9250eSAlex Richardson /* Initialization is the same as for the non-reentrant scanner. 1704*5bb9250eSAlex Richardson * This function is called from yylex_destroy(), so don't allocate here. 1705*5bb9250eSAlex Richardson */ 1706*5bb9250eSAlex Richardson 1707*5bb9250eSAlex Richardson (yy_buffer_stack) = 0; 1708*5bb9250eSAlex Richardson (yy_buffer_stack_top) = 0; 1709*5bb9250eSAlex Richardson (yy_buffer_stack_max) = 0; 1710*5bb9250eSAlex Richardson (yy_c_buf_p) = (char *) 0; 1711*5bb9250eSAlex Richardson (yy_init) = 0; 1712*5bb9250eSAlex Richardson (yy_start) = 0; 1713*5bb9250eSAlex Richardson 1714*5bb9250eSAlex Richardson /* Defined in main.c */ 1715*5bb9250eSAlex Richardson #ifdef YY_STDINIT 1716*5bb9250eSAlex Richardson yyin = stdin; 1717*5bb9250eSAlex Richardson yyout = stdout; 1718*5bb9250eSAlex Richardson #else 1719*5bb9250eSAlex Richardson yyin = (FILE *) 0; 1720*5bb9250eSAlex Richardson yyout = (FILE *) 0; 1721*5bb9250eSAlex Richardson #endif 1722*5bb9250eSAlex Richardson 1723*5bb9250eSAlex Richardson /* For future reference: Set errno on error, since we are called by 1724*5bb9250eSAlex Richardson * yylex_init() 1725*5bb9250eSAlex Richardson */ 1726*5bb9250eSAlex Richardson return 0; 1727*5bb9250eSAlex Richardson } 1728*5bb9250eSAlex Richardson 1729*5bb9250eSAlex Richardson /* yylex_destroy is for both reentrant and non-reentrant scanners. */ 1730*5bb9250eSAlex Richardson int yylex_destroy (void) 1731*5bb9250eSAlex Richardson { 1732*5bb9250eSAlex Richardson 1733*5bb9250eSAlex Richardson /* Pop the buffer stack, destroying each element. */ 1734*5bb9250eSAlex Richardson while(YY_CURRENT_BUFFER){ 1735*5bb9250eSAlex Richardson yy_delete_buffer(YY_CURRENT_BUFFER ); 1736*5bb9250eSAlex Richardson YY_CURRENT_BUFFER_LVALUE = NULL; 1737*5bb9250eSAlex Richardson yypop_buffer_state(); 1738*5bb9250eSAlex Richardson } 1739*5bb9250eSAlex Richardson 1740*5bb9250eSAlex Richardson /* Destroy the stack itself. */ 1741*5bb9250eSAlex Richardson yyfree((yy_buffer_stack) ); 1742*5bb9250eSAlex Richardson (yy_buffer_stack) = NULL; 1743*5bb9250eSAlex Richardson 1744*5bb9250eSAlex Richardson /* Reset the globals. This is important in a non-reentrant scanner so the next time 1745*5bb9250eSAlex Richardson * yylex() is called, initialization will occur. */ 1746*5bb9250eSAlex Richardson yy_init_globals( ); 1747*5bb9250eSAlex Richardson 1748*5bb9250eSAlex Richardson return 0; 1749*5bb9250eSAlex Richardson } 1750*5bb9250eSAlex Richardson 1751*5bb9250eSAlex Richardson /* 1752*5bb9250eSAlex Richardson * Internal utility routines. 1753*5bb9250eSAlex Richardson */ 1754*5bb9250eSAlex Richardson 1755*5bb9250eSAlex Richardson #ifndef yytext_ptr 1756*5bb9250eSAlex Richardson static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) 1757*5bb9250eSAlex Richardson { 1758*5bb9250eSAlex Richardson int i; 1759*5bb9250eSAlex Richardson for ( i = 0; i < n; ++i ) 1760*5bb9250eSAlex Richardson s1[i] = s2[i]; 1761*5bb9250eSAlex Richardson } 1762*5bb9250eSAlex Richardson #endif 1763*5bb9250eSAlex Richardson 1764*5bb9250eSAlex Richardson #ifdef YY_NEED_STRLEN 1765*5bb9250eSAlex Richardson static int yy_flex_strlen (yyconst char * s ) 1766*5bb9250eSAlex Richardson { 1767*5bb9250eSAlex Richardson int n; 1768*5bb9250eSAlex Richardson for ( n = 0; s[n]; ++n ) 1769*5bb9250eSAlex Richardson ; 1770*5bb9250eSAlex Richardson 1771*5bb9250eSAlex Richardson return n; 1772*5bb9250eSAlex Richardson } 1773*5bb9250eSAlex Richardson #endif 1774*5bb9250eSAlex Richardson 1775*5bb9250eSAlex Richardson void *yyalloc (yy_size_t size ) 1776*5bb9250eSAlex Richardson { 1777*5bb9250eSAlex Richardson return (void *) malloc( size ); 1778*5bb9250eSAlex Richardson } 1779*5bb9250eSAlex Richardson 1780*5bb9250eSAlex Richardson void *yyrealloc (void * ptr, yy_size_t size ) 1781*5bb9250eSAlex Richardson { 1782*5bb9250eSAlex Richardson /* The cast to (char *) in the following accommodates both 1783*5bb9250eSAlex Richardson * implementations that use char* generic pointers, and those 1784*5bb9250eSAlex Richardson * that use void* generic pointers. It works with the latter 1785*5bb9250eSAlex Richardson * because both ANSI C and C++ allow castless assignment from 1786*5bb9250eSAlex Richardson * any pointer type to void*, and deal with argument conversions 1787*5bb9250eSAlex Richardson * as though doing an assignment. 1788*5bb9250eSAlex Richardson */ 1789*5bb9250eSAlex Richardson return (void *) realloc( (char *) ptr, size ); 1790*5bb9250eSAlex Richardson } 1791*5bb9250eSAlex Richardson 1792*5bb9250eSAlex Richardson void yyfree (void * ptr ) 1793*5bb9250eSAlex Richardson { 1794*5bb9250eSAlex Richardson free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ 1795*5bb9250eSAlex Richardson } 1796*5bb9250eSAlex Richardson 1797*5bb9250eSAlex Richardson #define YYTABLES_NAME "yytables" 1798*5bb9250eSAlex Richardson 1799*5bb9250eSAlex Richardson 1800*5bb9250eSAlex Richardson 1801*5bb9250eSAlex Richardson 1802*5bb9250eSAlex Richardson int32_t 1803*5bb9250eSAlex Richardson number(void) 1804*5bb9250eSAlex Richardson { 1805*5bb9250eSAlex Richardson long l; 1806*5bb9250eSAlex Richardson 1807*5bb9250eSAlex Richardson errno = 0; 1808*5bb9250eSAlex Richardson l = strtol(yytext, NULL, 0); 1809*5bb9250eSAlex Richardson if (((l == LONG_MAX || l == LONG_MIN) && errno == ERANGE) || 1810*5bb9250eSAlex Richardson l > INT32_MAX || l < INT32_MIN) { 1811*5bb9250eSAlex Richardson m4_warnx("numeric overflow in expr: %s", yytext); 1812*5bb9250eSAlex Richardson } 1813*5bb9250eSAlex Richardson return l; 1814*5bb9250eSAlex Richardson } 1815*5bb9250eSAlex Richardson 1816*5bb9250eSAlex Richardson int32_t 1817*5bb9250eSAlex Richardson parse_radix(void) 1818*5bb9250eSAlex Richardson { 1819*5bb9250eSAlex Richardson long base; 1820*5bb9250eSAlex Richardson char *next; 1821*5bb9250eSAlex Richardson long l; 1822*5bb9250eSAlex Richardson int d; 1823*5bb9250eSAlex Richardson 1824*5bb9250eSAlex Richardson l = 0; 1825*5bb9250eSAlex Richardson base = strtol(yytext+2, &next, 0); 1826*5bb9250eSAlex Richardson if (base > 36 || next == NULL) { 1827*5bb9250eSAlex Richardson m4_warnx("error in number %s", yytext); 1828*5bb9250eSAlex Richardson } else { 1829*5bb9250eSAlex Richardson next++; 1830*5bb9250eSAlex Richardson while (*next != 0) { 1831*5bb9250eSAlex Richardson if (*next >= '0' && *next <= '9') 1832*5bb9250eSAlex Richardson d = *next - '0'; 1833*5bb9250eSAlex Richardson else if (*next >= 'a' && *next <= 'z') 1834*5bb9250eSAlex Richardson d = *next - 'a' + 10; 1835*5bb9250eSAlex Richardson else { 1836*5bb9250eSAlex Richardson assert(*next >= 'A' && *next <= 'Z'); 1837*5bb9250eSAlex Richardson d = *next - 'A' + 10; 1838*5bb9250eSAlex Richardson } 1839*5bb9250eSAlex Richardson if (d >= base) { 1840*5bb9250eSAlex Richardson m4_warnx("error in number %s", yytext); 1841*5bb9250eSAlex Richardson return 0; 1842*5bb9250eSAlex Richardson } 1843*5bb9250eSAlex Richardson l = base * l + d; 1844*5bb9250eSAlex Richardson next++; 1845*5bb9250eSAlex Richardson } 1846*5bb9250eSAlex Richardson } 1847*5bb9250eSAlex Richardson return l; 1848*5bb9250eSAlex Richardson } 1849*5bb9250eSAlex Richardson 1850*5bb9250eSAlex Richardson 1851