
"Leon Mergen"
Andy Little wrote:
Has anyone created a c++ parser with boost::spirit?
I dont know if anyone has (though I believe Hartmut Kaiser created a C parser) but AFAIK the problem with C++ parsers in general is that they dont tell the whole story, because in C++ there is a huge amount of context specific information.
Isn't this the problem with /all/ parsers, and in general, it is an AST treewalker that actually determines the context ?
As in, if you would want context, you would parse, build and AST, and then walk over the AST to determine the context... just as with any language ?
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. regards Andy Little