Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Creating a New Structure with ASTRewrite

On Sunday 25 May 2008, student08 wrote:
>
>                 ICASTCompositeTypeSpecifier declSpec = new
> CASTCompositeTypeSpecifier(); declSpec.setKey(1);
>                 declSpec.setStorageClass(1);
Don't use literal numbers use the defined constants like k_struct.
>
>
>                 struct.setDeclSpecifier(declSpec);
>
> ASTRewrite rewrite = collector.rewriterForTranslationUnit(unit);
>                 rewrite.insertBefore(unit,
>                                                         
> TranslationUnitHelper.getFirstNode(unit), prototype, new TextEditGroup
> ("Structure insertion"));
>

What's prototype?



Back to the top