forked from Ze1598/JS_stuff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
json_synxtax.js
74 lines (69 loc) · 1016 Bytes
/
json_synxtax.js
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//JSON syntax
JSON =
null
OR true OR false
OR JSONNumber
OR JSONString
OR JSONObject
OR JSONArray
JSONNumber =
- PositiveNumber
OR PositiveNumber
PositiveNumber =
DecimalNumber
OR DecimalNumber . Digits
OR DecimalNumber . Digits ExponentPart
OR DecimalNumber ExponentPart
DecimalNumber =
0
OR [1-9] Digits
ExponentPart =
e Exponent
OR E Exponent
Exponent =
Digits
OR + Digits
OR - Digits
Digits =
Digit
OR Digits Digit
Digit = [0-9]
OneToNine = [1-9]
JSONString =
""
OR " StringCharacters "
StringCharacters =
StringCharacter
OR StringCharacters StringCharacter
StringCharacter =
any character
except "
OR \
OR [U+0000-U+001F]
OR EscapeSequence
EscapeSequence =
\"
OR \/
OR \\
OR \b
OR \f
OR \n
OR \r
OR \t
OR \u HexDigit HexDigit HexDigit HexDigit
HexDigit =
[0-9]
OR [A-F]
OR [a-f]
JSONObject =
{ }
OR { Members }
Members =
JSONString : JSON
OR Members , JSONString : JSON
JSONArray =
[ ]
OR [ ArrayElements ]
ArrayElements =
JSON
OR ArrayElements , JSON