Subject: RE: capability negotiations

From: "Martin Stecher" <[email-masked]>
Date: Wed, 8 Oct 2003 16:32:56 +0200

Hi,

I do not really like that a structure does now start with either SP or CRLF right after the bracket.
(No wonder that you want to change rendering, looks ugly in the original way ;-)

I think, we could easily solve by defining the BNF this way:

   message = name [SP anonym-parameters] [CRLF named-parameters] [CRLF payload] ";" CRLF

   anonym-parameters = value *(SP value)               ; spaced values
   named-parameters = named-value *(CRLF named-value)  ; CRLF-separated values
   list-parameters = value *("," value)                ; comma-separated
   payload = data

   value = atom / structure / list
   named-value = name ":" SP value
   atom = bare-value / quoted-value
   structure = "{" [named-parameters] / [anonym-parameters [CRLF named-parameters]] "}"
   list =      "(" [list-parameters] ")"

Then syntax is again easy to write, no problem with the spaces I think.
The only burden remains to count characters for quoted strings (but since my text editorn shows number of selected characters, that is not too bad).

Regards
Martin

> -----Original Message-----
> From: [email-masked]
> [mailto:[email-masked]]On Behalf Of Alex Rousskov
> Sent: Wednesday, October 08, 2003 1:57 AM
> To: OPES WG (E-mail)
> Subject: RE: capability negotiations
> 
> 
> 
> 
> On Tue, 7 Oct 2003, Alex Rousskov wrote:
> 
> > > Will you add the named structure member concept to the OCP core?
> >
> > Yes, with the next revision, probably this week.
> 
> Done. See the latest snapshot at
> http://www.measurement-factory.com/tmp/opes/
> 
> Essentially, only the "structure" definition was changed from
> 
>   structure = "{" [ value *(SP  value) ] "}" ; spaced values
> 
> to
> 
>   structure = "{" parameters "}"             ; a.k.a structure members
> 
> where
> 
>   parameters = [anonym-parameters] [named-parameters]
> 
> Alex.
> 
> ------------------------------------------------------------
> This mail has been scanned by debian3-smtp
> (WebWasher 4.4.1 Build 652)
> ------------------------------------------------------------
>

---

From: Alex Rousskov <[email-masked]>
Date: Wed, 8 Oct 2003 11:17:07 -0600 (MDT)

> or CRLF right after the bracket.

I like it 50%. The leading SP is indeed a bug that should be fixed.

Leading CRLF is intentional -- it allows the parser to switch to
named-value parsing mode by looking ahead one character only.
Incidently, it makes syntax constructs simpler and also follows
classic C formatting style. How about this compromise (get rid of
leading SP, leave leading CRLF):

  message = name [SP anonym-parameters]
	[CRLF named-parameters CRLF]
	[CRLF payload]
	";" CRLF

  structure = "{" [anonym-parameters] [CRLF named-parameters CRLF] "}"

The above is (should be) identical to your proposal, except:

	- named-parameters always start with CRLF,
	  making parsing optimizations possible

	- named-parameters always end with CRLF,
	  making the layout classic C-like and
	  allowing for easier MIME-style payload
	  identification (CRLFCRLF or CRLF; terminates
	  "headers"), a very useful parsing optimization

For example,

	CMD1;

        CMD2 {
                n1: v1
                n2: {
                        n21: {v21a v21b}
                        n22: (v22a,v22b)
                }
        };

	CMD3 1 2 3
	n1: v1
	n2: v2
	;

I think we actually migrated to an even cleaner/simpler syntax with
all these named-members-related changes! Any corrections or
objections?

Thanks,

Alex.