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

mzukowski at yci.com mzukowski at yci.com
Fri Nov 15 12:08:11 PST 2002


Yeah, the lexer has no notion of what follows in the next token, so it
thinks there is nothing that could go wrong and doesn't even bother checking
LA(2).  This is a peculiarity of lexers.

Monty

-----Original Message-----
From: Paul J. Lucas [mailto:dude at darkfigure.org]
Sent: Friday, November 15, 2002 11:28 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:
> Could you post the generated code for that rule when k=2?

Here's the relevant bit from inside the try block:

        mNCName(false);
        {       
        if ((LA(1)==':')) {
                match(':');
                mNCName(false);
        }       
        else {  
        }       

        }       
        if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
                _token = makeToken(_ttype);
                _token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
        }       
        _returnToken = _token;                                       



 

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