[antlr-interest] second lexical pass

idontwantanidwith2000init idontwantanidwith2000init at yahoo.com
Sun Apr 11 06:25:38 PDT 2004


Is there an elegant way to do a second lexical path instead of 
writing two lexers?

For instance:
STRING_LITERAL:
'"' (~('\r'|'n'|'\\') | '\\' .) '"' ;

now STRING_LITERAL will colide with any special string you'd like to 
match, for instance:
DATE_TIME : '"'YYYY-MM-DD hh:mm:ss'"'

I've managed to merge it with: 
'"'(LETTER)*'"'
'"'(LETTER)*'.'(LETTER)*'"'
'"'(LETTER)*'-'(LETTER)*'"'
Which was a diffucult task but doable.


I thought about it and merging these rules is possible, but it will 
take me days to write it and we haven't talked about validation.
(It is a good to write down my thoughts I'm starting to convince 
myself that it is a good idea)

What do you think is a proper solution?

Tal.



 
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