[antlr-interest] Re: Lexer not putting colon back

mzukowski at yci.com mzukowski at yci.com
Fri Nov 15 10:52:23 PST 2002


I can't really say why it didn't work.  Could you post the generated code
for that rule when k=2?  The lexer analysis has to do some special things to
not analyze too deeply.  If you think of nextToken() as an alternative block
of all un-protected lexer rules, then you would see that the analysis for
your rule doesn't include looking at what is coming as the next complete
token.  If it did look beyond that then you would get a lot more ambiguities
which don't make sense for a lexer.  Ter can correct me here, but I think
that's what is going on.

Monty

-----Original Message-----
From: Paul J. Lucas [mailto:dude at darkfigure.org]
Sent: Friday, November 15, 2002 10:17 AM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] Re: Lexer not putting colon back


--- In antlr-interest at y..., mzukowski at y... wrote:
> Then use a syntactic predicate
> 
> QNAME ((':' ~('='))=>':' QNAME)?

That works; thanks.  But why is it necessary to do this?  The other way
really seems like it should have worked.

- Paul


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list