if (p.element() != null && p.element() instanceof Atom)
state.shifts.addAll(state.gotoSetTerminals.subset(((Atom)p.element()).getTokenTopology()));
}
+
if (top instanceof IntegerTopology)
for(State<Token> state : all_states) {
state.oreductions = state.reductions.optimize(((IntegerTopology)top).functor());
state.oshifts = state.shifts.optimize(((IntegerTopology)top).functor());
}
+
+ // crude algorithm to assing an ordinal ordering to every position
+ ArrayList<Sequence.Position> al = new ArrayList<Sequence.Position>();
+ for(State s : all_states) {
+ for(Object po : s) {
+ Sequence.Position p = (Sequence.Position)po;
+ if (al.contains(p)) continue;
+ int i=0;
+ for(; i<al.size(); i++) {
+ if (p.compareTo(al.get(i), cache) > 0)
+ break;
+ }
+ al.add(i, p);
+ }
+ }
+ for(int i=0; i<al.size(); i++)
+ al.get(i).ord = i;
}
private boolean isRightNullable(Position p) {