bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Update the variant example.


From: Akim Demaille
Subject: [PATCH] Update the variant example.
Date: Mon, 10 Nov 2008 10:11:56 -0000

        * examples/variant.yy: Formatting changes.
        One stage build.
---
 ChangeLog           |    6 ++++++
 examples/variant.yy |    9 ++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cba6f7c..a1403ad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2008-11-10  Akim Demaille  <address@hidden>
 
+       Update the variant example.
+       * examples/variant.yy: Formatting changes.
+       One stage build.
+
+2008-11-10  Akim Demaille  <address@hidden>
+
        Support constructor with an argument.
        This improves the "list" bench by 2%.
        
diff --git a/examples/variant.yy b/examples/variant.yy
index d560e7d..74fb109 100644
--- a/examples/variant.yy
+++ b/examples/variant.yy
@@ -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:
-- 
1.6.0.2.588.g3102





reply via email to

[Prev in Thread] Current Thread [Next in Thread]