Changeset View
Changeset View
Standalone View
Standalone View
support/xhpast/scanner.l
| %{ | %{ | ||||
| #include "ast.hpp" | #include "ast.hpp" | ||||
| #define push_state(s) xhp_new_push_state(s, yyg) | #define push_state(s) xhp_new_push_state(s, yyg) | ||||
| #define pop_state() xhp_new_pop_state(yyg) | #define pop_state() xhp_new_pop_state(yyg) | ||||
| #define set_state(s) xhp_set_state(s, yyg) | #define set_state(s) xhp_set_state(s, yyg) | ||||
| #define last_token() yyextra->last_token | |||||
| #define YY_USER_ACTION \ | |||||
| if (!yyg->yy_more_len) \ | |||||
| yyextra->first_lineno = yyextra->lineno; | |||||
| #define pttok(t, txt) \ | #define pttok(t, txt) \ | ||||
| yyextra->token_list.push_back( \ | yyextra->token_list.push_back( \ | ||||
| new xhpast::Token(t, txt, yyextra->list_size++)); \ | new xhpast::Token(t, txt, yyextra->list_size++)); \ | ||||
| *yylval = new xhpast::Node(0, yyextra->list_size - 1); | *yylval = new xhpast::Node(0, yyextra->list_size - 1); | ||||
| #define ptok(t) \ | #define ptok(t) \ | ||||
| pttok(t, yytext); | pttok(t, yytext); | ||||
| #define tok(t) \ | #define tok(t) \ | ||||
| ptok(t); \ | ptok(t); \ | ||||
| ▲ Show 20 Lines • Show All 512 Lines • Show Last 20 Lines | |||||