antlr4 icon indicating copy to clipboard operation
antlr4 copied to clipboard

A new lexer command: Less

Open massaad opened this issue 12 years ago • 24 comments
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 <?.

massaad avatar Mar 29 '13 17:03 massaad