I am getting following error on parsing but not sure why it's happening.
line 1:24 mismatched input '1' expecting NUM line 1:24 mismatched input '1' expecting NUM select a from abc limit 1 ;
--
grammar SQLCmd;
parse : sql ;
sql : ('select' ((columns (',' columns))|count) 'from') tables ('where' condition ((and|or) condition))* (limit)? ';' ;
limit : 'limit' NUM ;
num : NUM ;
count : 'count(*)' ;
columns : VAL ;
tables : VAL ;
condition : ( left '=' right )+ ;
and : 'and' ;
or : 'or' ;
left : VAL ;
right : VAL ;
VAL : [*a-z0-9A-Z~?]+ ;
NUM : [0-9]+ ;
WS : [ \t\n\r]+ -> skip ;