Here is the grammar:
<json> ::= <value> | <fn-def> <json>
<value> ::= <object> | <array> | <string> | <number> | <bool>
| <fn-def> | <fn-app>
| "null"
<object> ::= "{" [ <member> { "," <member> } ] "}"
<member> ::= <string> ":" <value>
<string> ::= "\"" { <char> } "\""
<char> ::= (ASCII other than "\"", "\\", 0-31, 127-159)
| (Unicode other than ASCII)
| ( "\\" (
"\"" | "\\" | "/" | "b" | "f" | "n" | "r" | "t"
| "u" <hex> <hex> <hex> <hex>
)
<hex> ::= /A-Fa-f0-9/
<array> ::= "[" [ <value> { "," <value> } ] "]"
<number> ::= <integer> [ <fraction> ] [ <exponent> ]
<integer> ::= "0" | /[1-9]+/ | "-" <integer>
<fractional> ::= "." /[0-9]+/
<exponent> ::= ("E" | "e") [ "-" | "+" ] /[0-9]+/
<bool> ::= "true" | "false"
<fn-def> ::= "(" <ident> { <ident> }
("->" <value> | ":" <string> <string>) ")"
<ident> ::= <startc> { <identc> }
<startc> ::= /A-Za-z_/ or non-ASCII Unicode
<identc> ::= <startc> | /[0-9-]/
<fn-app> ::= "(" <ident> { <value> } ")"
<var> ::= "$" <ident>