bison-patches
[Top][All Lists]
Advanced

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

[PATCH] Get rid of yyrhs and yyprhs in larl1.java.


From: Akim Demaille
Subject: [PATCH] Get rid of yyrhs and yyprhs in larl1.java.
Date: Mon, 24 Nov 2008 10:53:18 +0100

        * data/lalr1.java (yyrhs_, yyprhs_): Remove.
        (yy_reduce_print): Rather, use yystos_ and the state stack.
---
 ChangeLog       |    6 ++++++
 data/lalr1.java |    9 +--------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 06abb17..4485a14 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2008-11-25  Akim Demaille  <address@hidden>
 
+       Get rid of yyrhs and yyprhs in larl1.java.
+       * data/lalr1.java (yyrhs_, yyprhs_): Remove.
+       (yy_reduce_print): Rather, use yystos_ and the state stack.
+
+2008-11-25  Akim Demaille  <address@hidden>
+
        Formatting changes.
 
 2008-11-25  Akim Demaille  <address@hidden>
diff --git a/data/lalr1.java b/data/lalr1.java
index 7895394..3d17e46 100644
--- a/data/lalr1.java
+++ b/data/lalr1.java
@@ -802,13 +802,6 @@ m4_popdef([b4_at_dollar])])dnl
      First, the terminals, then, starting at \a yyntokens_, nonterminals.  */
   ]b4_typed_parser_table([String], [yytname_], [b4_tname])[
 
-  /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
-  ]b4_integral_parser_table([yyrhs_], [b4_rhs])[
-
-  /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
-     YYRHS.  */
-  ]b4_integral_parser_table([yyprhs_], [b4_prhs])[
-
   /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
   ]b4_integral_parser_table([yyrline_], [b4_rline])[
 
@@ -827,7 +820,7 @@ m4_popdef([b4_at_dollar])])dnl
     /* The symbols being reduced.  */
     for (int yyi = 0; yyi < yynrhs; yyi++)
       yy_symbol_print ("   $" + (yyi + 1) + " =",
-                       yyrhs_[yyprhs_[yyrule] + yyi],
+                       yystos_[yystack.stateAt(yyi + 1 - yynrhs)],
                        ]b4_rhs_value(yynrhs, yyi + 1)b4_locations_if([,
                        b4_rhs_location(yynrhs, yyi + 1)])[);
   }
-- 
1.6.0.2.588.g3102





reply via email to

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