1
0

json.gbnf 601 B

12345678910111213141516171819202122232425
  1. root ::= object
  2. value ::= object | array | string | number | ("true" | "false" | "null") ws
  3. object ::=
  4. "{" ws (
  5. string ":" ws value
  6. ("," ws string ":" ws value)*
  7. )? "}" ws
  8. array ::=
  9. "[" ws (
  10. value
  11. ("," ws value)*
  12. )? "]" ws
  13. string ::=
  14. "\"" (
  15. [^"\\\x7F\x00-\x1F] |
  16. "\\" (["\\bfnrt] | "u" [0-9a-fA-F]{4}) # escapes
  17. )* "\"" ws
  18. number ::= ("-"? ([0-9] | [1-9] [0-9]{0,15})) ("." [0-9]+)? ([eE] [-+]? [0-9] [1-9]{0,15})? ws
  19. # Optional space: by convention, applied in this grammar after literal chars when allowed
  20. ws ::= | " " | "\n" [ \t]{0,20}