Exemplo n.º 1
0
    def close_union(self, nfa: NFA) -> None:
        """
        close_union
        Close the last open union by connecting the two halves
        (from self.union_in_progress and self.last_state) to a new state via epsilon
        """

        logging.debug('Closing union: ' + str(self.union_in_progress[-1]))

        # connect last state of each branch
        self.last_state = nfa.close_branch(self.last_state,
                                           self.union_in_progress[-1][1])
        self.union_in_progress = self.union_in_progress[:-1]