📄 exlbrowser.c
字号:
} YY_BREAKcase 5:YY_RULE_SETUP#line 257 "exlbrowser.l"{ #if MATCH_DUMP matched_pattern("\\*+[^\\*/\\n]*\\n", yytext); #endif #if COMMENT_DUMP fprintf(stderr, "comment(4) \"%s\", %d\n", yytext, yyleng); #endif mode_buff.append( &mode_buff, yytext, yyleng ); sn_advance_line(); sn_reset_column(); } YY_BREAKcase 6:YY_RULE_SETUP#line 271 "exlbrowser.l"{ #if MATCH_DUMP matched_pattern("\\*+/", yytext); #endif /* Include multiple '*' characters in the comment */ if (yyleng > 2) { int to_append = yyleng; char *comment = (char *) yytext + yyleng - 1; assert(*comment == '/'); comment--; assert(*comment == '*'); *comment = '0'; to_append -= 2; mode_buff.append( &mode_buff, yytext, to_append ); } emit_comment(); sn_advance_column(yyleng); BEGIN(EXAMPLE); } YY_BREAK/* Uncomment the next rule if you want to check to make sure * the above rules cover all possible input. A warning * "rule cannot be matched" should be printed by flex. *//*. {}*/case 7:YY_RULE_SETUP#line 300 "exlbrowser.l"{#if MATCH_DUMP matched_pattern("\\\"\\\"", yytext);#endif /* FIXME: Can we pass NULL instead of "" after length issues worked out ? */ append_dqstring_token("", sn_line(), sn_column(), sn_line(), sn_column() + yyleng); sn_advance_column(yyleng);} YY_BREAKcase 8:YY_RULE_SETUP#line 313 "exlbrowser.l"{#if MATCH_DUMP matched_pattern("\\\"", yytext);#endif#if DQSTRING_DUMP fprintf(stderr, "dqstring started at (%d.%d)\n", sn_line(), sn_column());#endif LongStringInit(&mode_buff,0); mode_start_line = sn_line(); mode_start_column = sn_column(); sn_advance_column(yyleng); BEGIN(DQSTRING);} YY_BREAKcase 9:YY_RULE_SETUP#line 329 "exlbrowser.l"{ #if MATCH_DUMP matched_pattern("[^\\\"\\n]*", yytext); #endif #if DQSTRING_DUMP fprintf(stderr, "dqstring(1) \"%s\", %d\n", yytext, yyleng); #endif mode_buff.append( &mode_buff, yytext, yyleng ); sn_advance_column(yyleng); } YY_BREAKcase 10:YY_RULE_SETUP#line 341 "exlbrowser.l"{ #if MATCH_DUMP matched_pattern("[^\\\"\\n]*\\n", yytext); #endif #if DQSTRING_DUMP fprintf(stderr, "dqstring(2) \"%s\", %d\n", yytext, yyleng); #endif mode_buff.append( &mode_buff, yytext, yyleng ); sn_advance_line(); sn_reset_column(); } YY_BREAKcase 11:YY_RULE_SETUP#line 354 "exlbrowser.l"{ #if MATCH_DUMP matched_pattern("(\\\")+", yytext); #endif #if DQSTRING_DUMP fprintf(stderr, "dqstring(3) \"%s\", %d\n", yytext, yyleng); #endif mode_buff.append( &mode_buff, yytext, yyleng ); sn_advance_column(yyleng); } YY_BREAKcase 12:YY_RULE_SETUP#line 367 "exlbrowser.l"{ #if MATCH_DUMP matched_pattern("\\\"", yytext); #endif sn_advance_column(yyleng); emit_dqstring(); BEGIN(EXAMPLE); } YY_BREAK/* Uncomment the next rule if you want to check to make sure * the above rules cover all possible input. A warning * "rule cannot be matched" should be printed by flex. *//*. {}*/case 13:YY_RULE_SETUP#line 383 "exlbrowser.l"{#if MATCH_DUMP matched_pattern("(", yytext);#endif append_token(OPEN_PAREN, NULL, sn_line(), sn_column(), sn_line(), sn_column() + yyleng); sn_advance_column(yyleng);} YY_BREAKcase 14:YY_RULE_SETUP#line 396 "exlbrowser.l"{#if MATCH_DUMP matched_pattern(")", yytext);#endif append_token(CLOSE_PAREN, NULL, sn_line(), sn_column(), sn_line(), sn_column() + yyleng); sn_advance_column(yyleng);} YY_BREAKcase 15:YY_RULE_SETUP#line 408 "exlbrowser.l"{#if MATCH_DUMP matched_pattern("{", yytext);#endif append_token(OPEN_BRACE, NULL, sn_line(), sn_column(), sn_line(), sn_column() + yyleng); sn_advance_column(yyleng);} YY_BREAKcase 16:YY_RULE_SETUP#line 420 "exlbrowser.l"{#if MATCH_DUMP matched_pattern("}", yytext);#endif append_token(CLOSE_BRACE, NULL, sn_line(), sn_column(), sn_line(), sn_column() + yyleng); sn_advance_column(yyleng);} YY_BREAKcase 17:YY_RULE_SETUP#line 432 "exlbrowser.l"{#if MATCH_DUMP matched_pattern(";", yytext);#endif append_token(SEMICOLON, NULL, sn_line(), sn_column(), sn_line(), sn_column() + yyleng); sn_advance_column(yyleng);} YY_BREAKcase 18:YY_RULE_SETUP#line 444 "exlbrowser.l"{#if MATCH_DUMP matched_pattern("=", yytext);#endif append_token(ASSIGNMENT_OPERATOR, NULL, sn_line(), sn_column(), sn_line(), sn_column() + yyleng); sn_advance_column(yyleng);} YY_BREAKcase 19:YY_RULE_SETUP#line 456 "exlbrowser.l"{#if MATCH_DUMP matched_pattern("declare", yytext);#endif append_token(DECLARE_KEYWORD, NULL, sn_line(), sn_column(), sn_line(), sn_column() + yyleng); sn_advance_column(yyleng);} YY_BREAKcase 20:YY_RULE_SETUP#line 469 "exlbrowser.l"{#if MATCH_DUMP matched_pattern("global", yytext);#endif append_token(GLOBAL_KEYWORD, NULL, sn_line(), sn_column(), sn_line(), sn_column() + yyleng); sn_advance_column(yyleng);} YY_BREAKcase 21:YY_RULE_SETUP#line 481 "exlbrowser.l"{#if MATCH_DUMP matched_pattern("return", yytext);#endif append_token(KEYWORD, yytext, sn_line(), sn_column(), sn_line(), sn_column() + yyleng); sn_advance_column(yyleng);} YY_BREAKcase 22:YY_RULE_SETUP#line 493 "exlbrowser.l"{#if MATCH_DUMP matched_pattern("{literal}", yytext);#endif append_token(LITERAL, yytext, sn_line(), sn_column(), sn_line(), sn_column() + yyleng); sn_advance_column(yyleng);} YY_BREAKcase 23:YY_RULE_SETUP#line 505 "exlbrowser.l"{#if MATCH_DUMP matched_pattern("{someword}", yytext);#endif append_token(SOMEWORD, yytext, sn_line(), sn_column(), sn_line(), sn_column() + yyleng); sn_advance_column(yyleng);} YY_BREAKcase 24:YY_RULE_SETUP#line 518 "exlbrowser.l"{ char* x, *y; #if MATCH_DUMP matched_pattern("{wsn}+", yytext); #endif for (x=yytext, y=NULL; *x ; x++) { if (*x == '\n') { y=x+1; sn_advance_line(); } } if (y == NULL) { sn_advance_column(yyleng); } else { sn_reset_column(); sn_advance_column(x-y); }} YY_BREAKcase 25:YY_RULE_SETUP#line 538 "exlbrowser.l"{#if MATCH_DUMP matched_pattern(".", yytext);#endif /* Add an UNKNOWN token for each * character that we don't know * how to deal with. */ append_token(UNKNOWN, yytext, sn_line(), sn_column(), sn_line(), sn_column() + yyleng); /*fprintf(stderr, "adding unknown token for \"%s\"\n", yytext);*/ sn_advance_column(yyleng); /* eat text */} YY_BREAKcase 26:YY_RULE_SETUP#line 559 "exlbrowser.l"{ int parens, noargs; LongString abuff;#ifdef TOKEN_DEBUG fprintf(tokenout, "declaration at token %d\n", token_index); fprintf(tokenout, "match text was \"%s\"\n", yytext);#endif assert(tokens_head->type == DECLARE_KEYWORD); current_function_line_start = tokens_head->start_line; current_function_column_start = tokens_head->start_column; sn_highlight(SN_HIGH_KEYWORD, tokens_head->start_line, tokens_head->start_column, tokens_head->end_line, tokens_head->end_column); free_head_token(); /* DECLARE_KEYWORD */ if (current_function != NULL) { panic("Can't declare function inside another function"); } current_function = SN_StrDup(tokens_head->strval); current_function_highlight_line = tokens_head->start_line; current_function_highlight_column_start = tokens_head->start_column; current_function_highlight_column_end = tokens_head->end_column; free_head_token(); /* SOMEWORD */ free_head_token(); /* OPEN_PAREN */ free_head_token(); /* CLOSE_PAREN */ free_head_token(); /* OPEN_BRACE */ current_function_brace_count = 1;} YY_BREAKcase 27:YY_RULE_SETUP#line 595 "exlbrowser.l"{ if (current_function) { current_function_brace_count++; } free_head_token(); /* OPEN_BRACE */} YY_BREAKcase 28:YY_RULE_SETUP#line 602 "exlbrowser.l"{ if (current_function && (--current_function_brace_count == 0)) {#ifdef TOKEN_DEBUG fprintf(tokenout, "end of function %s at token %d\n", current_function, token_index);#endif current_function_line_end = tokens_head->end_line; current_function_column_end = tokens_head->end_column; emit_function_declaration(); } free_head_token(); /* CLOSE_BRACE */} YY_BREAKcase 29:YY_RULE_SETUP#line 618 "exlbrowser.l"{ SearchEntry entry;#ifdef TOKEN_DEBUG fprintf(tokenout, "global statement found at %d\n", token_index);#endif /* FIXME: If global keyword is used outside of a function, should we mark it as a keyword? We could mark it as a keyword and a syntax error also */ sn_highlight(SN_HIGH_KEYWORD, tokens_head->start_line, tokens_head->start_column, tokens_head->end_line, tokens_head->end_column); assert(tokens_head->type == GLOBAL_KEYWORD); free_head_token(); /* GLOBAL_KEYWORD */ if (current_function && (global_var_table == NULL)) { global_var_table = SearchTableCreate(100, SEARCH_HASH_TABLE, FreeGlobalEntry); } /* Insert the variable name into the function's global table */ assert(tokens_head->type == SOMEWORD); if (current_function) { entry.key = tokens_head->strval; entry.key_len = -1; if (global_var_table->search( &global_var_table, entry ) == NULL) { entry.data = NULL; entry.data_len = 0; entry.flag = SEARCH_DUP_KEY; /* add copy of entry.key */ global_var_table->add( &global_var_table, entry );#ifdef TOKEN_DEBUG fprintf(tokenout, "added global \"%s\"\n", entry.key);#endif } sn_highlight(SN_HIGH_VAR_GLOBAL, tokens_head->start_line, tokens_head->start_column, tokens_head->end_line, tokens_head->end_column); } free_head_token(); /* SOMEWORD */ free_head_token(); /* SEMICOLON */} YY_BREAKcase 30:YY_RULE_SETUP#line 667 "exlbrowser.l"{ char* fname; int line; int ref_from_scope_type;#ifdef TOKEN_DEBUG fprintf(tokenout, "found function call tokens at %d\n", token_index); fprintf(tokenout, "match text was \"%s\"\n", yytext);#endif fname = tokens_head->strval;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -