EBNF for Diet YAML

Trans <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <CAEu+kw3QPMt+wpy7oaoxNYYu4S08gWDKWNzUQ9AzAaqOib6usg@mail.gmail.com>
I have been thinking more and more about the need for a light-weight
version of YAML, especially after reading
https://github.com/toml-lang/toml#but-why, and learning that Rust's new
packages manager apparently will be using TOML. There are some things to
like about TOML, after all it is essentially the old INI format with a
couple of extra features. But it's those extra features that cause me rage
--they are down right ugly and confusing.

Anyway, I wanted to see if I could put together a EBNF for a "diet YAML"
--basically a YAML without types, complex map keys, etc. Just the basics
people use to hand write configuration files and such. How does this look
so far:

  Yaml ::= Data*
  Data ::= (Scalar | Sequence | Mapping )
  Scalar ::= (Number | String | Date | Boolean | Nil)
  Sequence ::= (InlineSequence | IndentedSequence)
  InlineSequence ::= "[" Data ("," Data)* "]"
  IndentedSequence ::= OptionalTab "-" Data ("\n" OptionalTab "-" Data)*
  Mapping ::= ( InlineMapping | IndentedMapping )
  InlineMapping ::= "{" Key ":" Data ("," Key ":" Data)* "}"
  IndentedMapping ::= Tab Key ":" Data ("\n" Tab Key ":" Data)*
  OptionalTab ::= Space*
  Tab ::= Space+
  Key ::= Scalar
  String ::= '"' [A-Za-z0-9]* '"' | [A-Za-z0-9]+
  Number ::= ("+" | "-")? [0-9]* ("." [0-9]+)?
  Date ::= [0-9][0-9][0-9][0-9] "-" [0-1][0-9] "-" [0-3][0-9] ( [0-2][0-9]
":" [0-5][0-9] ":" [0-5][0-9] )?
  Boolean ::= "true" | "false"
  Nil ::= "~"
  Space ::= " "

What am I missing? What needs fixing?

Note, you can put this code into http://bottlecaps.de/rr/ui and get a nice
picture of it all. Any one else have a good tool for drawing these?


trans

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft

_______________________________________________
Yaml-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/yaml-core
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.