json.gbnf 595 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. [^"\\] |
  16. "\\" (["\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]) # escapes
  17. )* "\"" ws
  18. number ::= ("-"? ([0-9] | [1-9] [0-9]*)) ("." [0-9]+)? ([eE] [-+]? [0-9]+)? ws
  19. # Optional space: by convention, applied in this grammar after literal chars when allowed
  20. ws ::= ([ \t\n] ws)?