[antlr-interest] Problem with lexer rule

carstenzerbst carsten.zerbst at atlantec-es.com
Thu Dec 18 02:11:29 PST 2003


Hello,

I'm just using antlr for step physical files and am pretty impressed
by the tool. I have a little problem to distinguish string like
'abcd.'


STRING : 
       APOSTROPHE! ( SPECIAL | DIGIT | SPACE | LOWER | UPPER  | "''" 
| REVERSE_SOLIDUS  )* APOSTROPHE!
       {Part21File.lexerLog.debug("found a string " + getText());} ;

and enumerations like '.UNUSED.'

ENUMERATION 
    options { paraphrase="an enumeration";} :
     '.'! UPPER ((UPPER | DIGIT )*) '.'!
     {Part21File.lexerLog.debug("found an enumeration " +
getText());} ;

How could I tell the string rule that tokens starting and ending with
a point (member of special) and including only uppercase and digits
are enumerations ?

Thanks, Carsten 



 

Yahoo! Groups Links

To visit your group on the web, go to:
 http://groups.yahoo.com/group/antlr-interest/

To unsubscribe from this group, send an email to:
 antlr-interest-unsubscribe at yahoogroups.com

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




More information about the antlr-interest mailing list