private final Table pt;
- /**
- * create a parser to parse the grammar with start symbol <tt>u</tt>
- */
+ /** create a parser to parse the grammar with start symbol <tt>u</tt> */
protected Parser(Union u) { this.pt = new Table(u, top()); }
protected Parser(Table pt) { this.pt = pt; }
// Table //////////////////////////////////////////////////////////////////////////////
/** an SLR(1) parse table which may contain conflicts */
- static class Table {
+ static class Table extends Walk.Cache {
- public final Walk.Cache cache = new Walk.Cache();
+ public final Walk.Cache cache = this;
private void walk(Element e, HashSet<Element> hs) {
if (e==null) return;
}
}
- /*
- public String toString() {
- StringBuffer sb = new StringBuffer();
- for(Element e : walk())
- if (e instanceof Union)
- ((Union)e).toString(sb);
- return sb.toString();
- }
- */
-
/** the start state */
public final State start;