major overhaul to institute optimal GSS sharing
[sbp.git] / src / edu / berkeley / sbp / Parser.java
index 6b9bad7..2fc0691 100644 (file)
@@ -273,8 +273,8 @@ public abstract class Parser<Token, NodeType> implements Serializable {
             HashMap<Pos,State<Token>>      gotoSetNonTerminals = new HashMap<Pos,State<Token>>();
             private transient TopologicalBag<Token,State<Token>>  gotoSetTerminals    = new TopologicalBag<Token,State<Token>>();
 
-            private           TopologicalBag<Token,Pos>      reductions          = new TopologicalBag<Token,Pos>();
-            private           HashSet<Pos>                   eofReductions       = new HashSet<Pos>();
+                       TopologicalBag<Token,Pos>      reductions          = new TopologicalBag<Token,Pos>();
+                       HashSet<Pos>                   eofReductions       = new HashSet<Pos>();
             private           TopologicalBag<Token,State<Token>>  shifts              = new TopologicalBag<Token,State<Token>>();
             private           boolean                             accept              = false;
 
@@ -290,16 +290,16 @@ public abstract class Parser<Token, NodeType> implements Serializable {
             Iterable<Pos>  positions()             { return hs; }
 
             boolean                    canShift(Token t)       { return oshifts!=null && oshifts.contains(t); }
-            void                       invokeShifts(Token t, GSS.Phase phase, Result r) { oshifts.invoke(t, phase, r); }
+            void                       invokeShifts(Token t, GSS.Phase phase, Node pred, Forest f) { oshifts.invoke(t, phase, pred, f); }
             boolean                    canReduce(Token t)        {
                 return oreductions != null && (t==null ? eofReductions.size()>0 : oreductions.contains(t)); }
             void          invokeEpsilonReductions(Token t, Node node) {
-                if (t==null) for(Pos r : eofReductions) node.invoke(r, null);
-                else         oreductions.invoke(t, node, null);
+                if (t==null) for(Pos r : eofReductions) node.invoke(r, null, null);
+                else         oreductions.invoke(t, node, null, null);
             }
             void          invokeReductions(Token t, Node node, Result b) {
-                if (t==null) for(Pos r : eofReductions) node.invoke(r, b);
-                else         oreductions.invoke(t, node, b);
+                if (t==null) for(Pos r : eofReductions) node.invoke(r, b, null);
+                else         oreductions.invoke(t, node, b, null);
             }
 
             // Constructor //////////////////////////////////////////////////////////////////////////////