Re: [Ogdl-core] Repy
Brought to you by:
rveen
|
From: Rolf V. <rol...@gm...> - 2015-02-04 10:31:41
|
Hi, Stewart.
What I mean is that the parenthesis themselves are lost, as you see in
your example.
An then there is the fact that nodes after parenthesis are not
allowed, as you correctly point out. The reason for that is that a
parenthesis can contain a tree, and there is no clean and clear way to
connect the nodes in that tree to the node that comes after the
parenthesis.
So my advise is that you don't use parenthesis in the syntax of your
schema language, because they are used in the underlying language
(OGDL in this case). In fact, you could begin thinking in canonical
OGDL, the most simple way of writing it: each node on exactly 1 line:
document
any:
@identifier
repeatable:
any:
@identifier
repeatable:
any:
And after that, see how it behaves in compact form (using parenthesis
and serveral nodes on one line).
There is one unclear behavior that has beed debated but is not
clarified yet. Until recently, these two fragments where equivalent:
a b
c
and
a
b
c
What has been proposed (and implemented in the experimental Go version) is that
a b
c
is equivalent to
a
b
c
I'm not convinced of either of them.
Cheers,
Rolf
On Tue, Feb 3, 2015 at 11:24 PM, Stewart B <st...@gm...> wrote:
> Hello Rolf,
>
> I'm working on a parser, but I don't expect to release it as it only parses
> a subset of the specification so far. If it gets to the point where I am
> happy with the reliability of the code, I'l release it - but like all my
> projects, it's just been hacked together.
>
> How come parenthesis doesn't appear in the final nodes? Does that mean it
> cannot appear in final nodes, or that it shouldn't according to best
> practice? My parser interprets the following snippet:
>
> ----------
> hello (world) child
> subchild
>
> parent (child 1)
> child 2
> ----------
>
> as:
>
> --------
> hello
> world
> child
> subchild
>
> parent
> child
> 1
> child
> 2
> ---------
>
> but I just realised that your specification doesn't allow nodes after
> parenthesis.
>
> Cheers,
> Stewart
|