|
Boost Users : |
From: Andy Little (andy_at_[hidden])
Date: 2006-03-07 13:47:05
"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 think you would have to go quite deep to do those things. One simple example
is that you need to find out if a name is a type or an object to continue
parsing an expression, then you have all the leftovers from C, the weird C
useage of typedef etc that must be catered for. IOW C++ parsing is not cleanly
split into syntax and semantics as theorists like to have it.
I read somewhere that the most recent gcc C++ parser was ultimately written by
hand based on a recursive descent parser, as was Bjarne Stroustrups original. He
mentions it somewhere in D&E I think.
Anyway I'm sure it would be an interesting topic on the Spirit developers list!
regards
Andy Little
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net