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>