From: Stefan S. <se...@sy...> - 2004-08-31 00:34:43
|
Grzegorz Jakacki wrote: > I don't pretend to understand all the details of how it works, but I > think there is more to it than you describe. Look at > 'SearchBaseOrUsing()', which to my understanding handles the 'forks' in > the acyclic graph. you are right. I was puzzled by the 'GetOuterEnvironment()' call... However, I must admit that I don't quite like the current design. As different context require different loopup rules, an IMO better approach would have been to provide a polymorphic 'Scope' type and then implement it differently for 'Function', 'Class', 'TemplateClass', etc. Then each scope would know the rules of where to look if a symbol isn't defined locally. This would be more flexible and in particular allow to implement different lookup semantics depending on whether we are parsing C++ or C. What do you think ? > Also note that OpenC++ is non-validating, consequently it rightfully > ignores, say, ambiguities in multiple inheritance. yeah, I notice that the current implementation isn't complete. >> Does symbol lookup currently work in such cases ? > > > Why not check empirically?... :-) heh, right. That brings me back to the other point: unit testing. Now that the release is out (congratulations !) we should try to cover as much as possible with unit tests so we can a) make sure changes don't incure regressions and b) learn how occ works in detail. Regards, Stefan |