[antlr-interest] Lazy load of CommonTokenStream??

Raphael Reitzig r_reitzi at cs.uni-kl.de
Mon Aug 18 12:10:50 PDT 2008


> The semantics are that a stream is never "on" a specific element,  
> but rather "in between". Then LA(-1) is the just consumed element  
> and LA(1) is the next one to be looked at. With those semantics  
> LA(0) makes no sense, because it's not a valid element. An element  
> (char, token or node) is either consumed or not, so I think it makes  
> sense to specify it this way.

Uh. Is that standard behaviour of streams? I certainly prefer Turing  
machine semantics.
You could implement LA(0) := LA(-1), but this would create additional  
confusion for sure. ("Why does LA(-1) not yield the next token to the  



This message was sent using IMP, the Internet Messaging Program.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: PGP Digital Signature
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20080818/ac3efd0f/attachment.bin 

More information about the antlr-interest mailing list