Re: [Ogdl-core] Extraneous Commas and Parens
Brought to you by:
rveen
|
From: Rolf V. <rol...@er...> - 2006-01-03 18:26:39
|
didge wrote:
> Allowing for a single trailing comma and empty end of group, each of these
> examples is suspicious because the extra punctuation suggests that there is
> something missing (denoted by the '?'):
>
> ?,a
>
> a,?,
>
> ?(a)
>
> a(?(b))
>
> a(?())
>
> a,?()
>
> Are there any examples of systems or individuals that currently author OGDL
> with extra punctuation and why?
I want the OGDL parser to be robust and tolerant, that is the main idea.
Case by case:
1) ,a +1 to signal this as an error
2) a,, -0. I don't care to much, but tolerance is for me desirable.
Just be sure that this will not round trip, no empty nodes
will be generated.
3) () -1. Empty group should be allowed. No nodes are generated.
4) (a) -1. Equivalent to scalar 'a'.
5) ((a)) -1. Equivalente to scalar 'a'.
Once thing is that we disallow nodes after groups, and other one is to
limit groups to more than one element.
> What would be the downside of not allowing extra punctuation?
Programs that generate OGDL do not need to care for this special cases,
that can occur, especially groups with less than 2 element.
> For my needs, I want to treat extra punctuation as possible errors in order
> to eliminate real errors in my systems as quickly as possible. Therefore,
> my parser will by default disallow extra punctuation (and probably trailing
> commas and empty groups, too), but may include an option to allow them if
> desired.
Totally acceptable of course, if the option remains. What you require
from OGDL streams could be considered as a stricter and unambiguous
syntax, canonical in some sense.
--
Rolf.
|