[antlr-interest] Missing characters in partial matches

Kay Röpke kroepke at classdump.org
Sat Aug 23 10:24:02 PDT 2008


On Aug 23, 2008, at 5:50 PM, Matt Palmer wrote:

> Just a quick thank you to everyone who's responded.  I feel like I  
> have a
> better grasp on what's going on now.  I'm going to have a play, and  
> look at
> the tokens DFA (or even the code, if that doesn't enlighten me).   
> I'm keen
> to understand how the v3 lexer actually works, but also how it might
> otherwise work too :)


The DFA in ANTLRWorks (or by generating it by hand and giving  
org.antlr.Tool the -dfa option) is really what you want to be looking  
at. For big DFAs the codegen will likely be a table-based DFA and  
that's not really readable ;)

Just come up with some simple cases where it doesn't do what you  
expect, then look at the DFAs. You'll pretty much know what happens  
then :) Together with the very helpful summary by the others in this  
thread, that is!

cheers,
-k
-- 
Kay Röpke
http://classdump.org/








More information about the antlr-interest mailing list