[antlr-interest] lexer rule for string

mzukowski at yci.com mzukowski at yci.com
Wed Oct 16 08:03:14 PDT 2002


You could take a look at the ANSI C/GCC parser and tree transformation
framework.  http://www.codetransform.com/gcc.html

Monty

> -----Original Message-----
> From: stephane brossier [mailto:dognogod at yahoo.com]
> Sent: Tuesday, October 15, 2002 11:02 PM
> To: antlr-interest at yahoogroups.com
> Subject: [antlr-interest] lexer rule for string
> 
> 
> 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/ 


 

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



More information about the antlr-interest mailing list