From: Stefan S. <se...@sy...> - 2004-06-01 17:17:53
|
Brian Kahne wrote: > > Yes, having the Walker act as a visitor, as you describe below, would be > very nice. In addition to having typed ptree-nodes, though, it would be > nice to get the actual C++ type of the expression, e.g. if the > expression is of the form "a + b * c", then be able to get a TypeInfo > object back that says that the return type of the expression is class > Foo. Is that possible today? It seems like the only way to get > TypeInfo objects is by looking up a name in the Environment, whereas > this requires figuring out that operator+() and operator*() is > overloaded for this class, getting that operator's return type, etc. I'm not sure about that. However, this shouldn't be much harder than constructing a call graph, where you have to use similar lookup rules to find the right (possibly overloaded) functions depending on the arguments' type and the C++ scoping rules. We do something similar already in synopsis when generating the cross-referenced source view I was talking about earlier, but I'd be very happy to see this functionality offered by opencxx directly. May be Grzegorz has more insights about how much work would be involved to add that. Regards, Stefan |