[antlr-interest] Another parsing question

Gavin Lambert antlr at mirality.co.nz
Wed Aug 6 04:33:08 PDT 2008


At 09:35 6/08/2008, Randall R Schulz wrote:
 >That's probably a good idea, but will you preserve the
 >current semantics, making the lazy version simply a
 >performance variant, or will you allow the parser to
 >influence the behavior of the lexer, as so many people
 >initially believe to be possible when the come to
 >ANTLR?

I'm somewhat interested in the idea of making a lexer-less parser 
(basically a parser-only grammar that matches individual 
characters instead of tokens).  I mean, I expect the performance 
will be significantly worse than the present design, but it would 
permit more flexibility, and in some applications that's more 
important than speed.

You could probably almost do it by making a stub lexer that 
generates single-character tokens; the trouble with that idea of 
course (other than being a bit kludgy) is that if you're expecting 
full Unicode-range input then that's a *massive* amount of 
possible tokens (and no doubt the Java compiler at least would 
have a fit if you generated the token identifiers the same way as 
at present).  :)



More information about the antlr-interest mailing list