+ static class Table<Tok> extends Walk.Cache {
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ sb.append("parse table");
+ for(State<Tok> state : all_states.values()) {
+ sb.append(" " + state + "\n");
+ for(Topology<Tok> t : state.shifts) {
+ sb.append(" shift \""+
+ new edu.berkeley.sbp.chr.CharTopology((IntegerTopology<Character>)t)+"\" => ");
+ for(State st : state.shifts.getAll(t))
+ sb.append(st.idx+" ");
+ sb.append("\n");
+ }
+ for(Topology<Tok> t : state.reductions)
+ sb.append(" reduce \""+
+ new edu.berkeley.sbp.chr.CharTopology((IntegerTopology<Character>)t)+"\" => " +
+ state.reductions.getAll(t) + "\n");
+ }
+ return sb.toString();
+ }