antlr4
antlr4 copied to clipboard
A new lexer command: Less
trafficstars
It will be helpful if we can do some look-ahead while in the lexer without tying the grammar to a particular target language.
So, I am proposing adding a new lexer command that is almost the opposite of more. Using an example derived from the example in the book (in section 12.4):
SPECIAL_OPEN : '<?' Name -> less, pushMode(PROC_INSTR);
when matched, will switch to PROC_INSTR mode, but then will start matching again starting from <?.