X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/9718cfa902806db3134c3c883457b548e23fb4a4..30bb2edccf7f352a0c149513905f5e1fcac04aaf:/examples/variant.yy diff --git a/examples/variant.yy b/examples/variant.yy index be43c60d..74fb1092 100644 --- a/examples/variant.yy +++ b/examples/variant.yy @@ -1,7 +1,7 @@ /* Test file for C++ parsers using variants. Based on an example by Michiel De Wilde . */ %debug -%skeleton "lalr1-fusion.cc" +%skeleton "lalr1.cc" %defines %define variant @@ -58,7 +58,7 @@ typedef std::list strings_type; %% result: - list { std::cout << $1 << std::endl; } + list { std::cout << $1 << std::endl; } ; list: @@ -90,18 +90,17 @@ yylex (yy::parser::semantic_type* yylval) switch (stage) { case 0: - yylval->build () = - 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 () = stage; + yylval->build (stage); result = yy::parser::token::NUMBER; break; case 4: - yylval->build () = std::string ("And that's all!"); + yylval->build (std::string ("And that's all!")); result = yy::parser::token::TEXT; break; default: @@ -126,7 +125,7 @@ main (int argc, char *argv[]) { yy::parser p; p.set_debug_level (!!getenv ("YYDEBUG")); - p.parse (); + return p.parse(); } // Local Variables: