Skip to content

Instantly share code, notes, and snippets.

@EndingCredits
Last active July 6, 2024 15:16
Show Gist options
  • Save EndingCredits/c12a9a99f87fd34d81df86b5588d3f1d to your computer and use it in GitHub Desktop.
Save EndingCredits/c12a9a99f87fd34d81df86b5588d3f1d to your computer and use it in GitHub Desktop.
Describing the JSON specification in psuedo-Backus-Naur Form
<json> ::= <primitive> | <container>
<primitive> ::= <number> | <string> | <boolean>
; Where:
; <number> is a valid real number expressed in one of a number of given formats
; <string> is a string of valid characters enclosed in quotes
; <boolean> is one of the literal strings 'true', 'false', or 'null' (unquoted)
<container> ::= <object> | <array>
<array> ::= '[' [ <json> *(', ' <json>) ] ']' ; A sequence of JSON values separated by commas
<object> ::= '{' [ <member> *(', ' <member>) ] '}' ; A sequence of 'members'
<member> ::= <string> ': ' <json> ; A pair consisting of a name, and a JSON value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment