How to control switching Antlr
lexer modes from parser actions?
I extended the generated Parser and Lexer so I can call pushMode
and popMode
from parser witch in turn call suitable pushMode
and popMode
of lexer but with no effect. Is there any thing I can do to activate this functionality?
Your lexer should be written such that the input can be completely tokenized before the parser is even created. Even though the token stream is lazily filled, ANTLR 4 is not guaranteed to correctly parse the input if your lexer does not meet this requirement.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With