Quantcast
Channel: Vimタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 5608

VIM Script Object Notation (vimson) grammar

$
0
0

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

エンコーディングは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 string> <double quoted character>
      |

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

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

<single quoted character>
    ::= <single quote> <single quote>
      | <backslash>
      | <character>

<number>
    ::= <decimal number>
      | <hex number>

<float>
    ::= <decimal number> <dot> <decimal number>

<list>
    ::= <left bracket> <list elements> <right bracket>

<list elements>
    ::= <list elements> <comma> <list element>
      | <list elements> <comma> <list element> <comma>
      |

<list element>
    ::= <value>

<dictionary>
    ::= <left brace> <dictionary elements> <right brace>

<dicrionary elements>
    ::= <dictionary elements> <comma> <dictionary element>

<dictionary element>
    ::= <dictionary key> <colon> <dictionary value>
      | <dictionary key> <colon> <dictionary value> <comma>

<dictionary key>
    ::= <string>

<dictionary value>
    ::= <value>

Viewing all articles
Browse latest Browse all 5608

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>