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>