Hi, I have two suggestions to improve Antlr 4.0.

1) I have a scala target that works for my needs. But it would help me if you 
could rename the match functions and the type fields in the Java runtime, 
because "match" and "type" are scala keywords.

2) I create my AST manually, so i have many rules which look like this:

foo_declaration returns [FooDeclaration node]
 :      VARIABLE identifier_list COLON type_mark SEMICOLON
        {$node=new FooDeclaration(...)};


foo_declarative_item returns [ASTNode node]
 :      example_declaration {$node=$example_declaration.node}
        | foo_declaration {$node=$foo_declaration.node}
        | bar_declaration {$node=$foo_declaration.node};

I think i would be better, if a referenced rule without an attribute is used, 
it 
should automatically use the return value.

e.g.

foo_declarative_item returns [ASTNode node]
 :      example_declaration {$node=$example_declaration}
        | foo_declaration {$node=$foo_declaration}
        | bar_declaration {$node=$foo_declaration}

Christian



_______________________________________________
antlr-dev mailing list
[email protected]
http://www.antlr.org/mailman/listinfo/antlr-dev

Reply via email to