Exemplo n.º 1
0
    def plus_nfa(self, nfa: NFA) -> None:
        """
        plus_nfa
        Add a plus operation on the last closed group of an existing nfa

        :param nfa: The existing NFA.
        """
        # add plus between last closed group and last state
        self.last_state = nfa.add_plus(self.last_closed_group, self.last_state)

        # register this as a star
        self.last_star.append(self.last_closed_group)

        # null out the last closed group so it can't be operated on again
        self.last_closed_group = None