got new tib tokenizer going
[sbp.git] / src / edu / berkeley / sbp / GSS.java
index 65c12e7..311fd29 100644 (file)
@@ -27,7 +27,7 @@ class GSS {
         public  Forest.Ref finalResult = null;
 
         /** all nodes, keyed by the value returned by code() */
-        private HashMap<Long,Phase.Node> hash    = new HashMap<Long,Phase.Node>();  /* ALLOC */
+        /*private*/ HashMap<Long,Phase.Node> hash    = new HashMap<Long,Phase.Node>();  /* ALLOC */
 
         /** the number of nodes in this phase */
         private int numNodes = 0;
@@ -45,6 +45,8 @@ class GSS {
 
         private String error = "generic syntax error";
         public void checkFailure() throws Parser.Failed {
+            if (token==null && finalResult==null)
+                throw new Parser.Failed(error, getLocation());
             if (numNodes <= 0)
                 throw new Parser.Failed(error, getLocation());
         }
@@ -66,8 +68,8 @@ class GSS {
         private void newNode2(Node p, Node parent, Forest pending, Parser.Table.State state, boolean fromEmptyReduction) {
             p.holder.merge(pending);
             if (p.parents().contains(parent)) return;
-            if (p.fe && p.phase() != parent.phase()) throw new Error("yep yep");
-            if (!p.fe && p.phase() == parent.phase()) throw new Error("yep yep2");
+            //if (p.fe && p.phase() != parent.phase()) throw new Error("yep yep");
+            //if (!p.fe && p.phase() == parent.phase()) throw new Error("yep yep2");
             p.parents().add(parent, true);
             if (p!=parent && !fromEmptyReduction) p.queueReductions(parent);
         }