[antlr-interest] Mutant Generator

Peter Nicklas pnicklas at freenet.de
Tue Apr 3 07:07:15 PDT 2012


Ok, perhaps my example was too simple.

There are a lot of operators to implement relating to polymorphism, OO, 
inheritance etc.
I think I have to use an AST.

New Example: Deletion/insertion of hiding or overriding variables.

I think you can't do this with a simple RegEx.

Peter



Cal Page wrote:
> use awk or sed.
>
> Using ANTLR is like hunting flies with a hammer.
>
>
> On Tue, Apr 3, 2012 at 3:34 AM, Peter Nicklas <pnicklas at freenet.de 
> <mailto:pnicklas at freenet.de>> wrote:
>
>     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
>
>
>
>
>     List: http://www.antlr.org/mailman/listinfo/antlr-interest
>     Unsubscribe:
>     http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>



More information about the antlr-interest mailing list