[antlr-interest] Mutant Generator

Peter Nicklas pnicklas at freenet.de
Tue Apr 3 00:34:35 PDT 2012


Hi everyone!

I'd like to use antlr for writing a mutant generator. There should be 
only one tiny difference between the mutant and the original code, e.g. 
by changing a "public" modifier to "private" etc.

I'm not sure which way would be the best:

#1 creating the AST, changing one node in the AST, creating the new 
source code from that

#2 using a rewriter (TokenRewriteStream etc.)


Things I don't know about that:

#1 How can I create the source code for the new AST ?

#2 Is it possible to change the code only on one location with a 
rewriter? Because I don't want to change the code on every occurrence of 
"public", only one of them should be changed.

Which way would you prefer/is easier/the best/most efficient ? Are there 
solutions for my problems?
Thank you very much.


Peter





More information about the antlr-interest mailing list