pyrser/ast/match.py
def build_state_tree(self, tree: list, sr: state.StateRegister):
        """ main function for creating a bottom-up tree automata
            for a block of matching statements.
        """
        all_seq = []
        # for all statements populate a list
        # from deeper to nearer of MatchExpr instances.
        for stmt in self.stmts:
            part_seq = list()
            stmt.build_state_tree(part_seq)
            all_seq.append(part_seq)
        # Walk on all MatchExpr instance
        # and create State instance into the StateRegister
        self.root_edge = populate_state_register(all_seq, sr)
def build_state_tree(self, tree: list, sr: state.StateRegister):
        """ main function for creating a bottom-up tree automata
            for a block of matching statements.
        """
        all_seq = []
        # for all statements populate a list
        # from deeper to nearer of MatchExpr instances.
        for stmt in self.stmts:
            part_seq = list()
            stmt.build_state_tree(part_seq)
            all_seq.append(part_seq)
        # Walk on all MatchExpr instance
        # and create State instance into the StateRegister
        self.root_edge = populate_state_register(all_seq, sr)
def build_state_tree ( self , tree : list , sr : state . StateRegister ) : all_seq = [ ] # for all statements populate a list # from deeper to nearer of MatchExpr instances. for stmt in self . stmts : part_seq = list ( ) stmt . build_state_tree ( part_seq ) all_seq . append ( part_seq ) # Walk on all MatchExpr instance # and create State instance into the StateRegister self . root_edge = populate_state_register ( all_seq , sr )
main function for creating a bottom-up tree automata
            for a block of matching statements.
main function for creating a bottom - up tree automata for a block of matching statements .