Subject: [Megaco] unfriendly ABNF for actionRequest

From: Raphael Tryster <[email-masked]>
Date: Thu, 22 Aug 2002 20:26:48 +0200

actionRequest        = CtxToken EQUAL ContextID LBRKT (( 
                          contextRequest [COMMA  commandRequestList])  
                          / commandRequestList) RBRKT 
    
   contextRequest          = ((contextProperties [COMMA contextAudit]) 
                           / contextAudit) 
    
   contextProperties    = contextProperty *(COMMA contextProperty) 
    
A straightforward implementation of a parser for the above expects, when
parsing contextProperties, to find another contextProperty after each COMMA.
However, it may actually find that the COMMA is followed by contextAudit, or
by commandRequestList.  This is unusual because, in the rest of Megaco,
punctuation is a good guide to delimiting content.  In this case, the parser
cannot make good use of the commas, but has to look ahead to the token after
it to determine which production the COMMA belongs to.

I think the meaning is really that an actionRequest has, inside the braces,
a list of items separated by commas, such that all items of type
contextProperty, if any, must come first, then, optionally, a contextAudit,
and then, optionally, a commandRequestList.  Is this the intention, and is
the parser-unfriendliness deliberate?

Raphael Tryster