[antlr-interest] lexical rule overlapping

=?gb2312?q?=CB=EF=BC=CD=B8=D5=20Jigang=20(Robert)=20Sun?= sunjigang1965 at yahoo.com.cn
Thu Jun 1 04:46:18 PDT 2006


Hi,

I am attempting implement Clean 0.8.4. According the following grammar (extracted from page 80 of
appendix.ps on ftp://ftp.cs.kun.nl/pub/Clean/old/Clean08/doc/ps/), +1234 could be either
considered as SymbolID or IntDenot.

SymbolId = UpperCaseChar.{RestChar} | Class1Char.{RestChar} ;

RestChar = LowerCaseChar | Class1Char | Digit| UpperCaseChar | CharDel | StringDel ;
LowerCaseChar = 'a' | 'b' | ... | 'z' ;
UpperCaseChar = 'A' | 'B' | ... | 'Z' ;

Class1Char = '@' | '#' | '$' | '%' | '^' | '&'| '?' | '*' | '-' | '+' | '/' | '='| '<' | '>' | '_'
| '.' | '`' | ''' ;

IntDenot = [Sign].[Digit]+ ;
Sign = '+' | '-' ;
Digit = '0' | '1' | ... | '9' ;


I am using Antlr to do the work. The rules IntDenot and SymbolId are overlapped, thus caused
lexical nondeterminism between the two grammar rules in lexer.  

Could anyone give me an idea?

Robert 



		
___________________________________________________________ 
ÇÀ×¢ÑÅ»¢Ãâ·ÑÓÊÏä-3.5GÈÝÁ¿£¬20M¸½¼þ£¡ 
http://cn.mail.yahoo.com


More information about the antlr-interest mailing list