I'm using the JSON grammar from the antlr4 grammar repository to parse JSON files. It works fine and ignores whitespace with the usual rule: WS: [ \t\n\r] + -> skip;
I want to re-use the lexer to identify all tokens for syntax highlighting in eclipse. It requires to specify whitespace tokens as well, but calling JSONLexer.nextToken()
skips over them.
Is there a way to not skip whitespace when using the lexer directly?