abathur / ldmud-doc

A temporary repo for working on a revamp of the documentation system for http://github.com/ldmud/ldmud
0 stars 0 forks source link

more thoroughly defined/documented grammar? #18

Open abathur opened 8 years ago

abathur commented 8 years ago

Sphinx provides a directive, productionlist (http://sphinx-doc.org/markup/para.html#directive-productionlist) that is used for presenting basic grammar definitions. The primary feature is that it'll link between tokens, so you can define what a statement or a block are, and every other definition making use of those tokens/definitions will link directly to them. Our current format is pretty informal.

There are a few things that make me hesitate to just convert them:

  1. While I can read a BNF when I need to, I don't have any experience writing them (I suspect it will take me a while to gain momentum)
  2. There's no guarantee the typical documentation consumer will be able to read them if we put them in this format, and I imagine the format takes a little more work to understand for everyone (though it removes much more ambiguity).
  3. We'd have to add a number of language pages (or at least a file documenting the basic atoms of the language) to have everything the more complex definitions depend on defined.
  4. The BNF, when output for the plaintext documentation, wouldn't have the advantage of linking to other token definitions, so the cost of the harder-to-read format increases without much corresponding benefit (aside from reduced ambiguity).

Another possibility is that we could provide both forms at some point (a simple syntax summary, and a BNF for better understanding).