1*4882a593Smuzhiyun 2*4882a593Smuzhiyun#define YY_INT_ALIGNED short int 3*4882a593Smuzhiyun 4*4882a593Smuzhiyun/* A lexical scanner generated by flex */ 5*4882a593Smuzhiyun 6*4882a593Smuzhiyun#define FLEX_SCANNER 7*4882a593Smuzhiyun#define YY_FLEX_MAJOR_VERSION 2 8*4882a593Smuzhiyun#define YY_FLEX_MINOR_VERSION 6 9*4882a593Smuzhiyun#define YY_FLEX_SUBMINOR_VERSION 4 10*4882a593Smuzhiyun#if YY_FLEX_SUBMINOR_VERSION > 0 11*4882a593Smuzhiyun#define FLEX_BETA 12*4882a593Smuzhiyun#endif 13*4882a593Smuzhiyun 14*4882a593Smuzhiyun/* First, we deal with platform-specific or compiler-specific issues. */ 15*4882a593Smuzhiyun 16*4882a593Smuzhiyun/* begin standard C headers. */ 17*4882a593Smuzhiyun#include <stdio.h> 18*4882a593Smuzhiyun#include <string.h> 19*4882a593Smuzhiyun#include <errno.h> 20*4882a593Smuzhiyun#include <stdlib.h> 21*4882a593Smuzhiyun 22*4882a593Smuzhiyun/* end standard C headers. */ 23*4882a593Smuzhiyun 24*4882a593Smuzhiyun/* flex integer type definitions */ 25*4882a593Smuzhiyun 26*4882a593Smuzhiyun#ifndef FLEXINT_H 27*4882a593Smuzhiyun#define FLEXINT_H 28*4882a593Smuzhiyun 29*4882a593Smuzhiyun/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ 30*4882a593Smuzhiyun 31*4882a593Smuzhiyun#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 32*4882a593Smuzhiyun 33*4882a593Smuzhiyun/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, 34*4882a593Smuzhiyun * if you want the limit (max/min) macros for int types. 35*4882a593Smuzhiyun */ 36*4882a593Smuzhiyun#ifndef __STDC_LIMIT_MACROS 37*4882a593Smuzhiyun#define __STDC_LIMIT_MACROS 1 38*4882a593Smuzhiyun#endif 39*4882a593Smuzhiyun 40*4882a593Smuzhiyun#include <inttypes.h> 41*4882a593Smuzhiyuntypedef int8_t flex_int8_t; 42*4882a593Smuzhiyuntypedef uint8_t flex_uint8_t; 43*4882a593Smuzhiyuntypedef int16_t flex_int16_t; 44*4882a593Smuzhiyuntypedef uint16_t flex_uint16_t; 45*4882a593Smuzhiyuntypedef int32_t flex_int32_t; 46*4882a593Smuzhiyuntypedef uint32_t flex_uint32_t; 47*4882a593Smuzhiyun#else 48*4882a593Smuzhiyuntypedef signed char flex_int8_t; 49*4882a593Smuzhiyuntypedef short int flex_int16_t; 50*4882a593Smuzhiyuntypedef int flex_int32_t; 51*4882a593Smuzhiyuntypedef unsigned char flex_uint8_t; 52*4882a593Smuzhiyuntypedef unsigned short int flex_uint16_t; 53*4882a593Smuzhiyuntypedef unsigned int flex_uint32_t; 54*4882a593Smuzhiyun 55*4882a593Smuzhiyun/* Limits of integral types. */ 56*4882a593Smuzhiyun#ifndef INT8_MIN 57*4882a593Smuzhiyun#define INT8_MIN (-128) 58*4882a593Smuzhiyun#endif 59*4882a593Smuzhiyun#ifndef INT16_MIN 60*4882a593Smuzhiyun#define INT16_MIN (-32767-1) 61*4882a593Smuzhiyun#endif 62*4882a593Smuzhiyun#ifndef INT32_MIN 63*4882a593Smuzhiyun#define INT32_MIN (-2147483647-1) 64*4882a593Smuzhiyun#endif 65*4882a593Smuzhiyun#ifndef INT8_MAX 66*4882a593Smuzhiyun#define INT8_MAX (127) 67*4882a593Smuzhiyun#endif 68*4882a593Smuzhiyun#ifndef INT16_MAX 69*4882a593Smuzhiyun#define INT16_MAX (32767) 70*4882a593Smuzhiyun#endif 71*4882a593Smuzhiyun#ifndef INT32_MAX 72*4882a593Smuzhiyun#define INT32_MAX (2147483647) 73*4882a593Smuzhiyun#endif 74*4882a593Smuzhiyun#ifndef UINT8_MAX 75*4882a593Smuzhiyun#define UINT8_MAX (255U) 76*4882a593Smuzhiyun#endif 77*4882a593Smuzhiyun#ifndef UINT16_MAX 78*4882a593Smuzhiyun#define UINT16_MAX (65535U) 79*4882a593Smuzhiyun#endif 80*4882a593Smuzhiyun#ifndef UINT32_MAX 81*4882a593Smuzhiyun#define UINT32_MAX (4294967295U) 82*4882a593Smuzhiyun#endif 83*4882a593Smuzhiyun 84*4882a593Smuzhiyun#ifndef SIZE_MAX 85*4882a593Smuzhiyun#define SIZE_MAX (~(size_t)0) 86*4882a593Smuzhiyun#endif 87*4882a593Smuzhiyun 88*4882a593Smuzhiyun#endif /* ! C99 */ 89*4882a593Smuzhiyun 90*4882a593Smuzhiyun#endif /* ! FLEXINT_H */ 91*4882a593Smuzhiyun 92*4882a593Smuzhiyun/* begin standard C++ headers. */ 93*4882a593Smuzhiyun 94*4882a593Smuzhiyun/* TODO: this is always defined, so inline it */ 95*4882a593Smuzhiyun#define yyconst const 96*4882a593Smuzhiyun 97*4882a593Smuzhiyun#if defined(__GNUC__) && __GNUC__ >= 3 98*4882a593Smuzhiyun#define yynoreturn __attribute__((__noreturn__)) 99*4882a593Smuzhiyun#else 100*4882a593Smuzhiyun#define yynoreturn 101*4882a593Smuzhiyun#endif 102*4882a593Smuzhiyun 103*4882a593Smuzhiyun/* Returned upon end-of-file. */ 104*4882a593Smuzhiyun#define YY_NULL 0 105*4882a593Smuzhiyun 106*4882a593Smuzhiyun/* Promotes a possibly negative, possibly signed char to an 107*4882a593Smuzhiyun * integer in range [0..255] for use as an array index. 108*4882a593Smuzhiyun */ 109*4882a593Smuzhiyun#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) 110*4882a593Smuzhiyun 111*4882a593Smuzhiyun/* Enter a start condition. This macro really ought to take a parameter, 112*4882a593Smuzhiyun * but we do it the disgusting crufty way forced on us by the ()-less 113*4882a593Smuzhiyun * definition of BEGIN. 114*4882a593Smuzhiyun */ 115*4882a593Smuzhiyun#define BEGIN (yy_start) = 1 + 2 * 116*4882a593Smuzhiyun/* Translate the current start state into a value that can be later handed 117*4882a593Smuzhiyun * to BEGIN to return to the state. The YYSTATE alias is for lex 118*4882a593Smuzhiyun * compatibility. 119*4882a593Smuzhiyun */ 120*4882a593Smuzhiyun#define YY_START (((yy_start) - 1) / 2) 121*4882a593Smuzhiyun#define YYSTATE YY_START 122*4882a593Smuzhiyun/* Action number for EOF rule of a given start state. */ 123*4882a593Smuzhiyun#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 124*4882a593Smuzhiyun/* Special action meaning "start processing a new file". */ 125*4882a593Smuzhiyun#define YY_NEW_FILE yyrestart( yyin ) 126*4882a593Smuzhiyun#define YY_END_OF_BUFFER_CHAR 0 127*4882a593Smuzhiyun 128*4882a593Smuzhiyun/* Size of default input buffer. */ 129*4882a593Smuzhiyun#ifndef YY_BUF_SIZE 130*4882a593Smuzhiyun#ifdef __ia64__ 131*4882a593Smuzhiyun/* On IA-64, the buffer size is 16k, not 8k. 132*4882a593Smuzhiyun * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. 133*4882a593Smuzhiyun * Ditto for the __ia64__ case accordingly. 134*4882a593Smuzhiyun */ 135*4882a593Smuzhiyun#define YY_BUF_SIZE 32768 136*4882a593Smuzhiyun#else 137*4882a593Smuzhiyun#define YY_BUF_SIZE 16384 138*4882a593Smuzhiyun#endif /* __ia64__ */ 139*4882a593Smuzhiyun#endif 140*4882a593Smuzhiyun 141*4882a593Smuzhiyun/* The state buf must be large enough to hold one state per character in the main buffer. 142*4882a593Smuzhiyun */ 143*4882a593Smuzhiyun#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) 144*4882a593Smuzhiyun 145*4882a593Smuzhiyun#ifndef YY_TYPEDEF_YY_BUFFER_STATE 146*4882a593Smuzhiyun#define YY_TYPEDEF_YY_BUFFER_STATE 147*4882a593Smuzhiyuntypedef struct yy_buffer_state *YY_BUFFER_STATE; 148*4882a593Smuzhiyun#endif 149*4882a593Smuzhiyun 150*4882a593Smuzhiyun#ifndef YY_TYPEDEF_YY_SIZE_T 151*4882a593Smuzhiyun#define YY_TYPEDEF_YY_SIZE_T 152*4882a593Smuzhiyuntypedef size_t yy_size_t; 153*4882a593Smuzhiyun#endif 154*4882a593Smuzhiyun 155*4882a593Smuzhiyunextern int yyleng; 156*4882a593Smuzhiyun 157*4882a593Smuzhiyunextern FILE *yyin, *yyout; 158*4882a593Smuzhiyun 159*4882a593Smuzhiyun#define EOB_ACT_CONTINUE_SCAN 0 160*4882a593Smuzhiyun#define EOB_ACT_END_OF_FILE 1 161*4882a593Smuzhiyun#define EOB_ACT_LAST_MATCH 2 162*4882a593Smuzhiyun 163*4882a593Smuzhiyun /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires 164*4882a593Smuzhiyun * access to the local variable yy_act. Since yyless() is a macro, it would break 165*4882a593Smuzhiyun * existing scanners that call yyless() from OUTSIDE yylex. 166*4882a593Smuzhiyun * One obvious solution it to make yy_act a global. I tried that, and saw 167*4882a593Smuzhiyun * a 5% performance hit in a non-yylineno scanner, because yy_act is 168*4882a593Smuzhiyun * normally declared as a register variable-- so it is not worth it. 169*4882a593Smuzhiyun */ 170*4882a593Smuzhiyun #define YY_LESS_LINENO(n) \ 171*4882a593Smuzhiyun do { \ 172*4882a593Smuzhiyun int yyl;\ 173*4882a593Smuzhiyun for ( yyl = n; yyl < yyleng; ++yyl )\ 174*4882a593Smuzhiyun if ( yytext[yyl] == '\n' )\ 175*4882a593Smuzhiyun --yylineno;\ 176*4882a593Smuzhiyun }while(0) 177*4882a593Smuzhiyun #define YY_LINENO_REWIND_TO(dst) \ 178*4882a593Smuzhiyun do {\ 179*4882a593Smuzhiyun const char *p;\ 180*4882a593Smuzhiyun for ( p = yy_cp-1; p >= (dst); --p)\ 181*4882a593Smuzhiyun if ( *p == '\n' )\ 182*4882a593Smuzhiyun --yylineno;\ 183*4882a593Smuzhiyun }while(0) 184*4882a593Smuzhiyun 185*4882a593Smuzhiyun/* Return all but the first "n" matched characters back to the input stream. */ 186*4882a593Smuzhiyun#define yyless(n) \ 187*4882a593Smuzhiyun do \ 188*4882a593Smuzhiyun { \ 189*4882a593Smuzhiyun /* Undo effects of setting up yytext. */ \ 190*4882a593Smuzhiyun int yyless_macro_arg = (n); \ 191*4882a593Smuzhiyun YY_LESS_LINENO(yyless_macro_arg);\ 192*4882a593Smuzhiyun *yy_cp = (yy_hold_char); \ 193*4882a593Smuzhiyun YY_RESTORE_YY_MORE_OFFSET \ 194*4882a593Smuzhiyun (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ 195*4882a593Smuzhiyun YY_DO_BEFORE_ACTION; /* set up yytext again */ \ 196*4882a593Smuzhiyun } \ 197*4882a593Smuzhiyun while ( 0 ) 198*4882a593Smuzhiyun#define unput(c) yyunput( c, (yytext_ptr) ) 199*4882a593Smuzhiyun 200*4882a593Smuzhiyun#ifndef YY_STRUCT_YY_BUFFER_STATE 201*4882a593Smuzhiyun#define YY_STRUCT_YY_BUFFER_STATE 202*4882a593Smuzhiyunstruct yy_buffer_state 203*4882a593Smuzhiyun { 204*4882a593Smuzhiyun FILE *yy_input_file; 205*4882a593Smuzhiyun 206*4882a593Smuzhiyun char *yy_ch_buf; /* input buffer */ 207*4882a593Smuzhiyun char *yy_buf_pos; /* current position in input buffer */ 208*4882a593Smuzhiyun 209*4882a593Smuzhiyun /* Size of input buffer in bytes, not including room for EOB 210*4882a593Smuzhiyun * characters. 211*4882a593Smuzhiyun */ 212*4882a593Smuzhiyun int yy_buf_size; 213*4882a593Smuzhiyun 214*4882a593Smuzhiyun /* Number of characters read into yy_ch_buf, not including EOB 215*4882a593Smuzhiyun * characters. 216*4882a593Smuzhiyun */ 217*4882a593Smuzhiyun int yy_n_chars; 218*4882a593Smuzhiyun 219*4882a593Smuzhiyun /* Whether we "own" the buffer - i.e., we know we created it, 220*4882a593Smuzhiyun * and can realloc() it to grow it, and should free() it to 221*4882a593Smuzhiyun * delete it. 222*4882a593Smuzhiyun */ 223*4882a593Smuzhiyun int yy_is_our_buffer; 224*4882a593Smuzhiyun 225*4882a593Smuzhiyun /* Whether this is an "interactive" input source; if so, and 226*4882a593Smuzhiyun * if we're using stdio for input, then we want to use getc() 227*4882a593Smuzhiyun * instead of fread(), to make sure we stop fetching input after 228*4882a593Smuzhiyun * each newline. 229*4882a593Smuzhiyun */ 230*4882a593Smuzhiyun int yy_is_interactive; 231*4882a593Smuzhiyun 232*4882a593Smuzhiyun /* Whether we're considered to be at the beginning of a line. 233*4882a593Smuzhiyun * If so, '^' rules will be active on the next match, otherwise 234*4882a593Smuzhiyun * not. 235*4882a593Smuzhiyun */ 236*4882a593Smuzhiyun int yy_at_bol; 237*4882a593Smuzhiyun 238*4882a593Smuzhiyun int yy_bs_lineno; /**< The line count. */ 239*4882a593Smuzhiyun int yy_bs_column; /**< The column count. */ 240*4882a593Smuzhiyun 241*4882a593Smuzhiyun /* Whether to try to fill the input buffer when we reach the 242*4882a593Smuzhiyun * end of it. 243*4882a593Smuzhiyun */ 244*4882a593Smuzhiyun int yy_fill_buffer; 245*4882a593Smuzhiyun 246*4882a593Smuzhiyun int yy_buffer_status; 247*4882a593Smuzhiyun 248*4882a593Smuzhiyun#define YY_BUFFER_NEW 0 249*4882a593Smuzhiyun#define YY_BUFFER_NORMAL 1 250*4882a593Smuzhiyun /* When an EOF's been seen but there's still some text to process 251*4882a593Smuzhiyun * then we mark the buffer as YY_EOF_PENDING, to indicate that we 252*4882a593Smuzhiyun * shouldn't try reading from the input source any more. We might 253*4882a593Smuzhiyun * still have a bunch of tokens to match, though, because of 254*4882a593Smuzhiyun * possible backing-up. 255*4882a593Smuzhiyun * 256*4882a593Smuzhiyun * When we actually see the EOF, we change the status to "new" 257*4882a593Smuzhiyun * (via yyrestart()), so that the user can continue scanning by 258*4882a593Smuzhiyun * just pointing yyin at a new input file. 259*4882a593Smuzhiyun */ 260*4882a593Smuzhiyun#define YY_BUFFER_EOF_PENDING 2 261*4882a593Smuzhiyun 262*4882a593Smuzhiyun }; 263*4882a593Smuzhiyun#endif /* !YY_STRUCT_YY_BUFFER_STATE */ 264*4882a593Smuzhiyun 265*4882a593Smuzhiyun/* Stack of input buffers. */ 266*4882a593Smuzhiyunstatic size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ 267*4882a593Smuzhiyunstatic size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ 268*4882a593Smuzhiyunstatic YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ 269*4882a593Smuzhiyun 270*4882a593Smuzhiyun/* We provide macros for accessing buffer states in case in the 271*4882a593Smuzhiyun * future we want to put the buffer states in a more general 272*4882a593Smuzhiyun * "scanner state". 273*4882a593Smuzhiyun * 274*4882a593Smuzhiyun * Returns the top of the stack, or NULL. 275*4882a593Smuzhiyun */ 276*4882a593Smuzhiyun#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ 277*4882a593Smuzhiyun ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ 278*4882a593Smuzhiyun : NULL) 279*4882a593Smuzhiyun/* Same as previous macro, but useful when we know that the buffer stack is not 280*4882a593Smuzhiyun * NULL or when we need an lvalue. For internal use only. 281*4882a593Smuzhiyun */ 282*4882a593Smuzhiyun#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] 283*4882a593Smuzhiyun 284*4882a593Smuzhiyun/* yy_hold_char holds the character lost when yytext is formed. */ 285*4882a593Smuzhiyunstatic char yy_hold_char; 286*4882a593Smuzhiyunstatic int yy_n_chars; /* number of characters read into yy_ch_buf */ 287*4882a593Smuzhiyunint yyleng; 288*4882a593Smuzhiyun 289*4882a593Smuzhiyun/* Points to current character in buffer. */ 290*4882a593Smuzhiyunstatic char *yy_c_buf_p = NULL; 291*4882a593Smuzhiyunstatic int yy_init = 0; /* whether we need to initialize */ 292*4882a593Smuzhiyunstatic int yy_start = 0; /* start state number */ 293*4882a593Smuzhiyun 294*4882a593Smuzhiyun/* Flag which is used to allow yywrap()'s to do buffer switches 295*4882a593Smuzhiyun * instead of setting up a fresh yyin. A bit of a hack ... 296*4882a593Smuzhiyun */ 297*4882a593Smuzhiyunstatic int yy_did_buffer_switch_on_eof; 298*4882a593Smuzhiyun 299*4882a593Smuzhiyunvoid yyrestart ( FILE *input_file ); 300*4882a593Smuzhiyunvoid yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); 301*4882a593SmuzhiyunYY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); 302*4882a593Smuzhiyunvoid yy_delete_buffer ( YY_BUFFER_STATE b ); 303*4882a593Smuzhiyunvoid yy_flush_buffer ( YY_BUFFER_STATE b ); 304*4882a593Smuzhiyunvoid yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); 305*4882a593Smuzhiyunvoid yypop_buffer_state ( void ); 306*4882a593Smuzhiyun 307*4882a593Smuzhiyunstatic void yyensure_buffer_stack ( void ); 308*4882a593Smuzhiyunstatic void yy_load_buffer_state ( void ); 309*4882a593Smuzhiyunstatic void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); 310*4882a593Smuzhiyun#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) 311*4882a593Smuzhiyun 312*4882a593SmuzhiyunYY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); 313*4882a593SmuzhiyunYY_BUFFER_STATE yy_scan_string ( const char *yy_str ); 314*4882a593SmuzhiyunYY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); 315*4882a593Smuzhiyun 316*4882a593Smuzhiyunvoid *yyalloc ( yy_size_t ); 317*4882a593Smuzhiyunvoid *yyrealloc ( void *, yy_size_t ); 318*4882a593Smuzhiyunvoid yyfree ( void * ); 319*4882a593Smuzhiyun 320*4882a593Smuzhiyun#define yy_new_buffer yy_create_buffer 321*4882a593Smuzhiyun#define yy_set_interactive(is_interactive) \ 322*4882a593Smuzhiyun { \ 323*4882a593Smuzhiyun if ( ! YY_CURRENT_BUFFER ){ \ 324*4882a593Smuzhiyun yyensure_buffer_stack (); \ 325*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE = \ 326*4882a593Smuzhiyun yy_create_buffer( yyin, YY_BUF_SIZE ); \ 327*4882a593Smuzhiyun } \ 328*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ 329*4882a593Smuzhiyun } 330*4882a593Smuzhiyun#define yy_set_bol(at_bol) \ 331*4882a593Smuzhiyun { \ 332*4882a593Smuzhiyun if ( ! YY_CURRENT_BUFFER ){\ 333*4882a593Smuzhiyun yyensure_buffer_stack (); \ 334*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE = \ 335*4882a593Smuzhiyun yy_create_buffer( yyin, YY_BUF_SIZE ); \ 336*4882a593Smuzhiyun } \ 337*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ 338*4882a593Smuzhiyun } 339*4882a593Smuzhiyun#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 340*4882a593Smuzhiyun 341*4882a593Smuzhiyun/* Begin user sect3 */ 342*4882a593Smuzhiyun 343*4882a593Smuzhiyun#define yywrap() (/*CONSTCOND*/1) 344*4882a593Smuzhiyun#define YY_SKIP_YYWRAP 345*4882a593Smuzhiyuntypedef flex_uint8_t YY_CHAR; 346*4882a593Smuzhiyun 347*4882a593SmuzhiyunFILE *yyin = NULL, *yyout = NULL; 348*4882a593Smuzhiyun 349*4882a593Smuzhiyuntypedef int yy_state_type; 350*4882a593Smuzhiyun 351*4882a593Smuzhiyunextern int yylineno; 352*4882a593Smuzhiyunint yylineno = 1; 353*4882a593Smuzhiyun 354*4882a593Smuzhiyunextern char *yytext; 355*4882a593Smuzhiyun#ifdef yytext_ptr 356*4882a593Smuzhiyun#undef yytext_ptr 357*4882a593Smuzhiyun#endif 358*4882a593Smuzhiyun#define yytext_ptr yytext 359*4882a593Smuzhiyun 360*4882a593Smuzhiyunstatic const flex_int16_t yy_nxt[][18] = 361*4882a593Smuzhiyun { 362*4882a593Smuzhiyun { 363*4882a593Smuzhiyun 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 364*4882a593Smuzhiyun 0, 0, 0, 0, 0, 0, 0, 0 365*4882a593Smuzhiyun }, 366*4882a593Smuzhiyun 367*4882a593Smuzhiyun { 368*4882a593Smuzhiyun 11, 12, 13, 14, 12, 12, 15, 12, 12, 12, 369*4882a593Smuzhiyun 12, 12, 12, 12, 12, 12, 12, 12 370*4882a593Smuzhiyun }, 371*4882a593Smuzhiyun 372*4882a593Smuzhiyun { 373*4882a593Smuzhiyun 11, 12, 13, 14, 12, 12, 15, 12, 12, 12, 374*4882a593Smuzhiyun 12, 12, 12, 12, 12, 12, 12, 12 375*4882a593Smuzhiyun }, 376*4882a593Smuzhiyun 377*4882a593Smuzhiyun { 378*4882a593Smuzhiyun 11, 16, 16, 17, 16, 16, 16, 16, 16, 16, 379*4882a593Smuzhiyun 16, 18, 16, 16, 16, 16, 16, 16 380*4882a593Smuzhiyun }, 381*4882a593Smuzhiyun 382*4882a593Smuzhiyun { 383*4882a593Smuzhiyun 11, 16, 16, 17, 16, 16, 16, 16, 16, 16, 384*4882a593Smuzhiyun 16, 18, 16, 16, 16, 16, 16, 16 385*4882a593Smuzhiyun 386*4882a593Smuzhiyun }, 387*4882a593Smuzhiyun 388*4882a593Smuzhiyun { 389*4882a593Smuzhiyun 11, 19, 20, 21, 19, 19, 19, 19, 19, 19, 390*4882a593Smuzhiyun 19, 19, 19, 19, 19, 19, 19, 19 391*4882a593Smuzhiyun }, 392*4882a593Smuzhiyun 393*4882a593Smuzhiyun { 394*4882a593Smuzhiyun 11, 19, 20, 21, 19, 19, 19, 19, 19, 19, 395*4882a593Smuzhiyun 19, 19, 19, 19, 19, 19, 19, 19 396*4882a593Smuzhiyun }, 397*4882a593Smuzhiyun 398*4882a593Smuzhiyun { 399*4882a593Smuzhiyun 11, 22, 22, 23, 22, 24, 22, 22, 24, 22, 400*4882a593Smuzhiyun 22, 22, 22, 22, 22, 22, 25, 22 401*4882a593Smuzhiyun }, 402*4882a593Smuzhiyun 403*4882a593Smuzhiyun { 404*4882a593Smuzhiyun 11, 22, 22, 23, 22, 24, 22, 22, 24, 22, 405*4882a593Smuzhiyun 22, 22, 22, 22, 22, 22, 25, 22 406*4882a593Smuzhiyun }, 407*4882a593Smuzhiyun 408*4882a593Smuzhiyun { 409*4882a593Smuzhiyun 11, 26, 27, 28, 29, 30, 31, 32, 30, 33, 410*4882a593Smuzhiyun 34, 35, 35, 36, 37, 38, 39, 40 411*4882a593Smuzhiyun 412*4882a593Smuzhiyun }, 413*4882a593Smuzhiyun 414*4882a593Smuzhiyun { 415*4882a593Smuzhiyun 11, 26, 27, 28, 29, 30, 31, 32, 30, 33, 416*4882a593Smuzhiyun 34, 35, 35, 36, 37, 38, 39, 40 417*4882a593Smuzhiyun }, 418*4882a593Smuzhiyun 419*4882a593Smuzhiyun { 420*4882a593Smuzhiyun -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, 421*4882a593Smuzhiyun -11, -11, -11, -11, -11, -11, -11, -11 422*4882a593Smuzhiyun }, 423*4882a593Smuzhiyun 424*4882a593Smuzhiyun { 425*4882a593Smuzhiyun 11, -12, -12, -12, -12, -12, -12, -12, -12, -12, 426*4882a593Smuzhiyun -12, -12, -12, -12, -12, -12, -12, -12 427*4882a593Smuzhiyun }, 428*4882a593Smuzhiyun 429*4882a593Smuzhiyun { 430*4882a593Smuzhiyun 11, -13, 41, 42, -13, -13, 43, -13, -13, -13, 431*4882a593Smuzhiyun -13, -13, -13, -13, -13, -13, -13, -13 432*4882a593Smuzhiyun }, 433*4882a593Smuzhiyun 434*4882a593Smuzhiyun { 435*4882a593Smuzhiyun 11, -14, -14, -14, -14, -14, -14, -14, -14, -14, 436*4882a593Smuzhiyun -14, -14, -14, -14, -14, -14, -14, -14 437*4882a593Smuzhiyun 438*4882a593Smuzhiyun }, 439*4882a593Smuzhiyun 440*4882a593Smuzhiyun { 441*4882a593Smuzhiyun 11, 44, 44, 45, 44, 44, 44, 44, 44, 44, 442*4882a593Smuzhiyun 44, 44, 44, 44, 44, 44, 44, 44 443*4882a593Smuzhiyun }, 444*4882a593Smuzhiyun 445*4882a593Smuzhiyun { 446*4882a593Smuzhiyun 11, -16, -16, -16, -16, -16, -16, -16, -16, -16, 447*4882a593Smuzhiyun -16, -16, -16, -16, -16, -16, -16, -16 448*4882a593Smuzhiyun }, 449*4882a593Smuzhiyun 450*4882a593Smuzhiyun { 451*4882a593Smuzhiyun 11, -17, -17, -17, -17, -17, -17, -17, -17, -17, 452*4882a593Smuzhiyun -17, -17, -17, -17, -17, -17, -17, -17 453*4882a593Smuzhiyun }, 454*4882a593Smuzhiyun 455*4882a593Smuzhiyun { 456*4882a593Smuzhiyun 11, -18, -18, -18, -18, -18, -18, -18, -18, -18, 457*4882a593Smuzhiyun -18, 46, -18, -18, -18, -18, -18, -18 458*4882a593Smuzhiyun }, 459*4882a593Smuzhiyun 460*4882a593Smuzhiyun { 461*4882a593Smuzhiyun 11, 47, 47, -19, 47, 47, 47, 47, 47, 47, 462*4882a593Smuzhiyun 47, 47, 47, 47, 47, 47, 47, 47 463*4882a593Smuzhiyun 464*4882a593Smuzhiyun }, 465*4882a593Smuzhiyun 466*4882a593Smuzhiyun { 467*4882a593Smuzhiyun 11, -20, 48, 49, -20, -20, -20, -20, -20, -20, 468*4882a593Smuzhiyun -20, -20, -20, -20, -20, -20, -20, -20 469*4882a593Smuzhiyun }, 470*4882a593Smuzhiyun 471*4882a593Smuzhiyun { 472*4882a593Smuzhiyun 11, 50, -21, -21, 50, 50, 50, 50, 50, 50, 473*4882a593Smuzhiyun 50, 50, 50, 50, 50, 50, 50, 50 474*4882a593Smuzhiyun }, 475*4882a593Smuzhiyun 476*4882a593Smuzhiyun { 477*4882a593Smuzhiyun 11, 51, 51, 52, 51, -22, 51, 51, -22, 51, 478*4882a593Smuzhiyun 51, 51, 51, 51, 51, 51, -22, 51 479*4882a593Smuzhiyun }, 480*4882a593Smuzhiyun 481*4882a593Smuzhiyun { 482*4882a593Smuzhiyun 11, -23, -23, -23, -23, -23, -23, -23, -23, -23, 483*4882a593Smuzhiyun -23, -23, -23, -23, -23, -23, -23, -23 484*4882a593Smuzhiyun }, 485*4882a593Smuzhiyun 486*4882a593Smuzhiyun { 487*4882a593Smuzhiyun 11, -24, -24, -24, -24, -24, -24, -24, -24, -24, 488*4882a593Smuzhiyun -24, -24, -24, -24, -24, -24, -24, -24 489*4882a593Smuzhiyun 490*4882a593Smuzhiyun }, 491*4882a593Smuzhiyun 492*4882a593Smuzhiyun { 493*4882a593Smuzhiyun 11, 53, 53, 54, 53, 53, 53, 53, 53, 53, 494*4882a593Smuzhiyun 53, 53, 53, 53, 53, 53, 53, 53 495*4882a593Smuzhiyun }, 496*4882a593Smuzhiyun 497*4882a593Smuzhiyun { 498*4882a593Smuzhiyun 11, -26, -26, -26, -26, -26, -26, -26, -26, -26, 499*4882a593Smuzhiyun -26, -26, -26, -26, -26, -26, -26, -26 500*4882a593Smuzhiyun }, 501*4882a593Smuzhiyun 502*4882a593Smuzhiyun { 503*4882a593Smuzhiyun 11, -27, 55, -27, -27, -27, -27, -27, -27, -27, 504*4882a593Smuzhiyun -27, -27, -27, -27, -27, -27, -27, -27 505*4882a593Smuzhiyun }, 506*4882a593Smuzhiyun 507*4882a593Smuzhiyun { 508*4882a593Smuzhiyun 11, -28, -28, -28, -28, -28, -28, -28, -28, -28, 509*4882a593Smuzhiyun -28, -28, -28, -28, -28, -28, -28, -28 510*4882a593Smuzhiyun }, 511*4882a593Smuzhiyun 512*4882a593Smuzhiyun { 513*4882a593Smuzhiyun 11, -29, -29, -29, -29, -29, -29, -29, -29, -29, 514*4882a593Smuzhiyun -29, -29, -29, -29, 56, -29, -29, -29 515*4882a593Smuzhiyun 516*4882a593Smuzhiyun }, 517*4882a593Smuzhiyun 518*4882a593Smuzhiyun { 519*4882a593Smuzhiyun 11, -30, -30, -30, -30, -30, -30, -30, -30, -30, 520*4882a593Smuzhiyun -30, -30, -30, -30, -30, -30, -30, -30 521*4882a593Smuzhiyun }, 522*4882a593Smuzhiyun 523*4882a593Smuzhiyun { 524*4882a593Smuzhiyun 11, 57, 57, -31, 57, 57, 57, 57, 57, 57, 525*4882a593Smuzhiyun 57, 57, 57, 57, 57, 57, 57, 57 526*4882a593Smuzhiyun }, 527*4882a593Smuzhiyun 528*4882a593Smuzhiyun { 529*4882a593Smuzhiyun 11, -32, -32, -32, -32, -32, -32, 58, -32, -32, 530*4882a593Smuzhiyun -32, -32, -32, -32, -32, -32, -32, -32 531*4882a593Smuzhiyun }, 532*4882a593Smuzhiyun 533*4882a593Smuzhiyun { 534*4882a593Smuzhiyun 11, -33, -33, -33, -33, -33, -33, -33, -33, -33, 535*4882a593Smuzhiyun -33, -33, -33, -33, -33, -33, -33, -33 536*4882a593Smuzhiyun }, 537*4882a593Smuzhiyun 538*4882a593Smuzhiyun { 539*4882a593Smuzhiyun 11, -34, -34, -34, -34, -34, -34, -34, -34, -34, 540*4882a593Smuzhiyun -34, -34, -34, -34, -34, -34, -34, -34 541*4882a593Smuzhiyun 542*4882a593Smuzhiyun }, 543*4882a593Smuzhiyun 544*4882a593Smuzhiyun { 545*4882a593Smuzhiyun 11, -35, -35, -35, -35, -35, -35, -35, -35, -35, 546*4882a593Smuzhiyun -35, 59, 59, -35, -35, -35, -35, -35 547*4882a593Smuzhiyun }, 548*4882a593Smuzhiyun 549*4882a593Smuzhiyun { 550*4882a593Smuzhiyun 11, -36, -36, -36, -36, -36, -36, -36, -36, -36, 551*4882a593Smuzhiyun -36, -36, -36, -36, 60, -36, -36, -36 552*4882a593Smuzhiyun }, 553*4882a593Smuzhiyun 554*4882a593Smuzhiyun { 555*4882a593Smuzhiyun 11, -37, -37, -37, -37, -37, -37, -37, -37, -37, 556*4882a593Smuzhiyun -37, -37, -37, -37, -37, -37, -37, -37 557*4882a593Smuzhiyun }, 558*4882a593Smuzhiyun 559*4882a593Smuzhiyun { 560*4882a593Smuzhiyun 11, -38, -38, -38, -38, -38, -38, -38, -38, -38, 561*4882a593Smuzhiyun -38, -38, -38, -38, 61, -38, -38, -38 562*4882a593Smuzhiyun }, 563*4882a593Smuzhiyun 564*4882a593Smuzhiyun { 565*4882a593Smuzhiyun 11, -39, -39, 62, -39, -39, -39, -39, -39, -39, 566*4882a593Smuzhiyun -39, -39, -39, -39, -39, -39, -39, -39 567*4882a593Smuzhiyun 568*4882a593Smuzhiyun }, 569*4882a593Smuzhiyun 570*4882a593Smuzhiyun { 571*4882a593Smuzhiyun 11, -40, -40, -40, -40, -40, -40, -40, -40, -40, 572*4882a593Smuzhiyun -40, -40, -40, -40, -40, -40, -40, 63 573*4882a593Smuzhiyun }, 574*4882a593Smuzhiyun 575*4882a593Smuzhiyun { 576*4882a593Smuzhiyun 11, -41, 41, 42, -41, -41, 43, -41, -41, -41, 577*4882a593Smuzhiyun -41, -41, -41, -41, -41, -41, -41, -41 578*4882a593Smuzhiyun }, 579*4882a593Smuzhiyun 580*4882a593Smuzhiyun { 581*4882a593Smuzhiyun 11, -42, -42, -42, -42, -42, -42, -42, -42, -42, 582*4882a593Smuzhiyun -42, -42, -42, -42, -42, -42, -42, -42 583*4882a593Smuzhiyun }, 584*4882a593Smuzhiyun 585*4882a593Smuzhiyun { 586*4882a593Smuzhiyun 11, 44, 44, 45, 44, 44, 44, 44, 44, 44, 587*4882a593Smuzhiyun 44, 44, 44, 44, 44, 44, 44, 44 588*4882a593Smuzhiyun }, 589*4882a593Smuzhiyun 590*4882a593Smuzhiyun { 591*4882a593Smuzhiyun 11, 44, 44, 45, 44, 44, 44, 44, 44, 44, 592*4882a593Smuzhiyun 44, 44, 44, 44, 44, 44, 44, 44 593*4882a593Smuzhiyun 594*4882a593Smuzhiyun }, 595*4882a593Smuzhiyun 596*4882a593Smuzhiyun { 597*4882a593Smuzhiyun 11, -45, -45, -45, -45, -45, -45, -45, -45, -45, 598*4882a593Smuzhiyun -45, -45, -45, -45, -45, -45, -45, -45 599*4882a593Smuzhiyun }, 600*4882a593Smuzhiyun 601*4882a593Smuzhiyun { 602*4882a593Smuzhiyun 11, -46, -46, -46, -46, -46, -46, -46, -46, -46, 603*4882a593Smuzhiyun -46, 46, -46, -46, -46, -46, -46, -46 604*4882a593Smuzhiyun }, 605*4882a593Smuzhiyun 606*4882a593Smuzhiyun { 607*4882a593Smuzhiyun 11, 47, 47, -47, 47, 47, 47, 47, 47, 47, 608*4882a593Smuzhiyun 47, 47, 47, 47, 47, 47, 47, 47 609*4882a593Smuzhiyun }, 610*4882a593Smuzhiyun 611*4882a593Smuzhiyun { 612*4882a593Smuzhiyun 11, -48, 48, 49, -48, -48, -48, -48, -48, -48, 613*4882a593Smuzhiyun -48, -48, -48, -48, -48, -48, -48, -48 614*4882a593Smuzhiyun }, 615*4882a593Smuzhiyun 616*4882a593Smuzhiyun { 617*4882a593Smuzhiyun 11, 50, -49, -49, 50, 50, 50, 50, 50, 50, 618*4882a593Smuzhiyun 50, 50, 50, 50, 50, 50, 50, 50 619*4882a593Smuzhiyun 620*4882a593Smuzhiyun }, 621*4882a593Smuzhiyun 622*4882a593Smuzhiyun { 623*4882a593Smuzhiyun 11, -50, -50, -50, -50, -50, -50, -50, -50, -50, 624*4882a593Smuzhiyun -50, -50, -50, -50, -50, -50, -50, -50 625*4882a593Smuzhiyun }, 626*4882a593Smuzhiyun 627*4882a593Smuzhiyun { 628*4882a593Smuzhiyun 11, 51, 51, 52, 51, -51, 51, 51, -51, 51, 629*4882a593Smuzhiyun 51, 51, 51, 51, 51, 51, -51, 51 630*4882a593Smuzhiyun }, 631*4882a593Smuzhiyun 632*4882a593Smuzhiyun { 633*4882a593Smuzhiyun 11, -52, -52, -52, -52, -52, -52, -52, -52, -52, 634*4882a593Smuzhiyun -52, -52, -52, -52, -52, -52, -52, -52 635*4882a593Smuzhiyun }, 636*4882a593Smuzhiyun 637*4882a593Smuzhiyun { 638*4882a593Smuzhiyun 11, -53, -53, 54, -53, -53, -53, -53, -53, -53, 639*4882a593Smuzhiyun -53, -53, -53, -53, -53, -53, -53, -53 640*4882a593Smuzhiyun }, 641*4882a593Smuzhiyun 642*4882a593Smuzhiyun { 643*4882a593Smuzhiyun 11, -54, -54, -54, -54, -54, -54, -54, -54, -54, 644*4882a593Smuzhiyun -54, -54, -54, -54, -54, -54, -54, -54 645*4882a593Smuzhiyun 646*4882a593Smuzhiyun }, 647*4882a593Smuzhiyun 648*4882a593Smuzhiyun { 649*4882a593Smuzhiyun 11, -55, 55, -55, -55, -55, -55, -55, -55, -55, 650*4882a593Smuzhiyun -55, -55, -55, -55, -55, -55, -55, -55 651*4882a593Smuzhiyun }, 652*4882a593Smuzhiyun 653*4882a593Smuzhiyun { 654*4882a593Smuzhiyun 11, -56, -56, -56, -56, -56, -56, -56, -56, -56, 655*4882a593Smuzhiyun -56, -56, -56, -56, -56, -56, -56, -56 656*4882a593Smuzhiyun }, 657*4882a593Smuzhiyun 658*4882a593Smuzhiyun { 659*4882a593Smuzhiyun 11, 57, 57, -57, 57, 57, 57, 57, 57, 57, 660*4882a593Smuzhiyun 57, 57, 57, 57, 57, 57, 57, 57 661*4882a593Smuzhiyun }, 662*4882a593Smuzhiyun 663*4882a593Smuzhiyun { 664*4882a593Smuzhiyun 11, -58, -58, -58, -58, -58, -58, -58, -58, -58, 665*4882a593Smuzhiyun -58, -58, -58, -58, -58, -58, -58, -58 666*4882a593Smuzhiyun }, 667*4882a593Smuzhiyun 668*4882a593Smuzhiyun { 669*4882a593Smuzhiyun 11, -59, -59, -59, -59, -59, -59, -59, -59, -59, 670*4882a593Smuzhiyun -59, 59, 59, -59, -59, -59, -59, -59 671*4882a593Smuzhiyun 672*4882a593Smuzhiyun }, 673*4882a593Smuzhiyun 674*4882a593Smuzhiyun { 675*4882a593Smuzhiyun 11, -60, -60, -60, -60, -60, -60, -60, -60, -60, 676*4882a593Smuzhiyun -60, -60, -60, -60, -60, -60, -60, -60 677*4882a593Smuzhiyun }, 678*4882a593Smuzhiyun 679*4882a593Smuzhiyun { 680*4882a593Smuzhiyun 11, -61, -61, -61, -61, -61, -61, -61, -61, -61, 681*4882a593Smuzhiyun -61, -61, -61, -61, -61, -61, -61, -61 682*4882a593Smuzhiyun }, 683*4882a593Smuzhiyun 684*4882a593Smuzhiyun { 685*4882a593Smuzhiyun 11, -62, -62, -62, -62, -62, -62, -62, -62, -62, 686*4882a593Smuzhiyun -62, -62, -62, -62, -62, -62, -62, -62 687*4882a593Smuzhiyun }, 688*4882a593Smuzhiyun 689*4882a593Smuzhiyun { 690*4882a593Smuzhiyun 11, -63, -63, -63, -63, -63, -63, -63, -63, -63, 691*4882a593Smuzhiyun -63, -63, -63, -63, -63, -63, -63, -63 692*4882a593Smuzhiyun }, 693*4882a593Smuzhiyun 694*4882a593Smuzhiyun } ; 695*4882a593Smuzhiyun 696*4882a593Smuzhiyunstatic yy_state_type yy_get_previous_state ( void ); 697*4882a593Smuzhiyunstatic yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); 698*4882a593Smuzhiyunstatic int yy_get_next_buffer ( void ); 699*4882a593Smuzhiyunstatic void yynoreturn yy_fatal_error ( const char* msg ); 700*4882a593Smuzhiyun 701*4882a593Smuzhiyun/* Done after the current pattern has been matched and before the 702*4882a593Smuzhiyun * corresponding action - sets up yytext. 703*4882a593Smuzhiyun */ 704*4882a593Smuzhiyun#define YY_DO_BEFORE_ACTION \ 705*4882a593Smuzhiyun (yytext_ptr) = yy_bp; \ 706*4882a593Smuzhiyun yyleng = (int) (yy_cp - yy_bp); \ 707*4882a593Smuzhiyun (yy_hold_char) = *yy_cp; \ 708*4882a593Smuzhiyun *yy_cp = '\0'; \ 709*4882a593Smuzhiyun (yy_c_buf_p) = yy_cp; 710*4882a593Smuzhiyun#define YY_NUM_RULES 37 711*4882a593Smuzhiyun#define YY_END_OF_BUFFER 38 712*4882a593Smuzhiyun/* This struct is not used in this scanner, 713*4882a593Smuzhiyun but its presence is necessary. */ 714*4882a593Smuzhiyunstruct yy_trans_info 715*4882a593Smuzhiyun { 716*4882a593Smuzhiyun flex_int32_t yy_verify; 717*4882a593Smuzhiyun flex_int32_t yy_nxt; 718*4882a593Smuzhiyun }; 719*4882a593Smuzhiyunstatic const flex_int16_t yy_accept[64] = 720*4882a593Smuzhiyun { 0, 721*4882a593Smuzhiyun 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 722*4882a593Smuzhiyun 38, 5, 4, 2, 3, 7, 8, 6, 36, 33, 723*4882a593Smuzhiyun 35, 28, 32, 31, 30, 26, 25, 21, 13, 20, 724*4882a593Smuzhiyun 23, 26, 11, 12, 22, 18, 14, 19, 26, 26, 725*4882a593Smuzhiyun 4, 2, 3, 3, 1, 6, 36, 33, 35, 34, 726*4882a593Smuzhiyun 28, 27, 30, 29, 25, 15, 23, 9, 22, 16, 727*4882a593Smuzhiyun 17, 24, 10 728*4882a593Smuzhiyun } ; 729*4882a593Smuzhiyun 730*4882a593Smuzhiyunstatic const YY_CHAR yy_ec[256] = 731*4882a593Smuzhiyun { 0, 732*4882a593Smuzhiyun 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 733*4882a593Smuzhiyun 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 734*4882a593Smuzhiyun 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 735*4882a593Smuzhiyun 1, 2, 4, 5, 6, 1, 1, 7, 8, 9, 736*4882a593Smuzhiyun 10, 1, 1, 1, 11, 12, 12, 11, 11, 11, 737*4882a593Smuzhiyun 11, 11, 11, 11, 11, 11, 11, 1, 1, 13, 738*4882a593Smuzhiyun 14, 15, 1, 1, 11, 11, 11, 11, 11, 11, 739*4882a593Smuzhiyun 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 740*4882a593Smuzhiyun 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 741*4882a593Smuzhiyun 1, 16, 1, 1, 11, 1, 11, 11, 11, 11, 742*4882a593Smuzhiyun 743*4882a593Smuzhiyun 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 744*4882a593Smuzhiyun 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 745*4882a593Smuzhiyun 11, 11, 1, 17, 1, 1, 1, 1, 1, 1, 746*4882a593Smuzhiyun 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 747*4882a593Smuzhiyun 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 748*4882a593Smuzhiyun 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 749*4882a593Smuzhiyun 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 750*4882a593Smuzhiyun 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 751*4882a593Smuzhiyun 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 752*4882a593Smuzhiyun 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 753*4882a593Smuzhiyun 754*4882a593Smuzhiyun 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 755*4882a593Smuzhiyun 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 756*4882a593Smuzhiyun 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 757*4882a593Smuzhiyun 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 758*4882a593Smuzhiyun 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 759*4882a593Smuzhiyun 1, 1, 1, 1, 1 760*4882a593Smuzhiyun } ; 761*4882a593Smuzhiyun 762*4882a593Smuzhiyun/* Table of booleans, true if rule could match eol. */ 763*4882a593Smuzhiyunstatic const flex_int32_t yy_rule_can_match_eol[38] = 764*4882a593Smuzhiyun { 0, 765*4882a593Smuzhiyun1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 766*4882a593Smuzhiyun 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, }; 767*4882a593Smuzhiyun 768*4882a593Smuzhiyunextern int yy_flex_debug; 769*4882a593Smuzhiyunint yy_flex_debug = 0; 770*4882a593Smuzhiyun 771*4882a593Smuzhiyun/* The intent behind this definition is that it'll catch 772*4882a593Smuzhiyun * any uses of REJECT which flex missed. 773*4882a593Smuzhiyun */ 774*4882a593Smuzhiyun#define REJECT reject_used_but_not_detected 775*4882a593Smuzhiyun#define yymore() yymore_used_but_not_detected 776*4882a593Smuzhiyun#define YY_MORE_ADJ 0 777*4882a593Smuzhiyun#define YY_RESTORE_YY_MORE_OFFSET 778*4882a593Smuzhiyunchar *yytext; 779*4882a593Smuzhiyun#define YY_NO_INPUT 1 780*4882a593Smuzhiyun 781*4882a593Smuzhiyun/* 782*4882a593Smuzhiyun * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> 783*4882a593Smuzhiyun * Released under the terms of the GNU GPL v2.0. 784*4882a593Smuzhiyun */ 785*4882a593Smuzhiyun 786*4882a593Smuzhiyun#include <limits.h> 787*4882a593Smuzhiyun#include <stdio.h> 788*4882a593Smuzhiyun#include <stdlib.h> 789*4882a593Smuzhiyun#include <string.h> 790*4882a593Smuzhiyun#include <unistd.h> 791*4882a593Smuzhiyun 792*4882a593Smuzhiyun#include "lkc.h" 793*4882a593Smuzhiyun 794*4882a593Smuzhiyun#define START_STRSIZE 16 795*4882a593Smuzhiyun 796*4882a593Smuzhiyunstatic struct { 797*4882a593Smuzhiyun struct file *file; 798*4882a593Smuzhiyun int lineno; 799*4882a593Smuzhiyun} current_pos; 800*4882a593Smuzhiyun 801*4882a593Smuzhiyunstatic char *text; 802*4882a593Smuzhiyunstatic int text_size, text_asize; 803*4882a593Smuzhiyun 804*4882a593Smuzhiyunstruct buffer { 805*4882a593Smuzhiyun struct buffer *parent; 806*4882a593Smuzhiyun YY_BUFFER_STATE state; 807*4882a593Smuzhiyun}; 808*4882a593Smuzhiyun 809*4882a593Smuzhiyunstruct buffer *current_buf; 810*4882a593Smuzhiyun 811*4882a593Smuzhiyunstatic int last_ts, first_ts; 812*4882a593Smuzhiyun 813*4882a593Smuzhiyunstatic void zconf_endhelp(void); 814*4882a593Smuzhiyunstatic void zconf_endfile(void); 815*4882a593Smuzhiyun 816*4882a593Smuzhiyunstatic void new_string(void) 817*4882a593Smuzhiyun{ 818*4882a593Smuzhiyun text = xmalloc(START_STRSIZE); 819*4882a593Smuzhiyun text_asize = START_STRSIZE; 820*4882a593Smuzhiyun text_size = 0; 821*4882a593Smuzhiyun *text = 0; 822*4882a593Smuzhiyun} 823*4882a593Smuzhiyun 824*4882a593Smuzhiyunstatic void append_string(const char *str, int size) 825*4882a593Smuzhiyun{ 826*4882a593Smuzhiyun int new_size = text_size + size + 1; 827*4882a593Smuzhiyun if (new_size > text_asize) { 828*4882a593Smuzhiyun new_size += START_STRSIZE - 1; 829*4882a593Smuzhiyun new_size &= -START_STRSIZE; 830*4882a593Smuzhiyun text = xrealloc(text, new_size); 831*4882a593Smuzhiyun text_asize = new_size; 832*4882a593Smuzhiyun } 833*4882a593Smuzhiyun memcpy(text + text_size, str, size); 834*4882a593Smuzhiyun text_size += size; 835*4882a593Smuzhiyun text[text_size] = 0; 836*4882a593Smuzhiyun} 837*4882a593Smuzhiyun 838*4882a593Smuzhiyunstatic void alloc_string(const char *str, int size) 839*4882a593Smuzhiyun{ 840*4882a593Smuzhiyun text = xmalloc(size + 1); 841*4882a593Smuzhiyun memcpy(text, str, size); 842*4882a593Smuzhiyun text[size] = 0; 843*4882a593Smuzhiyun} 844*4882a593Smuzhiyun 845*4882a593Smuzhiyunstatic void warn_ignored_character(char chr) 846*4882a593Smuzhiyun{ 847*4882a593Smuzhiyun fprintf(stderr, 848*4882a593Smuzhiyun "%s:%d:warning: ignoring unsupported character '%c'\n", 849*4882a593Smuzhiyun zconf_curname(), zconf_lineno(), chr); 850*4882a593Smuzhiyun} 851*4882a593Smuzhiyun 852*4882a593Smuzhiyun#define INITIAL 0 853*4882a593Smuzhiyun#define COMMAND 1 854*4882a593Smuzhiyun#define HELP 2 855*4882a593Smuzhiyun#define STRING 3 856*4882a593Smuzhiyun#define PARAM 4 857*4882a593Smuzhiyun 858*4882a593Smuzhiyun#ifndef YY_NO_UNISTD_H 859*4882a593Smuzhiyun/* Special case for "unistd.h", since it is non-ANSI. We include it way 860*4882a593Smuzhiyun * down here because we want the user's section 1 to have been scanned first. 861*4882a593Smuzhiyun * The user has a chance to override it with an option. 862*4882a593Smuzhiyun */ 863*4882a593Smuzhiyun#include <unistd.h> 864*4882a593Smuzhiyun#endif 865*4882a593Smuzhiyun 866*4882a593Smuzhiyun#ifndef YY_EXTRA_TYPE 867*4882a593Smuzhiyun#define YY_EXTRA_TYPE void * 868*4882a593Smuzhiyun#endif 869*4882a593Smuzhiyun 870*4882a593Smuzhiyunstatic int yy_init_globals ( void ); 871*4882a593Smuzhiyun 872*4882a593Smuzhiyun/* Accessor methods to globals. 873*4882a593Smuzhiyun These are made visible to non-reentrant scanners for convenience. */ 874*4882a593Smuzhiyun 875*4882a593Smuzhiyunint yylex_destroy ( void ); 876*4882a593Smuzhiyun 877*4882a593Smuzhiyunint yyget_debug ( void ); 878*4882a593Smuzhiyun 879*4882a593Smuzhiyunvoid yyset_debug ( int debug_flag ); 880*4882a593Smuzhiyun 881*4882a593SmuzhiyunYY_EXTRA_TYPE yyget_extra ( void ); 882*4882a593Smuzhiyun 883*4882a593Smuzhiyunvoid yyset_extra ( YY_EXTRA_TYPE user_defined ); 884*4882a593Smuzhiyun 885*4882a593SmuzhiyunFILE *yyget_in ( void ); 886*4882a593Smuzhiyun 887*4882a593Smuzhiyunvoid yyset_in ( FILE * _in_str ); 888*4882a593Smuzhiyun 889*4882a593SmuzhiyunFILE *yyget_out ( void ); 890*4882a593Smuzhiyun 891*4882a593Smuzhiyunvoid yyset_out ( FILE * _out_str ); 892*4882a593Smuzhiyun 893*4882a593Smuzhiyun int yyget_leng ( void ); 894*4882a593Smuzhiyun 895*4882a593Smuzhiyunchar *yyget_text ( void ); 896*4882a593Smuzhiyun 897*4882a593Smuzhiyunint yyget_lineno ( void ); 898*4882a593Smuzhiyun 899*4882a593Smuzhiyunvoid yyset_lineno ( int _line_number ); 900*4882a593Smuzhiyun 901*4882a593Smuzhiyun/* Macros after this point can all be overridden by user definitions in 902*4882a593Smuzhiyun * section 1. 903*4882a593Smuzhiyun */ 904*4882a593Smuzhiyun 905*4882a593Smuzhiyun#ifndef YY_SKIP_YYWRAP 906*4882a593Smuzhiyun#ifdef __cplusplus 907*4882a593Smuzhiyunextern "C" int yywrap ( void ); 908*4882a593Smuzhiyun#else 909*4882a593Smuzhiyunextern int yywrap ( void ); 910*4882a593Smuzhiyun#endif 911*4882a593Smuzhiyun#endif 912*4882a593Smuzhiyun 913*4882a593Smuzhiyun#ifndef YY_NO_UNPUT 914*4882a593Smuzhiyun 915*4882a593Smuzhiyun static void yyunput ( int c, char *buf_ptr ); 916*4882a593Smuzhiyun 917*4882a593Smuzhiyun#endif 918*4882a593Smuzhiyun 919*4882a593Smuzhiyun#ifndef yytext_ptr 920*4882a593Smuzhiyunstatic void yy_flex_strncpy ( char *, const char *, int ); 921*4882a593Smuzhiyun#endif 922*4882a593Smuzhiyun 923*4882a593Smuzhiyun#ifdef YY_NEED_STRLEN 924*4882a593Smuzhiyunstatic int yy_flex_strlen ( const char * ); 925*4882a593Smuzhiyun#endif 926*4882a593Smuzhiyun 927*4882a593Smuzhiyun#ifndef YY_NO_INPUT 928*4882a593Smuzhiyun#ifdef __cplusplus 929*4882a593Smuzhiyunstatic int yyinput ( void ); 930*4882a593Smuzhiyun#else 931*4882a593Smuzhiyunstatic int input ( void ); 932*4882a593Smuzhiyun#endif 933*4882a593Smuzhiyun 934*4882a593Smuzhiyun#endif 935*4882a593Smuzhiyun 936*4882a593Smuzhiyun/* Amount of stuff to slurp up with each read. */ 937*4882a593Smuzhiyun#ifndef YY_READ_BUF_SIZE 938*4882a593Smuzhiyun#ifdef __ia64__ 939*4882a593Smuzhiyun/* On IA-64, the buffer size is 16k, not 8k */ 940*4882a593Smuzhiyun#define YY_READ_BUF_SIZE 16384 941*4882a593Smuzhiyun#else 942*4882a593Smuzhiyun#define YY_READ_BUF_SIZE 8192 943*4882a593Smuzhiyun#endif /* __ia64__ */ 944*4882a593Smuzhiyun#endif 945*4882a593Smuzhiyun 946*4882a593Smuzhiyun/* Copy whatever the last rule matched to the standard output. */ 947*4882a593Smuzhiyun#ifndef ECHO 948*4882a593Smuzhiyun/* This used to be an fputs(), but since the string might contain NUL's, 949*4882a593Smuzhiyun * we now use fwrite(). 950*4882a593Smuzhiyun */ 951*4882a593Smuzhiyun#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) 952*4882a593Smuzhiyun#endif 953*4882a593Smuzhiyun 954*4882a593Smuzhiyun/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 955*4882a593Smuzhiyun * is returned in "result". 956*4882a593Smuzhiyun */ 957*4882a593Smuzhiyun#ifndef YY_INPUT 958*4882a593Smuzhiyun#define YY_INPUT(buf,result,max_size) \ 959*4882a593Smuzhiyun errno=0; \ 960*4882a593Smuzhiyun while ( (result = (int) read( fileno(yyin), buf, (yy_size_t) max_size )) < 0 ) \ 961*4882a593Smuzhiyun { \ 962*4882a593Smuzhiyun if( errno != EINTR) \ 963*4882a593Smuzhiyun { \ 964*4882a593Smuzhiyun YY_FATAL_ERROR( "input in flex scanner failed" ); \ 965*4882a593Smuzhiyun break; \ 966*4882a593Smuzhiyun } \ 967*4882a593Smuzhiyun errno=0; \ 968*4882a593Smuzhiyun clearerr(yyin); \ 969*4882a593Smuzhiyun }\ 970*4882a593Smuzhiyun\ 971*4882a593Smuzhiyun 972*4882a593Smuzhiyun#endif 973*4882a593Smuzhiyun 974*4882a593Smuzhiyun/* No semi-colon after return; correct usage is to write "yyterminate();" - 975*4882a593Smuzhiyun * we don't want an extra ';' after the "return" because that will cause 976*4882a593Smuzhiyun * some compilers to complain about unreachable statements. 977*4882a593Smuzhiyun */ 978*4882a593Smuzhiyun#ifndef yyterminate 979*4882a593Smuzhiyun#define yyterminate() return YY_NULL 980*4882a593Smuzhiyun#endif 981*4882a593Smuzhiyun 982*4882a593Smuzhiyun/* Number of entries by which start-condition stack grows. */ 983*4882a593Smuzhiyun#ifndef YY_START_STACK_INCR 984*4882a593Smuzhiyun#define YY_START_STACK_INCR 25 985*4882a593Smuzhiyun#endif 986*4882a593Smuzhiyun 987*4882a593Smuzhiyun/* Report a fatal error. */ 988*4882a593Smuzhiyun#ifndef YY_FATAL_ERROR 989*4882a593Smuzhiyun#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 990*4882a593Smuzhiyun#endif 991*4882a593Smuzhiyun 992*4882a593Smuzhiyun/* end tables serialization structures and prototypes */ 993*4882a593Smuzhiyun 994*4882a593Smuzhiyun/* Default declaration of generated scanner - a define so the user can 995*4882a593Smuzhiyun * easily add parameters. 996*4882a593Smuzhiyun */ 997*4882a593Smuzhiyun#ifndef YY_DECL 998*4882a593Smuzhiyun#define YY_DECL_IS_OURS 1 999*4882a593Smuzhiyun 1000*4882a593Smuzhiyunextern int yylex (void); 1001*4882a593Smuzhiyun 1002*4882a593Smuzhiyun#define YY_DECL int yylex (void) 1003*4882a593Smuzhiyun#endif /* !YY_DECL */ 1004*4882a593Smuzhiyun 1005*4882a593Smuzhiyun/* Code executed at the beginning of each rule, after yytext and yyleng 1006*4882a593Smuzhiyun * have been set up. 1007*4882a593Smuzhiyun */ 1008*4882a593Smuzhiyun#ifndef YY_USER_ACTION 1009*4882a593Smuzhiyun#define YY_USER_ACTION 1010*4882a593Smuzhiyun#endif 1011*4882a593Smuzhiyun 1012*4882a593Smuzhiyun/* Code executed at the end of each rule. */ 1013*4882a593Smuzhiyun#ifndef YY_BREAK 1014*4882a593Smuzhiyun#define YY_BREAK /*LINTED*/break; 1015*4882a593Smuzhiyun#endif 1016*4882a593Smuzhiyun 1017*4882a593Smuzhiyun#define YY_RULE_SETUP \ 1018*4882a593Smuzhiyun YY_USER_ACTION 1019*4882a593Smuzhiyun 1020*4882a593Smuzhiyun/** The main scanner function which does all the work. 1021*4882a593Smuzhiyun */ 1022*4882a593SmuzhiyunYY_DECL 1023*4882a593Smuzhiyun{ 1024*4882a593Smuzhiyun yy_state_type yy_current_state; 1025*4882a593Smuzhiyun char *yy_cp, *yy_bp; 1026*4882a593Smuzhiyun int yy_act; 1027*4882a593Smuzhiyun 1028*4882a593Smuzhiyun if ( !(yy_init) ) 1029*4882a593Smuzhiyun { 1030*4882a593Smuzhiyun (yy_init) = 1; 1031*4882a593Smuzhiyun 1032*4882a593Smuzhiyun#ifdef YY_USER_INIT 1033*4882a593Smuzhiyun YY_USER_INIT; 1034*4882a593Smuzhiyun#endif 1035*4882a593Smuzhiyun 1036*4882a593Smuzhiyun if ( ! (yy_start) ) 1037*4882a593Smuzhiyun (yy_start) = 1; /* first start state */ 1038*4882a593Smuzhiyun 1039*4882a593Smuzhiyun if ( ! yyin ) 1040*4882a593Smuzhiyun yyin = stdin; 1041*4882a593Smuzhiyun 1042*4882a593Smuzhiyun if ( ! yyout ) 1043*4882a593Smuzhiyun yyout = stdout; 1044*4882a593Smuzhiyun 1045*4882a593Smuzhiyun if ( ! YY_CURRENT_BUFFER ) { 1046*4882a593Smuzhiyun yyensure_buffer_stack (); 1047*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE = 1048*4882a593Smuzhiyun yy_create_buffer( yyin, YY_BUF_SIZE ); 1049*4882a593Smuzhiyun } 1050*4882a593Smuzhiyun 1051*4882a593Smuzhiyun yy_load_buffer_state( ); 1052*4882a593Smuzhiyun } 1053*4882a593Smuzhiyun 1054*4882a593Smuzhiyun { 1055*4882a593Smuzhiyun 1056*4882a593Smuzhiyun int str = 0; 1057*4882a593Smuzhiyun int ts, i; 1058*4882a593Smuzhiyun 1059*4882a593Smuzhiyun while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ 1060*4882a593Smuzhiyun { 1061*4882a593Smuzhiyun yy_cp = (yy_c_buf_p); 1062*4882a593Smuzhiyun 1063*4882a593Smuzhiyun /* Support of yytext. */ 1064*4882a593Smuzhiyun *yy_cp = (yy_hold_char); 1065*4882a593Smuzhiyun 1066*4882a593Smuzhiyun /* yy_bp points to the position in yy_ch_buf of the start of 1067*4882a593Smuzhiyun * the current run. 1068*4882a593Smuzhiyun */ 1069*4882a593Smuzhiyun yy_bp = yy_cp; 1070*4882a593Smuzhiyun 1071*4882a593Smuzhiyun yy_current_state = (yy_start); 1072*4882a593Smuzhiyunyy_match: 1073*4882a593Smuzhiyun while ( (yy_current_state = yy_nxt[yy_current_state][ yy_ec[YY_SC_TO_UI(*yy_cp)] ]) > 0 ) 1074*4882a593Smuzhiyun ++yy_cp; 1075*4882a593Smuzhiyun 1076*4882a593Smuzhiyun yy_current_state = -yy_current_state; 1077*4882a593Smuzhiyun 1078*4882a593Smuzhiyunyy_find_action: 1079*4882a593Smuzhiyun yy_act = yy_accept[yy_current_state]; 1080*4882a593Smuzhiyun 1081*4882a593Smuzhiyun YY_DO_BEFORE_ACTION; 1082*4882a593Smuzhiyun 1083*4882a593Smuzhiyun if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) 1084*4882a593Smuzhiyun { 1085*4882a593Smuzhiyun int yyl; 1086*4882a593Smuzhiyun for ( yyl = 0; yyl < yyleng; ++yyl ) 1087*4882a593Smuzhiyun if ( yytext[yyl] == '\n' ) 1088*4882a593Smuzhiyun 1089*4882a593Smuzhiyun yylineno++; 1090*4882a593Smuzhiyun; 1091*4882a593Smuzhiyun } 1092*4882a593Smuzhiyun 1093*4882a593Smuzhiyundo_action: /* This label is used only to access EOF actions. */ 1094*4882a593Smuzhiyun 1095*4882a593Smuzhiyun switch ( yy_act ) 1096*4882a593Smuzhiyun { /* beginning of action switch */ 1097*4882a593Smuzhiyuncase 1: 1098*4882a593Smuzhiyun/* rule 1 can match eol */ 1099*4882a593Smuzhiyuncase 2: 1100*4882a593Smuzhiyun/* rule 2 can match eol */ 1101*4882a593SmuzhiyunYY_RULE_SETUP 1102*4882a593Smuzhiyun{ 1103*4882a593Smuzhiyun return T_EOL; 1104*4882a593Smuzhiyun} 1105*4882a593Smuzhiyun YY_BREAK 1106*4882a593Smuzhiyuncase 3: 1107*4882a593SmuzhiyunYY_RULE_SETUP 1108*4882a593Smuzhiyun 1109*4882a593Smuzhiyun YY_BREAK 1110*4882a593Smuzhiyuncase 4: 1111*4882a593SmuzhiyunYY_RULE_SETUP 1112*4882a593Smuzhiyun{ 1113*4882a593Smuzhiyun BEGIN(COMMAND); 1114*4882a593Smuzhiyun} 1115*4882a593Smuzhiyun YY_BREAK 1116*4882a593Smuzhiyuncase 5: 1117*4882a593SmuzhiyunYY_RULE_SETUP 1118*4882a593Smuzhiyun{ 1119*4882a593Smuzhiyun unput(yytext[0]); 1120*4882a593Smuzhiyun BEGIN(COMMAND); 1121*4882a593Smuzhiyun} 1122*4882a593Smuzhiyun YY_BREAK 1123*4882a593Smuzhiyun 1124*4882a593Smuzhiyuncase 6: 1125*4882a593SmuzhiyunYY_RULE_SETUP 1126*4882a593Smuzhiyun{ 1127*4882a593Smuzhiyun const struct kconf_id *id = kconf_id_lookup(yytext, yyleng); 1128*4882a593Smuzhiyun BEGIN(PARAM); 1129*4882a593Smuzhiyun current_pos.file = current_file; 1130*4882a593Smuzhiyun current_pos.lineno = yylineno; 1131*4882a593Smuzhiyun if (id && id->flags & TF_COMMAND) { 1132*4882a593Smuzhiyun yylval.id = id; 1133*4882a593Smuzhiyun return id->token; 1134*4882a593Smuzhiyun } 1135*4882a593Smuzhiyun alloc_string(yytext, yyleng); 1136*4882a593Smuzhiyun yylval.string = text; 1137*4882a593Smuzhiyun return T_WORD; 1138*4882a593Smuzhiyun } 1139*4882a593Smuzhiyun YY_BREAK 1140*4882a593Smuzhiyuncase 7: 1141*4882a593SmuzhiyunYY_RULE_SETUP 1142*4882a593Smuzhiyunwarn_ignored_character(*yytext); 1143*4882a593Smuzhiyun YY_BREAK 1144*4882a593Smuzhiyuncase 8: 1145*4882a593Smuzhiyun/* rule 8 can match eol */ 1146*4882a593SmuzhiyunYY_RULE_SETUP 1147*4882a593Smuzhiyun{ 1148*4882a593Smuzhiyun BEGIN(INITIAL); 1149*4882a593Smuzhiyun return T_EOL; 1150*4882a593Smuzhiyun } 1151*4882a593Smuzhiyun YY_BREAK 1152*4882a593Smuzhiyun 1153*4882a593Smuzhiyuncase 9: 1154*4882a593SmuzhiyunYY_RULE_SETUP 1155*4882a593Smuzhiyunreturn T_AND; 1156*4882a593Smuzhiyun YY_BREAK 1157*4882a593Smuzhiyuncase 10: 1158*4882a593SmuzhiyunYY_RULE_SETUP 1159*4882a593Smuzhiyunreturn T_OR; 1160*4882a593Smuzhiyun YY_BREAK 1161*4882a593Smuzhiyuncase 11: 1162*4882a593SmuzhiyunYY_RULE_SETUP 1163*4882a593Smuzhiyunreturn T_OPEN_PAREN; 1164*4882a593Smuzhiyun YY_BREAK 1165*4882a593Smuzhiyuncase 12: 1166*4882a593SmuzhiyunYY_RULE_SETUP 1167*4882a593Smuzhiyunreturn T_CLOSE_PAREN; 1168*4882a593Smuzhiyun YY_BREAK 1169*4882a593Smuzhiyuncase 13: 1170*4882a593SmuzhiyunYY_RULE_SETUP 1171*4882a593Smuzhiyunreturn T_NOT; 1172*4882a593Smuzhiyun YY_BREAK 1173*4882a593Smuzhiyuncase 14: 1174*4882a593SmuzhiyunYY_RULE_SETUP 1175*4882a593Smuzhiyunreturn T_EQUAL; 1176*4882a593Smuzhiyun YY_BREAK 1177*4882a593Smuzhiyuncase 15: 1178*4882a593SmuzhiyunYY_RULE_SETUP 1179*4882a593Smuzhiyunreturn T_UNEQUAL; 1180*4882a593Smuzhiyun YY_BREAK 1181*4882a593Smuzhiyuncase 16: 1182*4882a593SmuzhiyunYY_RULE_SETUP 1183*4882a593Smuzhiyunreturn T_LESS_EQUAL; 1184*4882a593Smuzhiyun YY_BREAK 1185*4882a593Smuzhiyuncase 17: 1186*4882a593SmuzhiyunYY_RULE_SETUP 1187*4882a593Smuzhiyunreturn T_GREATER_EQUAL; 1188*4882a593Smuzhiyun YY_BREAK 1189*4882a593Smuzhiyuncase 18: 1190*4882a593SmuzhiyunYY_RULE_SETUP 1191*4882a593Smuzhiyunreturn T_LESS; 1192*4882a593Smuzhiyun YY_BREAK 1193*4882a593Smuzhiyuncase 19: 1194*4882a593SmuzhiyunYY_RULE_SETUP 1195*4882a593Smuzhiyunreturn T_GREATER; 1196*4882a593Smuzhiyun YY_BREAK 1197*4882a593Smuzhiyuncase 20: 1198*4882a593SmuzhiyunYY_RULE_SETUP 1199*4882a593Smuzhiyun{ 1200*4882a593Smuzhiyun str = yytext[0]; 1201*4882a593Smuzhiyun new_string(); 1202*4882a593Smuzhiyun BEGIN(STRING); 1203*4882a593Smuzhiyun } 1204*4882a593Smuzhiyun YY_BREAK 1205*4882a593Smuzhiyuncase 21: 1206*4882a593Smuzhiyun/* rule 21 can match eol */ 1207*4882a593SmuzhiyunYY_RULE_SETUP 1208*4882a593SmuzhiyunBEGIN(INITIAL); return T_EOL; 1209*4882a593Smuzhiyun YY_BREAK 1210*4882a593Smuzhiyuncase 22: 1211*4882a593SmuzhiyunYY_RULE_SETUP 1212*4882a593Smuzhiyun{ 1213*4882a593Smuzhiyun const struct kconf_id *id = kconf_id_lookup(yytext, yyleng); 1214*4882a593Smuzhiyun if (id && id->flags & TF_PARAM) { 1215*4882a593Smuzhiyun yylval.id = id; 1216*4882a593Smuzhiyun return id->token; 1217*4882a593Smuzhiyun } 1218*4882a593Smuzhiyun alloc_string(yytext, yyleng); 1219*4882a593Smuzhiyun yylval.string = text; 1220*4882a593Smuzhiyun return T_WORD; 1221*4882a593Smuzhiyun } 1222*4882a593Smuzhiyun YY_BREAK 1223*4882a593Smuzhiyuncase 23: 1224*4882a593SmuzhiyunYY_RULE_SETUP 1225*4882a593Smuzhiyun/* comment */ 1226*4882a593Smuzhiyun YY_BREAK 1227*4882a593Smuzhiyuncase 24: 1228*4882a593Smuzhiyun/* rule 24 can match eol */ 1229*4882a593SmuzhiyunYY_RULE_SETUP 1230*4882a593Smuzhiyun; 1231*4882a593Smuzhiyun YY_BREAK 1232*4882a593Smuzhiyuncase 25: 1233*4882a593SmuzhiyunYY_RULE_SETUP 1234*4882a593Smuzhiyun 1235*4882a593Smuzhiyun YY_BREAK 1236*4882a593Smuzhiyuncase 26: 1237*4882a593SmuzhiyunYY_RULE_SETUP 1238*4882a593Smuzhiyunwarn_ignored_character(*yytext); 1239*4882a593Smuzhiyun YY_BREAK 1240*4882a593Smuzhiyuncase YY_STATE_EOF(PARAM): 1241*4882a593Smuzhiyun{ 1242*4882a593Smuzhiyun BEGIN(INITIAL); 1243*4882a593Smuzhiyun } 1244*4882a593Smuzhiyun YY_BREAK 1245*4882a593Smuzhiyun 1246*4882a593Smuzhiyuncase 27: 1247*4882a593Smuzhiyun/* rule 27 can match eol */ 1248*4882a593Smuzhiyun*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ 1249*4882a593SmuzhiyunYY_LINENO_REWIND_TO(yy_cp - 1); 1250*4882a593Smuzhiyun(yy_c_buf_p) = yy_cp -= 1; 1251*4882a593SmuzhiyunYY_DO_BEFORE_ACTION; /* set up yytext again */ 1252*4882a593SmuzhiyunYY_RULE_SETUP 1253*4882a593Smuzhiyun{ 1254*4882a593Smuzhiyun append_string(yytext, yyleng); 1255*4882a593Smuzhiyun yylval.string = text; 1256*4882a593Smuzhiyun return T_WORD_QUOTE; 1257*4882a593Smuzhiyun } 1258*4882a593Smuzhiyun YY_BREAK 1259*4882a593Smuzhiyuncase 28: 1260*4882a593SmuzhiyunYY_RULE_SETUP 1261*4882a593Smuzhiyun{ 1262*4882a593Smuzhiyun append_string(yytext, yyleng); 1263*4882a593Smuzhiyun } 1264*4882a593Smuzhiyun YY_BREAK 1265*4882a593Smuzhiyuncase 29: 1266*4882a593Smuzhiyun/* rule 29 can match eol */ 1267*4882a593Smuzhiyun*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ 1268*4882a593SmuzhiyunYY_LINENO_REWIND_TO(yy_cp - 1); 1269*4882a593Smuzhiyun(yy_c_buf_p) = yy_cp -= 1; 1270*4882a593SmuzhiyunYY_DO_BEFORE_ACTION; /* set up yytext again */ 1271*4882a593SmuzhiyunYY_RULE_SETUP 1272*4882a593Smuzhiyun{ 1273*4882a593Smuzhiyun append_string(yytext + 1, yyleng - 1); 1274*4882a593Smuzhiyun yylval.string = text; 1275*4882a593Smuzhiyun return T_WORD_QUOTE; 1276*4882a593Smuzhiyun } 1277*4882a593Smuzhiyun YY_BREAK 1278*4882a593Smuzhiyuncase 30: 1279*4882a593SmuzhiyunYY_RULE_SETUP 1280*4882a593Smuzhiyun{ 1281*4882a593Smuzhiyun append_string(yytext + 1, yyleng - 1); 1282*4882a593Smuzhiyun } 1283*4882a593Smuzhiyun YY_BREAK 1284*4882a593Smuzhiyuncase 31: 1285*4882a593SmuzhiyunYY_RULE_SETUP 1286*4882a593Smuzhiyun{ 1287*4882a593Smuzhiyun if (str == yytext[0]) { 1288*4882a593Smuzhiyun BEGIN(PARAM); 1289*4882a593Smuzhiyun yylval.string = text; 1290*4882a593Smuzhiyun return T_WORD_QUOTE; 1291*4882a593Smuzhiyun } else 1292*4882a593Smuzhiyun append_string(yytext, 1); 1293*4882a593Smuzhiyun } 1294*4882a593Smuzhiyun YY_BREAK 1295*4882a593Smuzhiyuncase 32: 1296*4882a593Smuzhiyun/* rule 32 can match eol */ 1297*4882a593SmuzhiyunYY_RULE_SETUP 1298*4882a593Smuzhiyun{ 1299*4882a593Smuzhiyun fprintf(stderr, 1300*4882a593Smuzhiyun "%s:%d:warning: multi-line strings not supported\n", 1301*4882a593Smuzhiyun zconf_curname(), zconf_lineno()); 1302*4882a593Smuzhiyun BEGIN(INITIAL); 1303*4882a593Smuzhiyun return T_EOL; 1304*4882a593Smuzhiyun } 1305*4882a593Smuzhiyun YY_BREAK 1306*4882a593Smuzhiyuncase YY_STATE_EOF(STRING): 1307*4882a593Smuzhiyun{ 1308*4882a593Smuzhiyun BEGIN(INITIAL); 1309*4882a593Smuzhiyun } 1310*4882a593Smuzhiyun YY_BREAK 1311*4882a593Smuzhiyun 1312*4882a593Smuzhiyuncase 33: 1313*4882a593SmuzhiyunYY_RULE_SETUP 1314*4882a593Smuzhiyun{ 1315*4882a593Smuzhiyun ts = 0; 1316*4882a593Smuzhiyun for (i = 0; i < yyleng; i++) { 1317*4882a593Smuzhiyun if (yytext[i] == '\t') 1318*4882a593Smuzhiyun ts = (ts & ~7) + 8; 1319*4882a593Smuzhiyun else 1320*4882a593Smuzhiyun ts++; 1321*4882a593Smuzhiyun } 1322*4882a593Smuzhiyun last_ts = ts; 1323*4882a593Smuzhiyun if (first_ts) { 1324*4882a593Smuzhiyun if (ts < first_ts) { 1325*4882a593Smuzhiyun zconf_endhelp(); 1326*4882a593Smuzhiyun return T_HELPTEXT; 1327*4882a593Smuzhiyun } 1328*4882a593Smuzhiyun ts -= first_ts; 1329*4882a593Smuzhiyun while (ts > 8) { 1330*4882a593Smuzhiyun append_string(" ", 8); 1331*4882a593Smuzhiyun ts -= 8; 1332*4882a593Smuzhiyun } 1333*4882a593Smuzhiyun append_string(" ", ts); 1334*4882a593Smuzhiyun } 1335*4882a593Smuzhiyun } 1336*4882a593Smuzhiyun YY_BREAK 1337*4882a593Smuzhiyuncase 34: 1338*4882a593Smuzhiyun/* rule 34 can match eol */ 1339*4882a593Smuzhiyun*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ 1340*4882a593SmuzhiyunYY_LINENO_REWIND_TO(yy_cp - 1); 1341*4882a593Smuzhiyun(yy_c_buf_p) = yy_cp -= 1; 1342*4882a593SmuzhiyunYY_DO_BEFORE_ACTION; /* set up yytext again */ 1343*4882a593SmuzhiyunYY_RULE_SETUP 1344*4882a593Smuzhiyun{ 1345*4882a593Smuzhiyun zconf_endhelp(); 1346*4882a593Smuzhiyun return T_HELPTEXT; 1347*4882a593Smuzhiyun } 1348*4882a593Smuzhiyun YY_BREAK 1349*4882a593Smuzhiyuncase 35: 1350*4882a593Smuzhiyun/* rule 35 can match eol */ 1351*4882a593SmuzhiyunYY_RULE_SETUP 1352*4882a593Smuzhiyun{ 1353*4882a593Smuzhiyun append_string("\n", 1); 1354*4882a593Smuzhiyun } 1355*4882a593Smuzhiyun YY_BREAK 1356*4882a593Smuzhiyuncase 36: 1357*4882a593SmuzhiyunYY_RULE_SETUP 1358*4882a593Smuzhiyun{ 1359*4882a593Smuzhiyun while (yyleng) { 1360*4882a593Smuzhiyun if ((yytext[yyleng-1] != ' ') && (yytext[yyleng-1] != '\t')) 1361*4882a593Smuzhiyun break; 1362*4882a593Smuzhiyun yyleng--; 1363*4882a593Smuzhiyun } 1364*4882a593Smuzhiyun append_string(yytext, yyleng); 1365*4882a593Smuzhiyun if (!first_ts) 1366*4882a593Smuzhiyun first_ts = last_ts; 1367*4882a593Smuzhiyun } 1368*4882a593Smuzhiyun YY_BREAK 1369*4882a593Smuzhiyuncase YY_STATE_EOF(HELP): 1370*4882a593Smuzhiyun{ 1371*4882a593Smuzhiyun zconf_endhelp(); 1372*4882a593Smuzhiyun return T_HELPTEXT; 1373*4882a593Smuzhiyun } 1374*4882a593Smuzhiyun YY_BREAK 1375*4882a593Smuzhiyun 1376*4882a593Smuzhiyuncase YY_STATE_EOF(INITIAL): 1377*4882a593Smuzhiyuncase YY_STATE_EOF(COMMAND): 1378*4882a593Smuzhiyun{ 1379*4882a593Smuzhiyun if (current_file) { 1380*4882a593Smuzhiyun zconf_endfile(); 1381*4882a593Smuzhiyun return T_EOL; 1382*4882a593Smuzhiyun } 1383*4882a593Smuzhiyun fclose(yyin); 1384*4882a593Smuzhiyun yyterminate(); 1385*4882a593Smuzhiyun} 1386*4882a593Smuzhiyun YY_BREAK 1387*4882a593Smuzhiyuncase 37: 1388*4882a593SmuzhiyunYY_RULE_SETUP 1389*4882a593SmuzhiyunYY_FATAL_ERROR( "flex scanner jammed" ); 1390*4882a593Smuzhiyun YY_BREAK 1391*4882a593Smuzhiyun 1392*4882a593Smuzhiyun case YY_END_OF_BUFFER: 1393*4882a593Smuzhiyun { 1394*4882a593Smuzhiyun /* Amount of text matched not including the EOB char. */ 1395*4882a593Smuzhiyun int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; 1396*4882a593Smuzhiyun 1397*4882a593Smuzhiyun /* Undo the effects of YY_DO_BEFORE_ACTION. */ 1398*4882a593Smuzhiyun *yy_cp = (yy_hold_char); 1399*4882a593Smuzhiyun YY_RESTORE_YY_MORE_OFFSET 1400*4882a593Smuzhiyun 1401*4882a593Smuzhiyun if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) 1402*4882a593Smuzhiyun { 1403*4882a593Smuzhiyun /* We're scanning a new file or input source. It's 1404*4882a593Smuzhiyun * possible that this happened because the user 1405*4882a593Smuzhiyun * just pointed yyin at a new source and called 1406*4882a593Smuzhiyun * yylex(). If so, then we have to assure 1407*4882a593Smuzhiyun * consistency between YY_CURRENT_BUFFER and our 1408*4882a593Smuzhiyun * globals. Here is the right place to do so, because 1409*4882a593Smuzhiyun * this is the first action (other than possibly a 1410*4882a593Smuzhiyun * back-up) that will match for the new input source. 1411*4882a593Smuzhiyun */ 1412*4882a593Smuzhiyun (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 1413*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; 1414*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; 1415*4882a593Smuzhiyun } 1416*4882a593Smuzhiyun 1417*4882a593Smuzhiyun /* Note that here we test for yy_c_buf_p "<=" to the position 1418*4882a593Smuzhiyun * of the first EOB in the buffer, since yy_c_buf_p will 1419*4882a593Smuzhiyun * already have been incremented past the NUL character 1420*4882a593Smuzhiyun * (since all states make transitions on EOB to the 1421*4882a593Smuzhiyun * end-of-buffer state). Contrast this with the test 1422*4882a593Smuzhiyun * in input(). 1423*4882a593Smuzhiyun */ 1424*4882a593Smuzhiyun if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 1425*4882a593Smuzhiyun { /* This was really a NUL. */ 1426*4882a593Smuzhiyun yy_state_type yy_next_state; 1427*4882a593Smuzhiyun 1428*4882a593Smuzhiyun (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; 1429*4882a593Smuzhiyun 1430*4882a593Smuzhiyun yy_current_state = yy_get_previous_state( ); 1431*4882a593Smuzhiyun 1432*4882a593Smuzhiyun /* Okay, we're now positioned to make the NUL 1433*4882a593Smuzhiyun * transition. We couldn't have 1434*4882a593Smuzhiyun * yy_get_previous_state() go ahead and do it 1435*4882a593Smuzhiyun * for us because it doesn't know how to deal 1436*4882a593Smuzhiyun * with the possibility of jamming (and we don't 1437*4882a593Smuzhiyun * want to build jamming into it because then it 1438*4882a593Smuzhiyun * will run more slowly). 1439*4882a593Smuzhiyun */ 1440*4882a593Smuzhiyun 1441*4882a593Smuzhiyun yy_next_state = yy_try_NUL_trans( yy_current_state ); 1442*4882a593Smuzhiyun 1443*4882a593Smuzhiyun yy_bp = (yytext_ptr) + YY_MORE_ADJ; 1444*4882a593Smuzhiyun 1445*4882a593Smuzhiyun if ( yy_next_state ) 1446*4882a593Smuzhiyun { 1447*4882a593Smuzhiyun /* Consume the NUL. */ 1448*4882a593Smuzhiyun yy_cp = ++(yy_c_buf_p); 1449*4882a593Smuzhiyun yy_current_state = yy_next_state; 1450*4882a593Smuzhiyun goto yy_match; 1451*4882a593Smuzhiyun } 1452*4882a593Smuzhiyun 1453*4882a593Smuzhiyun else 1454*4882a593Smuzhiyun { 1455*4882a593Smuzhiyun yy_cp = (yy_c_buf_p); 1456*4882a593Smuzhiyun goto yy_find_action; 1457*4882a593Smuzhiyun } 1458*4882a593Smuzhiyun } 1459*4882a593Smuzhiyun 1460*4882a593Smuzhiyun else switch ( yy_get_next_buffer( ) ) 1461*4882a593Smuzhiyun { 1462*4882a593Smuzhiyun case EOB_ACT_END_OF_FILE: 1463*4882a593Smuzhiyun { 1464*4882a593Smuzhiyun (yy_did_buffer_switch_on_eof) = 0; 1465*4882a593Smuzhiyun 1466*4882a593Smuzhiyun if ( yywrap( ) ) 1467*4882a593Smuzhiyun { 1468*4882a593Smuzhiyun /* Note: because we've taken care in 1469*4882a593Smuzhiyun * yy_get_next_buffer() to have set up 1470*4882a593Smuzhiyun * yytext, we can now set up 1471*4882a593Smuzhiyun * yy_c_buf_p so that if some total 1472*4882a593Smuzhiyun * hoser (like flex itself) wants to 1473*4882a593Smuzhiyun * call the scanner after we return the 1474*4882a593Smuzhiyun * YY_NULL, it'll still work - another 1475*4882a593Smuzhiyun * YY_NULL will get returned. 1476*4882a593Smuzhiyun */ 1477*4882a593Smuzhiyun (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; 1478*4882a593Smuzhiyun 1479*4882a593Smuzhiyun yy_act = YY_STATE_EOF(YY_START); 1480*4882a593Smuzhiyun goto do_action; 1481*4882a593Smuzhiyun } 1482*4882a593Smuzhiyun 1483*4882a593Smuzhiyun else 1484*4882a593Smuzhiyun { 1485*4882a593Smuzhiyun if ( ! (yy_did_buffer_switch_on_eof) ) 1486*4882a593Smuzhiyun YY_NEW_FILE; 1487*4882a593Smuzhiyun } 1488*4882a593Smuzhiyun break; 1489*4882a593Smuzhiyun } 1490*4882a593Smuzhiyun 1491*4882a593Smuzhiyun case EOB_ACT_CONTINUE_SCAN: 1492*4882a593Smuzhiyun (yy_c_buf_p) = 1493*4882a593Smuzhiyun (yytext_ptr) + yy_amount_of_matched_text; 1494*4882a593Smuzhiyun 1495*4882a593Smuzhiyun yy_current_state = yy_get_previous_state( ); 1496*4882a593Smuzhiyun 1497*4882a593Smuzhiyun yy_cp = (yy_c_buf_p); 1498*4882a593Smuzhiyun yy_bp = (yytext_ptr) + YY_MORE_ADJ; 1499*4882a593Smuzhiyun goto yy_match; 1500*4882a593Smuzhiyun 1501*4882a593Smuzhiyun case EOB_ACT_LAST_MATCH: 1502*4882a593Smuzhiyun (yy_c_buf_p) = 1503*4882a593Smuzhiyun &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; 1504*4882a593Smuzhiyun 1505*4882a593Smuzhiyun yy_current_state = yy_get_previous_state( ); 1506*4882a593Smuzhiyun 1507*4882a593Smuzhiyun yy_cp = (yy_c_buf_p); 1508*4882a593Smuzhiyun yy_bp = (yytext_ptr) + YY_MORE_ADJ; 1509*4882a593Smuzhiyun goto yy_find_action; 1510*4882a593Smuzhiyun } 1511*4882a593Smuzhiyun break; 1512*4882a593Smuzhiyun } 1513*4882a593Smuzhiyun 1514*4882a593Smuzhiyun default: 1515*4882a593Smuzhiyun YY_FATAL_ERROR( 1516*4882a593Smuzhiyun "fatal flex scanner internal error--no action found" ); 1517*4882a593Smuzhiyun } /* end of action switch */ 1518*4882a593Smuzhiyun } /* end of scanning one token */ 1519*4882a593Smuzhiyun } /* end of user's declarations */ 1520*4882a593Smuzhiyun} /* end of yylex */ 1521*4882a593Smuzhiyun 1522*4882a593Smuzhiyun/* yy_get_next_buffer - try to read in a new buffer 1523*4882a593Smuzhiyun * 1524*4882a593Smuzhiyun * Returns a code representing an action: 1525*4882a593Smuzhiyun * EOB_ACT_LAST_MATCH - 1526*4882a593Smuzhiyun * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 1527*4882a593Smuzhiyun * EOB_ACT_END_OF_FILE - end of file 1528*4882a593Smuzhiyun */ 1529*4882a593Smuzhiyunstatic int yy_get_next_buffer (void) 1530*4882a593Smuzhiyun{ 1531*4882a593Smuzhiyun char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; 1532*4882a593Smuzhiyun char *source = (yytext_ptr); 1533*4882a593Smuzhiyun int number_to_move, i; 1534*4882a593Smuzhiyun int ret_val; 1535*4882a593Smuzhiyun 1536*4882a593Smuzhiyun if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) 1537*4882a593Smuzhiyun YY_FATAL_ERROR( 1538*4882a593Smuzhiyun "fatal flex scanner internal error--end of buffer missed" ); 1539*4882a593Smuzhiyun 1540*4882a593Smuzhiyun if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) 1541*4882a593Smuzhiyun { /* Don't try to fill the buffer, so this is an EOF. */ 1542*4882a593Smuzhiyun if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) 1543*4882a593Smuzhiyun { 1544*4882a593Smuzhiyun /* We matched a single character, the EOB, so 1545*4882a593Smuzhiyun * treat this as a final EOF. 1546*4882a593Smuzhiyun */ 1547*4882a593Smuzhiyun return EOB_ACT_END_OF_FILE; 1548*4882a593Smuzhiyun } 1549*4882a593Smuzhiyun 1550*4882a593Smuzhiyun else 1551*4882a593Smuzhiyun { 1552*4882a593Smuzhiyun /* We matched some text prior to the EOB, first 1553*4882a593Smuzhiyun * process it. 1554*4882a593Smuzhiyun */ 1555*4882a593Smuzhiyun return EOB_ACT_LAST_MATCH; 1556*4882a593Smuzhiyun } 1557*4882a593Smuzhiyun } 1558*4882a593Smuzhiyun 1559*4882a593Smuzhiyun /* Try to read more data. */ 1560*4882a593Smuzhiyun 1561*4882a593Smuzhiyun /* First move last chars to start of buffer. */ 1562*4882a593Smuzhiyun number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); 1563*4882a593Smuzhiyun 1564*4882a593Smuzhiyun for ( i = 0; i < number_to_move; ++i ) 1565*4882a593Smuzhiyun *(dest++) = *(source++); 1566*4882a593Smuzhiyun 1567*4882a593Smuzhiyun if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 1568*4882a593Smuzhiyun /* don't do the read, it's not guaranteed to return an EOF, 1569*4882a593Smuzhiyun * just force an EOF 1570*4882a593Smuzhiyun */ 1571*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; 1572*4882a593Smuzhiyun 1573*4882a593Smuzhiyun else 1574*4882a593Smuzhiyun { 1575*4882a593Smuzhiyun int num_to_read = 1576*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; 1577*4882a593Smuzhiyun 1578*4882a593Smuzhiyun while ( num_to_read <= 0 ) 1579*4882a593Smuzhiyun { /* Not enough room in the buffer - grow it. */ 1580*4882a593Smuzhiyun 1581*4882a593Smuzhiyun /* just a shorter name for the current buffer */ 1582*4882a593Smuzhiyun YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; 1583*4882a593Smuzhiyun 1584*4882a593Smuzhiyun int yy_c_buf_p_offset = 1585*4882a593Smuzhiyun (int) ((yy_c_buf_p) - b->yy_ch_buf); 1586*4882a593Smuzhiyun 1587*4882a593Smuzhiyun if ( b->yy_is_our_buffer ) 1588*4882a593Smuzhiyun { 1589*4882a593Smuzhiyun int new_size = b->yy_buf_size * 2; 1590*4882a593Smuzhiyun 1591*4882a593Smuzhiyun if ( new_size <= 0 ) 1592*4882a593Smuzhiyun b->yy_buf_size += b->yy_buf_size / 8; 1593*4882a593Smuzhiyun else 1594*4882a593Smuzhiyun b->yy_buf_size *= 2; 1595*4882a593Smuzhiyun 1596*4882a593Smuzhiyun b->yy_ch_buf = (char *) 1597*4882a593Smuzhiyun /* Include room in for 2 EOB chars. */ 1598*4882a593Smuzhiyun yyrealloc( (void *) b->yy_ch_buf, 1599*4882a593Smuzhiyun (yy_size_t) (b->yy_buf_size + 2) ); 1600*4882a593Smuzhiyun } 1601*4882a593Smuzhiyun else 1602*4882a593Smuzhiyun /* Can't grow it, we don't own it. */ 1603*4882a593Smuzhiyun b->yy_ch_buf = NULL; 1604*4882a593Smuzhiyun 1605*4882a593Smuzhiyun if ( ! b->yy_ch_buf ) 1606*4882a593Smuzhiyun YY_FATAL_ERROR( 1607*4882a593Smuzhiyun "fatal error - scanner input buffer overflow" ); 1608*4882a593Smuzhiyun 1609*4882a593Smuzhiyun (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; 1610*4882a593Smuzhiyun 1611*4882a593Smuzhiyun num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - 1612*4882a593Smuzhiyun number_to_move - 1; 1613*4882a593Smuzhiyun 1614*4882a593Smuzhiyun } 1615*4882a593Smuzhiyun 1616*4882a593Smuzhiyun if ( num_to_read > YY_READ_BUF_SIZE ) 1617*4882a593Smuzhiyun num_to_read = YY_READ_BUF_SIZE; 1618*4882a593Smuzhiyun 1619*4882a593Smuzhiyun /* Read in more data. */ 1620*4882a593Smuzhiyun YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), 1621*4882a593Smuzhiyun (yy_n_chars), num_to_read ); 1622*4882a593Smuzhiyun 1623*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 1624*4882a593Smuzhiyun } 1625*4882a593Smuzhiyun 1626*4882a593Smuzhiyun if ( (yy_n_chars) == 0 ) 1627*4882a593Smuzhiyun { 1628*4882a593Smuzhiyun if ( number_to_move == YY_MORE_ADJ ) 1629*4882a593Smuzhiyun { 1630*4882a593Smuzhiyun ret_val = EOB_ACT_END_OF_FILE; 1631*4882a593Smuzhiyun yyrestart( yyin ); 1632*4882a593Smuzhiyun } 1633*4882a593Smuzhiyun 1634*4882a593Smuzhiyun else 1635*4882a593Smuzhiyun { 1636*4882a593Smuzhiyun ret_val = EOB_ACT_LAST_MATCH; 1637*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = 1638*4882a593Smuzhiyun YY_BUFFER_EOF_PENDING; 1639*4882a593Smuzhiyun } 1640*4882a593Smuzhiyun } 1641*4882a593Smuzhiyun 1642*4882a593Smuzhiyun else 1643*4882a593Smuzhiyun ret_val = EOB_ACT_CONTINUE_SCAN; 1644*4882a593Smuzhiyun 1645*4882a593Smuzhiyun if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { 1646*4882a593Smuzhiyun /* Extend the array by 50%, plus the number we really need. */ 1647*4882a593Smuzhiyun int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); 1648*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( 1649*4882a593Smuzhiyun (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); 1650*4882a593Smuzhiyun if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 1651*4882a593Smuzhiyun YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); 1652*4882a593Smuzhiyun /* "- 2" to take care of EOB's */ 1653*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); 1654*4882a593Smuzhiyun } 1655*4882a593Smuzhiyun 1656*4882a593Smuzhiyun (yy_n_chars) += number_to_move; 1657*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; 1658*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; 1659*4882a593Smuzhiyun 1660*4882a593Smuzhiyun (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; 1661*4882a593Smuzhiyun 1662*4882a593Smuzhiyun return ret_val; 1663*4882a593Smuzhiyun} 1664*4882a593Smuzhiyun 1665*4882a593Smuzhiyun/* yy_get_previous_state - get the state just before the EOB char was reached */ 1666*4882a593Smuzhiyun 1667*4882a593Smuzhiyun static yy_state_type yy_get_previous_state (void) 1668*4882a593Smuzhiyun{ 1669*4882a593Smuzhiyun yy_state_type yy_current_state; 1670*4882a593Smuzhiyun char *yy_cp; 1671*4882a593Smuzhiyun 1672*4882a593Smuzhiyun yy_current_state = (yy_start); 1673*4882a593Smuzhiyun 1674*4882a593Smuzhiyun for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) 1675*4882a593Smuzhiyun { 1676*4882a593Smuzhiyun yy_current_state = yy_nxt[yy_current_state][(*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1)]; 1677*4882a593Smuzhiyun } 1678*4882a593Smuzhiyun 1679*4882a593Smuzhiyun return yy_current_state; 1680*4882a593Smuzhiyun} 1681*4882a593Smuzhiyun 1682*4882a593Smuzhiyun/* yy_try_NUL_trans - try to make a transition on the NUL character 1683*4882a593Smuzhiyun * 1684*4882a593Smuzhiyun * synopsis 1685*4882a593Smuzhiyun * next_state = yy_try_NUL_trans( current_state ); 1686*4882a593Smuzhiyun */ 1687*4882a593Smuzhiyun static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) 1688*4882a593Smuzhiyun{ 1689*4882a593Smuzhiyun int yy_is_jam; 1690*4882a593Smuzhiyun 1691*4882a593Smuzhiyun yy_current_state = yy_nxt[yy_current_state][1]; 1692*4882a593Smuzhiyun yy_is_jam = (yy_current_state <= 0); 1693*4882a593Smuzhiyun 1694*4882a593Smuzhiyun return yy_is_jam ? 0 : yy_current_state; 1695*4882a593Smuzhiyun} 1696*4882a593Smuzhiyun 1697*4882a593Smuzhiyun#ifndef YY_NO_UNPUT 1698*4882a593Smuzhiyun 1699*4882a593Smuzhiyun static void yyunput (int c, char * yy_bp ) 1700*4882a593Smuzhiyun{ 1701*4882a593Smuzhiyun char *yy_cp; 1702*4882a593Smuzhiyun 1703*4882a593Smuzhiyun yy_cp = (yy_c_buf_p); 1704*4882a593Smuzhiyun 1705*4882a593Smuzhiyun /* undo effects of setting up yytext */ 1706*4882a593Smuzhiyun *yy_cp = (yy_hold_char); 1707*4882a593Smuzhiyun 1708*4882a593Smuzhiyun if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) 1709*4882a593Smuzhiyun { /* need to shift things up to make room */ 1710*4882a593Smuzhiyun /* +2 for EOB chars. */ 1711*4882a593Smuzhiyun int number_to_move = (yy_n_chars) + 2; 1712*4882a593Smuzhiyun char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ 1713*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; 1714*4882a593Smuzhiyun char *source = 1715*4882a593Smuzhiyun &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; 1716*4882a593Smuzhiyun 1717*4882a593Smuzhiyun while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 1718*4882a593Smuzhiyun *--dest = *--source; 1719*4882a593Smuzhiyun 1720*4882a593Smuzhiyun yy_cp += (int) (dest - source); 1721*4882a593Smuzhiyun yy_bp += (int) (dest - source); 1722*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE->yy_n_chars = 1723*4882a593Smuzhiyun (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; 1724*4882a593Smuzhiyun 1725*4882a593Smuzhiyun if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) 1726*4882a593Smuzhiyun YY_FATAL_ERROR( "flex scanner push-back overflow" ); 1727*4882a593Smuzhiyun } 1728*4882a593Smuzhiyun 1729*4882a593Smuzhiyun *--yy_cp = (char) c; 1730*4882a593Smuzhiyun 1731*4882a593Smuzhiyun if ( c == '\n' ){ 1732*4882a593Smuzhiyun --yylineno; 1733*4882a593Smuzhiyun } 1734*4882a593Smuzhiyun 1735*4882a593Smuzhiyun (yytext_ptr) = yy_bp; 1736*4882a593Smuzhiyun (yy_hold_char) = *yy_cp; 1737*4882a593Smuzhiyun (yy_c_buf_p) = yy_cp; 1738*4882a593Smuzhiyun} 1739*4882a593Smuzhiyun 1740*4882a593Smuzhiyun#endif 1741*4882a593Smuzhiyun 1742*4882a593Smuzhiyun#ifndef YY_NO_INPUT 1743*4882a593Smuzhiyun#ifdef __cplusplus 1744*4882a593Smuzhiyun static int yyinput (void) 1745*4882a593Smuzhiyun#else 1746*4882a593Smuzhiyun static int input (void) 1747*4882a593Smuzhiyun#endif 1748*4882a593Smuzhiyun 1749*4882a593Smuzhiyun{ 1750*4882a593Smuzhiyun int c; 1751*4882a593Smuzhiyun 1752*4882a593Smuzhiyun *(yy_c_buf_p) = (yy_hold_char); 1753*4882a593Smuzhiyun 1754*4882a593Smuzhiyun if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) 1755*4882a593Smuzhiyun { 1756*4882a593Smuzhiyun /* yy_c_buf_p now points to the character we want to return. 1757*4882a593Smuzhiyun * If this occurs *before* the EOB characters, then it's a 1758*4882a593Smuzhiyun * valid NUL; if not, then we've hit the end of the buffer. 1759*4882a593Smuzhiyun */ 1760*4882a593Smuzhiyun if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 1761*4882a593Smuzhiyun /* This was really a NUL. */ 1762*4882a593Smuzhiyun *(yy_c_buf_p) = '\0'; 1763*4882a593Smuzhiyun 1764*4882a593Smuzhiyun else 1765*4882a593Smuzhiyun { /* need more input */ 1766*4882a593Smuzhiyun int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); 1767*4882a593Smuzhiyun ++(yy_c_buf_p); 1768*4882a593Smuzhiyun 1769*4882a593Smuzhiyun switch ( yy_get_next_buffer( ) ) 1770*4882a593Smuzhiyun { 1771*4882a593Smuzhiyun case EOB_ACT_LAST_MATCH: 1772*4882a593Smuzhiyun /* This happens because yy_g_n_b() 1773*4882a593Smuzhiyun * sees that we've accumulated a 1774*4882a593Smuzhiyun * token and flags that we need to 1775*4882a593Smuzhiyun * try matching the token before 1776*4882a593Smuzhiyun * proceeding. But for input(), 1777*4882a593Smuzhiyun * there's no matching to consider. 1778*4882a593Smuzhiyun * So convert the EOB_ACT_LAST_MATCH 1779*4882a593Smuzhiyun * to EOB_ACT_END_OF_FILE. 1780*4882a593Smuzhiyun */ 1781*4882a593Smuzhiyun 1782*4882a593Smuzhiyun /* Reset buffer status. */ 1783*4882a593Smuzhiyun yyrestart( yyin ); 1784*4882a593Smuzhiyun 1785*4882a593Smuzhiyun /*FALLTHROUGH*/ 1786*4882a593Smuzhiyun 1787*4882a593Smuzhiyun case EOB_ACT_END_OF_FILE: 1788*4882a593Smuzhiyun { 1789*4882a593Smuzhiyun if ( yywrap( ) ) 1790*4882a593Smuzhiyun return 0; 1791*4882a593Smuzhiyun 1792*4882a593Smuzhiyun if ( ! (yy_did_buffer_switch_on_eof) ) 1793*4882a593Smuzhiyun YY_NEW_FILE; 1794*4882a593Smuzhiyun#ifdef __cplusplus 1795*4882a593Smuzhiyun return yyinput(); 1796*4882a593Smuzhiyun#else 1797*4882a593Smuzhiyun return input(); 1798*4882a593Smuzhiyun#endif 1799*4882a593Smuzhiyun } 1800*4882a593Smuzhiyun 1801*4882a593Smuzhiyun case EOB_ACT_CONTINUE_SCAN: 1802*4882a593Smuzhiyun (yy_c_buf_p) = (yytext_ptr) + offset; 1803*4882a593Smuzhiyun break; 1804*4882a593Smuzhiyun } 1805*4882a593Smuzhiyun } 1806*4882a593Smuzhiyun } 1807*4882a593Smuzhiyun 1808*4882a593Smuzhiyun c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ 1809*4882a593Smuzhiyun *(yy_c_buf_p) = '\0'; /* preserve yytext */ 1810*4882a593Smuzhiyun (yy_hold_char) = *++(yy_c_buf_p); 1811*4882a593Smuzhiyun 1812*4882a593Smuzhiyun if ( c == '\n' ) 1813*4882a593Smuzhiyun 1814*4882a593Smuzhiyun yylineno++; 1815*4882a593Smuzhiyun; 1816*4882a593Smuzhiyun 1817*4882a593Smuzhiyun return c; 1818*4882a593Smuzhiyun} 1819*4882a593Smuzhiyun#endif /* ifndef YY_NO_INPUT */ 1820*4882a593Smuzhiyun 1821*4882a593Smuzhiyun/** Immediately switch to a different input stream. 1822*4882a593Smuzhiyun * @param input_file A readable stream. 1823*4882a593Smuzhiyun * 1824*4882a593Smuzhiyun * @note This function does not reset the start condition to @c INITIAL . 1825*4882a593Smuzhiyun */ 1826*4882a593Smuzhiyun void yyrestart (FILE * input_file ) 1827*4882a593Smuzhiyun{ 1828*4882a593Smuzhiyun 1829*4882a593Smuzhiyun if ( ! YY_CURRENT_BUFFER ){ 1830*4882a593Smuzhiyun yyensure_buffer_stack (); 1831*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE = 1832*4882a593Smuzhiyun yy_create_buffer( yyin, YY_BUF_SIZE ); 1833*4882a593Smuzhiyun } 1834*4882a593Smuzhiyun 1835*4882a593Smuzhiyun yy_init_buffer( YY_CURRENT_BUFFER, input_file ); 1836*4882a593Smuzhiyun yy_load_buffer_state( ); 1837*4882a593Smuzhiyun} 1838*4882a593Smuzhiyun 1839*4882a593Smuzhiyun/** Switch to a different input buffer. 1840*4882a593Smuzhiyun * @param new_buffer The new input buffer. 1841*4882a593Smuzhiyun * 1842*4882a593Smuzhiyun */ 1843*4882a593Smuzhiyun void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) 1844*4882a593Smuzhiyun{ 1845*4882a593Smuzhiyun 1846*4882a593Smuzhiyun /* TODO. We should be able to replace this entire function body 1847*4882a593Smuzhiyun * with 1848*4882a593Smuzhiyun * yypop_buffer_state(); 1849*4882a593Smuzhiyun * yypush_buffer_state(new_buffer); 1850*4882a593Smuzhiyun */ 1851*4882a593Smuzhiyun yyensure_buffer_stack (); 1852*4882a593Smuzhiyun if ( YY_CURRENT_BUFFER == new_buffer ) 1853*4882a593Smuzhiyun return; 1854*4882a593Smuzhiyun 1855*4882a593Smuzhiyun if ( YY_CURRENT_BUFFER ) 1856*4882a593Smuzhiyun { 1857*4882a593Smuzhiyun /* Flush out information for old buffer. */ 1858*4882a593Smuzhiyun *(yy_c_buf_p) = (yy_hold_char); 1859*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 1860*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 1861*4882a593Smuzhiyun } 1862*4882a593Smuzhiyun 1863*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE = new_buffer; 1864*4882a593Smuzhiyun yy_load_buffer_state( ); 1865*4882a593Smuzhiyun 1866*4882a593Smuzhiyun /* We don't actually know whether we did this switch during 1867*4882a593Smuzhiyun * EOF (yywrap()) processing, but the only time this flag 1868*4882a593Smuzhiyun * is looked at is after yywrap() is called, so it's safe 1869*4882a593Smuzhiyun * to go ahead and always set it. 1870*4882a593Smuzhiyun */ 1871*4882a593Smuzhiyun (yy_did_buffer_switch_on_eof) = 1; 1872*4882a593Smuzhiyun} 1873*4882a593Smuzhiyun 1874*4882a593Smuzhiyunstatic void yy_load_buffer_state (void) 1875*4882a593Smuzhiyun{ 1876*4882a593Smuzhiyun (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 1877*4882a593Smuzhiyun (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; 1878*4882a593Smuzhiyun yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; 1879*4882a593Smuzhiyun (yy_hold_char) = *(yy_c_buf_p); 1880*4882a593Smuzhiyun} 1881*4882a593Smuzhiyun 1882*4882a593Smuzhiyun/** Allocate and initialize an input buffer state. 1883*4882a593Smuzhiyun * @param file A readable stream. 1884*4882a593Smuzhiyun * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. 1885*4882a593Smuzhiyun * 1886*4882a593Smuzhiyun * @return the allocated buffer state. 1887*4882a593Smuzhiyun */ 1888*4882a593Smuzhiyun YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) 1889*4882a593Smuzhiyun{ 1890*4882a593Smuzhiyun YY_BUFFER_STATE b; 1891*4882a593Smuzhiyun 1892*4882a593Smuzhiyun b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); 1893*4882a593Smuzhiyun if ( ! b ) 1894*4882a593Smuzhiyun YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 1895*4882a593Smuzhiyun 1896*4882a593Smuzhiyun b->yy_buf_size = size; 1897*4882a593Smuzhiyun 1898*4882a593Smuzhiyun /* yy_ch_buf has to be 2 characters longer than the size given because 1899*4882a593Smuzhiyun * we need to put in 2 end-of-buffer characters. 1900*4882a593Smuzhiyun */ 1901*4882a593Smuzhiyun b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); 1902*4882a593Smuzhiyun if ( ! b->yy_ch_buf ) 1903*4882a593Smuzhiyun YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 1904*4882a593Smuzhiyun 1905*4882a593Smuzhiyun b->yy_is_our_buffer = 1; 1906*4882a593Smuzhiyun 1907*4882a593Smuzhiyun yy_init_buffer( b, file ); 1908*4882a593Smuzhiyun 1909*4882a593Smuzhiyun return b; 1910*4882a593Smuzhiyun} 1911*4882a593Smuzhiyun 1912*4882a593Smuzhiyun/** Destroy the buffer. 1913*4882a593Smuzhiyun * @param b a buffer created with yy_create_buffer() 1914*4882a593Smuzhiyun * 1915*4882a593Smuzhiyun */ 1916*4882a593Smuzhiyun void yy_delete_buffer (YY_BUFFER_STATE b ) 1917*4882a593Smuzhiyun{ 1918*4882a593Smuzhiyun 1919*4882a593Smuzhiyun if ( ! b ) 1920*4882a593Smuzhiyun return; 1921*4882a593Smuzhiyun 1922*4882a593Smuzhiyun if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ 1923*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; 1924*4882a593Smuzhiyun 1925*4882a593Smuzhiyun if ( b->yy_is_our_buffer ) 1926*4882a593Smuzhiyun yyfree( (void *) b->yy_ch_buf ); 1927*4882a593Smuzhiyun 1928*4882a593Smuzhiyun yyfree( (void *) b ); 1929*4882a593Smuzhiyun} 1930*4882a593Smuzhiyun 1931*4882a593Smuzhiyun/* Initializes or reinitializes a buffer. 1932*4882a593Smuzhiyun * This function is sometimes called more than once on the same buffer, 1933*4882a593Smuzhiyun * such as during a yyrestart() or at EOF. 1934*4882a593Smuzhiyun */ 1935*4882a593Smuzhiyun static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) 1936*4882a593Smuzhiyun 1937*4882a593Smuzhiyun{ 1938*4882a593Smuzhiyun int oerrno = errno; 1939*4882a593Smuzhiyun 1940*4882a593Smuzhiyun yy_flush_buffer( b ); 1941*4882a593Smuzhiyun 1942*4882a593Smuzhiyun b->yy_input_file = file; 1943*4882a593Smuzhiyun b->yy_fill_buffer = 1; 1944*4882a593Smuzhiyun 1945*4882a593Smuzhiyun /* If b is the current buffer, then yy_init_buffer was _probably_ 1946*4882a593Smuzhiyun * called from yyrestart() or through yy_get_next_buffer. 1947*4882a593Smuzhiyun * In that case, we don't want to reset the lineno or column. 1948*4882a593Smuzhiyun */ 1949*4882a593Smuzhiyun if (b != YY_CURRENT_BUFFER){ 1950*4882a593Smuzhiyun b->yy_bs_lineno = 1; 1951*4882a593Smuzhiyun b->yy_bs_column = 0; 1952*4882a593Smuzhiyun } 1953*4882a593Smuzhiyun 1954*4882a593Smuzhiyun b->yy_is_interactive = 0; 1955*4882a593Smuzhiyun 1956*4882a593Smuzhiyun errno = oerrno; 1957*4882a593Smuzhiyun} 1958*4882a593Smuzhiyun 1959*4882a593Smuzhiyun/** Discard all buffered characters. On the next scan, YY_INPUT will be called. 1960*4882a593Smuzhiyun * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. 1961*4882a593Smuzhiyun * 1962*4882a593Smuzhiyun */ 1963*4882a593Smuzhiyun void yy_flush_buffer (YY_BUFFER_STATE b ) 1964*4882a593Smuzhiyun{ 1965*4882a593Smuzhiyun if ( ! b ) 1966*4882a593Smuzhiyun return; 1967*4882a593Smuzhiyun 1968*4882a593Smuzhiyun b->yy_n_chars = 0; 1969*4882a593Smuzhiyun 1970*4882a593Smuzhiyun /* We always need two end-of-buffer characters. The first causes 1971*4882a593Smuzhiyun * a transition to the end-of-buffer state. The second causes 1972*4882a593Smuzhiyun * a jam in that state. 1973*4882a593Smuzhiyun */ 1974*4882a593Smuzhiyun b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 1975*4882a593Smuzhiyun b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 1976*4882a593Smuzhiyun 1977*4882a593Smuzhiyun b->yy_buf_pos = &b->yy_ch_buf[0]; 1978*4882a593Smuzhiyun 1979*4882a593Smuzhiyun b->yy_at_bol = 1; 1980*4882a593Smuzhiyun b->yy_buffer_status = YY_BUFFER_NEW; 1981*4882a593Smuzhiyun 1982*4882a593Smuzhiyun if ( b == YY_CURRENT_BUFFER ) 1983*4882a593Smuzhiyun yy_load_buffer_state( ); 1984*4882a593Smuzhiyun} 1985*4882a593Smuzhiyun 1986*4882a593Smuzhiyun/** Pushes the new state onto the stack. The new state becomes 1987*4882a593Smuzhiyun * the current state. This function will allocate the stack 1988*4882a593Smuzhiyun * if necessary. 1989*4882a593Smuzhiyun * @param new_buffer The new state. 1990*4882a593Smuzhiyun * 1991*4882a593Smuzhiyun */ 1992*4882a593Smuzhiyunvoid yypush_buffer_state (YY_BUFFER_STATE new_buffer ) 1993*4882a593Smuzhiyun{ 1994*4882a593Smuzhiyun if (new_buffer == NULL) 1995*4882a593Smuzhiyun return; 1996*4882a593Smuzhiyun 1997*4882a593Smuzhiyun yyensure_buffer_stack(); 1998*4882a593Smuzhiyun 1999*4882a593Smuzhiyun /* This block is copied from yy_switch_to_buffer. */ 2000*4882a593Smuzhiyun if ( YY_CURRENT_BUFFER ) 2001*4882a593Smuzhiyun { 2002*4882a593Smuzhiyun /* Flush out information for old buffer. */ 2003*4882a593Smuzhiyun *(yy_c_buf_p) = (yy_hold_char); 2004*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 2005*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 2006*4882a593Smuzhiyun } 2007*4882a593Smuzhiyun 2008*4882a593Smuzhiyun /* Only push if top exists. Otherwise, replace top. */ 2009*4882a593Smuzhiyun if (YY_CURRENT_BUFFER) 2010*4882a593Smuzhiyun (yy_buffer_stack_top)++; 2011*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE = new_buffer; 2012*4882a593Smuzhiyun 2013*4882a593Smuzhiyun /* copied from yy_switch_to_buffer. */ 2014*4882a593Smuzhiyun yy_load_buffer_state( ); 2015*4882a593Smuzhiyun (yy_did_buffer_switch_on_eof) = 1; 2016*4882a593Smuzhiyun} 2017*4882a593Smuzhiyun 2018*4882a593Smuzhiyun/** Removes and deletes the top of the stack, if present. 2019*4882a593Smuzhiyun * The next element becomes the new top. 2020*4882a593Smuzhiyun * 2021*4882a593Smuzhiyun */ 2022*4882a593Smuzhiyunvoid yypop_buffer_state (void) 2023*4882a593Smuzhiyun{ 2024*4882a593Smuzhiyun if (!YY_CURRENT_BUFFER) 2025*4882a593Smuzhiyun return; 2026*4882a593Smuzhiyun 2027*4882a593Smuzhiyun yy_delete_buffer(YY_CURRENT_BUFFER ); 2028*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE = NULL; 2029*4882a593Smuzhiyun if ((yy_buffer_stack_top) > 0) 2030*4882a593Smuzhiyun --(yy_buffer_stack_top); 2031*4882a593Smuzhiyun 2032*4882a593Smuzhiyun if (YY_CURRENT_BUFFER) { 2033*4882a593Smuzhiyun yy_load_buffer_state( ); 2034*4882a593Smuzhiyun (yy_did_buffer_switch_on_eof) = 1; 2035*4882a593Smuzhiyun } 2036*4882a593Smuzhiyun} 2037*4882a593Smuzhiyun 2038*4882a593Smuzhiyun/* Allocates the stack if it does not exist. 2039*4882a593Smuzhiyun * Guarantees space for at least one push. 2040*4882a593Smuzhiyun */ 2041*4882a593Smuzhiyunstatic void yyensure_buffer_stack (void) 2042*4882a593Smuzhiyun{ 2043*4882a593Smuzhiyun yy_size_t num_to_alloc; 2044*4882a593Smuzhiyun 2045*4882a593Smuzhiyun if (!(yy_buffer_stack)) { 2046*4882a593Smuzhiyun 2047*4882a593Smuzhiyun /* First allocation is just for 2 elements, since we don't know if this 2048*4882a593Smuzhiyun * scanner will even need a stack. We use 2 instead of 1 to avoid an 2049*4882a593Smuzhiyun * immediate realloc on the next call. 2050*4882a593Smuzhiyun */ 2051*4882a593Smuzhiyun num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ 2052*4882a593Smuzhiyun (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc 2053*4882a593Smuzhiyun (num_to_alloc * sizeof(struct yy_buffer_state*) 2054*4882a593Smuzhiyun ); 2055*4882a593Smuzhiyun if ( ! (yy_buffer_stack) ) 2056*4882a593Smuzhiyun YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); 2057*4882a593Smuzhiyun 2058*4882a593Smuzhiyun memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 2059*4882a593Smuzhiyun 2060*4882a593Smuzhiyun (yy_buffer_stack_max) = num_to_alloc; 2061*4882a593Smuzhiyun (yy_buffer_stack_top) = 0; 2062*4882a593Smuzhiyun return; 2063*4882a593Smuzhiyun } 2064*4882a593Smuzhiyun 2065*4882a593Smuzhiyun if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ 2066*4882a593Smuzhiyun 2067*4882a593Smuzhiyun /* Increase the buffer to prepare for a possible push. */ 2068*4882a593Smuzhiyun yy_size_t grow_size = 8 /* arbitrary grow size */; 2069*4882a593Smuzhiyun 2070*4882a593Smuzhiyun num_to_alloc = (yy_buffer_stack_max) + grow_size; 2071*4882a593Smuzhiyun (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc 2072*4882a593Smuzhiyun ((yy_buffer_stack), 2073*4882a593Smuzhiyun num_to_alloc * sizeof(struct yy_buffer_state*) 2074*4882a593Smuzhiyun ); 2075*4882a593Smuzhiyun if ( ! (yy_buffer_stack) ) 2076*4882a593Smuzhiyun YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); 2077*4882a593Smuzhiyun 2078*4882a593Smuzhiyun /* zero only the new slots.*/ 2079*4882a593Smuzhiyun memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); 2080*4882a593Smuzhiyun (yy_buffer_stack_max) = num_to_alloc; 2081*4882a593Smuzhiyun } 2082*4882a593Smuzhiyun} 2083*4882a593Smuzhiyun 2084*4882a593Smuzhiyun/** Setup the input buffer state to scan directly from a user-specified character buffer. 2085*4882a593Smuzhiyun * @param base the character buffer 2086*4882a593Smuzhiyun * @param size the size in bytes of the character buffer 2087*4882a593Smuzhiyun * 2088*4882a593Smuzhiyun * @return the newly allocated buffer state object. 2089*4882a593Smuzhiyun */ 2090*4882a593SmuzhiyunYY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) 2091*4882a593Smuzhiyun{ 2092*4882a593Smuzhiyun YY_BUFFER_STATE b; 2093*4882a593Smuzhiyun 2094*4882a593Smuzhiyun if ( size < 2 || 2095*4882a593Smuzhiyun base[size-2] != YY_END_OF_BUFFER_CHAR || 2096*4882a593Smuzhiyun base[size-1] != YY_END_OF_BUFFER_CHAR ) 2097*4882a593Smuzhiyun /* They forgot to leave room for the EOB's. */ 2098*4882a593Smuzhiyun return NULL; 2099*4882a593Smuzhiyun 2100*4882a593Smuzhiyun b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); 2101*4882a593Smuzhiyun if ( ! b ) 2102*4882a593Smuzhiyun YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); 2103*4882a593Smuzhiyun 2104*4882a593Smuzhiyun b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ 2105*4882a593Smuzhiyun b->yy_buf_pos = b->yy_ch_buf = base; 2106*4882a593Smuzhiyun b->yy_is_our_buffer = 0; 2107*4882a593Smuzhiyun b->yy_input_file = NULL; 2108*4882a593Smuzhiyun b->yy_n_chars = b->yy_buf_size; 2109*4882a593Smuzhiyun b->yy_is_interactive = 0; 2110*4882a593Smuzhiyun b->yy_at_bol = 1; 2111*4882a593Smuzhiyun b->yy_fill_buffer = 0; 2112*4882a593Smuzhiyun b->yy_buffer_status = YY_BUFFER_NEW; 2113*4882a593Smuzhiyun 2114*4882a593Smuzhiyun yy_switch_to_buffer( b ); 2115*4882a593Smuzhiyun 2116*4882a593Smuzhiyun return b; 2117*4882a593Smuzhiyun} 2118*4882a593Smuzhiyun 2119*4882a593Smuzhiyun/** Setup the input buffer state to scan a string. The next call to yylex() will 2120*4882a593Smuzhiyun * scan from a @e copy of @a str. 2121*4882a593Smuzhiyun * @param yystr a NUL-terminated string to scan 2122*4882a593Smuzhiyun * 2123*4882a593Smuzhiyun * @return the newly allocated buffer state object. 2124*4882a593Smuzhiyun * @note If you want to scan bytes that may contain NUL values, then use 2125*4882a593Smuzhiyun * yy_scan_bytes() instead. 2126*4882a593Smuzhiyun */ 2127*4882a593SmuzhiyunYY_BUFFER_STATE yy_scan_string (const char * yystr ) 2128*4882a593Smuzhiyun{ 2129*4882a593Smuzhiyun 2130*4882a593Smuzhiyun return yy_scan_bytes( yystr, (int) strlen(yystr) ); 2131*4882a593Smuzhiyun} 2132*4882a593Smuzhiyun 2133*4882a593Smuzhiyun/** Setup the input buffer state to scan the given bytes. The next call to yylex() will 2134*4882a593Smuzhiyun * scan from a @e copy of @a bytes. 2135*4882a593Smuzhiyun * @param yybytes the byte buffer to scan 2136*4882a593Smuzhiyun * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. 2137*4882a593Smuzhiyun * 2138*4882a593Smuzhiyun * @return the newly allocated buffer state object. 2139*4882a593Smuzhiyun */ 2140*4882a593SmuzhiyunYY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) 2141*4882a593Smuzhiyun{ 2142*4882a593Smuzhiyun YY_BUFFER_STATE b; 2143*4882a593Smuzhiyun char *buf; 2144*4882a593Smuzhiyun yy_size_t n; 2145*4882a593Smuzhiyun int i; 2146*4882a593Smuzhiyun 2147*4882a593Smuzhiyun /* Get memory for full buffer, including space for trailing EOB's. */ 2148*4882a593Smuzhiyun n = (yy_size_t) (_yybytes_len + 2); 2149*4882a593Smuzhiyun buf = (char *) yyalloc( n ); 2150*4882a593Smuzhiyun if ( ! buf ) 2151*4882a593Smuzhiyun YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); 2152*4882a593Smuzhiyun 2153*4882a593Smuzhiyun for ( i = 0; i < _yybytes_len; ++i ) 2154*4882a593Smuzhiyun buf[i] = yybytes[i]; 2155*4882a593Smuzhiyun 2156*4882a593Smuzhiyun buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; 2157*4882a593Smuzhiyun 2158*4882a593Smuzhiyun b = yy_scan_buffer( buf, n ); 2159*4882a593Smuzhiyun if ( ! b ) 2160*4882a593Smuzhiyun YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); 2161*4882a593Smuzhiyun 2162*4882a593Smuzhiyun /* It's okay to grow etc. this buffer, and we should throw it 2163*4882a593Smuzhiyun * away when we're done. 2164*4882a593Smuzhiyun */ 2165*4882a593Smuzhiyun b->yy_is_our_buffer = 1; 2166*4882a593Smuzhiyun 2167*4882a593Smuzhiyun return b; 2168*4882a593Smuzhiyun} 2169*4882a593Smuzhiyun 2170*4882a593Smuzhiyun#ifndef YY_EXIT_FAILURE 2171*4882a593Smuzhiyun#define YY_EXIT_FAILURE 2 2172*4882a593Smuzhiyun#endif 2173*4882a593Smuzhiyun 2174*4882a593Smuzhiyunstatic void yynoreturn yy_fatal_error (const char* msg ) 2175*4882a593Smuzhiyun{ 2176*4882a593Smuzhiyun fprintf( stderr, "%s\n", msg ); 2177*4882a593Smuzhiyun exit( YY_EXIT_FAILURE ); 2178*4882a593Smuzhiyun} 2179*4882a593Smuzhiyun 2180*4882a593Smuzhiyun/* Redefine yyless() so it works in section 3 code. */ 2181*4882a593Smuzhiyun 2182*4882a593Smuzhiyun#undef yyless 2183*4882a593Smuzhiyun#define yyless(n) \ 2184*4882a593Smuzhiyun do \ 2185*4882a593Smuzhiyun { \ 2186*4882a593Smuzhiyun /* Undo effects of setting up yytext. */ \ 2187*4882a593Smuzhiyun int yyless_macro_arg = (n); \ 2188*4882a593Smuzhiyun YY_LESS_LINENO(yyless_macro_arg);\ 2189*4882a593Smuzhiyun yytext[yyleng] = (yy_hold_char); \ 2190*4882a593Smuzhiyun (yy_c_buf_p) = yytext + yyless_macro_arg; \ 2191*4882a593Smuzhiyun (yy_hold_char) = *(yy_c_buf_p); \ 2192*4882a593Smuzhiyun *(yy_c_buf_p) = '\0'; \ 2193*4882a593Smuzhiyun yyleng = yyless_macro_arg; \ 2194*4882a593Smuzhiyun } \ 2195*4882a593Smuzhiyun while ( 0 ) 2196*4882a593Smuzhiyun 2197*4882a593Smuzhiyun/* Accessor methods (get/set functions) to struct members. */ 2198*4882a593Smuzhiyun 2199*4882a593Smuzhiyun/** Get the current line number. 2200*4882a593Smuzhiyun * 2201*4882a593Smuzhiyun */ 2202*4882a593Smuzhiyunint yyget_lineno (void) 2203*4882a593Smuzhiyun{ 2204*4882a593Smuzhiyun 2205*4882a593Smuzhiyun return yylineno; 2206*4882a593Smuzhiyun} 2207*4882a593Smuzhiyun 2208*4882a593Smuzhiyun/** Get the input stream. 2209*4882a593Smuzhiyun * 2210*4882a593Smuzhiyun */ 2211*4882a593SmuzhiyunFILE *yyget_in (void) 2212*4882a593Smuzhiyun{ 2213*4882a593Smuzhiyun return yyin; 2214*4882a593Smuzhiyun} 2215*4882a593Smuzhiyun 2216*4882a593Smuzhiyun/** Get the output stream. 2217*4882a593Smuzhiyun * 2218*4882a593Smuzhiyun */ 2219*4882a593SmuzhiyunFILE *yyget_out (void) 2220*4882a593Smuzhiyun{ 2221*4882a593Smuzhiyun return yyout; 2222*4882a593Smuzhiyun} 2223*4882a593Smuzhiyun 2224*4882a593Smuzhiyun/** Get the length of the current token. 2225*4882a593Smuzhiyun * 2226*4882a593Smuzhiyun */ 2227*4882a593Smuzhiyunint yyget_leng (void) 2228*4882a593Smuzhiyun{ 2229*4882a593Smuzhiyun return yyleng; 2230*4882a593Smuzhiyun} 2231*4882a593Smuzhiyun 2232*4882a593Smuzhiyun/** Get the current token. 2233*4882a593Smuzhiyun * 2234*4882a593Smuzhiyun */ 2235*4882a593Smuzhiyun 2236*4882a593Smuzhiyunchar *yyget_text (void) 2237*4882a593Smuzhiyun{ 2238*4882a593Smuzhiyun return yytext; 2239*4882a593Smuzhiyun} 2240*4882a593Smuzhiyun 2241*4882a593Smuzhiyun/** Set the current line number. 2242*4882a593Smuzhiyun * @param _line_number line number 2243*4882a593Smuzhiyun * 2244*4882a593Smuzhiyun */ 2245*4882a593Smuzhiyunvoid yyset_lineno (int _line_number ) 2246*4882a593Smuzhiyun{ 2247*4882a593Smuzhiyun 2248*4882a593Smuzhiyun yylineno = _line_number; 2249*4882a593Smuzhiyun} 2250*4882a593Smuzhiyun 2251*4882a593Smuzhiyun/** Set the input stream. This does not discard the current 2252*4882a593Smuzhiyun * input buffer. 2253*4882a593Smuzhiyun * @param _in_str A readable stream. 2254*4882a593Smuzhiyun * 2255*4882a593Smuzhiyun * @see yy_switch_to_buffer 2256*4882a593Smuzhiyun */ 2257*4882a593Smuzhiyunvoid yyset_in (FILE * _in_str ) 2258*4882a593Smuzhiyun{ 2259*4882a593Smuzhiyun yyin = _in_str ; 2260*4882a593Smuzhiyun} 2261*4882a593Smuzhiyun 2262*4882a593Smuzhiyunvoid yyset_out (FILE * _out_str ) 2263*4882a593Smuzhiyun{ 2264*4882a593Smuzhiyun yyout = _out_str ; 2265*4882a593Smuzhiyun} 2266*4882a593Smuzhiyun 2267*4882a593Smuzhiyunint yyget_debug (void) 2268*4882a593Smuzhiyun{ 2269*4882a593Smuzhiyun return yy_flex_debug; 2270*4882a593Smuzhiyun} 2271*4882a593Smuzhiyun 2272*4882a593Smuzhiyunvoid yyset_debug (int _bdebug ) 2273*4882a593Smuzhiyun{ 2274*4882a593Smuzhiyun yy_flex_debug = _bdebug ; 2275*4882a593Smuzhiyun} 2276*4882a593Smuzhiyun 2277*4882a593Smuzhiyunstatic int yy_init_globals (void) 2278*4882a593Smuzhiyun{ 2279*4882a593Smuzhiyun /* Initialization is the same as for the non-reentrant scanner. 2280*4882a593Smuzhiyun * This function is called from yylex_destroy(), so don't allocate here. 2281*4882a593Smuzhiyun */ 2282*4882a593Smuzhiyun 2283*4882a593Smuzhiyun /* We do not touch yylineno unless the option is enabled. */ 2284*4882a593Smuzhiyun yylineno = 1; 2285*4882a593Smuzhiyun 2286*4882a593Smuzhiyun (yy_buffer_stack) = NULL; 2287*4882a593Smuzhiyun (yy_buffer_stack_top) = 0; 2288*4882a593Smuzhiyun (yy_buffer_stack_max) = 0; 2289*4882a593Smuzhiyun (yy_c_buf_p) = NULL; 2290*4882a593Smuzhiyun (yy_init) = 0; 2291*4882a593Smuzhiyun (yy_start) = 0; 2292*4882a593Smuzhiyun 2293*4882a593Smuzhiyun/* Defined in main.c */ 2294*4882a593Smuzhiyun#ifdef YY_STDINIT 2295*4882a593Smuzhiyun yyin = stdin; 2296*4882a593Smuzhiyun yyout = stdout; 2297*4882a593Smuzhiyun#else 2298*4882a593Smuzhiyun yyin = NULL; 2299*4882a593Smuzhiyun yyout = NULL; 2300*4882a593Smuzhiyun#endif 2301*4882a593Smuzhiyun 2302*4882a593Smuzhiyun /* For future reference: Set errno on error, since we are called by 2303*4882a593Smuzhiyun * yylex_init() 2304*4882a593Smuzhiyun */ 2305*4882a593Smuzhiyun return 0; 2306*4882a593Smuzhiyun} 2307*4882a593Smuzhiyun 2308*4882a593Smuzhiyun/* yylex_destroy is for both reentrant and non-reentrant scanners. */ 2309*4882a593Smuzhiyunint yylex_destroy (void) 2310*4882a593Smuzhiyun{ 2311*4882a593Smuzhiyun 2312*4882a593Smuzhiyun /* Pop the buffer stack, destroying each element. */ 2313*4882a593Smuzhiyun while(YY_CURRENT_BUFFER){ 2314*4882a593Smuzhiyun yy_delete_buffer( YY_CURRENT_BUFFER ); 2315*4882a593Smuzhiyun YY_CURRENT_BUFFER_LVALUE = NULL; 2316*4882a593Smuzhiyun yypop_buffer_state(); 2317*4882a593Smuzhiyun } 2318*4882a593Smuzhiyun 2319*4882a593Smuzhiyun /* Destroy the stack itself. */ 2320*4882a593Smuzhiyun yyfree((yy_buffer_stack) ); 2321*4882a593Smuzhiyun (yy_buffer_stack) = NULL; 2322*4882a593Smuzhiyun 2323*4882a593Smuzhiyun /* Reset the globals. This is important in a non-reentrant scanner so the next time 2324*4882a593Smuzhiyun * yylex() is called, initialization will occur. */ 2325*4882a593Smuzhiyun yy_init_globals( ); 2326*4882a593Smuzhiyun 2327*4882a593Smuzhiyun return 0; 2328*4882a593Smuzhiyun} 2329*4882a593Smuzhiyun 2330*4882a593Smuzhiyun/* 2331*4882a593Smuzhiyun * Internal utility routines. 2332*4882a593Smuzhiyun */ 2333*4882a593Smuzhiyun 2334*4882a593Smuzhiyun#ifndef yytext_ptr 2335*4882a593Smuzhiyunstatic void yy_flex_strncpy (char* s1, const char * s2, int n ) 2336*4882a593Smuzhiyun{ 2337*4882a593Smuzhiyun 2338*4882a593Smuzhiyun int i; 2339*4882a593Smuzhiyun for ( i = 0; i < n; ++i ) 2340*4882a593Smuzhiyun s1[i] = s2[i]; 2341*4882a593Smuzhiyun} 2342*4882a593Smuzhiyun#endif 2343*4882a593Smuzhiyun 2344*4882a593Smuzhiyun#ifdef YY_NEED_STRLEN 2345*4882a593Smuzhiyunstatic int yy_flex_strlen (const char * s ) 2346*4882a593Smuzhiyun{ 2347*4882a593Smuzhiyun int n; 2348*4882a593Smuzhiyun for ( n = 0; s[n]; ++n ) 2349*4882a593Smuzhiyun ; 2350*4882a593Smuzhiyun 2351*4882a593Smuzhiyun return n; 2352*4882a593Smuzhiyun} 2353*4882a593Smuzhiyun#endif 2354*4882a593Smuzhiyun 2355*4882a593Smuzhiyunvoid *yyalloc (yy_size_t size ) 2356*4882a593Smuzhiyun{ 2357*4882a593Smuzhiyun return malloc(size); 2358*4882a593Smuzhiyun} 2359*4882a593Smuzhiyun 2360*4882a593Smuzhiyunvoid *yyrealloc (void * ptr, yy_size_t size ) 2361*4882a593Smuzhiyun{ 2362*4882a593Smuzhiyun 2363*4882a593Smuzhiyun /* The cast to (char *) in the following accommodates both 2364*4882a593Smuzhiyun * implementations that use char* generic pointers, and those 2365*4882a593Smuzhiyun * that use void* generic pointers. It works with the latter 2366*4882a593Smuzhiyun * because both ANSI C and C++ allow castless assignment from 2367*4882a593Smuzhiyun * any pointer type to void*, and deal with argument conversions 2368*4882a593Smuzhiyun * as though doing an assignment. 2369*4882a593Smuzhiyun */ 2370*4882a593Smuzhiyun return realloc(ptr, size); 2371*4882a593Smuzhiyun} 2372*4882a593Smuzhiyun 2373*4882a593Smuzhiyunvoid yyfree (void * ptr ) 2374*4882a593Smuzhiyun{ 2375*4882a593Smuzhiyun free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ 2376*4882a593Smuzhiyun} 2377*4882a593Smuzhiyun 2378*4882a593Smuzhiyun#define YYTABLES_NAME "yytables" 2379*4882a593Smuzhiyun 2380*4882a593Smuzhiyunvoid zconf_starthelp(void) 2381*4882a593Smuzhiyun{ 2382*4882a593Smuzhiyun new_string(); 2383*4882a593Smuzhiyun last_ts = first_ts = 0; 2384*4882a593Smuzhiyun BEGIN(HELP); 2385*4882a593Smuzhiyun} 2386*4882a593Smuzhiyun 2387*4882a593Smuzhiyunstatic void zconf_endhelp(void) 2388*4882a593Smuzhiyun{ 2389*4882a593Smuzhiyun yylval.string = text; 2390*4882a593Smuzhiyun BEGIN(INITIAL); 2391*4882a593Smuzhiyun} 2392*4882a593Smuzhiyun 2393*4882a593Smuzhiyun/* 2394*4882a593Smuzhiyun * Try to open specified file with following names: 2395*4882a593Smuzhiyun * ./name 2396*4882a593Smuzhiyun * $(srctree)/name 2397*4882a593Smuzhiyun * The latter is used when srctree is separate from objtree 2398*4882a593Smuzhiyun * when compiling the kernel. 2399*4882a593Smuzhiyun * Return NULL if file is not found. 2400*4882a593Smuzhiyun */ 2401*4882a593SmuzhiyunFILE *zconf_fopen(const char *name) 2402*4882a593Smuzhiyun{ 2403*4882a593Smuzhiyun char *env, fullname[PATH_MAX+1]; 2404*4882a593Smuzhiyun FILE *f; 2405*4882a593Smuzhiyun 2406*4882a593Smuzhiyun f = fopen(name, "r"); 2407*4882a593Smuzhiyun if (!f && name != NULL && name[0] != '/') { 2408*4882a593Smuzhiyun env = getenv(SRCTREE); 2409*4882a593Smuzhiyun if (env) { 2410*4882a593Smuzhiyun sprintf(fullname, "%s/%s", env, name); 2411*4882a593Smuzhiyun f = fopen(fullname, "r"); 2412*4882a593Smuzhiyun } 2413*4882a593Smuzhiyun } 2414*4882a593Smuzhiyun return f; 2415*4882a593Smuzhiyun} 2416*4882a593Smuzhiyun 2417*4882a593Smuzhiyunvoid zconf_initscan(const char *name) 2418*4882a593Smuzhiyun{ 2419*4882a593Smuzhiyun yyin = zconf_fopen(name); 2420*4882a593Smuzhiyun if (!yyin) { 2421*4882a593Smuzhiyun fprintf(stderr, "can't find file %s\n", name); 2422*4882a593Smuzhiyun exit(1); 2423*4882a593Smuzhiyun } 2424*4882a593Smuzhiyun 2425*4882a593Smuzhiyun current_buf = xmalloc(sizeof(*current_buf)); 2426*4882a593Smuzhiyun memset(current_buf, 0, sizeof(*current_buf)); 2427*4882a593Smuzhiyun 2428*4882a593Smuzhiyun current_file = file_lookup(name); 2429*4882a593Smuzhiyun yylineno = 1; 2430*4882a593Smuzhiyun} 2431*4882a593Smuzhiyun 2432*4882a593Smuzhiyunvoid zconf_nextfile(const char *name) 2433*4882a593Smuzhiyun{ 2434*4882a593Smuzhiyun struct file *iter; 2435*4882a593Smuzhiyun struct file *file = file_lookup(name); 2436*4882a593Smuzhiyun struct buffer *buf = xmalloc(sizeof(*buf)); 2437*4882a593Smuzhiyun memset(buf, 0, sizeof(*buf)); 2438*4882a593Smuzhiyun 2439*4882a593Smuzhiyun current_buf->state = YY_CURRENT_BUFFER; 2440*4882a593Smuzhiyun yyin = zconf_fopen(file->name); 2441*4882a593Smuzhiyun if (!yyin) { 2442*4882a593Smuzhiyun fprintf(stderr, "%s:%d: can't open file \"%s\"\n", 2443*4882a593Smuzhiyun zconf_curname(), zconf_lineno(), file->name); 2444*4882a593Smuzhiyun exit(1); 2445*4882a593Smuzhiyun } 2446*4882a593Smuzhiyun yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE)); 2447*4882a593Smuzhiyun buf->parent = current_buf; 2448*4882a593Smuzhiyun current_buf = buf; 2449*4882a593Smuzhiyun 2450*4882a593Smuzhiyun current_file->lineno = yylineno; 2451*4882a593Smuzhiyun file->parent = current_file; 2452*4882a593Smuzhiyun 2453*4882a593Smuzhiyun for (iter = current_file; iter; iter = iter->parent) { 2454*4882a593Smuzhiyun if (!strcmp(iter->name, file->name)) { 2455*4882a593Smuzhiyun fprintf(stderr, 2456*4882a593Smuzhiyun "Recursive inclusion detected.\n" 2457*4882a593Smuzhiyun "Inclusion path:\n" 2458*4882a593Smuzhiyun " current file : %s\n", file->name); 2459*4882a593Smuzhiyun iter = file; 2460*4882a593Smuzhiyun do { 2461*4882a593Smuzhiyun iter = iter->parent; 2462*4882a593Smuzhiyun fprintf(stderr, " included from: %s:%d\n", 2463*4882a593Smuzhiyun iter->name, iter->lineno - 1); 2464*4882a593Smuzhiyun } while (strcmp(iter->name, file->name)); 2465*4882a593Smuzhiyun exit(1); 2466*4882a593Smuzhiyun } 2467*4882a593Smuzhiyun } 2468*4882a593Smuzhiyun 2469*4882a593Smuzhiyun yylineno = 1; 2470*4882a593Smuzhiyun current_file = file; 2471*4882a593Smuzhiyun} 2472*4882a593Smuzhiyun 2473*4882a593Smuzhiyunstatic void zconf_endfile(void) 2474*4882a593Smuzhiyun{ 2475*4882a593Smuzhiyun struct buffer *parent; 2476*4882a593Smuzhiyun 2477*4882a593Smuzhiyun current_file = current_file->parent; 2478*4882a593Smuzhiyun if (current_file) 2479*4882a593Smuzhiyun yylineno = current_file->lineno; 2480*4882a593Smuzhiyun 2481*4882a593Smuzhiyun parent = current_buf->parent; 2482*4882a593Smuzhiyun if (parent) { 2483*4882a593Smuzhiyun fclose(yyin); 2484*4882a593Smuzhiyun yy_delete_buffer(YY_CURRENT_BUFFER); 2485*4882a593Smuzhiyun yy_switch_to_buffer(parent->state); 2486*4882a593Smuzhiyun } 2487*4882a593Smuzhiyun free(current_buf); 2488*4882a593Smuzhiyun current_buf = parent; 2489*4882a593Smuzhiyun} 2490*4882a593Smuzhiyun 2491*4882a593Smuzhiyunint zconf_lineno(void) 2492*4882a593Smuzhiyun{ 2493*4882a593Smuzhiyun return current_pos.lineno; 2494*4882a593Smuzhiyun} 2495*4882a593Smuzhiyun 2496*4882a593Smuzhiyunconst char *zconf_curname(void) 2497*4882a593Smuzhiyun{ 2498*4882a593Smuzhiyun return current_pos.file ? current_pos.file->name : "<none>"; 2499*4882a593Smuzhiyun} 2500*4882a593Smuzhiyun 2501