I'm excepting to write between brackets letters/ numbers. However, my Grammar is not accepting numbers.
The rules are defined in my grammar file like this:
id_list
: '(' ID (',' ID)* ')'
-> ID+
;
ID
: ('a'..'z' | 'A'..'Z' | '_' | '.' | '-' | Digit)*
;
Number
: Int ('.' Digit*)?
;
fragment Int
: '1'..'9' Digit*
| '0'
;
fragment Digit
: '0'..'9'
;
But I'm not able to write (1, 2). It tells me "mismatched input '1' expecting ID" It is only accepting letters or letters with numbers, not just numbers.
Can you tell my what is wrong?