]> git.saurik.com Git - bison.git/commitdiff
Update the variant example.
authorAkim Demaille <demaille@gostai.com>
Sat, 9 Aug 2008 12:59:34 +0000 (14:59 +0200)
committerAkim Demaille <demaille@gostai.com>
Mon, 10 Nov 2008 10:08:09 +0000 (11:08 +0100)
* examples/variant.yy: Formatting changes.
One stage build.

ChangeLog
examples/variant.yy

index cba6f7c19da63c395c26e3429e53e9d2cba6642c..a1403addfb79afa81bd481c50ea21d5071c07dd3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-11-10  Akim Demaille  <demaille@gostai.com>
+
+       Update the variant example.
+       * examples/variant.yy: Formatting changes.
+       One stage build.
+
 2008-11-10  Akim Demaille  <demaille@gostai.com>
 
        Support constructor with an argument.
index d560e7dd63bb59cb92751a27cbd011b652a3b729..74fb10920b4affaa35b794641835eeaa9b51ff3d 100644 (file)
@@ -90,18 +90,17 @@ yylex (yy::parser::semantic_type* yylval)
   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:
@@ -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: