From: Stefan S. <se...@sy...> - 2004-07-18 19:03:40
|
Grzegorz Jakacki wrote: >> what does 'ClassWalker' do ? The name suggests it is only inspecting >> class definitions, but not you are suggesting it deals with arbitrary >> type recovery. > > > AFAIK it traverses the AST and registers all definitions and > declarations in the Environment it maintains. > >>> This is fair enough when there is no namespaces or nested templates. >>> However, if top-level construct is a namespace, then Environment does >>> not have a clue about anything defined in it until it is fully parsed. >> >> >> >> hmm, I don't understand the design of Environment et al. yet. Why doesn't >> it 'have a clue' until it is 'fully parsed' ? In the example >> >> namespace Foo >> { >> typedef int Int; >> typedef std::vecor<Int> IntVector; >> } >> >> Shouldn't it know 'Int' when it sees the typedef for IntVector ? > > > The top-level loop will call parser. Parser will return AST representing > all the above text. At this moment the text is already parsed, but > Environment object still does not know anything about Int or IntVector. > Only now the main loop calls ClassWalker, which begins to traverse the > AST. The traversal reaches first typedef and registers Int in top-level > Environment, then second typedef and registers IntVector. > > So, Environment does not know about Int or IntVector until the parsing > of the whole namespace ends. well, but as we just discovered, this doesn't work for C++ in general where certain ambiguities have to be resolved using the knowledge about previously declared types, variables, etc. >> Please document the current design and the solutions you envision. It >> will >> help a lot to work out the remaining issues to make opencxx a very >> powerful >> tool that supports all standard C++. > > > I am putting it really high on my TODO list, I will try to post it this > week. As for existing design, however, my knowledge is limited to what I > absorbed or figured out, so I am afraid there are going to be some dark > corners. Yeah. But if we have very specific questions I'm sure we can always get back to Chiba to help us out. >> More and more people use synopsis, and the bug reports about parse errors >> I get become more and more sophisticated, indicating that it becomes more >> and more important to make the parser work correct not only for the most >> used C++ features, but really covering the full standard. > > > That's great news. There is still a lot of work, but let's keep moving > forward. Sure. I'm aiming for a new synopsis release within the coming week, and after that I'll start working on a refactoring of the opencxx code synopsis uses. I'm sure I'll have lots of questions in the process... Regards, Stefan |