📄 initscan.c
字号:
# line 408 "scan.l"return ','; YY_BREAKcase 79:YY_USER_ACTION# line 409 "scan.l"BEGIN(SECT2); return '}'; YY_BREAKcase 80:YY_USER_ACTION# line 411 "scan.l"{ synerr( "bad character inside {}'s" ); BEGIN(SECT2); return '}'; } YY_BREAKcase 81:YY_USER_ACTION# line 417 "scan.l"{ synerr( "missing }" ); BEGIN(SECT2); ++linenum; return '}'; } YY_BREAKcase 82:YY_USER_ACTION# line 425 "scan.l"synerr( "bad name in {}'s" ); BEGIN(SECT2); YY_BREAKcase 83:YY_USER_ACTION# line 426 "scan.l"synerr( "missing }" ); ++linenum; BEGIN(SECT2); YY_BREAKcase 84:YY_USER_ACTION# line 429 "scan.l"ACTION_ECHO; BEGIN(ACTION_COMMENT); YY_BREAKcase 85:YY_USER_ACTION# line 430 "scan.l"bracelevel = 0; YY_BREAKcase 86:YY_USER_ACTION# line 431 "scan.l"{ ACTION_ECHO; CHECK_REJECT(yytext); } YY_BREAKcase 87:YY_USER_ACTION# line 435 "scan.l"{ ACTION_ECHO; CHECK_YYMORE(yytext); } YY_BREAKcase 88:YY_USER_ACTION# line 439 "scan.l"ACTION_ECHO; YY_BREAKcase 89:YY_USER_ACTION# line 440 "scan.l"{ ++linenum; ACTION_ECHO; if ( bracelevel == 0 || (doing_codeblock && indented_code) ) { if ( ! doing_codeblock ) add_action( "\tYY_BREAK\n" ); doing_codeblock = false; BEGIN(SECT2); } } YY_BREAK /* Reject and YYmore() are checked for above, in PERCENT_BRACE_ACTION */case 90:YY_USER_ACTION# line 456 "scan.l"ACTION_ECHO; ++bracelevel; YY_BREAKcase 91:YY_USER_ACTION# line 457 "scan.l"ACTION_ECHO; --bracelevel; YY_BREAKcase 92:YY_USER_ACTION# line 458 "scan.l"ACTION_ECHO; YY_BREAKcase 93:YY_USER_ACTION# line 459 "scan.l"ACTION_ECHO; YY_BREAKcase 94:YY_USER_ACTION# line 460 "scan.l"ACTION_ECHO; BEGIN(ACTION_COMMENT); YY_BREAKcase 95:YY_USER_ACTION# line 461 "scan.l"ACTION_ECHO; /* character constant */ YY_BREAKcase 96:YY_USER_ACTION# line 462 "scan.l"ACTION_ECHO; BEGIN(ACTION_STRING); YY_BREAKcase 97:YY_USER_ACTION# line 463 "scan.l"{ ++linenum; ACTION_ECHO; if ( bracelevel == 0 ) { add_action( "\tYY_BREAK\n" ); BEGIN(SECT2); } } YY_BREAKcase 98:YY_USER_ACTION# line 472 "scan.l"ACTION_ECHO; YY_BREAKcase 99:YY_USER_ACTION# line 474 "scan.l"{ ACTION_ECHO; if ( doing_codeblock ) BEGIN(CODEBLOCK_2); else BEGIN(ACTION); } YY_BREAKcase 100:YY_USER_ACTION# line 482 "scan.l"ACTION_ECHO; YY_BREAKcase 101:YY_USER_ACTION# line 483 "scan.l"ACTION_ECHO; YY_BREAKcase 102:YY_USER_ACTION# line 484 "scan.l"++linenum; ACTION_ECHO; YY_BREAKcase 103:YY_USER_ACTION# line 486 "scan.l"ACTION_ECHO; YY_BREAKcase 104:YY_USER_ACTION# line 487 "scan.l"ACTION_ECHO; YY_BREAKcase 105:YY_USER_ACTION# line 488 "scan.l"++linenum; ACTION_ECHO; YY_BREAKcase 106:YY_USER_ACTION# line 489 "scan.l"ACTION_ECHO; BEGIN(ACTION); YY_BREAKcase 107:YY_USER_ACTION# line 490 "scan.l"ACTION_ECHO; YY_BREAKcase YY_STATE_EOF(ACTION):case YY_STATE_EOF(ACTION_COMMENT):case YY_STATE_EOF(ACTION_STRING):# line 492 "scan.l"{ synerr( "EOF encountered inside an action" ); yyterminate(); } YY_BREAKcase 108:YY_USER_ACTION# line 498 "scan.l"{ yylval = myesc( (Char *) yytext ); return CHAR; } YY_BREAKcase 109:YY_USER_ACTION# line 503 "scan.l"{ yylval = myesc( (Char *) yytext ); BEGIN(CCL); return CHAR; } YY_BREAKcase 110:YY_USER_ACTION# line 510 "scan.l"ECHO; YY_BREAKcase YY_STATE_EOF(SECT3):# line 511 "scan.l"sectnum = 0; yyterminate(); YY_BREAKcase 111:YY_USER_ACTION# line 513 "scan.l"format_synerr( "bad character: %s", yytext ); YY_BREAKcase 112:YY_USER_ACTION# line 515 "scan.l"YY_FATAL_ERROR( "lex scanner jammed" ); YY_BREAKcase YY_STATE_EOF(INITIAL):case YY_STATE_EOF(SECT2):case YY_STATE_EOF(CODEBLOCK):case YY_STATE_EOF(PICKUPDEF):case YY_STATE_EOF(SC):case YY_STATE_EOF(CARETISBOL):case YY_STATE_EOF(NUM):case YY_STATE_EOF(QUOTE):case YY_STATE_EOF(FIRSTCCL):case YY_STATE_EOF(CCL):case YY_STATE_EOF(RECOVER):case YY_STATE_EOF(BRACEERROR):case YY_STATE_EOF(C_COMMENT):case YY_STATE_EOF(PERCENT_BRACE_ACTION):case YY_STATE_EOF(USED_LIST):case YY_STATE_EOF(CODEBLOCK_2): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = yy_cp - yytext_ptr - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yy_hold_char; if ( yy_current_buffer->yy_input_file != yyin ) { /* This can happen if we scan a file, yywrap() returns * 1, and then later the user points yyin at a new * file to resume scanning. We have to assure * consistency between yy_current_buffer and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input file. */ yy_current_buffer->yy_input_file = yyin; yy_n_chars = yy_current_buffer->yy_n_chars; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) { /* This was really a NUL. */ yy_state_type yy_next_state; yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = yytext_ptr + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++yy_c_buf_p; yy_current_state = yy_next_state; goto yy_match; } else { goto yy_find_action; } } else switch ( yy_get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { yy_did_buffer_switch_on_eof = 0; if ( yywrap() ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: yy_c_buf_p = &yy_current_buffer->yy_ch_buf[yy_n_chars]; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex *//* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */static int yy_get_next_buffer() { register char *dest = yy_current_buffer->yy_ch_buf; register char *source = yytext_ptr - 1; /* copy prev. char, too */ register int number_to_move, i; int ret_val; if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( yy_current_buffer->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a singled characater, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = yy_c_buf_p - yytext_ptr; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( yy_current_buffer->yy_eof_status !=
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -