[antlr-interest] How to have strings enclosed in " and/or "

Terence Parr parrt at cs.usfca.edu
Fri Dec 10 14:17:44 PST 2004



On Dec 10, 2004, at 12:33 PM, matthew ford wrote:

>
> Hi Ter,
>
> " foo " and more "
> is String ' foo '
> Text  ' and more '
> and start of another string unclosed

Oh.  I thought you could nest these.  If it's just (quote or 
escaped-quote) stuff (quote or escaped-quote) then it's easy, right?

> It is not quite that bad. Actually
> it would more like
> !![ " foo "] and more "
> or some such
> I am only looking at quotes inside my webstringtemplate escapes !![  ]
> I need to know when closing ] is outside a quoted string (allow for 
> escaped
> quotes)
> e.g  !![" !![ ]" ]  in the template will output
> !![ ]
> and  !![""" !![ ]""" ]  in the template will output
> "!![ ]"

Do you really want to allow """ to mean double quote?

Anyway, I understand your issue, but I think i'd do something to make 
it more obvious to the scanner.

Ter
>
> a " and a " are interchangable because they look the same to
> the user editing HTML in a visual editor.
> matthew
> ----- Original Message -----
> From: "Terence Parr" <parrt at cs.usfca.edu>
> To: <antlr-interest at yahoogroups.com>
> Sent: Saturday, December 11, 2004 4:51 AM
> Subject: Re: [antlr-interest] How to have strings enclosed in " and/or
> &quot;
>
>
>>
>>
>> On Dec 10, 2004, at 2:43 AM, matthew ford wrote:
>>> Yes I do
>>> I stop the string when I meet
>>> either "  or &quot;  by themselves
>>
>> Hmm...doesn't seem right to me.  For example, here is some text that
>> should be one string...OR not depending on your interpretation; has
>> somebody in HTML land just dictated which way it goes like
>> if-then-else?
>>
>> " foo &quot; and more "
>>
>> Ter
>>
>>> if I meet
>>> "&quot; or "" or &quot;" or &quot;&quot;
>>> Then this is not the end of the string just an escaped quote
>>> matthew
>>>
>>> ----- Original Message -----
>>> From: "Terence Parr" <parrt at cs.usfca.edu>
>>> To: <antlr-interest at yahoogroups.com>
>>> Sent: Friday, December 10, 2004 8:32 AM
>>> Subject: Re: [antlr-interest] How to have strings enclosed in " 
>>> and/or
>>> &quot;
>>>
>>>
>>>>
>>>>
>>>> On Dec 9, 2004, at 11:36 AM, matthew ford wrote:
>>>>
>>>>>
>>>>> Hi Ter,
>>>>> What ambiguity do you see that I don't? Both  tokens mean the same 
>>>>>  "
>>>>> = =
>>>>> &quot;
>>>>> Perhaps I am too close the problem
>>>>
>>>> I just meant that you really don't know when to stop a string, do 
>>>> you?
>>>>
>>>> Ter
>>>> --
>>>> CS Professor & Grad Director, University of San Francisco
>>>> Creator, ANTLR Parser Generator, http://www.antlr.org
>>>> Cofounder, http://www.jguru.com
>>>> Cofounder, http://www.knowspam.net enjoy email again!
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Yahoo! Groups Links
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>> Yahoo! Groups Links
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>> --
>> CS Professor & Grad Director, University of San Francisco
>> Creator, ANTLR Parser Generator, http://www.antlr.org
>> Cofounder, http://www.jguru.com
>> Cofounder, http://www.knowspam.net enjoy email again!
>>
>>
>>
>>
>>
>>
>> Yahoo! Groups Links
>>
>>
>>
>>
>>
>>
>>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
--
CS Professor & Grad Director, University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com
Cofounder, http://www.knowspam.net enjoy email again!





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

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





More information about the antlr-interest mailing list