?? ael_lex.c
字號:
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c); BEGIN(0); yylval->str = malloc(yyleng+1); strncpy(yylval->str, yytext, yyleng); yylval->str[yyleng] = 0; return word; } yymore(); } YY_BREAKcase 61:/* rule 61 can match eol */YY_RULE_SETUP#line 371 "ael.flex"{ if ( pbcpop3(']') ) { /* error */ STORE_LOC; ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext); BEGIN(0); yylval->str = malloc(yyleng+1); strncpy(yylval->str, yytext, yyleng); yylval->str[yyleng] = 0; return word; } parencount3--; if ( parencount3 >= 0) { yymore(); } else { BEGIN(wordstate); /* Finished with the current ${} construct. Return to word gathering state */ yymore(); } } YY_BREAKcase 62:/* rule 62 can match eol */YY_RULE_SETUP#line 390 "ael.flex"{ char c = yytext[yyleng-1]; if (c == '[') parencount3++; pbcpush3(c); yymore(); } YY_BREAKcase 63:/* rule 63 can match eol */YY_RULE_SETUP#line 398 "ael.flex"{ char c = yytext[yyleng-1]; if ( pbcpop3(c)) { /* error */ STORE_LOC; ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c); BEGIN(0); yylval->str = malloc(yyleng+1); strncpy(yylval->str, yytext, yyleng); yylval->str[yyleng] = 0; return word; } yymore(); } YY_BREAK/* * context used for arguments of if_head, random_head, switch_head, * for (last statement), while (XXX why not iftime_head ?). * End with the matching parentheses. * A comma at the top level is valid here, unlike in argg where it * is an argument separator so it must be returned as a token. */case 64:/* rule 64 can match eol */YY_RULE_SETUP#line 421 "ael.flex"{ if ( pbcpop(')') ) { /* error */ STORE_LOC; ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext); BEGIN(0); yylval->str = malloc(yyleng+1); strncpy(yylval->str, yytext, yyleng); yylval->str[yyleng] = 0; prev_word = 0; return word; } parencount--; if ( parencount >= 0) { yymore(); } else { STORE_LOC; yylval->str = malloc(yyleng); strncpy(yylval->str, yytext, yyleng); yylval->str[yyleng-1] = 0; unput(')'); BEGIN(0); return word; } } YY_BREAKcase 65:/* rule 65 can match eol */YY_RULE_SETUP#line 446 "ael.flex"{ char c = yytext[yyleng-1]; if (c == '(') parencount++; pbcpush(c); yymore(); } YY_BREAKcase 66:/* rule 66 can match eol */YY_RULE_SETUP#line 454 "ael.flex"{ char c = yytext[yyleng-1]; if ( pbcpop(c)) { /* error */ STORE_LOC; ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c); BEGIN(0); yylval->str = malloc(yyleng+1); strncpy(yylval->str, yytext, yyleng); yylval->str[yyleng] = 0; return word; } yymore(); } YY_BREAK/* * handlers for arguments to a macro or application calls. * We enter this context when we find the initial '(' and * stay here until we close all matching parentheses, * and find the comma (argument separator) or the closing ')' * of the (external) call, which happens when parencount == 0 * before the decrement. */case 67:/* rule 67 can match eol */YY_RULE_SETUP#line 478 "ael.flex"{ char c = yytext[yyleng-1]; if (c == '(') parencount++; pbcpush(c); yymore(); } YY_BREAKcase 68:/* rule 68 can match eol */YY_RULE_SETUP#line 486 "ael.flex"{ if ( pbcpop(')') ) { /* error */ STORE_LOC; ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression!\n", my_file, my_lineno, my_col); BEGIN(0); yylval->str = malloc(yyleng+1); strncpy(yylval->str, yytext, yyleng); yylval->str[yyleng] = 0; return word; } parencount--; if( parencount >= 0){ yymore(); } else { STORE_LOC; BEGIN(0); if ( !strcmp(yytext, ")") ) return RP; yylval->str = malloc(yyleng); strncpy(yylval->str, yytext, yyleng); yylval->str[yyleng-1] = '\0'; /* trim trailing ')' */ unput(')'); return word; } } YY_BREAKcase 69:/* rule 69 can match eol */YY_RULE_SETUP#line 513 "ael.flex"{ if( parencount != 0) { /* ast_log(LOG_NOTICE,"Folding in a comma!\n"); */ yymore(); } else { STORE_LOC; if( !strcmp(yytext,"," ) ) return COMMA; yylval->str = malloc(yyleng); strncpy(yylval->str, yytext, yyleng); yylval->str[yyleng-1] = '\0'; /* trim trailing ',' */ unput(','); return word; } } YY_BREAKcase 70:/* rule 70 can match eol */YY_RULE_SETUP#line 528 "ael.flex"{ char c = yytext[yyleng-1]; if ( pbcpop(c) ) { /* error */ STORE_LOC; ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c); BEGIN(0); yylval->str = malloc(yyleng+1); strncpy(yylval->str, yytext, yyleng); yylval->str[yyleng] = '\0'; return word; } yymore(); } YY_BREAK/* * context used to find tokens in the right hand side of assignments, * or in the first and second operand of a 'for'. As above, match * commas and use ';' as a separator (hence return it as a separate token). */case 71:/* rule 71 can match eol */YY_RULE_SETUP#line 547 "ael.flex"{ char c = yytext[yyleng-1]; yymore(); pbcpush(c); } YY_BREAKcase 72:/* rule 72 can match eol */YY_RULE_SETUP#line 553 "ael.flex"{ char c = yytext[yyleng-1]; if ( pbcpop(c) ) { /* error */ STORE_LOC; ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c); BEGIN(0); yylval->str = malloc(yyleng+1); strncpy(yylval->str, yytext, yyleng); yylval->str[yyleng] = '\0'; return word; } yymore(); } YY_BREAKcase 73:/* rule 73 can match eol */YY_RULE_SETUP#line 567 "ael.flex"{ STORE_LOC; yylval->str = malloc(yyleng); strncpy(yylval->str, yytext, yyleng); yylval->str[yyleng-1] = '\0'; /* trim trailing ';' */ unput(';'); BEGIN(0); return word; } YY_BREAKcase 74:/* rule 74 can match eol */YY_RULE_SETUP#line 577 "ael.flex"{ char fnamebuf[1024],*p1,*p2; int glob_ret; glob_t globbuf; /* the current globbuf */ int globbuf_pos = -1; /* where we are in the current globbuf */ globbuf.gl_offs = 0; /* initialize it to silence gcc */ p1 = strchr(yytext,'"'); p2 = strrchr(yytext,'"'); if ( include_stack_index >= MAX_INCLUDE_DEPTH ) { ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Includes nested too deeply! Wow!!! How did you do that?\n", my_file, my_lineno, my_col); } else if ( (int)(p2-p1) > sizeof(fnamebuf) - 1 ) { ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Filename is incredibly way too long (%d chars!). Inclusion ignored!\n", my_file, my_lineno, my_col, yyleng - 10); } else { strncpy(fnamebuf, p1+1, p2-p1-1); fnamebuf[p2-p1-1] = 0; if (fnamebuf[0] != '/') { char fnamebuf2[1024]; snprintf(fnamebuf2,sizeof(fnamebuf2), "%s/%s", (char *)ast_config_AST_CONFIG_DIR, fnamebuf); ast_copy_string(fnamebuf,fnamebuf2,sizeof(fnamebuf)); }#ifdef SOLARIS glob_ret = glob(fnamebuf, GLOB_NOCHECK, NULL, &globbuf);#else glob_ret = glob(fnamebuf, GLOB_NOMAGIC|GLOB_BRACE, NULL, &globbuf);#endif if (glob_ret == GLOB_NOSPACE) { ast_log(LOG_WARNING, "Glob Expansion of pattern '%s' failed: Not enough memory\n", fnamebuf); } else if (glob_ret == GLOB_ABORTED) { ast_log(LOG_WARNING, "Glob Expansion of pattern '%s' failed: Read error\n", fnamebuf); } else if (glob_ret == GLOB_NOMATCH) { ast_log(LOG_WARNING, "Glob Expansion of pattern '%s' failed: No matches!\n", fnamebuf); } else { globbuf_pos = 0; } } if (globbuf_pos > -1) { setup_filestack(fnamebuf, sizeof(fnamebuf), &globbuf, 0, yyscanner, 1); } } YY_BREAKcase YY_STATE_EOF(INITIAL):case YY_STATE_EOF(paren):case YY_STATE_EOF(semic):case YY_STATE_EOF(argg):case YY_STATE_EOF(comment):case YY_STATE_EOF(curlystate):case YY_STATE_EOF(wordstate):case YY_STATE_EOF(brackstate):#line 622 "ael.flex"{ char fnamebuf[2048]; if (include_stack_index > 0 && include_stack[include_stack_index-1].globbuf_pos < include_stack[include_stack_index-1].globbuf.gl_pathc-1) { ael_yy_delete_buffer(YY_CURRENT_BUFFER,yyscanner ); include_stack[include_stack_index-1].globbuf_pos++; setup_filestack(fnamebuf, sizeof(fnamebuf), &include_stack[include_stack_index-1].globbuf, include_stack[include_stack_index-1].globbuf_pos, yyscanner, 0); /* finish this */ } else { if (include_stack[include_stack_index].fname) { free(include_stack[include_stack_index].fname); include_stack[include_stack_index].fname = 0; } if (my_file) { free(my_file); my_file = 0; } if ( --include_stack_index < 0 ) { yyterminate(); } else { globfree(&include_stack[include_stack_index].globbuf); include_stack[include_stack_index].globbuf_pos = -1; ael_yy_delete_buffer(YY_CURRENT_BUFFER,yyscanner ); ael_yy_switch_to_buffer(include_stack[include_stack_index].bufstate,yyscanner ); my_lineno = include_stack[include_stack_index].lineno; my_col = include_stack[include_stack_index].colno; my_file = strdup(include_stack[include_stack_index].fname); } } } YY_BREAKcase 75:/* rule 75 can match eol */YY_RULE_SETUP#line 654 "ael.flex"{ /* default rule */ ast_log(LOG_ERROR,"Unhandled char(s): %s\n", yytext); } YY_BREAKcase 76:YY_RULE_SETUP#line 656 "ael.flex"YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK#line 2040 "ael_lex.c" case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yyg->yy_hold_char; YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * ael_yylex(). If so, then 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 source. */ yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* 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 ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) { /* This was really a NUL. */ yy_state_type yy_next_state; yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( yyscanner ); /* 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
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -