[cfe-dev] decl/expr ambiguity

Chris Lattner clattner at apple.com
Mon Aug 25 10:56:44 PDT 2008


On Aug 25, 2008, at 10:54 AM, Hartmut Kaiser wrote:

>> Parsing a superset of the language might
>> be possible, but would probably make the common code significantly
>> more complex: it would have to handle the nastiness of decls and  
>> exprs
>> in one shared parser.
>
> I don't follow here. I thought the decls/expr ambiguities are  
> something C++
> specific so will have to be handled for C++ and by the C++ specific  
> parts of
> the parser only. That means any understood superset of C++ will  
> affect the
> C++ specific parser only. No common code with C/ObjC/etc., AFAICS.  
> Could you
> elaborate, please?

Two issues: 1) Clang use a unified C and C++ parser, so there is no  
such thing as a C++-only parser for expressions (for example).  2) the  
point is that we'd have to maintain code *somewhere* that parses decls  
and exprs in parallel, it being in the C or C++ front-end doesn't  
impact the fact that we'd have to write/understand/maintain it.

-Chris



More information about the cfe-dev mailing list