- State<Tok> s = all_states.get(h) == null ? new State<Tok>(h, all_states, all_elements) : all_states.get(h);
- gotoSetNonTerminals.put(y, s);
+ State<Token> s = all_states.get(h) == null ? new State<Token>(h, all_states, all_elements) : all_states.get(h);
+ // if a reduction is "lame", it should wind up in the dead_state after reducing
+ if (y instanceof Sequence) {
+ for(Position p : hs) {
+ if (p.element() != null && (p.element() instanceof Union)) {
+ Union u = (Union)p.element();
+ for(Sequence seq : u)
+ if (seq.needs.contains((Sequence)y) || seq.hates.contains((Sequence)y)) {
+ // FIXME: what if there are two "routes" to get to the sequence?
+ ((HashMap)gotoSetNonTerminals).put((Sequence)y, dead_state);
+ continue OUTER;
+ }
+ }
+ }
+ gotoSetNonTerminals.put((Sequence)y, s);
+ }