From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Joshua S. Allen" To: mrs@wrs.com (Mike Stump) Cc: egcs@cygnus.com Subject: Re: Multiple inheritance Date: Wed, 10 Dec 1997 07:31:00 -0000 Message-id: <199712101521.JAA27023@juno.eecs.tulane.edu> References: <199712022336.PAA16687@kankakee.wrs.com> X-SW-Source: 1997-12/msg00587.html > > > From: "Joshua S. Allen" > > To: egcs@cygnus.com > > Date: Mon, 1 Dec 1997 09:05:40 -0600 (CST) > > > (1) I need to construct a table of direct parents of a class. > > Why? Anyway, you can construct it from BINFO_BASETYPES, but it sounds > more like you'd just be replicating it. I've been trying to look at the data in BINFO_BASETYPES using TREE_VALUE but it just gives me an integer, which I assume it an offset maybe. Is there a way to get a string value of the class name? For example, if a class named "A" has two direct parents named "B" and "C", then I would like to retieve the strings "B" and "C." > An easier way to do this would seem to me to just redefine hides with > whatever rules you want. If you do that, then the rest of the code > should just work, though I may be missing something because you didn't > describe what it is you wanted to do very well. I could give better > help with a better idea of what it is you wanted to do. > Specifically, what I am doing is computing a linearization of super classes for each class. Once I have this linearization, I will use it do automatic conflict resolution of methods that have the same name in multiple inheritance. I already have the linearization algorithm developed in C. I am now trying to integrate it into the g++ compiler. Basically, there are 2 steps: (1) Compute the superclass linearization for each class. (2) When ambiguity occurs in multiple inheritance with duplicate class names, resolve it by using the one that first appears in the linearization. In order to compute my linearization I need to know only the direct superclasses of a particular class. I use this informaiton to recursively construct the complete linearization for a class. If a conflict occurs, I get the clases linearization. If it has not been computed, then I compute it. Then I simply search each class in the lineartion from left to right until I find the first method with the name I am looking for. I hope that helps to describe what I am doing. Thanks for your help! --Joshua