Automaton convert(ChoicePattern choice) {
Automaton parts = null;
final Iterator<PartPattern> iterator = choice.getParts().iterator();
while (iterator.hasNext()) {
PartPattern part = iterator.next();
if (parts == null)
parts = convert(part);
else
parts = parts.concatenate(convert(part));
boolean hasMoreParts = iterator.hasNext();