[antlr-interest] strange bug (v 2.7.2)

Terence Parr parrt at cs.usfca.edu
Wed Jul 2 10:20:59 PDT 2003


This is an approximate lookahead issue.  Break it up like this:

NE : "<>" ;

NE2: "!=" {$setType(NE);}

....

Ter

On Tuesday, July 1, 2003, at 11:01  PM, Lloyd Dupont wrote:

> :> java antlr.Tool FileMaker2.g
> ANTLR Parser Generator   Version 2.7.2   1989-2003 jGuru.com
> FileMaker2.g: warning:lexical nondeterminism between rules NOT_EQ and 
> LE
> upon
> FileMaker2.g:     k==1:'<'
> FileMaker2.g:     k==2:'='
> FileMaker2.g:     k==3:<end-of-token>
>
> :>
> ----- Original Message -----
> From: "Terence Parr" <parrt at cs.usfca.edu>
> To: <antlr-interest at yahoogroups.com>
> Sent: Wednesday, July 02, 2003 3:56 PM
> Subject: Re: [antlr-interest] strange bug (v 2.7.2)
>
>
> What's the warning say?
>
> Ter
>
> On Tuesday, July 1, 2003, at 10:33  PM, Lloyd Dupont wrote:
>
>> (I join you a simple failing grammar)
>>
>> basically I have a simple tokens definition like that:
>> //--------------------------- lexer.g ----------------
>> class FMSqlLexer extends Lexer;
>> options {
>> k = 3;
>> charVocabulary = '3' .. '177';
>> }
>>
>> NOT_EQ: ("<>") | ("!=") | ("^=") ;
>> LE: ("<=") ;
>> LessT: "<" ;
>> // ---------- end of lexer ----------
>>
>> and ANTLR find it ambiguous !
>>
>> what's wrong ?
>> I mean which clues should I give to ANTLR to help it understand its
>> errors ?
>>
>>
>>
>> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
> --
> Professor Comp. Sci., University of San Francisco
> Creator, ANTLR Parser Generator, http://www.antlr.org
> Co-founder, http://www.jguru.com
> Co-founder, http://www.knowspam.net enjoy email again!
> Co-founder, http://www.peerscope.com link sharing, pure-n-simple
>
>
>
>
>
>
> 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/
>
> <FileMaker2.g>
--
Professor Comp. Sci., University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Co-founder, http://www.jguru.com
Co-founder, http://www.knowspam.net enjoy email again!
Co-founder, http://www.peerscope.com link sharing, pure-n-simple




 

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




More information about the antlr-interest mailing list