This is an example grammar:
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals
generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"
START: elem += DOG ;
DOG: 'DOG' INT ';' ;
terminal CAT : ('A'..'Z')('A'..'Z')('A'..'Z')' '('0'..'9')+;
When Xtext sees the line: DOG 1234, it can't resolve and will give the error "mismatch input DOG 1234... expecting DOG" something like that. I thought that when Xtext encounters a keyword, it should have higher precedence than the terminal. But it seems like it's confused. How can I fix this?
Note that DOG and CAT is used in different placed (i.e. the terminal CAT is used in other rule, but its definition conflicts with DOG rule)
DOG 134,DOG 1234, but the terminal CAT will recognize the same thing also. - Amumu