def _remove_alone_endif(self):
        """
            Can occur on:
            if(..){
                return
            }
            else{
                return
            }

            Iterate until a fix point to remove the ENDIF node
            creates on the following pattern
            if(){
                return
            }
            else if(){
                return
            }
        """
        prev_nodes = []
        while set(prev_nodes) != set(self.nodes):
            prev_nodes = self.nodes
            to_remove = []
            for node in self.nodes:
                if node.type == NodeType.ENDIF and not node.fathers:
                    for son in node.sons:
                        son.remove_father(node)
                    node.set_sons([])
                    to_remove.append(node)
            self._nodes = [n for n in self.nodes if not n in to_remove]
def _remove_alone_endif ( self ) : prev_nodes = [ ] while set ( prev_nodes ) != set ( self . nodes ) : prev_nodes = self . nodes to_remove = [ ] for node in self . nodes : if node . type == NodeType . ENDIF and not node . fathers : for son in node . sons : son . remove_father ( node ) node . set_sons ( [ ] ) to_remove . append ( node ) self . _nodes = [ n for n in self . nodes if not n in to_remove ]
Can occur on:
            if(..){
                return
            }
            else{
                return
            }

            Iterate until a fix point to remove the ENDIF node
            creates on the following pattern
            if(){
                return
            }
            else if(){
                return
            }