[antlr-interest] Another parsing question

Matt Palmer mattpalms at gmail.com
Wed Aug 6 04:52:50 PDT 2008


I believe you are talking about Parsing Expression Grammars

http://en.wikipedia.org/wiki/Parsing_expression_grammar

In fact, ANTLR supports many features of PEGs - but it retains the
separation of lexer and parser.

Matt

On Wed, Aug 6, 2008 at 12:33 PM, Gavin Lambert <antlr at mirality.co.nz> wrote:

> 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).  :)
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080806/eef85721/attachment.html 


More information about the antlr-interest mailing list