[cfe-dev] Writing a tentative parser for C++0x attributes

Argyrios Kyrtzidis kyrtzidis at apple.com
Mon Aug 10 14:15:43 PDT 2009


Hi Sean,

On Aug 10, 2009, at 12:21 PM, Sean Hunt wrote:

> Hey clang-folk!
>
> I'm working on implementing the new C++0x attribute specification,
> currently integrated into the working paper. Aside from a couple  
> issues
> in the specification which I've sent forward to the committee in hopes
> they can be addressed, my biggest issue is adjusting
> isCXXDeclarationStatement
>
> The problem is that C++0x attributes can be the start of all
> declarations as well as some statements. As a result, the tentative
> parsers that disambiguate need to be able to work in the face of an
> attribute-specifier.
>
> Initially, I opened a TentativeParseAction in  
> isCXXDeclarationSatement,
> but that was causing crashes in the scope annotation system. Does  
> anyone
> have any better ideas for how to do this?

Can you post a patch of what you were trying ? I assume you can parse  
and create attributes and it's only a matter of fixing the  
disambiguation, right ?
I think we need an attribute annotation token that will cache the  
parsed attribute.

-Argiris



More information about the cfe-dev mailing list