+ static]AT_TOKEN_CTOR_IF([[
+ parser::symbol_type yylex ()]], [[
+ parser::token_type yylex (parser::semantic_type* yylval,
+ parser::location_type* yylloc)]])[
+ {
+ typedef parser::location_type location;
+ static int stage = -1;
+ ++stage;
+ if (stage == STAGE_MAX)
+ {]AT_TOKEN_CTOR_IF([[
+ return parser::make_END_OF_FILE (location ());]], [[
+ *yylloc = location ();
+ return parser::token::END_OF_FILE;]])[
+ }
+ else if (stage % 2)
+ {]AT_TOKEN_CTOR_IF([[
+ return parser::make_NUMBER (stage, location ());]], [[
+ yylval->BUILD (int, stage);
+ *yylloc = location ();
+ return parser::token::NUMBER;]])[
+ }
+ else
+ {]AT_TOKEN_CTOR_IF([[
+ return parser::make_TEXT (string_cast (stage), location ());]], [[
+ yylval->BUILD (std::string, string_cast (stage));
+ *yylloc = location ();
+ return parser::token::TEXT;]])[
+ }
+ abort ();
+ }
+
+ void
+ parser::error (const parser::location_type&, const std::string& message)
+ {
+ std::cerr << message << std::endl;
+ }