This antlr example is not working properly
- by Aftershock
Hi,
This ANTLR example does not parse input "1;" . Can you explain why? It parses "11;".
grammar test;
options
{//language = 'CSharp2';
//language = 'Java';
output=AST;
}
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)+
;