You don't necessarily need to remove embedded multiple quotes.
The function you use to access the string value can skip over the
multiple quotes. The original token string can be read-only.

Anyway, I remember a discussion on the Antlr list where you or
one of your co-workers discussed this very problem with a function
to eliminate the duplicate quotes.


On 9/27/11 6:34 PM, "Ruslan Zasukhin" <[email protected]>
wrote:

>On 9/28/11 12:46 AM, "Douglas Godfrey" <[email protected]> wrote:
>
>Hi Douglas,
>
>Yes, I have thinked about this way also.
>
>But in your solution you use helper functions as
>    RemoveQuotePairs()
>
>Which, I guess do some coping in additional ram buffers.
>This is fine for Java guys, but in C code, as Jim likes underline each
>time,
>we tend to use only pointers to input buffer, as long as possible.
> 
>
>> You need to modify your string lexing rules to use sub-rules for the
>> elementary
>> strings and return the concatenated string as the lexer token value.
>> 
>> The value of 
>> 
>> StringConstant: QuotedString
>> {RemoveQuotePairs($QuotedString);};
>> 
>> fragment
>> QuotedString:  ( StringTerm )+;
>> 
>> fragment
>> StringTerm:  Dquote ( Character )* Dquote;
>> 
>> fragment
>> Character: ( ' ' | AlphaChar | Punctuation | Digit );
>
>-- 
>Best regards,
>
>Ruslan Zasukhin
>VP Engineering and New Technology
>Paradigma Software, Inc
>
>Valentina - Joining Worlds of Information
>http://www.paradigmasoft.com
>
>[I feel the need: the need for speed]
>
>
>
>List: http://www.antlr.org/mailman/listinfo/antlr-interest
>Unsubscribe: 
>http://www.antlr.org/mailman/options/antlr-interest/your-email-address



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.

Reply via email to