This is the mail archive of the docbook@lists.oasis-open.org mailing list for the DocBook project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Proposal for BNF/EBNF markup


/ "Eve L. Maler" <elm@east.sun.com> was heard to say:
| Sorry, I wasn't clear about the semantics of rhsline.  It is literally to
| create several lines in the output for convenience of reading/formatting --
| it has no production semantics whatsoever.  That's why I suggested (further
| down in my proposal) that maybe we want to allow the rhs element to contain
| the sbr element, which is already in DocBook for this purpose.  The rhsline
| approach is just the one that XMLspec happened to take.

I'm not sure I follow your description in either case. Given what you
originally suggested:

  <!ELEMENT prod (lhs, rhs)>
  <!ELEMENT lhs (#PCDATA)>
  <!ELEMENT rhs (rhsline+)>
  <!ELEMENT rhsline (#PCDATA|nt|lineannotation|co)*>

Is this not how you'd markup production 29 from the XML Rec?

<prod>
  <lhs>markupdecl</lhs>
  <rhs>
    <rhsline><nt>elementdecl</nt></rhsline>
    <rhsline><nt>AttlistDecl</nt></rhsline>
    <rhsline><nt>EntityDecl</nt></rhsline>
    <rhsline><nt>NotationDecl</nt></rhsline>
    <rhsline><nt>PI</nt></rhsline>
    <rhsline><nt>Comment</nt></rhsline>
    <rhsline>
      <lineannotation>VC: Proper Declaration/PE Nesting</lineannotation>
    </rhsline>
    <rhsline>
      <lineannotation>WFC: PEs in Internal Subset</lineannotation>
    </rhsline>
  </rhs>
</prod>

Looking at that, I see two things:

 1. They aren't lines (look at how [29] is formatted)
 2. Sbr isn't relevant at all, what I want to do is separate alternate
    right-hand-sides.

| >How does lineannotation in this context map to XMLSpec?
|
| It's the same as the com (comment) element.

Ok. And that has the same formatting expectations as constraint, but
isn't a constraint and probably isn't linked. Yes?

| >   <!ELEMENT rhsline (#PCDATA|nt|lineannotation|constraint)*>
| >
| >where constraint has some non-empty content model.
|
| Okay, in that case, I can flesh out the proposal with XMLspec-like
| constraint/constraintnote stuff.

Do we really need a constraintnote? Seems to me we could leave
the processing of the notes up to the author (sections, list
items, what have you).

| >| - The content model for nt could have been EMPTY, assuming that the
| >| production was always defined in the current document (or in some other
| >| accessible place), but in practice it's easier to just supply the name.  It
| >| might be possible for, e.g., an XSL stylesheet to try and generate a name
| >| whenever no content is supplied, but this is more trouble than it's worth.
| >
| >It does mean that some checking should be done on the content of <nt>'s
| >that do have IDREFs though, yes? :-)
|
| Yes, ideally, although we haven't been doing that in XMLspec.  Actually,

What should we do about the linking semantics? I'd sortof like
to make the linking attribute on nonterminal an XPointer...so it
could be internal or external. If not, I guess we need both a
linkend and a url attribute.

| what XMLspec does is to have two elements, nt (for references to
| productions in the current document) and xnt (for references to productions
| in other documents); the former bears an IDREF and the latter bears a URI
| reference.  On the former, you could guarantee access to the production,
| and therefore snatch up its lhs content and reproduce it in place of an
| empty nt.  Thoughts?

I'd rather not have two elements for this purpose.

| >What is bnf, just a PCDATA way of making anything I want go in a
| >production?  This seems like it would be very hard to
| >format. Maybe it needs to be
|
| bnf is the free-form workaround when you want to include content in the
| production that the markup doesn't support, kind of like synopsis.  I toyed
| with just reusing programlisting here at first, but it doesn't require an
| ID.  Same problem with synopsis itself (which, come to think of it, is a
| closer match than programlisting because a production is a meta-thing,
| whereas a listing is a thing-itself).

Um, you weren't planning to make bnf linespecific were you? And what
did you think of my suggestion that it should be in an rhs?

                                        Be seeing you,
                                          norm

--
Norman Walsh <ndw@nwalsh.com>      | A man should have any number of
http://www.oasis-open.org/docbook/ | little aims about which he should
Chair, DocBook Technical Committee | be conscious and for which he
                                   | should have names, but he should
                                   | have neither name for, nor
                                   | consciousness concerning, the main
                                   | aim of his life.--Samuel Butler
                                   | (II)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]