I have defined a ANTLR grammer:
grammar test5;
stats_statement
:
STATS IDENT ASSIGN_SYM functions_stats
;
functions_stats
: COUNT LPAREN IDENT RPAREN
;
STATS
: 'STATS'
;
COUNT
: 'count'
;
IDENT
: (LETTER | '_') (LETTER | DIGIT | '_')*
;
ASSIGN_SYM
: ':='
;
COMMA_SYM
: ','
;
SEMI_SYM
: ';'
;
LPAREN
: '(' ;
RPAREN
: ')' ;
fragment
LETTER : ('a'..'z' | 'A'..'Z') ;
fragment
DIGIT : '0'..'9';
which has one build-in function "count". But if I use the following test string:
STATS count:=count(col1)
the parser will return an error saying:
mismatched input 'count' expecting IDENT
any clue and/or hints on how to fix this problem?
Thanks Charles