At 05:56 18/03/2009, Gesuato Emanuele wrote:
>I would like to use the ' character inside the string something
>similar to:
>
>Invoice.customer='Tom L\'oreal'
>or (better)
>Invoice.customer="Tom L'oreal"
>
>I've got the String definition for such fields that is the
>following:
>STRING : "'"((JOLLY)?(PAROLE|INTEGER)(JOLLY)?)"'";
Are you sure that *s can only appear at either end, never in the
middle?
Anyway, if you want to permit a \' escape, then you have to
explicitly spell it out. Personally, though, I wouldn't try to be
even slightly restrictive on the contents of the string -- leave
that to later validation in the parser or external code:
STRING : '\'' ('\\' ('\'')? | ~('\\' | '\''))* '\'';
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---