[antlr-interest] Do I have to use lex state in this case?

Xue Yong Zhi zhixueyong at hotmail.com
Fri Oct 7 14:23:39 PDT 2005


In Perl and ruby, regular expression starts and ends with '/', for example:
/perl|ruby/

As we all know, '/' is the divide operator.

In my lexer I need to know wether '/' is the start of regular expression or 
simple a divide operator. Seems I have to reply on the current "context" (by 
introducing lex state). Are better ideas?

Thank you.

Yong
http://seclib.blogspot.com 





More information about the antlr-interest mailing list