
"Andy Little"
"Noel Yap" wrote
On 3/7/06, Andy Littlewrote:
I guess so, except high altitude mountain climbing over the AST using copious supplies of oxygen might be nearer the mark than walking. As I understand it C++ is not beloved by compiler writers for this reason! I guess it all comes down to the exact definition of "a C++ parser"and what you want to do with its output.
Some things I had in mind were: - code beautification - static dependency analysis for link- or compile-compatibility - other static code analysis - creation of refactoring tools
I forgot to say that though this would be a very difficult project, I think it would also be a very worthwhile project. My analysis of the difficulties is because I started naively to try to write a C++ parser some years ago. The main issue I found is that I just didnt know the language well enough to proceed so I was constantly consulting the standard to learn huge chunks of the language itself, which meant progress was slow though it did help me understand C++ a bit more! I was also using VC6 which didnt help! I think its when I came to parsing templates that I really hit difficulties as I had very little experience with templates at the time. I know a bit more about templates now so I might do better but then there are all the details of overloaded functions , finding best match, partial specialisation etc etc. This is the big problem with a C++ parser. its just incredibly complicated. Nevertheless judging by the interest in Wave preprocessor I have no doubt there would be a huge interest in such a beast by boost and C++ developers in general for all the tasks you mention and more. regards Andy Little