[antlr-interest] lexer rule for string

stephane brossier dognogod at yahoo.com
Tue Oct 15 23:02:19 PDT 2002


Hi,

I am trying to recognize some strings in a C program.

I first had a lexer rule defined as is:

STRING: '"' ~'"' '"';

This worked pretty well until I had some traces like:
 printf("The string is  \" the_string \" ");

How can i make the lexer understand that \" is not the
end of my string but is actually part of my string
since there is an escape char before?

Thanks,

S.


__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com

 

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



More information about the antlr-interest mailing list