LoginSignup
2
2

More than 5 years have passed since last update.

VIM Script Object Notation (vimson) grammar

Last updated at Posted at 2014-06-27

vimson serializer/deserializer 作るのにまとめ中。
間違ってたら指摘頂けると助かります。

作りました https://github.com/kamichidu/cpp-lolivimson
src/lolivimson.hppをコピペして使ってください。

エンコーディングはutf8、文字列中の \xYYYY 形式は対応しない。

grammar.bnf
<value>
    ::= <string>
      | <number>
      | <float>
      | <list>
      | <dictionary>

<string>
    ::= <double quote> <double quoted string> <double quote>
      | <single quote> <single quoted string> <single quote>

<double quoted string>
    ::= <double quoted character> <double quoted string>
      |

<single quoted string>
    ::= <single quoted character> <single quoted string>
      |

<double quoted character>
    ::= "\" <double quote>
      | "\" "\"
      | "\" "n"
      | "\" "r"
      | "\" "t"
      | <character>

<single quoted character>
    ::= <single quote> <single quote>
      | "\"
      | <character>

<number>
    ::= <decimal number>
      | <hexadecimal number>

<float>
    ::= <decimal number> "." <decimal number>

<list>
    ::= "[" <list elements> "]"

<list elements>
    ::= <list element> "," <list elements>
      |

<list element>
    ::= <value>

<dictionary>
    ::= "{" <dictionary elements> "}"

<dicrionary elements>
    ::= <dictionary element> "," <dictionary elements>
      |

<dictionary element>
    ::= <dictionary key> ":" <dictionary value>

<dictionary key>
    ::= <string>

<dictionary value>
    ::= <value>
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2