Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] insert pragma into AST?

This is the link that works:
http://download.eclipse.org/tools/cdt/builds/5.0.1/index.html
 
Markus.


From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Jimmie Eriksson
Sent: Thursday, July 24, 2008 5:57 PM
To: CDT General developers list.
Subject: Re: [cdt-dev] insert pragma into AST?
Importance: Low

I really would like to have your change as soon as possible, so I can continue my work.
I tried to get it from the cvs repository but that really is a pain to get a working version out from that (it surely is not when one know how) and I assure I tried.
I tried to follow this..
http://wiki.eclipse.org/index.php/CDT/User/FAQ#How_do_I_build_CDT_from_CVS_if_I_want_an_even_more_recent_build_and_I_want_all_the_pieces_and_parts.3F
but it doesn't cope..
then I also tried this..
http://download.eclipse.org/tools/cdt/builds/5.0.1/latest/index.html ... nothing exists here???.. and the others doesn't include the fix.
is my only solution to wait? or can I get a latest version from somewhere?

/Jimmie

2008/7/21 Schorn, Markus <Markus.Schorn@xxxxxxxxxxxxx>:
The following code should do the trick:
 
    ASTRewrite re= ASTRewrite.create(ast);
    IASTNode lit= re.createLiteralNode("#pragma xxx\n");
    re.insertBefore(belowNode, beforeNode lit, null);
    Change change= re.rewriteAST();
    change.perform(new NullProgressMonitor());
A quick test showed that this does not work with 5.0. I have now corrected the ASTWriter, such that the code above will work in 5.0.1 > 20080721.
 
Markus.
 
 


From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Jimmie Eriksson
Sent: Friday, July 18, 2008 5:16 PM
To: CDT General developers list.
Subject: [cdt-dev] insert pragma into AST?
Importance: Low

hi

I want to be able to insert a pragma (a IASTPreprocessorPragmaStatement) in the middle of an existing AST and then in I want to reflect the changes back to the sourcecode accordingly. I've searched some and found the ASTRewrite somewhat interesting but can't get it to work as I want. Can anyone give an example of how to use it or point me somewhere else?

thanks in advance

/Jimmie

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



Back to the top