public final Walk.Cache cache = this;
- public void optimize(Functor<Tok,Integer> f) {
- for(State<Tok> state : all_states.values()) {
- state.oreductions = state.reductions.optimize(f);
- state.oshifts = state.shifts.optimize(f);
- }
- }
-
private void walk(Element e, HashSet<Element> hs) {
if (e==null) return;
if (hs.contains(e)) return;
if (p.element() != null && p.element() instanceof Atom)
state.shifts.addAll(state.gotoSetTerminals.subset(((Atom)p.element())));
}
+ if (top instanceof IntegerTopology)
+ for(State<Tok> state : all_states.values()) {
+ state.oreductions = state.reductions.optimize(((IntegerTopology)top).functor());
+ state.oshifts = state.shifts.optimize(((IntegerTopology)top).functor());
+ }
}
private boolean isRightNullable(Position p) {