bison-patches
[Top][All Lists]
Advanced

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

[PATCH 2/4] bench: simplify the calc grammar


From: Akim Demaille
Subject: [PATCH 2/4] bench: simplify the calc grammar
Date: Sat, 21 Mar 2020 18:39:18 +0100

* etc/bench.pl.in (generate_grammar_calc): We don't need global_result
etc.
---
 etc/bench.pl.in | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/etc/bench.pl.in b/etc/bench.pl.in
index 6460a90c..de2fcb7e 100755
--- a/etc/bench.pl.in
+++ b/etc/bench.pl.in
@@ -379,9 +379,6 @@ sub generate_grammar_calc ($$@)
 #include <string.h>
 #include <ctype.h>
 #define USE(Var)
-
-static int global_result = 0;
-static int global_count = 0;
 %}
 
 %define api.value.type union
@@ -557,10 +554,6 @@ power (int base, int exponent)
 int
 main (int argc, const char **argv)
 {
-  int result = 0;
-  int count = 0;
-  int status;
-
 #if YYDEBUG
   yydebug = !!getenv ("YYDEBUG");
 #endif
@@ -572,13 +565,7 @@ main (int argc, const char **argv)
       return 3;
     }
 
-  status = yyparse ();
-  if (global_result != result)
-    abort ();
-  if (global_count != count)
-    abort ();
-
-  return status;
+  return yyparse ();
 }
 EOF
 }
-- 
2.25.1




reply via email to

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