Iñaki Baz Castillo wrote:
> El Thursday 05 June 2008 17:37:58 [EMAIL PROTECTED] escribió:
>> From: =?utf-8?q?I=C3=B1aki_Baz_Castillo?= <[EMAIL PROTECTED]>
>>
>> So I must be carefull and don't match comma between "", () or <> when
>> spliting the header raw text into various values.
>>
>> Yes, in general you cannot split a header into parts without parsing
>> the parts.
>
> This is IMHO a **very** bad design of a protocol. Instead of using this
> ambiguous and difficult mechanims (for the parser) a simple solution could be
> avoid multivalues headers.
Yes, it is. I guess you can blame the designers of http for this, or
maybe goes back to email.
It is certainly attractive to do a "light" parse into headers without
parsing the header content, and then only parse the details if needed.
And it can be done with care. If you want a general approach you could
process the abnf to generate a very simple grammar just for that
purpose. It will not be quite as simple as a fsm, because at least one
relevant rule (comment) is recursive. But it can be pretty simple.
I've only seen it done ad-hoc.
Paul
_______________________________________________
Sip-implementors mailing list
[email protected]
https://lists.cs.columbia.edu/cucslists/listinfo/sip-implementors