Patent ID: 6754887
Filing Date: 2004-06-22
Classification: G06F

Abstract:
A method for implementing virtual bases with fixed offsets in a class hierarchy graph corresponding to an object oriented program, the graph having nodes representing object classes and edges representing immediate inheritance therebetween, the method comprising the steps of:determining whether a set N is empty, the set N comprising all nodes in the graph; removing a node x from the set N, when the set N is not empty; determining whether a set Y is empty, the set Y comprising nodes that directly and virtually inherit from the node x; returning to said step of determining whether the set N is empty, when the set Y is empty; removing a node y from the set Y, when the set Y is not empty; determining whether the node y is duplicated in the graph; returning to said step of determining whether the set Y is empty, when the node y is duplicated; replacing an edge e with an edge eâ€², when the node y is not duplicated, the edge e representing that the node y directly and virtually inherits from the node x and the edge eâ€² representing that the node x has a fixed offset with respect to the node y; wherein determining whether the node y is duplicated in the graph comprises: determining whether a set V is empty, the set V comprising nodes that directly and nonvirtually inherit from the node y; removing a node u from the set V, when the set V is not empty; determining whether the node u is duplicated; determining whether a set Vâ€² is empty, when the node u is not duplicated in the graph, the set Vâ€² comprising nodes that directly inherit from the node y and that are not the node u; returning to said step of determining whether the set V is empty, when the set Vâ€² is empty; removing a node v from the set Vâ€², when the set Vâ€² is not empty; determining whether the node u and the node v have a common descendant; returning to said step of determining whether the set Vâ€² is empty, when the node u and the node v do not have a common descendant; identifying that the node y is duplicated, when one of the node u is duplicated, and the node u and the node v have a common descendant; and identifying that the node v is not duplicated, when the set V is empty.