Subject: RE: IG 6.79 "Cancelling Event Detection" breaks ABNF

From: "Tom-PT Taylor" <[email-masked]>
Date: Thu, 7 Jun 2001 17:50:27 -0400

I'm the one responsible for all this.  I suppose I should dig up the thread.
Anyway, the intention was definitiely to provide a way of signalling empty
descriptors.  I think we chose rather arbitrarily between the desc{} and
desc form, opting for the latter.

-----Original Message-----
From: Troy Cauble [mailto:[email-masked]]
Sent: Thursday, June 07, 2001 3:33 PM
To: Rosen, Brian
Cc: Christian Groves; MEGACO list
Subject: Re: IG 6.79 "Cancelling Event Detection" breaks ABNF

"Rosen, Brian" wrote:
> 
> I see the problem.  It took me a while to see why auditItem
> is in auditReturnParameter in the first place.  It's so that
> you can return an empty descriptor, at least that is the only
> reason I can come up with.  

How do we verify that this was the only intended use of that 
form in auditReturnParameter?

The rest of my statements below are based on this assumption.

> Not all the descriptor definitions
> allow an "empty" descriptor.  Consider Mux and Modem for example:
>    muxDescriptor        = MuxToken EQUAL MuxType  terminationIDList
>    modemDescriptor      = ModemToken (( EQUAL modemType) /
>                           (LSBRKT modemType *(COMMA modemType) RSBRKT))
>                           [ LBRKT NAME parmValue
>                          *(COMMA NAME parmValue) RBRKT ]
> 
> Notice that an empty modem is easy, but an empty mux is not.

It's the same in either case, just an extra "( ) / LBRKT RBRKT" for 
my proposal or an extra "[ ]" if you're getting rid of auditItem  
like you propose below.

It would make modemDescriptor a little uglier, but I think that
having a higher level parsing conflict is uglier yet.

And regarding the form, Token-only vs. Token { }, signalsDescriptor
already has an empty form that uses the braces.  We should be consistent
in what an empty descriptor looks like.

> Assuming there isn't another reason, your problem is solved --
> you can assume either, they mean the same thing, and you don't
> have to change the syntax.  

Then there are big implications in the ASN.1 encoding.  There
there are two *very* different  ways of encoding the same thing. 
And you can't fix this in ASN.1 only without making it hard to 
see the alignment in the two encodings.

> I'm worried that a rule-based parser
> will complain about the grammar as opposed to actually having a
> problem parsing.  

A rule based parser will have a reduce/reduce conflict.
Your argument that it means the same thing and either
choice is OK is valid *IFF* 1) the generater will pick one
as a default instead of failing, and 2) the writer associates 
the same actions with the rules.

It's much better to fix the problem though.  Two ways to
encode the same thing is bad.  Conflict messages indicate a
poorly defined grammar, whether or not you can explain them
away.

> It would have been better to eliminate auditItem
> in auditReturnParameter and fix all the descriptor productions to
> have the value optional.  

I think that this is the "right" answer, too.

Another argument for doing the "right" thing:
The auditItem elements have been left out of the command
API descriptions, section 7.2.5 and 7.2.6.  If the returned
descriptors listed there *imply* empty ones too, then an
"empty" form should be a part of the ABNF & ASN.1 representations 
for those descriptors.

> That seems like too big of a change for the
> IG.

I see it differently.  The IG is breaking things with 6.79.
It is never too much to ask that the IG not break things.
We need a *different* or *additional* IG modification to 
solve the problem that 6.79 was trying to solve.

This is significant breakage.  Please don't let this slide!

But I also understand the desire to do minimal changes.
Given that, we could fix how the 3 descriptors with empty
forms work with auditItem, not how they all work with auditItem.

Here is one approach that works with the current 6.79 (although
I'd prefer to see those empty descriptors forms changed to Token { }).

Two forms of auditItem.

   auditReturnItem      = ( MuxToken / ModemToken / MediaToken /
                           				; SignalsToken /
EventBufferToken /
                           DigitMapToken / StatsToken / 	  ;
EventsToken /
                           ObservedEventsToken / PackagesToken )

   auditItem            = ( auditReturnItem /
                            SignalsToken / EventsToken / EventBufferToken )

   auditReturnParameter = (mediaDescriptor / modemDescriptor /
                           muxDescriptor / eventsDescriptor /
                           signalsDescriptor / digitMapDescriptor /
                     observedEventsDescriptor / eventBufferDescriptor /
                           statisticsDescriptor / packagesDescriptor /
                            errorDescriptor / auditEmptyReturnItem )

and lots of comments and similar ASN.1 changes.

-troy

> 
> Brian
> 
> > -----Original Message-----
> > From: Troy Cauble [mailto:[email-masked]]
> > Sent: Thursday, June 07, 2001 11:46 AM
> > To: Christian Groves; MEGACO list; Rosen, Brian
> > Subject: IG 6.79 "Cancelling Event Detection" breaks ABNF
> >
> >
> >
> > Greetings,
> >
> > IG 6.79 introduces the square brackets in the ABNF syntax below.
> >
> >    eventsDescriptor     = EventsToken [ EQUAL RequestID LBRKT
> >                          requestedEvent *( COMMA
> > requestedEvent ) RBRKT ]
> >
> > and similar changes to "embedFirst" and "eventBufferDescriptor".
> >
> >
> > The token-only representations for empty descriptors are
> > indistingushable
> > from the auditItem tokens in an auditReturnParameter/terminationAudit.
> >
> > (That is, when parsing a terminationAudit, you can't tell if an
> > EventsToken is an empty eventsDescriptor or an auditItem.)
> >
> >    auditItem            = ( MuxToken / ModemToken / MediaToken /
> >                            SignalsToken / EventBufferToken /
> >                            DigitMapToken / StatsToken / EventsToken /
> >                            ObservedEventsToken / PackagesToken )
> >
> >    auditReturnParameter = (mediaDescriptor / modemDescriptor /
> >                            muxDescriptor / eventsDescriptor /
> >                            signalsDescriptor / digitMapDescriptor /
> >                      observedEventsDescriptor /
> > eventBufferDescriptor /
> >                            statisticsDescriptor / packagesDescriptor /
> >                             errorDescriptor / auditItem )
> >
> >    terminationAudit     = auditReturnParameter *(COMMA
> >                         auditReturnParameter)
> >
> >
> > One fix would be to change the empty descriptor syntax to "Token { }"
> > or "Token = { }".
> >
> >    eventsDescriptor     = (EventsToken EQUAL RequestID LBRKT
> >                          requestedEvent *( COMMA
> > requestedEvent ) RBRKT) /
> >                          (EventsToken LBRKT RBRKT)
> >
> > With similar changes for "embedFirst" and "eventBufferDescriptor".
> >
> > -troy
> >

---

From: Troy Cauble <[email-masked]>
Date: Thu, 07 Jun 2001 18:39:25 -0400

> Tom-PT Taylor wrote:
> descriptors.  I think we chose rather arbitrarily between the desc{} and desc
> form, opting for the latter.

Well, an empty Signals Descriptors already uses desc{},
shouldn't we go for the symmetry?  Didn't we just change
the original protocol for symmetry reasons?  This would 
be just changing the IG.

-troy