[antlr-interest] Pushdown lexer

Peter S. May me at psmay.com
Sat Nov 10 21:52:33 PST 2012


Hello again.

I've been in the process of writing a lexer that could rightly be described as a pushdown automaton with some utilization of lookahead; it variously pushes and pops states on a stack depending on the input and uses the top as a start conditions. This essentially makes it so that every single rule begins with a semantic predicate, since ANTLR doesn't do start conditions on its own. Naturally, "The code of method specialStateTransition(int, IntStream) is exceeding the 65535 bytes limit". Is there any general advice on refactoring a lexer to get around this? (Or, dare I ask, should I be researching a tool that handles this sort of language more efficiently?)

Thanks
PSM


More information about the antlr-interest mailing list