Try this ?
<QUOTED_STRING: "\'" (~["\'"])* ( "\'\'\'" (~["\'"])* )* "\'">
You should also extend this if you can have two apostrophes in a row
Marc MAZAS
-----Message d'origine-----
De : Alexander James [mailto:
earwigboy@...]
Envoyé : dimanche 25 octobre 2009 17:55
À :
users@...
Objet : [JavaCC] Parsing strings with quotes....
Hi All,
I'm trying to parse a language where single quotes are allowed within strings that are themselves enclosed within the same quotes without an escape character being used.
E.g. 'This is how you'''d use an apostrophe'
At the moment I'm defining a string within single quotes as the
following:
<QUOTED_STRING: "\'" (~["\'"])* "\'">
Has anyone got an suggestions on I could handle this?
Cheers,
---------------------------------------------------------------------
To unsubscribe, e-mail:
users-unsubscribe@...
For additional commands, e-mail:
users-help@...
---------------------------------------------------------------------
To unsubscribe, e-mail:
users-unsubscribe@...
For additional commands, e-mail:
users-help@...