public Automaton convert(String pattern) {
return convert(new MyPatternMatcher(pattern, true));
}
private Automaton convert(MyPatternMatcher matcher) {
Pattern pattern = matcher.getParsedpattern();
Automaton choices = Automaton.makeEmpty();
for (ChoicePattern choice : pattern.getChoices()) {
choices = choices.union(convert(choice));
}
return choices;
}