X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FGSS.java;h=311fd29322d250285566a33b4579b7ac3f1319bb;hp=65c12e78385d89c64bf3a52d15d2bbbb1223d0af;hb=08aa6cdd07a882fdedf7a6d5c7bd0d754460965b;hpb=03dd839af8e8d1a6c2f69c5410da6d19fbbe3931 diff --git a/src/edu/berkeley/sbp/GSS.java b/src/edu/berkeley/sbp/GSS.java index 65c12e7..311fd29 100644 --- a/src/edu/berkeley/sbp/GSS.java +++ b/src/edu/berkeley/sbp/GSS.java @@ -27,7 +27,7 @@ class GSS { public Forest.Ref finalResult = null; /** all nodes, keyed by the value returned by code() */ - private HashMap hash = new HashMap(); /* ALLOC */ + /*private*/ HashMap hash = new HashMap(); /* 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); }