[antlr-interest] problem with literal match

John Lambert johnl at jbase.com
Wed Oct 3 13:38:34 PDT 2001


Monty,
 
If you use case insensitive, you need all you literals in lower case.
 
John
 

-----Original Message-----
From: mzukowski at bco.com [mailto:mzukowski at bco.com]
Sent: Wednesday, October 03, 2001 1:37 PM
To: antlr-interest at yahoogroups.com
Subject: RE: [antlr-interest] problem with literal match



I vaguely remember a bug with cases and case-insensitive literals.  Try
making your literals upper case instead of lower, see if that works.

Monty 

> -----Original Message----- 
> From: Ruslan Zasukhin [ mailto:sunshine at public.kherson.ua
<mailto:sunshine at public.kherson.ua> ] 
> Sent: Wednesday, October 03, 2001 1:22 PM 
> To: antlr-interest at yahoogroups.com 
> Subject: Re: [antlr-interest] problem with literal match 
> 
> 
> on 10/3/01 22:35, Ruslan Zasukhin at sunshine at public.kherson.ua wrote: 
> 
> I wonder that may be problem is hidden that the next function 
> is EMPTY in 
> generated code? 
> 
> void OBL_SQL_Lexer::initLiterals() 
> { 
> } 
> 
> But then I wonder why I must init table of Literals by hands ??? 
> And how to do this ? 
> I don't see nothing helpful in examples and docs. 
> 
> 
> > Hi All, 
> > 
> > I have in grammar rule as: 
> > 
> > ------------------------------------------------- 
> > drop_table_statement 
> > :    "drop"! "table"! table_name drop_behavior 
> > ; 
> > 
> > 
> > in generated parser I see that in table ANTLR put literals with "" 
> > ------------------------------------------------- 
> > const char* OBL_SQL_Parser::tokenNames[] = { 
> > "<0>", 
> > "EOF", 
> > ........       
> > "\"drop\"", 
> > "\"table\"", 
> > "\"cascade\"", 
> > "\"restrict\"", 
> > 0 
> > }; 
> > 
> > 
> > Now I try to pass to Parser test string "DROP TABLE errors" 
> > I see in debugger that function 
> > 
> > int CharScanner::testLiteralsTable(int ttype) const 
> > { 
> > 
> STD::map<STD::string,int,CharScannerLiteralsLess>::const_iterator i = 
> > literals.find(text); 
> > if (i != literals.end()) 
> > ttype = (*i).second; 
> > return ttype; 
> > } 
> > 
> > DO NOT FIND first word 'DROP' in my test string. 
> > 
> > NOTES: 
> > ** CASE is not sensitive. 
> > ** I did try testLiterals as true so false. 
> > 
> > WHERE IS PROBLEM ??? 
> 
> -- 
> Best regards, 
> Ruslan Zasukhin 
> 
> ------------------------- 
> Paradigma. 
> 
> e-mail: ruslan at paradigmasoft.com 
> web   : http://www.paradigmasoft.com <http://www.paradigmasoft.com>  
> 
> To subscribe to the Valentina mail list 
> send a letter to valentina-on at lists.macserve.net 
> 
> 
> 
>  
> 
> Your use of Yahoo! Groups is subject to 
> http://docs.yahoo.com/info/terms/ <http://docs.yahoo.com/info/terms/>  
> 
> 
> 


Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> . 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20011003/e696cc89/attachment.html


More information about the antlr-interest mailing list