Hi I have a small problem in my ANTLR tree grammar. I am using ANTLRWorks 1.4. In parser grammar I have the rule like this:
declaration
: 'variable' IDENTIFIER ( ',' IDENTIFIER)* ':' TYPE ';'
-> ^('variable' IDENTIFIER TYPE)+
So I wanted one tree per each IDENTIFIER.
And in the tree grammar I left only rewrite rules:
declaration
: ^('variable' IDENTIFIER TYPE)+
But when I check grammar I got syntax error unexpected token +. And it is this + sign at the end of the declaration rule in the tree grammar. So what I am doing wrong?
Parser grammar works fine and builds AST tree as expected. I generated lexer and parser for C# and test it for some input.