[antlr-interest] Parsing a quoted string

mzukowski at yci.com mzukowski at yci.com
Mon Jan 13 08:25:49 PST 2003


Take a look at the java grammar or the gcc grammar for examples of string
parsing.

Monty

-----Original Message-----
From: xadeck <decoret at graphics.lcs.mit.edu>
[mailto:decoret at graphics.lcs.mit.edu]
Sent: Saturday, January 11, 2003 9:25 PM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] Parsing a quoted string


I am trying to parse quoted atring, that is "lfkgslfkhg"

My basic rule is:
STRING: '"' ~'"'+ '"'
 
How can I do to allow protected quote inside a STRING, that is parse
values like "Joe \"Kid\" Banana"?

And then how can I also handle protected \, that is parse values like
"welcome to my \\home"

Thanks for any hint.


 

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