Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] ASTRewrite and addComment

Sergey,

 

As you mentioned in the bug report thread, I can create a comment note using a literal node in ASTRewrite. It would be good enough if there was a simple way to generate a code string (that the code generator writes) from an IASTStatement. Then I could use that as a string for the literal node and it would exactly be what I need - commenting a statement refactoring.

 

Thanks,

Andrey

 

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Sergey Prigogin
Sent: Wednesday, November 27, 2013 12:16 PM
To: CDT General developers list.
Subject: Re: [cdt-dev] ASTRewrite and addComment

 

You are right, it is currently impossible to create a comment node using only public API. Feel free to create a feature request and add a method for that to INodeFactory and NodeFactory.

 

-sergey

 

On Wed, Nov 27, 2013 at 11:57 AM, Ayupov, Andrey <andrey.ayupov@xxxxxxxxx> wrote:

Seems like the ASTRewriter has some support for comments (I believe adds only):

public void addComment(IASTNode node, IASTComment comment, CommentPosition pos)

 

However, I can’t find who can create an IASTComment implementing object for me. The ICPPNodeFactory does not have a creator method for that. Any clues?

 

Thanks and happy thanksgiving!


_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev

 


Back to the top