📄 bootscanner.c
字号:
if ( Int_yywrap() ) return EOF; if ( ! Int_yy_did_buffer_switch_on_eof ) YY_NEW_FILE;#ifdef __cplusplus return Int_yyinput();#else return input();#endif } case EOB_ACT_CONTINUE_SCAN: Int_yy_c_buf_p = Int_yytext_ptr + offset; break; } } } c = *(unsigned char *) Int_yy_c_buf_p; /* cast for 8-bit char's */ *Int_yy_c_buf_p = '\0'; /* preserve Int_yytext */ Int_yy_hold_char = *++Int_yy_c_buf_p; Int_yy_current_buffer->Int_yy_at_bol = (c == '\n'); return c; }#ifdef YY_USE_PROTOSvoid Int_yyrestart( FILE *input_file )#elsevoid Int_yyrestart( input_file )FILE *input_file;#endif { if ( ! Int_yy_current_buffer ) Int_yy_current_buffer = Int_yy_create_buffer( Int_yyin, YY_BUF_SIZE ); Int_yy_init_buffer( Int_yy_current_buffer, input_file ); Int_yy_load_buffer_state(); }#ifdef YY_USE_PROTOSvoid Int_yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )#elsevoid Int_yy_switch_to_buffer( new_buffer )YY_BUFFER_STATE new_buffer;#endif { if ( Int_yy_current_buffer == new_buffer ) return; if ( Int_yy_current_buffer ) { /* Flush out information for old buffer. */ *Int_yy_c_buf_p = Int_yy_hold_char; Int_yy_current_buffer->Int_yy_buf_pos = Int_yy_c_buf_p; Int_yy_current_buffer->Int_yy_n_chars = Int_yy_n_chars; } Int_yy_current_buffer = new_buffer; Int_yy_load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (Int_yywrap()) processing, but the only time this flag * is looked at is after Int_yywrap() is called, so it's safe * to go ahead and always set it. */ Int_yy_did_buffer_switch_on_eof = 1; }#ifdef YY_USE_PROTOSvoid Int_yy_load_buffer_state( void )#elsevoid Int_yy_load_buffer_state()#endif { Int_yy_n_chars = Int_yy_current_buffer->Int_yy_n_chars; Int_yytext_ptr = Int_yy_c_buf_p = Int_yy_current_buffer->Int_yy_buf_pos; Int_yyin = Int_yy_current_buffer->Int_yy_input_file; Int_yy_hold_char = *Int_yy_c_buf_p; }#ifdef YY_USE_PROTOSYY_BUFFER_STATE Int_yy_create_buffer( FILE *file, int size )#elseYY_BUFFER_STATE Int_yy_create_buffer( file, size )FILE *file;int size;#endif { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) Int_yy_flex_alloc( sizeof( struct Int_yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in Int_yy_create_buffer()" ); b->Int_yy_buf_size = size; /* Int_yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->Int_yy_ch_buf = (char *) Int_yy_flex_alloc( b->Int_yy_buf_size + 2 ); if ( ! b->Int_yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in Int_yy_create_buffer()" ); b->Int_yy_is_our_buffer = 1; Int_yy_init_buffer( b, file ); return b; }#ifdef YY_USE_PROTOSvoid Int_yy_delete_buffer( YY_BUFFER_STATE b )#elsevoid Int_yy_delete_buffer( b )YY_BUFFER_STATE b;#endif { if ( ! b ) return; if ( b == Int_yy_current_buffer ) Int_yy_current_buffer = (YY_BUFFER_STATE) 0; if ( b->Int_yy_is_our_buffer ) Int_yy_flex_free( (void *) b->Int_yy_ch_buf ); Int_yy_flex_free( (void *) b ); }#ifndef YY_ALWAYS_INTERACTIVE#ifndef YY_NEVER_INTERACTIVEextern int isatty YY_PROTO(( int ));#endif#endif#ifdef YY_USE_PROTOSvoid Int_yy_init_buffer( YY_BUFFER_STATE b, FILE *file )#elsevoid Int_yy_init_buffer( b, file )YY_BUFFER_STATE b;FILE *file;#endif { Int_yy_flush_buffer( b ); b->Int_yy_input_file = file; b->Int_yy_fill_buffer = 1;#if YY_ALWAYS_INTERACTIVE b->Int_yy_is_interactive = 1;#else#if YY_NEVER_INTERACTIVE b->Int_yy_is_interactive = 0;#else b->Int_yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;#endif#endif }#ifdef YY_USE_PROTOSvoid Int_yy_flush_buffer( YY_BUFFER_STATE b )#elsevoid Int_yy_flush_buffer( b )YY_BUFFER_STATE b;#endif { if ( ! b ) return; b->Int_yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->Int_yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->Int_yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->Int_yy_buf_pos = &b->Int_yy_ch_buf[0]; b->Int_yy_at_bol = 1; b->Int_yy_buffer_status = YY_BUFFER_NEW; if ( b == Int_yy_current_buffer ) Int_yy_load_buffer_state(); }#ifndef YY_NO_SCAN_BUFFER#ifdef YY_USE_PROTOSYY_BUFFER_STATE Int_yy_scan_buffer( char *base, Int_yy_size_t size )#elseYY_BUFFER_STATE Int_yy_scan_buffer( base, size )char *base;Int_yy_size_t size;#endif { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) Int_yy_flex_alloc( sizeof( struct Int_yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in Int_yy_scan_buffer()" ); b->Int_yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->Int_yy_buf_pos = b->Int_yy_ch_buf = base; b->Int_yy_is_our_buffer = 0; b->Int_yy_input_file = 0; b->Int_yy_n_chars = b->Int_yy_buf_size; b->Int_yy_is_interactive = 0; b->Int_yy_at_bol = 1; b->Int_yy_fill_buffer = 0; b->Int_yy_buffer_status = YY_BUFFER_NEW; Int_yy_switch_to_buffer( b ); return b; }#endif#ifndef YY_NO_SCAN_STRING#ifdef YY_USE_PROTOSYY_BUFFER_STATE Int_yy_scan_string( Int_yyconst char *Int_yy_str )#elseYY_BUFFER_STATE Int_yy_scan_string( Int_yy_str )Int_yyconst char *Int_yy_str;#endif { int len; for ( len = 0; Int_yy_str[len]; ++len ) ; return Int_yy_scan_bytes( Int_yy_str, len ); }#endif#ifndef YY_NO_SCAN_BYTES#ifdef YY_USE_PROTOSYY_BUFFER_STATE Int_yy_scan_bytes( Int_yyconst char *bytes, int len )#elseYY_BUFFER_STATE Int_yy_scan_bytes( bytes, len )Int_yyconst char *bytes;int len;#endif { YY_BUFFER_STATE b; char *buf; Int_yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; buf = (char *) Int_yy_flex_alloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in Int_yy_scan_bytes()" ); for ( i = 0; i < len; ++i ) buf[i] = bytes[i]; buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; b = Int_yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in Int_yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->Int_yy_is_our_buffer = 1; return b; }#endif#ifndef YY_NO_PUSH_STATE#ifdef YY_USE_PROTOSstatic void Int_yy_push_state( int new_state )#elsestatic void Int_yy_push_state( new_state )int new_state;#endif { if ( Int_yy_start_stack_ptr >= Int_yy_start_stack_depth ) { Int_yy_size_t new_size; Int_yy_start_stack_depth += YY_START_STACK_INCR; new_size = Int_yy_start_stack_depth * sizeof( int ); if ( ! Int_yy_start_stack ) Int_yy_start_stack = (int *) Int_yy_flex_alloc( new_size ); else Int_yy_start_stack = (int *) Int_yy_flex_realloc( (void *) Int_yy_start_stack, new_size ); if ( ! Int_yy_start_stack ) YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); } Int_yy_start_stack[Int_yy_start_stack_ptr++] = YY_START; BEGIN(new_state); }#endif#ifndef YY_NO_POP_STATEstatic void Int_yy_pop_state() { if ( --Int_yy_start_stack_ptr < 0 ) YY_FATAL_ERROR( "start-condition stack underflow" ); BEGIN(Int_yy_start_stack[Int_yy_start_stack_ptr]); }#endif#ifndef YY_NO_TOP_STATEstatic int Int_yy_top_state() { return Int_yy_start_stack[Int_yy_start_stack_ptr - 1]; }#endif#ifndef YY_EXIT_FAILURE#define YY_EXIT_FAILURE 2#endif#ifdef YY_USE_PROTOSstatic void Int_yy_fatal_error( Int_yyconst char msg[] )#elsestatic void Int_yy_fatal_error( msg )char msg[];#endif { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); }/* Redefine Int_yyless() so it works in section 3 code. */#undef Int_yyless#define Int_yyless(n) \ do \ { \ /* Undo effects of setting up Int_yytext. */ \ Int_yytext[Int_yyleng] = Int_yy_hold_char; \ Int_yy_c_buf_p = Int_yytext + n; \ Int_yy_hold_char = *Int_yy_c_buf_p; \ *Int_yy_c_buf_p = '\0'; \ Int_yyleng = n; \ } \ while ( 0 )/* Internal utility routines. */#ifndef Int_yytext_ptr#ifdef YY_USE_PROTOSstatic void Int_yy_flex_strncpy( char *s1, Int_yyconst char *s2, int n )#elsestatic void Int_yy_flex_strncpy( s1, s2, n )char *s1;Int_yyconst char *s2;int n;#endif { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; }#endif#ifdef YY_NEED_STRLEN#ifdef YY_USE_PROTOSstatic int Int_yy_flex_strlen( Int_yyconst char *s )#elsestatic int Int_yy_flex_strlen( s )Int_yyconst char *s;#endif { register int n; for ( n = 0; s[n]; ++n ) ; return n; }#endif#ifdef YY_USE_PROTOSstatic void *Int_yy_flex_alloc( Int_yy_size_t size )#elsestatic void *Int_yy_flex_alloc( size )Int_yy_size_t size;#endif { return (void *) malloc( size ); }#ifdef YY_USE_PROTOSstatic void *Int_yy_flex_realloc( void *ptr, Int_yy_size_t size )#elsestatic void *Int_yy_flex_realloc( ptr, size )void *ptr;Int_yy_size_t size;#endif { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); }#ifdef YY_USE_PROTOSstatic void Int_yy_flex_free( void *ptr )#elsestatic void Int_yy_flex_free( ptr )void *ptr;#endif { free( ptr ); }#if YY_MAINint main() { Int_yylex(); return 0; }#endif#line 135 "bootscanner.l"voidInt_yyerror(const char *message){ elog(ERROR, "%s at line %d", message, Int_yyline);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -