-
Notifications
You must be signed in to change notification settings - Fork 0
/
jason1.html
230 lines (216 loc) · 8.05 KB
/
jason1.html
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en">
<title>JASON</title>
<style>
body {
background-color: linen;
padding-left: 5%;
padding-right: 5%;
}
ul ul {
list-style: disc;
}
hr {
background-color: black;
border: 0px;
color: black;
height: 2px;
padding: 0px;
}
a {
text-decoration: none;
}
a:link {
color: navy;
}
a:visited {
color: maroon;
}
a:hover {
color: blue;
text-decoration: underline;
}
a:active {
color: red;
}
tt {
font-family: monospace;
font-weight: bold;
}
</style>
</head><body>
<table border="0" width="100%">
<tbody><tr>
<td align="center" valign="middle" width="160"><img src="http://www.json.org/img/json160.gif"
alt="json logo" align="left" border="0" height="160" width="160"></td>
<td align="center" valign="middle">
<div style="border: 2px solid black; padding: 10px; background-color: white; margin-left: 40px; margin-right: 40px; font-family: serif;">
<h1 align="center">Introducing JASON</h1>
</div>
</td>
</tr>
</tbody></table>
<hr>
<!--div align="center"><small>
<a href="json-ar.html">العربية</a>
<a href="json-bg.html">Български</a>
<a href="json-zh.html">中文</a>
<a href="json-cz.html">Český</a>
<a href="json-da.html">Dansk</a>
<a href="json-nl.html">Nederlands</a>
<a href="index.html">English</a>
<a href="json-eo.html">Esperanto</a>
<a href="json-fr.html">Français</a>
<a href="json-de.html">Deutsch</a>
<a href="json-el.html">Ελληνικά</a>
<a href="json-he.html">עברית</a>
<a href="json-hu.html">Magyar</a>
<a href="json-id.html">Indonesia</a>
<br>
<a href="json-it.html">Italiano</a>
<a href="json-ja.html">日本</a>
<a href="json-ko.html">한국어</a>
<a href="json-fa.html">فارسی</a>
<a href="json-pl.html">Polski</a>
<a href="json-pt.html">Português</a>
<a href="json-ro.html">Română</a>
<a href="json-ru.html">Русский</a>
<a href="json-sr.html">Српско-хрватски</a>
<a href="json-sl.html">Slovenščina</a>
<a href="json-es.html">Español</a>
<a href="json-sv.html">Svenska</a>
<a href="json-tr.html">Türkçe</a>
<a href="json-vi.html">Tiếng Việt</a>
</small></div>
<hr-->
<div align="center"><a href="http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf">ECMA-404 The JASON Data Interchange Standard</a>.</div>
<hr>
<div style="float: right; border: 2px solid black; margin: 10px; padding: 10px; background-color: white;">
<dl>
<dt><i>object</i></dt>
<dd><tt>{}</tt><br>
<tt>{</tt> <i>members</i> <tt>}</tt> </dd>
<dt><i>members</i></dt>
<dd><i>pair</i><br>
<i>pair</i> <tt>,</tt> <i>members</i></dd>
<dt><i>pair</i></dt>
<dd><i>string</i> <tt>:</tt> <i>value</i></dd>
<dt><i>array</i></dt>
<dd><tt>[]</tt><br>
<tt>[</tt> <i>elements</i> <tt>]</tt></dd>
<dt><i>elements</i></dt>
<dd><i>value</i> <br>
<i>value</i> <tt>,</tt> <i>elements</i></dd>
<dt><i>value</i></dt>
<dd><i>string</i><br>
<i>number</i><br>
<i>object</i><br>
<i>array</i><br>
<tt>true</tt><br>
<tt>false</tt><br>
<tt>null</tt></dd>
</dl>
<hr align=center width=144>
<dl>
<dt><i>string</i></dt>
<dd><tt>""</tt><br>
<tt>"</tt> <i>chars</i> <tt>"</tt></dd>
<dt><i>string template</i></dt>
<dd><tt>``</tt><br>
<tt>`</tt> <i>chars</i> <tt>`</tt></dd>
<dt><i>chars</i></dt>
<dd><i>char</i><br>
<i>char chars</i></dd>
<dt><i>char</i></dt>
<dd><small><i>any-Unicode-character-</i></small><br>
<small> <i>except-</i></small><b><tt>"</tt></b><small><i>-or-</i></small><b><tt>\</tt></b><small><i>-or-</i></small><br>
<small> <i>control-character</i></small><br>
<tt>\"</tt><br>
<tt>\\</tt><br>
<tt>\/</tt><br>
<tt>\b</tt><br>
<tt>\f</tt><br>
<tt>\n</tt><br>
<tt>\r</tt><br>
<tt>\t</tt><br>
<tt>\u</tt> <i>four-hex-digits</i> </dd>
<dt><i>number</i></dt>
<dd><i>int</i><br>
<i>int frac</i><br>
<i>int exp</i><br>
<i>int frac exp</i>
</dd>
<dt><i>int</i></dt>
<dd><i>digit</i><br>
<i>digit1-9 digits</i>
<br><tt>-</tt> <i>digit</i><br>
<tt>-</tt> <i>digit1-9 digits</i>
</dd>
<dt><i>frac</i></dt>
<dd><b><tt>.</tt></b> <i>digits</i></dd>
<dt><i>exp</i></dt>
<dd><i>e</i> <i>digits</i></dd>
<dt><i>digits</i></dt>
<dd><i>digit</i><br>
<i>digit</i> <i>digits</i></dd>
<dt><i>e</i></dt>
<dd><b><tt>e</tt></b><br>
<b><tt>e+</tt></b><br>
<b><tt>e-</tt></b><br>
<b><tt>E</tt></b><br>
<b><tt>E+</tt></b><br>
<b><tt>E-</tt></b></dd>
</dl>
</div>
<p><b>JASON</b> (JAvaScript Object Notation) is a lightweight data-interchange
format. It is easy for humans to read and write. It is easy for machines to
parse and generate. It is based on a subset of the
<a href="http://javascript.crockford.com/">JavaScript
Programming Language</a>,
<a href="http://www.ecma-international.org/publications/files/ecma-st/ECMA-262.pdf">Standard
ECMA-262 3rd Edition - December 1999</a>. JASON is a text format that is completely
language independent but uses conventions that are familiar to programmers of
the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python,
and many others. These properties make JASON an ideal data-interchange language.</p>
<p>JASON is built on two structures:</p>
<ul>
<li>A collection of name/value pairs. In various languages, this is realized
as an <i>object</i>, record, struct, dictionary, hash table, keyed list, or
associative array.</li>
<li>An ordered list of values. In most languages, this is realized as an <i>array</i>,
vector, list, or sequence.</li>
</ul>
<p>These are universal data structures. Virtually all modern
programming languages support them in one form or another. It makes sense
that a data format that is interchangeable with programming languages also
be based on these structures.</p>
<p>In JASON, they take on these forms:</p>
<p>An <i>object</i> is an unordered set of name/value pairs. An object
begins with <tt>{</tt> <small>(left brace)</small> and ends
with <tt>}</tt> <small>(right brace)</small>. Each name is followed
by <tt>:</tt> <small>(colon)</small> and the name/value pairs are
separated by <tt>,</tt> <small>(comma)</small>.</p>
<p><img src="http://json.org/object.gif" width="598" height="113"></p>
<p>An <i>array</i> is an ordered collection of values. An array begins
with <tt>[</tt> <small>(left bracket)</small> and ends
with <tt>]</tt> <small>(right bracket)</small>. Values are separated
by <tt>,</tt> <small>(comma)</small>.</p>
<p><img src="http://json.org/array.gif" width="598" height="113"></p>
<p>A <i>value</i> can be a <i>string</i> in double quotes, <i>template string</i> in backticks, or a <i>number</i>,
or <tt>true</tt> or <tt>false</tt> or <tt>null</tt>, or an <i>object</i> or
an <i>array</i>. These structures can be nested.</p>
<p><img src="http://json.org/value.gif" width="598" height="278"></p>
<p>A <i>string</i> is a sequence of zero or more Unicode characters, wrapped
in double quotes, using backslash escapes. A character is represented as a
single character string. A string is very much like a C or Java string.</p>
<p><img src="http://json.org/string.gif" width="598" height="413"></p>
<p>A <i>string template</i> is a sequence of zero or more Unicode characters, wrapped
in backticks, using backslash escapes. A character is represented as a
single character string. A template string is very much like a C or Java string except you do not have to escape new lines.</p>
<p><img src="string.gif" width="598" height="413"></p>
<p>A <i>number</i> is very much like a C or Java number, except that the octal
and hexadecimal formats are not used.</p>
<p><img src="http://json.org/number.gif" height="266" width="598"></p>
<p>Whitespace can be inserted between any pair of tokens. Excepting
a few encoding details, that completely describes the language.</p>