On Tue, Apr 1, 2008 at 11:55 AM, Frank W. Miller <[EMAIL PROTECTED]> wrote: > > > I've been following this discussion for a bit. I agree that the grammar is > probably overly permissive but it is what it is. Just for fun, I decided to > contribute a bit here. In my implementation, I run the following little > preprocessor bit over all incoming messages. The idea is to try to put the > message in a little bit more "normal" form prior to parsing. This code is > part of the Asterisk implementation as well when the "pendantic" option is > turned on. It does a single pass over the message and collapses it > "in-place" in the provided buffer. It can probably be improved so I'm > interested in any and all comments. No license on this, use it as you > will... > >
I think line folding was not a terribly good idea. It complicates the parser and costs some processing overhead. As for the other stuff people complain about ( too many spaces and tabs and what not) - they are trivial to deal with. Yes you can produce terrible looking legal messages but any sensible implementation would not emit such messages. The problem is that a legal implementation *Could* emit such messages so we cannot use hindsight and tighten up the grammar. Oh incidentally, you can produce awfully formatted legal c++ syntax too but nobody would suggest we tighten up c++ grammar and make it more like python for reasons of readability. What is done is done. Ranga -- M. Ranganathan _______________________________________________ Sip-implementors mailing list Sip-implementors@lists.cs.columbia.edu https://lists.cs.columbia.edu/cucslists/listinfo/sip-implementors