/* Test file for C++ parsers using variants.
Based on an example by Michiel De Wilde <mdewilde.agilent@gmail.com>. */
%debug
-%skeleton "lalr1-fusion.cc"
+%skeleton "lalr1.cc"
%defines
%define variant
switch (stage)
{
case 0:
- yylval->build<std::string> () =
- std::string ("I have three numbers for you.");
+ yylval->build (std::string ("I have three numbers for you."));
result = yy::parser::token::TEXT;
break;
case 1:
case 2:
case 3:
- yylval->build<int> () = stage;
+ yylval->build (stage);
result = yy::parser::token::NUMBER;
break;
case 4:
- yylval->build<std::string> () = std::string ("And that's all!");
+ yylval->build (std::string ("And that's all!"));
result = yy::parser::token::TEXT;
break;
default:
{
yy::parser p;
p.set_debug_level (!!getenv ("YYDEBUG"));
- p.parse ();
+ return p.parse();
}
// Local Variables: