private final List<Sequence> alternatives = new ArrayList<Sequence>();
public Iterator<Sequence> iterator() { return alternatives.iterator(); }
+ public boolean contains(Sequence s) { return alternatives.contains(s); }
Topology toAtom() {
if (alternatives.size()==0) throw new RuntimeException("cannot build an Atom from a Union with no productions");
}
/** adds an alternative */
- public void add(Sequence s) { alternatives.add(s); }
+ public void add(Sequence s) {
+ alternatives.add(s);
+ if (/*!synthetic &&*/ shortForm!=null
+ //&& Character.isUpperCase(shortForm.charAt(0))
+ )
+ s.setName(toString());
+ }
/**
* Since every cycle in a non-degenerate grammar contains at