I am new to Antlr-4, but have some idea about Antlr-3, where the lexer could be created without the need of any parser rule; in order to match a lexer rule by matching some tokens like:
CLASS: 'Class' WS+ id=ID
{
System.out.println($id.text);
}
ID : [a-z]+ ;
WS : [ \r\t\n]+
How could I do this in Antlr-4 without any parser, since the Antlr-4 lexer does not allow using attributes in the rule's action?
Any idea/example will be helpful for me!