-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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> ::= " "* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
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 ::= " "* | ||
|