public Atom(Topology<T> rt) { this.rt = rt; }
- Topology<T> top() { return rt; }
-
void reachable(HashSet<Sequence.Position> h) { /* do-nothing */ }
/** equality is based on the underlying <tt>Topology</tt> */
// if the element following this position is an atom, copy the corresponding
// set of rows out of the "master" goto table and into this state's shift table
if (p.element() != null && p.element() instanceof Atom)
- state.shifts.addAll(state.gotoSetTerminals.subset(((Atom)p.element()).top()));
+ state.shifts.addAll(state.gotoSetTerminals.subset(((Atom)p.element()).dup()));
}
}
Atom a = (Atom)position.element();
HashSet<Position> hp = new HashSet<Position>();
position.next().reachable(hp);
- bag0.addAll(a.top(), /*clo.walk()*/hp);
+ bag0.addAll(a.dup(), /*clo.walk()*/hp);
}
// Step 1b: for each _minimal, contiguous_ set of characters having an identical next-position
public HashSet<Element> bottom(Element e) { return acc; }
public HashSet<Element> sequence(Sequence seq) { return bottom(seq); }
public HashSet<Element> walkAtom(Atom r) {
- c.atoms.put(e, c.atoms.get(e)==null ? r.top() : c.atoms.get(e).union(r.top()));
+ c.atoms.put(e, c.atoms.get(e)==null ? r.dup() : c.atoms.get(e).union(r.dup()));
return super.walkAtom(r);
}
}
public WalkTokenSet(Topology<Tok> cs) { this.cs = cs; }
public WalkTokenSet(Topology<Tok> cs, Cache c) { super(c); this.cs = cs; }
public Topology<Tok> bottom(Element e) { return cs; }
- public Topology<Tok> walkAtom(Atom r) { cs.add(r.top()); return cs; }
+ public Topology<Tok> walkAtom(Atom r) { cs.add(r.dup()); return cs; }
}
class First<Tok extends Token> extends WalkTokenSet<Tok> {
if (e instanceof Atom) {
Topology top = c.atoms.get(pos.element());
if (top==null) continue;
- if (!(top.containsAll(((Atom)e).top()))) continue;
+ if (!(top.containsAll(((Atom)e).dup()))) continue;
} else {
if (c.ys.get(pos.element()).contains(e)) good = true;
}