Subject: [Sip] Using ABNF incremental rules to extend SIP grammer

From: "Pete Cordell" <[email-masked]>
Date: Tue, 28 Feb 2006 16:31:07 -0000

Apologies if this has been discussed before, but I quickly scanned
Jonathan's recently mentioned draft, and it occurred to me that the grammar
for the SIP extensions could be made more formal using ABNF's incremental
rules.

As you no doubt recall from rfc4234:

         ruleset     =  alt1 / alt2

         ruleset     =/ alt3

         ruleset     =/ alt4 / alt5

   is the same as specifying

         ruleset     =  alt1 / alt2 / alt3 / alt4 / alt5

Thus the grammar specified in Jonathan's document could have been made more
formal by doing:

   message-header =/ Anonymous-To  ; Extended from RFC3261

   Anonymous-To    =     "Anonymous-To" HCOLON ( name-addr / addr-spec )
                  *( SEMI generic-param )

   option-tag =/ anonymous-tag  ; Extended from RFC3261

   anonymous-tag   =     "anonymous"

   other-user =/  "anonymous"

Similarly, the grammar from draft-ietf-sip-answermode-00.txt, could be
augmented to become:

      message-header =/ Answer-Mode / Priv-Answer-Mode
                      ; Extended from RFC3261

      Answer-Mode = "Answer-Mode" HCOLON answer-mode-param *(SEMI
      answer-mode-option)

      Priv-Answer-Mode = "Priv-Answer-Mode" HCOLON answer-mode-param
      *(SEMI answer-mode-option)

      answer-mode-param = "Manual" / "Auto" / generic-param

      answer-mode-option = "require" / token

As code will often be generated from the ABNF definition, or manually 
created parsers will often include the ABNF as comments, it seems to me that 
this would reduce the scope for errors in implementation, with only minor 
effort from the document editors.

Pete.
--
=============================================
Pete Cordell
Tech-Know-Ware Ltd
                         for XML to C++ data binding visit
                         http://www.tech-know-ware.com/lmx
                         (or http://www.xml2cpp.com)
=============================================

_______________________________________________
Sip mailing list  https://www1.ietf.org/mailman/listinfo/sip
This list is for NEW development of the core SIP Protocol
Use [email-masked] for questions on current sip
Use [email-masked] for new developments on the application of sip