Hi Krishna
Unfortunately, there is no such operation for getting an intermediate AST yet. While the AST could be created in such a way, there might be inconsistencies
regarding location information (positions not corresponding to actual source code). That's one problem, but a much more severe issue would be to provide a complete resolution of the bindings for the intermediate AST. That goes far beyond of the capabilities
of the ASTRewrite.
Regards
Thomas
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
On Behalf Of Krishna Narasimhan
Sent: Mittwoch, 22. Oktober 2014 14:27
To: CDT General developers list.
Subject: 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.
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 ...
ASTRewrite rewriter = collector.getRewriterforast(ast);
rewriter.insertbefore(...)
astsaved = rewriter.getAST(ast)
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
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?
_______________________________________________
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