[antlr-interest] Treeparser with custom nodes?

Mari Matinlassi mmatinlassi at icinetic.com
Fri Nov 4 01:30:23 PDT 2011


Hi,

 

I am making a tree parser with custom nodes (C# target).

 

I get error message "The non-generic type 'Antlr.Runtime.Tree.TreeRewriter'
cannot be used with type arguments".

 

That error is in Antlr generated tree parser class. I copy the code snippet
below.

 

public partial class DslDefinitionTree :
Antlr.Runtime.Tree.TreeRewriter<CustomTree>

{

 

CustomTree is my specific node that is inherited from CommonTree. Works fine
with normal parser.

 

If I remove the type argument, it compiles and runs but, tree parser returns
null.

 

Any idea what is wrong?

 

Thanks for help,

 

mari



More information about the antlr-interest mailing list