This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
Re: Proposal for BNF/EBNF markup
/ Dave Makower <davemak@iclick.com> was heard to say:
| guess the intention is to avoid making this one of them.) What would
| you think about making the element names a little more
| self-explanatory, at the risk of making them too verbose. For
| example:
Probably a good idea.
|
| prod --> production
| lhs --> prodleftside
| rhs --> prodtranslation
| (or maybe translation, translations, or translationlist)
I think LHS and RHS are fairly universal descriptions of what
occurs in a production, but maybe we should call them
lefthandside and righthandside. Ick. Looks like 'lefth' and
'side' at first glance. Maybe lhs and rhs are better...
| nt --> nonterminal
Yep.
| rhsline --> prodtranslationitem (or maybe translationitem)
If possible, I'd like to keep this one kind of short. It gets used
a lot in productions.
| (2) I've seen repetition expressed using * and +, and I've also seen
| it expressed using curly brackets. What would you think if this were
| expressed semantically in the XML with something like either a
| <bnfrepetition> element (which begs the question, how to distinguish
| between * and +), or perhaps a <zeroormore> and a <oneormore>
| element. (Note: I'm not thrilled with my element names here; I'm
| more interested in bringing up the idea to encourage feedback.)
In the past, we've usually done this with attributes, though I guess
it raises the question of whether or not we need a <terminal> element.
<production>
<lhs>work</lhs>
<rhs>
<rhsline>[A-Za-z][A-Za-z']*</rhsline>
</rhs>
</production>
or
<production>
<lhs>work</lhs>
<rhs>
<rhsline>
<terminal>[A-Za-z]</terminal>
<terminal rep="repeat" choice="opt">[A-Za-z']</terminal>
</rhsline>
</rhs>
</production>
Hmmm. Fairly high markup/text ratio.
Be seeing you,
norm
--
Norman Walsh <ndw@nwalsh.com> | Growth for the sake of growth is
http://www.oasis-open.org/docbook/ | the ideology of the cancer
Chair, DocBook Technical Committee | cell.--Edward Abbey