Repository navigation
Expand file tree
/
Copy pathJSON-ab.ebnf
More file actions
36 lines (28 loc) · 1.7 KB
/
Copy pathJSON-ab.ebnf
File metadata and controls
36 lines (28 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<quoted_string> ::= <quote> ( <unescaped_char> | <escaped_char> )+ <quote>
<escaped_char> ::= <escape> ( '"' | "/" | "b" | "f" | "n" | "r" | "t" | <unicode> | <escape> )
<escaped_literal> ::= <escaped_char> | <escape> "`"
<unescaped_char> ::= <digit> | <letter> | " " | "!" | "#" | "$" | "%" | "&" | "'" | "(" | ")" | "*+" | "," | "-" | "." | "/" | ":" | ";" | "<" | ">" | "?" | "@" | "[" | "]" | "^" | "_" | "`" | "{" | "|" | "}" | "~"
<unescaped_literal> ::= <digit> | <letter> | " " | "!" | "#" | "$" | "%" | "&" | "'" | "(" | ")" | "*+" | "," | "-" | "." | "/" | ":" | ";" | "<" | ">" | "?" | "@" | "[" | "]" | "^" | "_" | "{" | "|" | "}" | "~"
<unicode> ::= "u" <digit> <digit> <digit> <digit>
<escape> ::= "\"
<digit> ::= [0-9]
<letter> ::= [A-Z] | [a-z] | "_"
<quote> ::= '"'
/* The ``json-value`` is any valid JSON value with the one exception that the */
/* ``%x60`` character must be escaped. While it's encouraged that implementations */
/* use any existing JSON parser for this grammar rule (after handling the escaped */
/* literal characters), the grammar rule is shown below for completeness:: */
<json_value> ::= <json_array>
| <json_boolean>
| <json_null>
| <json_number>
| <json_object>
| <json_string>
<json_null> ::= "null"
<json_boolean> ::= "true" | "false"
<json_number> ::= "-"? ( "0" | [1-9] [0-9]* ) ( "." [0-9]+ )? ( "e" ( "-" | "+" ) [0-9]+ )?
<json_array> ::= <ws> "[" ( <ws> <json_value> <ws> ( "," <ws> <json_value> <ws> )* )? "]" <ws>
<json_object> ::= <ws> "{" <ws> ( <member> <ws> ( "," <ws> <member> <ws> )* )? "}" <ws>
<json_string> ::= <quote> ( <unescaped_literal> | <escaped_literal> )* <quote>
<member> ::= <quoted_string> <ws> ":" <ws> <json_value>
<ws> ::= " "*