[antlr-interest] DMQL Grammar - ANTLR Eats Characters

Terence Parr parrt at cs.usfca.edu
Fri Mar 20 11:31:39 PDT 2009


On Mar 20, 2009, at 6:23 AM, Indhu Bharathi wrote:

> Unfortunately, ANTLR implementation of Lexer doesn't backtrack (maybe
> for efficiency purposes). Backtracking and taking an alternative can  
> be
> done only in the parser. This was already discussed in the list. See -
> http://www.antlr.org/pipermail/antlr-interest/2009-February/032981.html 
> .

Hi. ANTLR generates lexer's, parsers, tree parsers with the same code  
generator and all of those derive from a single base class. all three  
can backtrack :) in the case of the lexer, though, it's not the kind  
of backtracking you see in lex.

Ter


More information about the antlr-interest mailing list