[antlr-interest] gunit with custom AST nodes

Michael Pasdziernik michael at pasdziernik.net
Fri Mar 20 01:41:43 PDT 2009


Hi,
It was the wrong class I tried to patch.
Since I am using the interpreter I had to manipulate gUnitExcecutor instead of 
gUnitBaseTest. I added

            MiniJavaOOParser mp = (MiniJavaOOParser) parObj;
            mp.setTreeAdaptor(new AstTreeAdaptor());

to the methods runParser and runTreeParser behind the parser constructor call.
Now it works :)

Regards
Michael

On Thursday 19 March 2009 15:55:01 Michael Pasdziernik wrote:
> Hi,
> I have some problems using gUnit with a custom tree class. I have tried to
> patch gunit as described in the corresponding thread from march 2008 but
> with no success. The error I get is:
>
> java.lang.ClassCastException: org.antlr.runtime.tree.CommonTree cannot be
> cast to ast.AstTree
>
> thanks
> Michael
>
> 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