if
comment = SWS '(' SWS *(ctext / quoted-pair / comment) SWS ')'
then " ( Demo ( 5 days left ) ) " parses the way you want.
You will match the "Demo" in comment as ctext.
You are still in the *(ctext / quoted-pair / comment) loop.
The next thing you see matches SWS '(' ctext SWS ')',
so you recur as comment
You then see SWS ')', so the outer comments ends,
and the whole comment production ends.
so comment will first match "Demo" and then match "5 days left"
Brian
-----Original Message-----
From: Chris McKinnon [mailto:[EMAIL PROTECTED]
Sent: Monday, August 25, 2003 2:39 PM
To: Rosen, Brian; Mailing List SIP
Subject: Re: [Sip-implementors] Comments
Hi,
I think you're on the right track with "comment = SWS '(' SWS *(ctext /
quoted-pair / comment) SWS ')' ". Here are the two cases:
Retry-After = "Retry-After" HCOLON delta-seconds [ comment ] *(SEMI
retry-param)
Server = "Server" HCOLON server-val *(LWS server-val)
server-val = product / comment
I looks like it would work for both. I remembered after I sent my last
e-mail that in order to allow "Retry-After: 120 (I'm in a meeting)" we need
"SWS "(" SWS".
If we are worried about white-space around text this still causes some
issues. For "( Demo ( 5 days left ) )" the text would parse as "Demo ", "5
days left ", and " ". To fix this I was thinking we would have to use
something like:
ctext-no-lws = %x21-27 / %x2A-5B / %x5D-7E / UTF8-NONASCII / quoted-pair
ctext-char = %x21-27 / %x2A-5B / %x5D-7E / UTF8-NONASCII / LWS / quoted-pair
ctext = ctext-no-lws [ *ctext-char ctext-no-lws ]
sub-comment = SWS '(' SWS *(ctext / sub-comment) SWS ')' SWS
comment = SWS '(' SWS *(ctext / sub-comment) SWS ')'
This production would parse the text in "( Demo ( 5 days left ) )" as "Demo"
and "5 days left". I'm not sure how important removing white-space is in
this field (it is just a comment).
Thanks,
Chris McKinnon
_______________________________________________
Sip-implementors mailing list
[EMAIL PROTECTED]
http://lists.cs.columbia.edu/mailman/listinfo/sip-implementors