class ZeroOrMore(ComposedDFA): def __init__(self, machine): self.machine = OneOrMore(machine) super(ZeroOrMore, self).__init__() def is_final(self): return len(self.lexeme) == 0 or self.machine.is_final() def clone(self): return ZeroOrMore(self.machine.clone())
def __init__(self, machine): self.machine = OneOrMore(machine) super(ZeroOrMore, self).__init__()