The reality: You can't. But it's not a big deal, either. The main reason it's not a big deal is because other than the q-value, we don't really have another accept-param defined. So at least for now, you can assume it's a m-parameter until you see a q-value.
If I'm not mistaken, too, m-parameters are usually specifically defined for each m-type, so you could potentially parse for each of those as well, and then assume if there's no match that it's an accept-param. - rob -----Original Message----- From: Benoit Thiery [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 18, 2003 10:14 AM To: [EMAIL PROTECTED] Subject: [Sip-implementors] SIP grammar issue Hello, I would like to write a SIP parser. When analyzing RFC3261 grammar, I see one problem. For the rules : Accept = "Accept" HCOLON [ accept-range *(COMMA accept-range) ] accept-range = media-range *(SEMI accept-param) media-range = ( "*/*" / ( m-type SLASH "*" ) / ( m-type SLASH m-subtype ) ) *( SEMI m-parameter ) accept-param = ("q" EQUAL qvalue) / generic-param m-parameter = m-attribute EQUAL m-value m-attribute = token m-value = token / quoted-string How can I distinguish an accept-param of the accept-range and an m-parameter of the media-range as they can both be any "token EQUAL token" and they are both separated by SEMI ? Kind regards, Benoit _______________________________________________ Sip-implementors mailing list [EMAIL PROTECTED] http://lists.cs.columbia.edu/mailman/listinfo/sip-implementors _______________________________________________ Sip-implementors mailing list [EMAIL PROTECTED] http://lists.cs.columbia.edu/mailman/listinfo/sip-implementors
