Lexical mode in Antlr
Lexical modes allow to split a single lexer grammar file into multiple sublexers.
Lexers start out in the so-called default mode.
All rules are considered to be within the default mode unless you specify a mode command.
Modes are not allowed within combined grammars, just lexer grammars.
rules in default mode /** ... **/ mode MODE1; rules in MODE1 /** ... **/ mode MODEN; rules in MODEN /** ... **/