I have a grammar as roughly defined in Tutorial for walking ANTLR ASTs in C#?:
grammar Test;
options
{
language = 'CSharp3';
output=AST;
}
public expr : mexpr (PLUS^ mexpr)* SEMI!
;
mexpr
: atom (STAR^ atom)*
;
atom: INT
;
//class csharpTestLexer extends Lexer;
WS : (' '
| '\t'
| '\n'
| '\r')
{ $channel = Hidden; }
;
LPAREN: '('
;
RPAREN: ')'
;
STAR: '*'
;
PLUS: '+'
;
SEMI: ';'
;
protected
DIGIT
: '0'..'9'
;
INT : (DIGIT)+
;
This builds, but leaves me with no parser.expr_result class which I did expect, and parser.expr() returns AstParserRuleReturnScope what am I doing wrong? Are it the options? tool commandline options? anything else?