utility methods are defined in the class Grammar and some extra helper
classes.
SequenceAnalyzer defines INFINITE for -1, which means no upper limit for
the repetitions.