Changeset View
Changeset View
Standalone View
Standalone View
support/xhpast/parser.y
| Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | |||||
| static void yyerror(void* yyscanner, void* _, const char* error) { | static void yyerror(void* yyscanner, void* _, const char* error) { | ||||
| if (yyextra->terminated) { | if (yyextra->terminated) { | ||||
| return; | return; | ||||
| } | } | ||||
| yyextra->terminated = true; | yyextra->terminated = true; | ||||
| yyextra->error = error; | yyextra->error = error; | ||||
| } | } | ||||
| /* | |||||
| TODO: Restore this. | |||||
| static void replacestr(string &source, const string &find, const string &rep) { | |||||
| size_t j; | |||||
| while ((j = source.find(find)) != std::string::npos) { | |||||
| source.replace(j, find.length(), rep); | |||||
| } | |||||
| } | |||||
| */ | |||||
| %} | %} | ||||
| %expect 5 | %expect 5 | ||||
| // 2: PHP's if/else grammar | // 2: PHP's if/else grammar | ||||
| // 7: expr '[' dim_offset ']' -- shift will default to first grammar | // 7: expr '[' dim_offset ']' -- shift will default to first grammar | ||||
| %name-prefix "xhpast" | %name-prefix "xhpast" | ||||
| %pure-parser | %pure-parser | ||||
| %parse-param { void* yyscanner } | %parse-param { void* yyscanner } | ||||
| ▲ Show 20 Lines • Show All 2,655 Lines • Show Last 20 Lines | |||||