Hello I need help with antlr4 grammar. I have been trying to create a parser for Datalog grammar. This is just a small snippet of the whole code. Whatever I try to parse its being recognized as Uppercase or Lowercase. The predicate token is not being recognized
For example the following Code should parse
abc as abc-> predicate
But its being parsed as
a-> Lrr
b-> Lrr
c-> Lrr
Its being parsed similarly for the rest of my code. How do I fix it?
grammar D;
predicate : Lrr | predicate varChars ;
varChars : Lrr | Urr;
Lrr : LOWERCASE;
Urr: UPPERCASE;
fragment LOWERCASE : [a-z] ;
fragment UPPERCASE : [A-Z] ;
Where am I going wrong. Please help