[cfe-dev] Chaining ASTConsumers

Mohamed Yousef harrrrpo at gmail.com
Fri May 7 05:22:20 PDT 2010


Hello ,

I'm writing a source to source tool, according to list prefred way is
Rewriter class , but also i can modify list by a series of traversals

the problem is Rewriter class method is really primitive,, isn't suitable
for big changes (esp. in structure )

what i'm asking for is, can i chain ASTConsumer's ,,so i can progressively
modify AST and pretty-print it finally
but it looks like (from ParseAST) i would have to Parser -> ASTConsumer ->
pretty-print ->Parser ->ASTConsumer -> .. and so on
which is very tedious

is the there an explicit AST data structure ? can i just parse once and
modify resulting AST many times  (traverse,add/delete nodes it not re-parse
source) ?

Thanks,
Mohamed Yousef
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100507/0223d875/attachment.html>


More information about the cfe-dev mailing list