Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Constructing Compond statement without brackets

I wanted to do that. But, I am currently using a very lame and crude approach of performing all my modifications on a IASTNode (which only supports replace and only when the node being modified is a AMbigiousNode).

This is because I was facing an issue with the ASTRewrite.

I have a question : 

1) How do I get the AST after every modification and continue to work on that AST . Basically how do I save and retreive the state of an AST after every rewrite operation and how do I use a Saved AST ... 


something like 

ASTRewrite rewriter = collector.getRewriterforast(ast);
rewriter.insertbefore(...)
astsaved = rewriter.getAST(ast)


Something like that... 

On Wed, Oct 22, 2014 at 8:14 AM, Corbat Thomas <tcorbat@xxxxxx> wrote:

Hi Krishna

 

A compound statement is always surrounded by curly braces. Can't you just insert the "bunch of other statements" before the statement which should be at the end?

 

Regards

Thomas

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Krishna Narasimhan
Sent: Montag, 20. Oktober 2014 12:04
To: CDT General developers list.
Subject: [cdt-dev] Constructing Compond statement without brackets

 

Dear all,

           I am trying to construct a replace a statement with a bunch of other statements and itself at the end. The problem I have here is that when I use a compound statement, it places a bracket . Anyway to remove this?

 


 

 

Regards
       Krishna


_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/cdt-dev



--
-----------------------------------------------------
I dare do all that may become a man; Who dares do more, is none - Macbeth, twelfh night!
Regards
       Krishna

Back to the top