[antlr-interest] Another parsing question

Terence Parr parrt at cs.usfca.edu
Tue Aug 5 14:52:33 PDT 2008


On Aug 5, 2008, at 2:35 PM, Randall R Schulz wrote:

> On Tuesday 05 August 2008 14:22, Terence Parr wrote:
>> On Aug 5, 2008, at 12:44 PM, Foust wrote:
>>>> Lexing is all done up front with no input from the parser at all.
>>>
>>> Why was that done? Is it the price you pay for infinite lookahead?
>>
>> Speed of access for ith char / token.  Will build a lazy version. :)
>
> 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?

Nope...the infinite lookahead makes comm between the two impossible.   
It will simply consume less memory and allow interactive parsers.

Ter


More information about the antlr-interest mailing list