?? lp_rlpt.inc
字號:
register int lpt_yy_is_jam; struct lpt_yyguts_t * lpt_yyg = (struct lpt_yyguts_t*)lpt_yyscanner; /* This var may be unused depending upon options. */ register char *lpt_yy_cp = lpt_yyg->lpt_yy_c_buf_p; register YY_CHAR lpt_yy_c = 1; if ( lpt_yy_accept[lpt_yy_current_state] ) { lpt_yyg->lpt_yy_last_accepting_state = lpt_yy_current_state; lpt_yyg->lpt_yy_last_accepting_cpos = lpt_yy_cp; } while ( lpt_yy_chk[lpt_yy_base[lpt_yy_current_state] + lpt_yy_c] != lpt_yy_current_state ) { lpt_yy_current_state = (int) lpt_yy_def[lpt_yy_current_state]; if ( lpt_yy_current_state >= 174 ) lpt_yy_c = lpt_yy_meta[(unsigned int) lpt_yy_c]; } lpt_yy_current_state = lpt_yy_nxt[lpt_yy_base[lpt_yy_current_state] + (unsigned int) lpt_yy_c]; lpt_yy_is_jam = (lpt_yy_current_state == 173); return lpt_yy_is_jam ? 0 : lpt_yy_current_state;} static void lpt_yyunput (int c, register char * lpt_yy_bp , lpt_yyscan_t lpt_yyscanner){ register char *lpt_yy_cp; struct lpt_yyguts_t * lpt_yyg = (struct lpt_yyguts_t*)lpt_yyscanner; lpt_yy_cp = lpt_yyg->lpt_yy_c_buf_p; /* undo effects of setting up lpt_yytext */ *lpt_yy_cp = lpt_yyg->lpt_yy_hold_char; if ( lpt_yy_cp < YY_CURRENT_BUFFER_LVALUE->lpt_yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = lpt_yyg->lpt_yy_n_chars + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->lpt_yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->lpt_yy_buf_size + 2]; register char *source = &YY_CURRENT_BUFFER_LVALUE->lpt_yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->lpt_yy_ch_buf ) *--dest = *--source; lpt_yy_cp += (int) (dest - source); lpt_yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->lpt_yy_n_chars = lpt_yyg->lpt_yy_n_chars = YY_CURRENT_BUFFER_LVALUE->lpt_yy_buf_size; if ( lpt_yy_cp < YY_CURRENT_BUFFER_LVALUE->lpt_yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--lpt_yy_cp = (char) c; if ( c == '\n' ){ --lpt_yylineno; } lpt_yyg->lpt_yytext_ptr = lpt_yy_bp; lpt_yyg->lpt_yy_hold_char = *lpt_yy_cp; lpt_yyg->lpt_yy_c_buf_p = lpt_yy_cp;}#ifndef YY_NO_INPUT#ifdef __cplusplus static int lpt_yyinput (lpt_yyscan_t lpt_yyscanner)#else static int input (lpt_yyscan_t lpt_yyscanner)#endif{ int c; struct lpt_yyguts_t * lpt_yyg = (struct lpt_yyguts_t*)lpt_yyscanner; *lpt_yyg->lpt_yy_c_buf_p = lpt_yyg->lpt_yy_hold_char; if ( *lpt_yyg->lpt_yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* lpt_yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( lpt_yyg->lpt_yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->lpt_yy_ch_buf[lpt_yyg->lpt_yy_n_chars] ) /* This was really a NUL. */ *lpt_yyg->lpt_yy_c_buf_p = '\0'; else { /* need more input */ int offset = lpt_yyg->lpt_yy_c_buf_p - lpt_yyg->lpt_yytext_ptr; ++lpt_yyg->lpt_yy_c_buf_p; switch ( lpt_yy_get_next_buffer( lpt_yyscanner ) ) { case EOB_ACT_LAST_MATCH: /* This happens because lpt_yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ lpt_yyrestart(lpt_yyin ,lpt_yyscanner); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( lpt_yywrap(lpt_yyscanner ) ) return EOF; if ( ! lpt_yyg->lpt_yy_did_buffer_switch_on_eof ) YY_NEW_FILE;#ifdef __cplusplus return lpt_yyinput(lpt_yyscanner);#else return input(lpt_yyscanner);#endif } case EOB_ACT_CONTINUE_SCAN: lpt_yyg->lpt_yy_c_buf_p = lpt_yyg->lpt_yytext_ptr + offset; break; } } } c = *(unsigned char *) lpt_yyg->lpt_yy_c_buf_p; /* cast for 8-bit char's */ *lpt_yyg->lpt_yy_c_buf_p = '\0'; /* preserve lpt_yytext */ lpt_yyg->lpt_yy_hold_char = *++lpt_yyg->lpt_yy_c_buf_p; YY_CURRENT_BUFFER_LVALUE->lpt_yy_at_bol = (c == '\n'); if ( YY_CURRENT_BUFFER_LVALUE->lpt_yy_at_bol ) do{ lpt_yylineno++; lpt_yycolumn=0; }while(0); return c;}#endif /* ifndef YY_NO_INPUT *//** Immediately switch to a different input stream. * @param input_file A readable stream. * @param lpt_yyscanner The scanner object. * @note This function does not reset the start condition to @c INITIAL . */ void lpt_yyrestart (FILE * input_file , lpt_yyscan_t lpt_yyscanner){ struct lpt_yyguts_t * lpt_yyg = (struct lpt_yyguts_t*)lpt_yyscanner; if ( ! YY_CURRENT_BUFFER ){ lpt_yyensure_buffer_stack (lpt_yyscanner); YY_CURRENT_BUFFER_LVALUE = lpt_yy_create_buffer(lpt_yyin,YY_BUF_SIZE ,lpt_yyscanner); } lpt_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,lpt_yyscanner); lpt_yy_load_buffer_state(lpt_yyscanner );}/** Switch to a different input buffer. * @param new_buffer The new input buffer. * @param lpt_yyscanner The scanner object. */ void lpt_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , lpt_yyscan_t lpt_yyscanner){ struct lpt_yyguts_t * lpt_yyg = (struct lpt_yyguts_t*)lpt_yyscanner; /* TODO. We should be able to replace this entire function body * with * lpt_yypop_buffer_state(); * lpt_yypush_buffer_state(new_buffer); */ lpt_yyensure_buffer_stack (lpt_yyscanner); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *lpt_yyg->lpt_yy_c_buf_p = lpt_yyg->lpt_yy_hold_char; YY_CURRENT_BUFFER_LVALUE->lpt_yy_buf_pos = lpt_yyg->lpt_yy_c_buf_p; YY_CURRENT_BUFFER_LVALUE->lpt_yy_n_chars = lpt_yyg->lpt_yy_n_chars; } YY_CURRENT_BUFFER_LVALUE = new_buffer; lpt_yy_load_buffer_state(lpt_yyscanner ); /* We don't actually know whether we did this switch during * EOF (lpt_yywrap()) processing, but the only time this flag * is looked at is after lpt_yywrap() is called, so it's safe * to go ahead and always set it. */ lpt_yyg->lpt_yy_did_buffer_switch_on_eof = 1;}static void lpt_yy_load_buffer_state (lpt_yyscan_t lpt_yyscanner){ struct lpt_yyguts_t * lpt_yyg = (struct lpt_yyguts_t*)lpt_yyscanner; lpt_yyg->lpt_yy_n_chars = YY_CURRENT_BUFFER_LVALUE->lpt_yy_n_chars; lpt_yyg->lpt_yytext_ptr = lpt_yyg->lpt_yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->lpt_yy_buf_pos; lpt_yyin = YY_CURRENT_BUFFER_LVALUE->lpt_yy_input_file; lpt_yyg->lpt_yy_hold_char = *lpt_yyg->lpt_yy_c_buf_p;}/** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * @param lpt_yyscanner The scanner object. * @return the allocated buffer state. */ YY_BUFFER_STATE lpt_yy_create_buffer (FILE * file, int size , lpt_yyscan_t lpt_yyscanner){ YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) lpt_yyalloc(sizeof( struct lpt_yy_buffer_state ) ,lpt_yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in lpt_yy_create_buffer()" ); b->lpt_yy_buf_size = size; /* lpt_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->lpt_yy_ch_buf = (char *) lpt_yyalloc(b->lpt_yy_buf_size + 2 ,lpt_yyscanner ); if ( ! b->lpt_yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in lpt_yy_create_buffer()" ); b->lpt_yy_is_our_buffer = 1; lpt_yy_init_buffer(b,file ,lpt_yyscanner); return b;}/** Destroy the buffer. * @param b a buffer created with lpt_yy_create_buffer() * @param lpt_yyscanner The scanner object. */ void lpt_yy_delete_buffer (YY_BUFFER_STATE b , lpt_yyscan_t lpt_yyscanner){ struct lpt_yyguts_t * lpt_yyg = (struct lpt_yyguts_t*)lpt_yyscanner; if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->lpt_yy_is_our_buffer ) lpt_yyfree((void *) b->lpt_yy_ch_buf ,lpt_yyscanner ); lpt_yyfree((void *) b ,lpt_yyscanner );}#ifndef __cplusplusextern int isatty (int );#endif /* __cplusplus */ /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a lpt_yyrestart() or at EOF. */ static void lpt_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , lpt_yyscan_t lpt_yyscanner){ int oerrno = errno; struct lpt_yyguts_t * lpt_yyg = (struct lpt_yyguts_t*)lpt_yyscanner; lpt_yy_flush_buffer(b ,lpt_yyscanner); b->lpt_yy_input_file = file; b->lpt_yy_fill_buffer = 1; /* If b is the current buffer, then lpt_yy_init_buffer was _probably_ * called from lpt_yyrestart() or through lpt_yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->lpt_yy_bs_lineno = 1; b->lpt_yy_bs_column = 0; } b->lpt_yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno;}/** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * @param lpt_yyscanner The scanner object. */ void lpt_yy_flush_buffer (YY_BUFFER_STATE b , lpt_yyscan_t lpt_yyscanner){ struct lpt_yyguts_t * lpt_yyg = (struct lpt_yyguts_t*)lpt_yyscanner; if ( ! b ) return; b->lpt_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->lpt_yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->lpt_yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->lpt_yy_buf_pos = &b->lpt_yy_ch_buf[0]; b->lpt_yy_at_bol = 1; b->lpt_yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) lpt_yy_load_buffer_state(lpt_yyscanner );}/** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * @param lpt_yyscanner The scanner object. */void lpt_yypush_buffer_state (YY_BUFFER_STATE new_buffer , lpt_yyscan_t lpt_yyscanner){ struct lpt_yyguts_t * lpt_yyg = (struct lpt_yyguts_t*)lpt_yyscanner; if (new_buffer == NULL) return; lpt_yyensure_buffer_stack(lpt_yyscanner); /* This block is copied from lpt_yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *lpt_yyg->lpt_yy_c_buf_p = lpt_yyg->lpt_yy_hold_char; YY_CURRENT_BUFFER_LVALUE->lpt_yy_buf_pos = lpt_yyg->lpt_yy_c_buf_p; YY_CURRENT_BUFFER_LVALUE->lpt_yy_n_chars = lpt_yyg->lpt_yy_n_chars; } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) lpt_yyg->lpt_yy_buffer_stack_top++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from lpt_yy_switch_to_buffer. */ lpt_yy_load_buffer_state(lpt_yyscanner ); lpt_yyg->lpt_yy_did_buffer_switch_on_eof = 1;}/** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * @param lpt_yyscanner The scanner object. */void lpt_yypop_buffer_state (lpt_yyscan_t lpt_yyscanner){ struct lpt_yyguts_t * lpt_yyg = (struct lpt_yyguts_t*)lpt_yyscanner; if (!YY_CURRENT_BUFFER) return; lpt_yy_delete_buffer(YY_CURRENT_BUFFER ,lpt_yyscanner); YY_CURRENT_BUFFER_LVALUE = NULL; if (lpt_yyg->lpt_yy_buffer_stack_top > 0) --lpt_yyg->lpt_yy_buffer_stack_top; if (YY_CURRENT_BUFFER) { lpt_yy_load_buffer_state(lpt_yyscanner ); lpt_yyg->lpt_yy_did_buffer_switch_on_eof = 1; }}/* Allocates the stack if it does not exist. * Guarantees space for at least one push. */static void lpt_yyensure_buffer_stack (lpt_yyscan_t lpt_yyscanner){ int num_to_alloc; struct lpt_yyguts_t * lpt_yyg = (struct lpt_yyguts_t*)lpt_yyscanner; if (!lpt_yyg->lpt_yy_buffer_stack) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; lpt_yyg->lpt_yy_buffer_stack = (struct lpt_yy_buffer_state**)lpt_yyalloc (num_to_alloc * sizeof(struct lpt_yy_buffer_state*) , lpt_yyscanner); if ( ! lpt_yyg->lpt_yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in lpt_yyensure_buffer_stack()" ); memset(lpt_yyg->lpt_yy_buffer_stack, 0, num_to_alloc * sizeof(struct lpt_yy_buffer_state*)); lpt_yyg->lpt_yy_buffer_stack_max = num_to_alloc; lpt_yyg->lpt_yy_b
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -