Hi there!
I have created a grammar and I am using 'skip' in the lexer to ditch whitespace, like so:
WS : [ \t\r\n]+ -> skip ;
Other tokens I have (and I would like to keep these, not rewrite):
FOO : 'foo';
STAR : '*';
BLOB: 'blob';
However, there are times in the parser where whitespace is significant for me. I would like to be able to parse:
foo * blob
differently to
foo *blob
But I do not want to turn off skip (my real grammar is more complex and there are only a few cases where whitespace is significant).
How can I do this in ANTLR4?
Thanks,
Maurice