ebnf 2.3.1 → 2.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -4
- data/VERSION +1 -1
- data/etc/turtle.html +387 -466
- data/lib/ebnf/native.rb +2 -1
- data/lib/ebnf/writer.rb +29 -24
- metadata +16 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4fb86945b28f51ba07f086e46e5d89e0707bbaa5d59c88c1748c4701d1106e4
|
4
|
+
data.tar.gz: e7df3a8153bf07c292ccd0aa1d7664583032ecd06a224a48a0485c0f87024fe5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cfe707433ef76136a8e856f5ae6e7eb8e1cb9e6430d762f337f9ce388fa7b055a6dc4538d272fb4c4a91a57b65d888ee0c314d47ba35ec77d9cbae826936810
|
7
|
+
data.tar.gz: 316d8928d79e585bc00a9667b7ab31f4ab8236863af0526631c5dcf5eeb3d152cf3ac31f188264f43250498bc7f3fe6d735d6b1e06ca99b186cdc1996c553fd6
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[EBNF][] parser and generic parser generator.
|
4
4
|
|
5
|
-
[![Gem Version](https://badge.fury.io/rb/ebnf.
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/ebnf.svg)](https://badge.fury.io/rb/ebnf)
|
6
6
|
[![Build Status](https://github.com/dryruby/ebnf/workflows/CI/badge.svg?branch=develop)](https://github.com/dryruby/ebnf/actions?query=workflow%3ACI)
|
7
7
|
[![Coverage Status](https://coveralls.io/repos/dryruby/ebnf/badge.svg?branch=develop)](https://coveralls.io/r/dryruby/ebnf?branch=develop)
|
8
8
|
[![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf)
|
@@ -99,7 +99,9 @@ The formatted HTML results are designed to be appropriate for including in speci
|
|
99
99
|
On a parsing failure, and exception is raised with information that may be useful in determining the source of the error.
|
100
100
|
|
101
101
|
## EBNF Grammar
|
102
|
-
The [EBNF][] variant used here is based on [W3C](https://w3.org/) [EBNF][]
|
102
|
+
The [EBNF][] variant used here is based on [W3C](https://w3.org/) [EBNF][]
|
103
|
+
(see [EBNF grammar](https://dryruby.github.io/ebnf/etc/ebnf.ebnf))
|
104
|
+
as defined in the
|
103
105
|
[XML 1.0 recommendation](https://www.w3.org/TR/REC-xml/), with minor extensions:
|
104
106
|
|
105
107
|
Note that the grammar includes an optional `[identifer]` in front of rule names, which can be in conflict with the `RANGE` terminal. It is typically not a problem, but if it comes up, try parsing with the `native` parser, add comments or sequences to disambiguate. EBNF does not have beginning of line checks as all whitespace is treated the same, so the common practice of identifying each rule inherently leads to such ambiguity.
|
@@ -161,7 +163,12 @@ Within the expression on the right-hand side of a rule, the following expression
|
|
161
163
|
* `@pass` defines the expression used to detect whitespace, which is removed in processing.
|
162
164
|
* No support for `wfc` (well-formedness constraint) or `vc` (validity constraint).
|
163
165
|
|
164
|
-
Parsing this grammar yields an [S-Expression][] version:
|
166
|
+
Parsing this grammar yields an [S-Expression][S-Expression] version:
|
167
|
+
[here](https://dryruby.github.io/ebnf/etc/ebnf.sxp)
|
168
|
+
(or [LL(1)][] version
|
169
|
+
[here](https://dryruby.github.io/ebnf/etc/ebnf.ll1.sxp)
|
170
|
+
or [PEG][] version
|
171
|
+
[here](https://dryruby.github.io/ebnf/etc/ebnf.peg.sxp)).
|
165
172
|
|
166
173
|
### Parser S-Expressions
|
167
174
|
Intermediate representations of the grammar may be serialized to Lisp-like [S-Expressions][S-Expression]. For example, the rule
|
@@ -225,7 +232,7 @@ For a [PEG][] parser for a simple grammar implementing a calculator see [Calc ex
|
|
225
232
|
For an example parser built using this gem that parses the [EBNF][] grammar, see [EBNF PEG Parser example](https://dryruby.github.io/ebnf/examples/ebnf-peg-parser/doc/parser.html). This example creates a parser for the [EBNF][] grammar which generates the same Abstract Syntax Tree as the built-in parser in the gem.
|
226
233
|
|
227
234
|
There is also an
|
228
|
-
[EBNF LL(1) Parser example](https://dryruby.github.io/ebnf/examples/ebnf-
|
235
|
+
[EBNF LL(1) Parser example](https://dryruby.github.io/ebnf/examples/ebnf-ll1-parser/doc/parser.html).
|
229
236
|
|
230
237
|
The [ISO EBNF Parser](https://dryruby.github.io/ebnf/examples/isoebnf/doc/parser.html) example parses [ISO/IEC 14977][] into [S-Expressions][S-Expression], which can be used to parse compatible grammars using this parser (either [PEG][] or [LL(1)][]).
|
231
238
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.3
|
data/etc/turtle.html
CHANGED
@@ -1,467 +1,388 @@
|
|
1
|
-
|
2
|
-
<
|
3
|
-
<
|
4
|
-
<
|
5
|
-
<td
|
6
|
-
<td
|
7
|
-
<td>
|
8
|
-
statement
|
9
|
-
</
|
10
|
-
|
11
|
-
<
|
12
|
-
<td>
|
13
|
-
<td
|
14
|
-
<td
|
15
|
-
|
16
|
-
|
17
|
-
</td>
|
18
|
-
</
|
19
|
-
<
|
20
|
-
<td>
|
21
|
-
|
22
|
-
<
|
23
|
-
<td>
|
24
|
-
prefixID
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
</
|
30
|
-
<
|
31
|
-
<td
|
32
|
-
<td
|
33
|
-
|
34
|
-
<
|
35
|
-
|
36
|
-
</td>
|
37
|
-
|
38
|
-
<
|
39
|
-
|
40
|
-
<
|
41
|
-
<td
|
42
|
-
<td>
|
43
|
-
|
44
|
-
</td>
|
45
|
-
</tr>
|
46
|
-
<tr id=
|
47
|
-
<td>[
|
48
|
-
<td><code>
|
49
|
-
<td>::=</td>
|
50
|
-
<td>
|
51
|
-
|
52
|
-
|
53
|
-
</
|
54
|
-
<
|
55
|
-
<td
|
56
|
-
<td><code>
|
57
|
-
|
58
|
-
<
|
59
|
-
|
60
|
-
</td>
|
61
|
-
|
62
|
-
<
|
63
|
-
|
64
|
-
<
|
65
|
-
<td
|
66
|
-
<td>
|
67
|
-
|
68
|
-
|
69
|
-
</
|
70
|
-
|
71
|
-
<
|
72
|
-
<td>
|
73
|
-
<td
|
74
|
-
<td
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
</
|
81
|
-
|
82
|
-
<
|
83
|
-
<td
|
84
|
-
<td
|
85
|
-
<td>
|
86
|
-
|
87
|
-
</
|
88
|
-
|
89
|
-
<
|
90
|
-
<td>
|
91
|
-
<td
|
92
|
-
<td
|
93
|
-
|
94
|
-
|
95
|
-
</td>
|
96
|
-
</
|
97
|
-
<
|
98
|
-
<td>[
|
99
|
-
|
100
|
-
<
|
101
|
-
<td>
|
102
|
-
|
103
|
-
|
104
|
-
</
|
105
|
-
|
106
|
-
<
|
107
|
-
<td
|
108
|
-
<td
|
109
|
-
<td>
|
110
|
-
|
111
|
-
</
|
112
|
-
|
113
|
-
<
|
114
|
-
<td>
|
115
|
-
<td
|
116
|
-
<td
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
</
|
124
|
-
|
125
|
-
<
|
126
|
-
<td>
|
127
|
-
<td
|
128
|
-
<td
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
</
|
135
|
-
|
136
|
-
<
|
137
|
-
<td
|
138
|
-
<td
|
139
|
-
<td>
|
140
|
-
"
|
141
|
-
</
|
142
|
-
|
143
|
-
<
|
144
|
-
<td>
|
145
|
-
<td
|
146
|
-
<td
|
147
|
-
|
148
|
-
|
149
|
-
</td>
|
150
|
-
|
151
|
-
<
|
152
|
-
|
153
|
-
<
|
154
|
-
<td
|
155
|
-
<td>
|
156
|
-
|
157
|
-
</td>
|
158
|
-
</tr>
|
159
|
-
<tr id=
|
160
|
-
<td>[
|
161
|
-
<td><code>
|
162
|
-
<td>::=</td>
|
163
|
-
<td>
|
164
|
-
|
165
|
-
|
166
|
-
</
|
167
|
-
<
|
168
|
-
<td
|
169
|
-
<td><
|
170
|
-
|
171
|
-
<
|
172
|
-
|
173
|
-
</td>
|
174
|
-
|
175
|
-
<
|
176
|
-
|
177
|
-
<
|
178
|
-
<td
|
179
|
-
<td>
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
</td>
|
185
|
-
</
|
186
|
-
<
|
187
|
-
<td>[
|
188
|
-
|
189
|
-
<
|
190
|
-
<td>
|
191
|
-
|
192
|
-
|
193
|
-
</
|
194
|
-
|
195
|
-
<
|
196
|
-
<td
|
197
|
-
<td
|
198
|
-
<td>
|
199
|
-
|
200
|
-
</
|
201
|
-
|
202
|
-
<
|
203
|
-
<td>
|
204
|
-
<td
|
205
|
-
<td
|
206
|
-
|
207
|
-
|
208
|
-
</td>
|
209
|
-
</
|
210
|
-
<
|
211
|
-
<td>[
|
212
|
-
|
213
|
-
<
|
214
|
-
<td>
|
215
|
-
|
216
|
-
|
217
|
-
</td>
|
218
|
-
</tr>
|
219
|
-
<tr id=
|
220
|
-
<td>[
|
221
|
-
<td><code>
|
222
|
-
<td>::=</td>
|
223
|
-
<td>
|
224
|
-
|
225
|
-
|
226
|
-
</
|
227
|
-
<
|
228
|
-
<td
|
229
|
-
<td><code>
|
230
|
-
|
231
|
-
<
|
232
|
-
|
233
|
-
</td>
|
234
|
-
|
235
|
-
<
|
236
|
-
|
237
|
-
<
|
238
|
-
<td
|
239
|
-
<td>
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
</
|
245
|
-
<
|
246
|
-
<td
|
247
|
-
<td><code>
|
248
|
-
|
249
|
-
<
|
250
|
-
|
251
|
-
</td>
|
252
|
-
|
253
|
-
<
|
254
|
-
|
255
|
-
<
|
256
|
-
<td
|
257
|
-
<td>
|
258
|
-
|
259
|
-
</td>
|
260
|
-
</tr>
|
261
|
-
<tr id=
|
262
|
-
<td>[
|
263
|
-
<td><code>
|
264
|
-
<td>::=</td>
|
265
|
-
<td>
|
266
|
-
|
267
|
-
|
268
|
-
</
|
269
|
-
<
|
270
|
-
<td
|
271
|
-
<td><code>
|
272
|
-
|
273
|
-
<
|
274
|
-
|
275
|
-
|
276
|
-
</td>
|
277
|
-
</tr>
|
278
|
-
<tr
|
279
|
-
<td
|
280
|
-
<td
|
281
|
-
<td
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
<
|
287
|
-
|
288
|
-
<
|
289
|
-
<td
|
290
|
-
<td>
|
291
|
-
'"'
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
<
|
297
|
-
|
298
|
-
<
|
299
|
-
<td
|
300
|
-
<td>
|
301
|
-
"'"
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
<
|
307
|
-
|
308
|
-
<
|
309
|
-
<td
|
310
|
-
<td>
|
311
|
-
"'''"
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
<
|
316
|
-
<td>[
|
317
|
-
|
318
|
-
<
|
319
|
-
<td>
|
320
|
-
|
321
|
-
|
322
|
-
</
|
323
|
-
|
324
|
-
<
|
325
|
-
<td
|
326
|
-
<td><code>
|
327
|
-
|
328
|
-
<
|
329
|
-
|
330
|
-
|
331
|
-
</td>
|
332
|
-
</tr>
|
333
|
-
<tr
|
334
|
-
<td
|
335
|
-
<td
|
336
|
-
<td
|
337
|
-
|
338
|
-
"
|
339
|
-
</td>
|
340
|
-
</
|
341
|
-
<
|
342
|
-
<td>
|
343
|
-
|
344
|
-
<
|
345
|
-
<td>
|
346
|
-
|
347
|
-
|
348
|
-
</
|
349
|
-
|
350
|
-
<
|
351
|
-
<td
|
352
|
-
<td
|
353
|
-
<td>
|
354
|
-
|
355
|
-
</
|
356
|
-
|
357
|
-
<
|
358
|
-
<td>
|
359
|
-
<td
|
360
|
-
<td
|
361
|
-
|
362
|
-
|
363
|
-
</td>
|
364
|
-
</
|
365
|
-
<
|
366
|
-
<td>
|
367
|
-
|
368
|
-
<
|
369
|
-
<td>
|
370
|
-
|
371
|
-
|
372
|
-
</
|
373
|
-
|
374
|
-
<
|
375
|
-
<td
|
376
|
-
<td
|
377
|
-
<td>
|
378
|
-
[
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
| [#x2C00-#x2FEF]
|
388
|
-
| [#x3001-#xD7FF]
|
389
|
-
| [#xF900-#xFDCF]
|
390
|
-
| [#xFDF0-#xFFFD]
|
391
|
-
| [#x10000-#xEFFFF]
|
392
|
-
</td>
|
393
|
-
</tr>
|
394
|
-
<tr id='grammar-production-PN_CHARS_U'>
|
395
|
-
<td>[164s]</td>
|
396
|
-
<td><code>PN_CHARS_U</code></td>
|
397
|
-
<td>::=</td>
|
398
|
-
<td>
|
399
|
-
PN_CHARS_BASE | "_"
|
400
|
-
</td>
|
401
|
-
</tr>
|
402
|
-
<tr id='grammar-production-PN_CHARS'>
|
403
|
-
<td>[166s]</td>
|
404
|
-
<td><code>PN_CHARS</code></td>
|
405
|
-
<td>::=</td>
|
406
|
-
<td>
|
407
|
-
PN_CHARS_U
|
408
|
-
| "-"
|
409
|
-
| [0-9]
|
410
|
-
| #x00B7
|
411
|
-
| [#x0300-#x036F]
|
412
|
-
| [#x203F-#x2040]
|
413
|
-
</td>
|
414
|
-
</tr>
|
415
|
-
<tr id='grammar-production-PN_PREFIX'>
|
416
|
-
<td>[167s]</td>
|
417
|
-
<td><code>PN_PREFIX</code></td>
|
418
|
-
<td>::=</td>
|
419
|
-
<td>
|
420
|
-
PN_CHARS_BASE
|
421
|
-
(PN_CHARS | ".")* PN_CHARS?
|
422
|
-
</td>
|
423
|
-
</tr>
|
424
|
-
<tr id='grammar-production-PN_LOCAL'>
|
425
|
-
<td>[168s]</td>
|
426
|
-
<td><code>PN_LOCAL</code></td>
|
427
|
-
<td>::=</td>
|
428
|
-
<td>
|
429
|
-
(PN_CHARS_U | ":" | [0-9] | PLX)
|
430
|
-
(PN_CHARS | "." | ":" | PLX)* (PN_CHARS | ":" | PLX)?
|
431
|
-
</td>
|
432
|
-
</tr>
|
433
|
-
<tr id='grammar-production-PLX'>
|
434
|
-
<td>[169s]</td>
|
435
|
-
<td><code>PLX</code></td>
|
436
|
-
<td>::=</td>
|
437
|
-
<td>
|
438
|
-
PERCENT | PN_LOCAL_ESC
|
439
|
-
</td>
|
440
|
-
</tr>
|
441
|
-
<tr id='grammar-production-PERCENT'>
|
442
|
-
<td>[170s]</td>
|
443
|
-
<td><code>PERCENT</code></td>
|
444
|
-
<td>::=</td>
|
445
|
-
<td>
|
446
|
-
"%" HEX HEX
|
447
|
-
</td>
|
448
|
-
</tr>
|
449
|
-
<tr id='grammar-production-HEX'>
|
450
|
-
<td>[171s]</td>
|
451
|
-
<td><code>HEX</code></td>
|
452
|
-
<td>::=</td>
|
453
|
-
<td>
|
454
|
-
[0-9] | [A-F] | [a-f]
|
455
|
-
</td>
|
456
|
-
</tr>
|
457
|
-
<tr id='grammar-production-PN_LOCAL_ESC'>
|
458
|
-
<td>[172s]</td>
|
459
|
-
<td><code>PN_LOCAL_ESC</code></td>
|
460
|
-
<td>::=</td>
|
461
|
-
<td>
|
462
|
-
"\"
|
463
|
-
("_" | "~" | "." | "-" | #x21 | "$" | "&" | "'" | "(" | ")" | "*" | "+" | "," | ";" | "=" | "/" | "?" | "#" | "@" | "%")
|
464
|
-
</td>
|
465
|
-
</tr>
|
466
|
-
</tbody>
|
1
|
+
|
2
|
+
<table class="grammar">
|
3
|
+
<tbody id="grammar-productions" class="ebnf">
|
4
|
+
<tr id="grammar-production-turtleDoc">
|
5
|
+
<td>[1]</td>
|
6
|
+
<td><code>turtleDoc</code></td>
|
7
|
+
<td>::=</td>
|
8
|
+
<td><a href="#grammar-production-statement">statement</a><code>*</code></td>
|
9
|
+
</tr>
|
10
|
+
<tr id="grammar-production-statement">
|
11
|
+
<td>[2]</td>
|
12
|
+
<td><code>statement</code></td>
|
13
|
+
<td>::=</td>
|
14
|
+
<td><a href="#grammar-production-directive">directive</a> <code>|</code> <code>(</code><a href="#grammar-production-triples">triples</a> "<code class="grammar-literal">.</code>"<code>)</code></td>
|
15
|
+
</tr>
|
16
|
+
<tr id="grammar-production-directive">
|
17
|
+
<td>[3]</td>
|
18
|
+
<td><code>directive</code></td>
|
19
|
+
<td>::=</td>
|
20
|
+
<td><a href="#grammar-production-prefixID">prefixID</a> <code>|</code> <a href="#grammar-production-base">base</a> <code>|</code> <a href="#grammar-production-sparqlPrefix">sparqlPrefix</a> <code>|</code> <a href="#grammar-production-sparqlBase">sparqlBase</a></td>
|
21
|
+
</tr>
|
22
|
+
<tr id="grammar-production-prefixID">
|
23
|
+
<td>[4]</td>
|
24
|
+
<td><code>prefixID</code></td>
|
25
|
+
<td>::=</td>
|
26
|
+
<td>"@prefix" <a href="#grammar-production-PNAME_NS">PNAME_NS</a> <a href="#grammar-production-IRIREF">IRIREF</a> "<code class="grammar-literal">.</code>"</td>
|
27
|
+
</tr>
|
28
|
+
<tr id="grammar-production-base">
|
29
|
+
<td>[5]</td>
|
30
|
+
<td><code>base</code></td>
|
31
|
+
<td>::=</td>
|
32
|
+
<td>"@base" <a href="#grammar-production-IRIREF">IRIREF</a> "<code class="grammar-literal">.</code>"</td>
|
33
|
+
</tr>
|
34
|
+
<tr id="grammar-production-sparqlPrefix">
|
35
|
+
<td>[28s]</td>
|
36
|
+
<td><code>sparqlPrefix</code></td>
|
37
|
+
<td>::=</td>
|
38
|
+
<td><a href="#grammar-production-SPARQL_PREFIX">SPARQL_PREFIX</a> <a href="#grammar-production-PNAME_NS">PNAME_NS</a> <a href="#grammar-production-IRIREF">IRIREF</a></td>
|
39
|
+
</tr>
|
40
|
+
<tr id="grammar-production-sparqlBase">
|
41
|
+
<td>[29s]</td>
|
42
|
+
<td><code>sparqlBase</code></td>
|
43
|
+
<td>::=</td>
|
44
|
+
<td><a href="#grammar-production-SPARQL_BASE">SPARQL_BASE</a> <a href="#grammar-production-IRIREF">IRIREF</a></td>
|
45
|
+
</tr>
|
46
|
+
<tr id="grammar-production-triples">
|
47
|
+
<td>[6]</td>
|
48
|
+
<td><code>triples</code></td>
|
49
|
+
<td>::=</td>
|
50
|
+
<td><code>(</code><a href="#grammar-production-subject">subject</a> <a href="#grammar-production-predicateObjectList">predicateObjectList</a><code>)</code> <code>|</code> <code>(</code><a href="#grammar-production-blankNodePropertyList">blankNodePropertyList</a> <a href="#grammar-production-predicateObjectList">predicateObjectList</a><code>?</code><code>)</code></td>
|
51
|
+
</tr>
|
52
|
+
<tr id="grammar-production-predicateObjectList">
|
53
|
+
<td>[7]</td>
|
54
|
+
<td><code>predicateObjectList</code></td>
|
55
|
+
<td>::=</td>
|
56
|
+
<td><a href="#grammar-production-verb">verb</a> <a href="#grammar-production-objectList">objectList</a> <code>(</code>"<code class="grammar-literal">;</code>" <code>(</code><a href="#grammar-production-verb">verb</a> <a href="#grammar-production-objectList">objectList</a><code>)</code><code>?</code><code>)</code><code>*</code></td>
|
57
|
+
</tr>
|
58
|
+
<tr id="grammar-production-objectList">
|
59
|
+
<td>[8]</td>
|
60
|
+
<td><code>objectList</code></td>
|
61
|
+
<td>::=</td>
|
62
|
+
<td><a href="#grammar-production-object">object</a> <code>(</code>"<code class="grammar-literal">,</code>" <a href="#grammar-production-object">object</a><code>)</code><code>*</code></td>
|
63
|
+
</tr>
|
64
|
+
<tr id="grammar-production-verb">
|
65
|
+
<td>[9]</td>
|
66
|
+
<td><code>verb</code></td>
|
67
|
+
<td>::=</td>
|
68
|
+
<td><a href="#grammar-production-predicate">predicate</a> <code>|</code> "<code class="grammar-literal">a</code>"</td>
|
69
|
+
</tr>
|
70
|
+
<tr id="grammar-production-subject">
|
71
|
+
<td>[10]</td>
|
72
|
+
<td><code>subject</code></td>
|
73
|
+
<td>::=</td>
|
74
|
+
<td><a href="#grammar-production-iri">iri</a> <code>|</code> <a href="#grammar-production-BlankNode">BlankNode</a> <code>|</code> <a href="#grammar-production-collection">collection</a></td>
|
75
|
+
</tr>
|
76
|
+
<tr id="grammar-production-predicate">
|
77
|
+
<td>[11]</td>
|
78
|
+
<td><code>predicate</code></td>
|
79
|
+
<td>::=</td>
|
80
|
+
<td><a href="#grammar-production-iri">iri</a></td>
|
81
|
+
</tr>
|
82
|
+
<tr id="grammar-production-object">
|
83
|
+
<td>[12]</td>
|
84
|
+
<td><code>object</code></td>
|
85
|
+
<td>::=</td>
|
86
|
+
<td><a href="#grammar-production-iri">iri</a> <code>|</code> <a href="#grammar-production-BlankNode">BlankNode</a> <code>|</code> <a href="#grammar-production-collection">collection</a> <code>|</code> <a href="#grammar-production-blankNodePropertyList">blankNodePropertyList</a> <code>|</code> <a href="#grammar-production-literal">literal</a></td>
|
87
|
+
</tr>
|
88
|
+
<tr id="grammar-production-literal">
|
89
|
+
<td>[13]</td>
|
90
|
+
<td><code>literal</code></td>
|
91
|
+
<td>::=</td>
|
92
|
+
<td><a href="#grammar-production-RDFLiteral">RDFLiteral</a> <code>|</code> <a href="#grammar-production-NumericLiteral">NumericLiteral</a> <code>|</code> <a href="#grammar-production-BooleanLiteral">BooleanLiteral</a></td>
|
93
|
+
</tr>
|
94
|
+
<tr id="grammar-production-blankNodePropertyList">
|
95
|
+
<td>[14]</td>
|
96
|
+
<td><code>blankNodePropertyList</code></td>
|
97
|
+
<td>::=</td>
|
98
|
+
<td>"<code class="grammar-literal">[</code>" <a href="#grammar-production-predicateObjectList">predicateObjectList</a> "<code class="grammar-literal">]</code>"</td>
|
99
|
+
</tr>
|
100
|
+
<tr id="grammar-production-collection">
|
101
|
+
<td>[15]</td>
|
102
|
+
<td><code>collection</code></td>
|
103
|
+
<td>::=</td>
|
104
|
+
<td>"<code class="grammar-literal">(</code>" <a href="#grammar-production-object">object</a><code>*</code> "<code class="grammar-literal">)</code>"</td>
|
105
|
+
</tr>
|
106
|
+
<tr id="grammar-production-NumericLiteral">
|
107
|
+
<td>[16]</td>
|
108
|
+
<td><code>NumericLiteral</code></td>
|
109
|
+
<td>::=</td>
|
110
|
+
<td><a href="#grammar-production-INTEGER">INTEGER</a> <code>|</code> <a href="#grammar-production-DECIMAL">DECIMAL</a> <code>|</code> <a href="#grammar-production-DOUBLE">DOUBLE</a></td>
|
111
|
+
</tr>
|
112
|
+
<tr id="grammar-production-RDFLiteral">
|
113
|
+
<td>[128s]</td>
|
114
|
+
<td><code>RDFLiteral</code></td>
|
115
|
+
<td>::=</td>
|
116
|
+
<td><a href="#grammar-production-String">String</a> <code>(</code><a href="#grammar-production-LANGTAG">LANGTAG</a> <code>|</code> <code>(</code>"^^" <a href="#grammar-production-iri">iri</a><code>)</code><code>)</code><code>?</code></td>
|
117
|
+
</tr>
|
118
|
+
<tr id="grammar-production-BooleanLiteral">
|
119
|
+
<td>[133s]</td>
|
120
|
+
<td><code>BooleanLiteral</code></td>
|
121
|
+
<td>::=</td>
|
122
|
+
<td>"true" <code>|</code> "false"</td>
|
123
|
+
</tr>
|
124
|
+
<tr id="grammar-production-String">
|
125
|
+
<td>[17]</td>
|
126
|
+
<td><code>String</code></td>
|
127
|
+
<td>::=</td>
|
128
|
+
<td><a href="#grammar-production-STRING_LITERAL_QUOTE">STRING_LITERAL_QUOTE</a> <code>|</code> <a href="#grammar-production-STRING_LITERAL_SINGLE_QUOTE">STRING_LITERAL_SINGLE_QUOTE</a> <code>|</code> <a href="#grammar-production-STRING_LITERAL_LONG_SINGLE_QUOTE">STRING_LITERAL_LONG_SINGLE_QUOTE</a> <code>|</code> <a href="#grammar-production-STRING_LITERAL_LONG_QUOTE">STRING_LITERAL_LONG_QUOTE</a></td>
|
129
|
+
</tr>
|
130
|
+
<tr id="grammar-production-iri">
|
131
|
+
<td>[135s]</td>
|
132
|
+
<td><code>iri</code></td>
|
133
|
+
<td>::=</td>
|
134
|
+
<td><a href="#grammar-production-IRIREF">IRIREF</a> <code>|</code> <a href="#grammar-production-PrefixedName">PrefixedName</a></td>
|
135
|
+
</tr>
|
136
|
+
<tr id="grammar-production-PrefixedName">
|
137
|
+
<td>[136s]</td>
|
138
|
+
<td><code>PrefixedName</code></td>
|
139
|
+
<td>::=</td>
|
140
|
+
<td><a href="#grammar-production-PNAME_LN">PNAME_LN</a> <code>|</code> <a href="#grammar-production-PNAME_NS">PNAME_NS</a></td>
|
141
|
+
</tr>
|
142
|
+
<tr id="grammar-production-BlankNode">
|
143
|
+
<td>[137s]</td>
|
144
|
+
<td><code>BlankNode</code></td>
|
145
|
+
<td>::=</td>
|
146
|
+
<td><a href="#grammar-production-BLANK_NODE_LABEL">BLANK_NODE_LABEL</a> <code>|</code> <a href="#grammar-production-ANON">ANON</a></td>
|
147
|
+
</tr>
|
148
|
+
<tr>
|
149
|
+
<td colspan=2>@terminals</td>
|
150
|
+
<td></td>
|
151
|
+
<td><strong># Productions for terminals</strong></td>
|
152
|
+
</tr>
|
153
|
+
<tr id="grammar-production-IRIREF">
|
154
|
+
<td>[18]</td>
|
155
|
+
<td><code>IRIREF</code></td>
|
156
|
+
<td>::=</td>
|
157
|
+
<td>"<code class="grammar-literal"><</code>" <code>(</code><code>[</code><code class="grammar-literal">^<>"{}|^`]-[</code><code class="grammar-char-escape"><abbr title="null">#x00</abbr></code><code class="grammar-literal">-</code><code class="grammar-char-escape"><abbr title="space">#x20</abbr></code><code>]</code> <code>|</code> <a href="#grammar-production-UCHAR">UCHAR</a><code>)</code><code>*</code> "<code class="grammar-literal">></code>"</td>
|
158
|
+
</tr>
|
159
|
+
<tr id="grammar-production-PNAME_NS">
|
160
|
+
<td>[139s]</td>
|
161
|
+
<td><code>PNAME_NS</code></td>
|
162
|
+
<td>::=</td>
|
163
|
+
<td><a href="#grammar-production-PN_PREFIX">PN_PREFIX</a><code>?</code> "<code class="grammar-literal">:</code>"</td>
|
164
|
+
</tr>
|
165
|
+
<tr id="grammar-production-PNAME_LN">
|
166
|
+
<td>[140s]</td>
|
167
|
+
<td><code>PNAME_LN</code></td>
|
168
|
+
<td>::=</td>
|
169
|
+
<td><a href="#grammar-production-PNAME_NS">PNAME_NS</a> <a href="#grammar-production-PN_LOCAL">PN_LOCAL</a></td>
|
170
|
+
</tr>
|
171
|
+
<tr id="grammar-production-BLANK_NODE_LABEL">
|
172
|
+
<td>[141s]</td>
|
173
|
+
<td><code>BLANK_NODE_LABEL</code></td>
|
174
|
+
<td>::=</td>
|
175
|
+
<td>"_:" <code>(</code><a href="#grammar-production-PN_CHARS_U">PN_CHARS_U</a> <code>|</code> <code>[</code><code class="grammar-literal">0-9</code><code>]</code><code>)</code> <code>(</code><code>(</code><a href="#grammar-production-PN_CHARS">PN_CHARS</a> <code>|</code> "<code class="grammar-literal">.</code>"<code>)</code><code>*</code> <a href="#grammar-production-PN_CHARS">PN_CHARS</a><code>)</code><code>?</code></td>
|
176
|
+
</tr>
|
177
|
+
<tr id="grammar-production-LANGTAG">
|
178
|
+
<td>[144s]</td>
|
179
|
+
<td><code>LANGTAG</code></td>
|
180
|
+
<td>::=</td>
|
181
|
+
<td>"<code class="grammar-literal">@</code>" <code>[</code><code class="grammar-literal">a-zA-Z</code><code>]</code><code>+</code> <code>(</code>"<code class="grammar-literal">-</code>" <code>[</code><code class="grammar-literal">a-zA-Z0-9</code><code>]</code><code>+</code><code>)</code><code>*</code></td>
|
182
|
+
</tr>
|
183
|
+
<tr id="grammar-production-INTEGER">
|
184
|
+
<td>[19]</td>
|
185
|
+
<td><code>INTEGER</code></td>
|
186
|
+
<td>::=</td>
|
187
|
+
<td><code>[</code><code class="grammar-literal">+-</code><code>]</code><code>?</code> <code>[</code><code class="grammar-literal">0-9</code><code>]</code><code>+</code></td>
|
188
|
+
</tr>
|
189
|
+
<tr id="grammar-production-DECIMAL">
|
190
|
+
<td>[20]</td>
|
191
|
+
<td><code>DECIMAL</code></td>
|
192
|
+
<td>::=</td>
|
193
|
+
<td><code>[</code><code class="grammar-literal">+-</code><code>]</code><code>?</code> <code>(</code><code>[</code><code class="grammar-literal">0-9</code><code>]</code><code>*</code> "<code class="grammar-literal">.</code>" <code>[</code><code class="grammar-literal">0-9</code><code>]</code><code>+</code><code>)</code></td>
|
194
|
+
</tr>
|
195
|
+
<tr id="grammar-production-DOUBLE">
|
196
|
+
<td>[21]</td>
|
197
|
+
<td><code>DOUBLE</code></td>
|
198
|
+
<td>::=</td>
|
199
|
+
<td><code>[</code><code class="grammar-literal">+-</code><code>]</code><code>?</code> <code>(</code><code>(</code><code>[</code><code class="grammar-literal">0-9</code><code>]</code><code>+</code> "<code class="grammar-literal">.</code>" <code>[</code><code class="grammar-literal">0-9</code><code>]</code><code>*</code> <a href="#grammar-production-EXPONENT">EXPONENT</a><code>)</code> <code>|</code> <code>(</code>"<code class="grammar-literal">.</code>" <code>[</code><code class="grammar-literal">0-9</code><code>]</code><code>+</code> <a href="#grammar-production-EXPONENT">EXPONENT</a><code>)</code> <code>|</code> <code>(</code><code>[</code><code class="grammar-literal">0-9</code><code>]</code><code>+</code> <a href="#grammar-production-EXPONENT">EXPONENT</a><code>)</code><code>)</code></td>
|
200
|
+
</tr>
|
201
|
+
<tr id="grammar-production-EXPONENT">
|
202
|
+
<td>[154s]</td>
|
203
|
+
<td><code>EXPONENT</code></td>
|
204
|
+
<td>::=</td>
|
205
|
+
<td><code>[</code><code class="grammar-literal">eE</code><code>]</code> <code>[</code><code class="grammar-literal">+-</code><code>]</code><code>?</code> <code>[</code><code class="grammar-literal">0-9</code><code>]</code><code>+</code></td>
|
206
|
+
</tr>
|
207
|
+
<tr id="grammar-production-STRING_LITERAL_QUOTE">
|
208
|
+
<td>[22]</td>
|
209
|
+
<td><code>STRING_LITERAL_QUOTE</code></td>
|
210
|
+
<td>::=</td>
|
211
|
+
<td>'<code class="grammar-literal">"</code>' <code>(</code><code>[</code><code class="grammar-literal">^</code><code class="grammar-char-escape"><abbr title="quot">>"</abbr></code><code class="grammar-char-escape"><abbr title="ascii '\'">#x5C</abbr></code><code class="grammar-char-escape"><abbr title="new line">#x0A</abbr></code><code class="grammar-char-escape"><abbr title="carriage return">#x0D</abbr></code><code>]</code> <code>|</code> <a href="#grammar-production-ECHAR">ECHAR</a> <code>|</code> <a href="#grammar-production-UCHAR">UCHAR</a><code>)</code><code>*</code> '<code class="grammar-literal">"</code>'</td>
|
212
|
+
</tr>
|
213
|
+
<tr id="grammar-production-STRING_LITERAL_SINGLE_QUOTE">
|
214
|
+
<td>[23]</td>
|
215
|
+
<td><code>STRING_LITERAL_SINGLE_QUOTE</code></td>
|
216
|
+
<td>::=</td>
|
217
|
+
<td>"<code class="grammar-literal">'</code>" <code>(</code><code>[</code><code class="grammar-literal">^</code><code class="grammar-char-escape"><abbr title="ascii '''">#x27</abbr></code><code class="grammar-char-escape"><abbr title="ascii '\'">#x5C</abbr></code><code class="grammar-char-escape"><abbr title="new line">#x0A</abbr></code><code class="grammar-char-escape"><abbr title="carriage return">#x0D</abbr></code><code>]</code> <code>|</code> <a href="#grammar-production-ECHAR">ECHAR</a> <code>|</code> <a href="#grammar-production-UCHAR">UCHAR</a><code>)</code><code>*</code> "<code class="grammar-literal">'</code>"</td>
|
218
|
+
</tr>
|
219
|
+
<tr id="grammar-production-STRING_LITERAL_LONG_SINGLE_QUOTE">
|
220
|
+
<td>[24]</td>
|
221
|
+
<td><code>STRING_LITERAL_LONG_SINGLE_QUOTE</code></td>
|
222
|
+
<td>::=</td>
|
223
|
+
<td>"'''" <code>(</code><code>(</code>"<code class="grammar-literal">'</code>" <code>|</code> "''"<code>)</code><code>?</code> <code>[</code><code class="grammar-literal">^']</code><code class="grammar-char-escape"><abbr title="space">#x20</abbr></code><code class="grammar-literal">|</code><code class="grammar-char-escape"><abbr title="space">#x20</abbr></code><code class="grammar-literal">ECHAR</code><code class="grammar-char-escape"><abbr title="space">#x20</abbr></code><code class="grammar-literal">|</code><code class="grammar-char-escape"><abbr title="space">#x20</abbr></code><code class="grammar-literal">UCHAR</code><code class="grammar-char-escape"><abbr title="space">#x20</abbr></code><code class="grammar-literal">)</code><code class="grammar-char-escape"><abbr title="space">#x20</abbr></code><code class="grammar-literal">)*</code><code class="grammar-char-escape"><abbr title="space">#x20</abbr></code><code class="grammar-literal">"'''"</code><code>]</code><code>)</code></td>
|
224
|
+
</tr>
|
225
|
+
<tr id="grammar-production-STRING_LITERAL_LONG_QUOTE">
|
226
|
+
<td>[25]</td>
|
227
|
+
<td><code>STRING_LITERAL_LONG_QUOTE</code></td>
|
228
|
+
<td>::=</td>
|
229
|
+
<td>'"""' <code>(</code><code>(</code>'<code class="grammar-literal">"</code>' <code>|</code> '""'<code>)</code><code>?</code> <code>[</code><code class="grammar-literal">^"]</code><code class="grammar-char-escape"><abbr title="space">#x20</abbr></code><code class="grammar-literal">|</code><code class="grammar-char-escape"><abbr title="space">#x20</abbr></code><code class="grammar-literal">ECHAR</code><code class="grammar-char-escape"><abbr title="space">#x20</abbr></code><code class="grammar-literal">|</code><code class="grammar-char-escape"><abbr title="space">#x20</abbr></code><code class="grammar-literal">UCHAR</code><code class="grammar-char-escape"><abbr title="space">#x20</abbr></code><code class="grammar-literal">)</code><code class="grammar-char-escape"><abbr title="space">#x20</abbr></code><code class="grammar-literal">)*</code><code class="grammar-char-escape"><abbr title="space">#x20</abbr></code><code class="grammar-literal">'"""'</code><code>]</code><code>)</code></td>
|
230
|
+
</tr>
|
231
|
+
<tr id="grammar-production-UCHAR">
|
232
|
+
<td>[26]</td>
|
233
|
+
<td><code>UCHAR</code></td>
|
234
|
+
<td>::=</td>
|
235
|
+
<td><code>(</code>"<code class="grammar-literal">u</code>" <a href="#grammar-production-HEX">HEX</a> <a href="#grammar-production-HEX">HEX</a> <a href="#grammar-production-HEX">HEX</a> <a href="#grammar-production-HEX">HEX</a><code>)</code> <code>|</code> <code>(</code>"<code class="grammar-literal">U</code>" <a href="#grammar-production-HEX">HEX</a> <a href="#grammar-production-HEX">HEX</a> <a href="#grammar-production-HEX">HEX</a> <a href="#grammar-production-HEX">HEX</a> <a href="#grammar-production-HEX">HEX</a> <a href="#grammar-production-HEX">HEX</a> <a href="#grammar-production-HEX">HEX</a> <a href="#grammar-production-HEX">HEX</a><code>)</code></td>
|
236
|
+
</tr>
|
237
|
+
<tr id="grammar-production-ECHAR">
|
238
|
+
<td>[159s]</td>
|
239
|
+
<td><code>ECHAR</code></td>
|
240
|
+
<td>::=</td>
|
241
|
+
<td>"<code class="grammar-literal">\</code>" <code>[</code><code class="grammar-literal">tbnrf"'</code><code>]</code></td>
|
242
|
+
</tr>
|
243
|
+
<tr id="grammar-production-SPARQL_PREFIX">
|
244
|
+
<td>[28t]</td>
|
245
|
+
<td><code>SPARQL_PREFIX</code></td>
|
246
|
+
<td>::=</td>
|
247
|
+
<td><code>[</code><code class="grammar-literal">Pp</code><code>]</code> <code>[</code><code class="grammar-literal">Rr</code><code>]</code> <code>[</code><code class="grammar-literal">Ee</code><code>]</code> <code>[</code><code class="grammar-literal">Ff</code><code>]</code> <code>[</code><code class="grammar-literal">Ii</code><code>]</code> <code>[</code><code class="grammar-literal">Xx</code><code>]</code></td>
|
248
|
+
</tr>
|
249
|
+
<tr id="grammar-production-SPARQL_BASE">
|
250
|
+
<td>[29t]</td>
|
251
|
+
<td><code>SPARQL_BASE</code></td>
|
252
|
+
<td>::=</td>
|
253
|
+
<td><code>[</code><code class="grammar-literal">Bb</code><code>]</code> <code>[</code><code class="grammar-literal">Aa</code><code>]</code> <code>[</code><code class="grammar-literal">Ss</code><code>]</code> <code>[</code><code class="grammar-literal">Ee</code><code>]</code></td>
|
254
|
+
</tr>
|
255
|
+
<tr id="grammar-production-WS">
|
256
|
+
<td>[161s]</td>
|
257
|
+
<td><code>WS</code></td>
|
258
|
+
<td>::=</td>
|
259
|
+
<td><code class="grammar-char-escape"><abbr title="space">#x20</abbr></code> <code>|</code> <code class="grammar-char-escape"><abbr title="horizontal tab">#x09</abbr></code> <code>|</code> <code class="grammar-char-escape"><abbr title="carriage return">#x0D</abbr></code> <code>|</code> <code class="grammar-char-escape"><abbr title="new line">#x0A</abbr></code></td>
|
260
|
+
</tr>
|
261
|
+
<tr id="grammar-production-ANON">
|
262
|
+
<td>[162s]</td>
|
263
|
+
<td><code>ANON</code></td>
|
264
|
+
<td>::=</td>
|
265
|
+
<td>"<code class="grammar-literal">[</code>" <a href="#grammar-production-WS">WS</a><code>*</code> "<code class="grammar-literal">]</code>"</td>
|
266
|
+
</tr>
|
267
|
+
<tr id="grammar-production-PN_CHARS_BASE">
|
268
|
+
<td>[163s]</td>
|
269
|
+
<td><code>PN_CHARS_BASE</code></td>
|
270
|
+
<td>::=</td>
|
271
|
+
<td><code>[</code><code class="grammar-literal">A-Z</code><code>]</code></td>
|
272
|
+
</tr>
|
273
|
+
<tr>
|
274
|
+
<td colspan=2></td>
|
275
|
+
<td>|</td>
|
276
|
+
<td><code>[</code><code class="grammar-literal">a-z</code><code>]</code></td>
|
277
|
+
</tr>
|
278
|
+
<tr>
|
279
|
+
<td colspan=2></td>
|
280
|
+
<td>|</td>
|
281
|
+
<td><code>[</code><code class="grammar-char-escape"><abbr title="extended ascii '#xC0'">#xC0</abbr></code><code class="grammar-literal">-</code><code class="grammar-char-escape"><abbr title="extended ascii '#xD6'">#xD6</abbr></code><code>]</code></td>
|
282
|
+
</tr>
|
283
|
+
<tr>
|
284
|
+
<td colspan=2></td>
|
285
|
+
<td>|</td>
|
286
|
+
<td><code>[</code><code class="grammar-char-escape"><abbr title="extended ascii '#xD8'">#xD8</abbr></code><code class="grammar-literal">-</code><code class="grammar-char-escape"><abbr title="extended ascii '#xF6'">#xF6</abbr></code><code>]</code></td>
|
287
|
+
</tr>
|
288
|
+
<tr>
|
289
|
+
<td colspan=2></td>
|
290
|
+
<td>|</td>
|
291
|
+
<td><code>[</code><code class="grammar-char-escape"><abbr title="extended ascii '#xF8'">#xF8</abbr></code><code class="grammar-literal">-</code><code class="grammar-char-escape"><abbr title="unicode 'Graphic'">#x02FF</abbr></code><code>]</code></td>
|
292
|
+
</tr>
|
293
|
+
<tr>
|
294
|
+
<td colspan=2></td>
|
295
|
+
<td>|</td>
|
296
|
+
<td><code>[</code><code class="grammar-char-escape"><abbr title="unicode 'Graphic'">#x0370</abbr></code><code class="grammar-literal">-</code><code class="grammar-char-escape"><abbr title="unicode 'Graphic'">#x037D</abbr></code><code>]</code></td>
|
297
|
+
</tr>
|
298
|
+
<tr>
|
299
|
+
<td colspan=2></td>
|
300
|
+
<td>|</td>
|
301
|
+
<td><code>[</code><code class="grammar-char-escape"><abbr title="unicode 'Graphic'">#x037F</abbr></code><code class="grammar-literal">-</code><code class="grammar-char-escape"><abbr title="unicode 'Reserved'">#x1FFF</abbr></code><code>]</code></td>
|
302
|
+
</tr>
|
303
|
+
<tr>
|
304
|
+
<td colspan=2></td>
|
305
|
+
<td>|</td>
|
306
|
+
<td><code>[</code><code class="grammar-char-escape"><abbr title="unicode 'Format'">#x200C</abbr></code><code class="grammar-literal">-</code><code class="grammar-char-escape"><abbr title="unicode 'Format'">#x200D</abbr></code><code>]</code></td>
|
307
|
+
</tr>
|
308
|
+
<tr>
|
309
|
+
<td colspan=2></td>
|
310
|
+
<td>|</td>
|
311
|
+
<td><code>[</code><code class="grammar-char-escape"><abbr title="unicode 'Graphic'">#x2070</abbr></code><code class="grammar-literal">-</code><code class="grammar-char-escape"><abbr title="unicode 'Reserved'">#x218F</abbr></code><code>]</code></td>
|
312
|
+
</tr>
|
313
|
+
<tr>
|
314
|
+
<td colspan=2></td>
|
315
|
+
<td>|</td>
|
316
|
+
<td><code>[</code><code class="grammar-char-escape"><abbr title="unicode 'Graphic'">#x2C00</abbr></code><code class="grammar-literal">-</code><code class="grammar-char-escape"><abbr title="unicode 'Reserved'">#x2FEF</abbr></code><code>]</code></td>
|
317
|
+
</tr>
|
318
|
+
<tr>
|
319
|
+
<td colspan=2></td>
|
320
|
+
<td>|</td>
|
321
|
+
<td><code>[</code><code class="grammar-char-escape"><abbr title="unicode 'Graphic'">#x3001</abbr></code><code class="grammar-literal">-</code><code class="grammar-char-escape"><abbr title="unicode 'Reserved'">#xD7FF</abbr></code><code>]</code></td>
|
322
|
+
</tr>
|
323
|
+
<tr>
|
324
|
+
<td colspan=2></td>
|
325
|
+
<td>|</td>
|
326
|
+
<td><code>[</code><code class="grammar-char-escape"><abbr title="unicode 'Graphic'">#xF900</abbr></code><code class="grammar-literal">-</code><code class="grammar-char-escape"><abbr title="unicode 'Graphic'">#xFDCF</abbr></code><code>]</code></td>
|
327
|
+
</tr>
|
328
|
+
<tr>
|
329
|
+
<td colspan=2></td>
|
330
|
+
<td>|</td>
|
331
|
+
<td><code>[</code><code class="grammar-char-escape"><abbr title="unicode 'Graphic'">#xFDF0</abbr></code><code class="grammar-literal">-</code><code class="grammar-char-escape"><abbr title="unicode 'Graphic'">#xFFFD</abbr></code><code>]</code></td>
|
332
|
+
</tr>
|
333
|
+
<tr>
|
334
|
+
<td colspan=2></td>
|
335
|
+
<td>|</td>
|
336
|
+
<td><code>[</code><code class="grammar-char-escape"><abbr title="unicode 'Graphic'">#x00010000</abbr></code><code class="grammar-literal">-</code><code class="grammar-char-escape"><abbr title="unicode 'Noncharacter'">#x000EFFFF</abbr></code><code>]</code></td>
|
337
|
+
</tr>
|
338
|
+
<tr id="grammar-production-PN_CHARS_U">
|
339
|
+
<td>[164s]</td>
|
340
|
+
<td><code>PN_CHARS_U</code></td>
|
341
|
+
<td>::=</td>
|
342
|
+
<td><a href="#grammar-production-PN_CHARS_BASE">PN_CHARS_BASE</a> <code>|</code> "<code class="grammar-literal">_</code>"</td>
|
343
|
+
</tr>
|
344
|
+
<tr id="grammar-production-PN_CHARS">
|
345
|
+
<td>[166s]</td>
|
346
|
+
<td><code>PN_CHARS</code></td>
|
347
|
+
<td>::=</td>
|
348
|
+
<td><a href="#grammar-production-PN_CHARS_U">PN_CHARS_U</a> <code>|</code> "<code class="grammar-literal">-</code>" <code>|</code> <code>[</code><code class="grammar-literal">0-9</code><code>]</code> <code>|</code> <code class="grammar-char-escape"><abbr title="extended ascii '#xB7'">#xB7</abbr></code> <code>|</code> <code>[</code><code class="grammar-char-escape"><abbr title="unicode 'Graphic'">#x0300</abbr></code><code class="grammar-literal">-</code><code class="grammar-char-escape"><abbr title="unicode 'Graphic'">#x036F</abbr></code><code>]</code> <code>|</code> <code>[</code><code class="grammar-char-escape"><abbr title="unicode 'Graphic'">#x203F</abbr></code><code class="grammar-literal">-</code><code class="grammar-char-escape"><abbr title="unicode 'Graphic'">#x2040</abbr></code><code>]</code></td>
|
349
|
+
</tr>
|
350
|
+
<tr id="grammar-production-PN_PREFIX">
|
351
|
+
<td>[167s]</td>
|
352
|
+
<td><code>PN_PREFIX</code></td>
|
353
|
+
<td>::=</td>
|
354
|
+
<td><a href="#grammar-production-PN_CHARS_BASE">PN_CHARS_BASE</a> <code>(</code><code>(</code><a href="#grammar-production-PN_CHARS">PN_CHARS</a> <code>|</code> "<code class="grammar-literal">.</code>"<code>)</code><code>*</code> <a href="#grammar-production-PN_CHARS">PN_CHARS</a><code>)</code><code>?</code></td>
|
355
|
+
</tr>
|
356
|
+
<tr id="grammar-production-PN_LOCAL">
|
357
|
+
<td>[168s]</td>
|
358
|
+
<td><code>PN_LOCAL</code></td>
|
359
|
+
<td>::=</td>
|
360
|
+
<td><code>(</code><a href="#grammar-production-PN_CHARS_U">PN_CHARS_U</a> <code>|</code> "<code class="grammar-literal">:</code>" <code>|</code> <code>[</code><code class="grammar-literal">0-9</code><code>]</code> <code>|</code> <a href="#grammar-production-PLX">PLX</a><code>)</code> <code>(</code><code>(</code><a href="#grammar-production-PN_CHARS">PN_CHARS</a> <code>|</code> "<code class="grammar-literal">.</code>" <code>|</code> "<code class="grammar-literal">:</code>" <code>|</code> <a href="#grammar-production-PLX">PLX</a><code>)</code><code>*</code> <code>(</code><a href="#grammar-production-PN_CHARS">PN_CHARS</a> <code>|</code> "<code class="grammar-literal">:</code>" <code>|</code> <a href="#grammar-production-PLX">PLX</a><code>)</code><code>)</code><code>?</code></td>
|
361
|
+
</tr>
|
362
|
+
<tr id="grammar-production-PLX">
|
363
|
+
<td>[169s]</td>
|
364
|
+
<td><code>PLX</code></td>
|
365
|
+
<td>::=</td>
|
366
|
+
<td><a href="#grammar-production-PERCENT">PERCENT</a> <code>|</code> <a href="#grammar-production-PN_LOCAL_ESC">PN_LOCAL_ESC</a></td>
|
367
|
+
</tr>
|
368
|
+
<tr id="grammar-production-PERCENT">
|
369
|
+
<td>[170s]</td>
|
370
|
+
<td><code>PERCENT</code></td>
|
371
|
+
<td>::=</td>
|
372
|
+
<td>"<code class="grammar-literal">%</code>" <a href="#grammar-production-HEX">HEX</a> <a href="#grammar-production-HEX">HEX</a></td>
|
373
|
+
</tr>
|
374
|
+
<tr id="grammar-production-HEX">
|
375
|
+
<td>[171s]</td>
|
376
|
+
<td><code>HEX</code></td>
|
377
|
+
<td>::=</td>
|
378
|
+
<td><code>[</code><code class="grammar-literal">0-9A-Fa-f</code><code>]</code></td>
|
379
|
+
</tr>
|
380
|
+
<tr id="grammar-production-PN_LOCAL_ESC">
|
381
|
+
<td>[172s]</td>
|
382
|
+
<td><code>PN_LOCAL_ESC</code></td>
|
383
|
+
<td>::=</td>
|
384
|
+
<td>"<code class="grammar-literal">\</code>" <code>(</code>"<code class="grammar-literal">_</code>" <code>|</code> "<code class="grammar-literal">~</code>" <code>|</code> "<code class="grammar-literal">.</code>" <code>|</code> "<code class="grammar-literal">-</code>" <code>|</code> "<code class="grammar-literal">!</code>" <code>|</code> "<code class="grammar-literal">$</code>" <code>|</code> "<code class="grammar-literal">&</code>" <code>|</code> "<code class="grammar-literal">'</code>" <code>|</code> "<code class="grammar-literal">(</code>" <code>|</code> "<code class="grammar-literal">)</code>" <code>|</code> "<code class="grammar-literal">*</code>" <code>|</code> "<code class="grammar-literal">+</code>" <code>|</code> "<code class="grammar-literal">,</code>" <code>|</code> "<code class="grammar-literal">;</code>" <code>|</code> "<code class="grammar-literal">=</code>" <code>|</code> "<code class="grammar-literal">/</code>" <code>|</code> "<code class="grammar-literal">?</code>" <code>|</code> "<code class="grammar-literal">#</code>" <code>|</code> "<code class="grammar-literal">@</code>" <code>|</code> "<code class="grammar-literal">%</code>"<code>)</code></td>
|
385
|
+
</tr>
|
386
|
+
</tbody>
|
467
387
|
</table>
|
388
|
+
|
data/lib/ebnf/native.rb
CHANGED
@@ -289,7 +289,8 @@ module EBNF
|
|
289
289
|
l, s = s[1..-1].split(m.rstrip, 2)
|
290
290
|
[Unescape.unescape_string(l), s]
|
291
291
|
when '[' # RANGE, O_RANGE
|
292
|
-
|
292
|
+
# Includes RANGE and O_RANGE which can't include a ']'
|
293
|
+
l, s = s[1..-1].split(']', 2)
|
293
294
|
[[:range, Unescape.unescape_string(l)], s]
|
294
295
|
when '#' # HEX
|
295
296
|
s.match(/(#x\h+)(.*)$/)
|
data/lib/ebnf/writer.rb
CHANGED
@@ -181,8 +181,9 @@ module EBNF
|
|
181
181
|
|
182
182
|
if validate
|
183
183
|
begin
|
184
|
+
require 'nokogiri'
|
184
185
|
# Validate the output HTML
|
185
|
-
doc = Nokogiri::HTML5("<!DOCTYPE html>" + html_result, max_errors: 10)
|
186
|
+
doc = ::Nokogiri::HTML5("<!DOCTYPE html>" + html_result, max_errors: 10)
|
186
187
|
raise EncodingError, "Errors found in generated HTML:\n " +
|
187
188
|
doc.errors.map(&:to_s).join("\n ") unless doc.errors.empty?
|
188
189
|
rescue LoadError, NoMethodError
|
@@ -245,14 +246,14 @@ module EBNF
|
|
245
246
|
format_ebnf_string(expr, expr.include?('"') ? "'" : '"')
|
246
247
|
end
|
247
248
|
parts = {
|
248
|
-
alt: (@options[:html] ?
|
249
|
-
diff: (@options[:html] ?
|
250
|
-
star: (@options[:html] ?
|
251
|
-
plus: (@options[:html] ?
|
252
|
-
opt: (@options[:html] ?
|
249
|
+
alt: (@options[:html] ? %(<code class="grammar-alt">|</code> ) : "| "),
|
250
|
+
diff: (@options[:html] ? %(<code class="grammar-diff">-</code> ) : "- "),
|
251
|
+
star: (@options[:html] ? %(<code class="grammar-star">*</code>) : "*"),
|
252
|
+
plus: (@options[:html] ? %(<code class="grammar-plus">+</code>) : "+"),
|
253
|
+
opt: (@options[:html] ? %(<code class="grammar-opt">?</code>) : "?")
|
253
254
|
}
|
254
|
-
lparen = (@options[:html] ?
|
255
|
-
rparen = (@options[:html] ?
|
255
|
+
lparen = (@options[:html] ? %[<code class="grammar-paren">(</code>] : "(")
|
256
|
+
rparen = (@options[:html] ? %[<code class="grammar-paren">)</code>] : ")")
|
256
257
|
|
257
258
|
case expr.first
|
258
259
|
when :istr
|
@@ -322,8 +323,8 @@ module EBNF
|
|
322
323
|
|
323
324
|
# Format a range
|
324
325
|
def format_ebnf_range(string)
|
325
|
-
lbrac = (@options[:html] ?
|
326
|
-
rbrac = (@options[:html] ?
|
326
|
+
lbrac = (@options[:html] ? %(<code class="grammar-brac">[</code>) : "[")
|
327
|
+
rbrac = (@options[:html] ? %(<code class="grammar-brac">]</code>) : "]")
|
327
328
|
|
328
329
|
buffer = lbrac
|
329
330
|
s = StringScanner.new(string)
|
@@ -407,19 +408,19 @@ module EBNF
|
|
407
408
|
seq.unshift(:seq)
|
408
409
|
return format_abnf(seq, sep: nil, embedded: false)
|
409
410
|
else
|
410
|
-
return (@options[:html] ? %("<code class="grammar-literal">#{
|
411
|
+
return (@options[:html] ? %("<code class="grammar-literal">#{@coder.encode expr}</code>") : %("#{expr}"))
|
411
412
|
end
|
412
413
|
end
|
413
414
|
parts = {
|
414
|
-
alt: (@options[:html] ?
|
415
|
-
star: (@options[:html] ?
|
416
|
-
plus: (@options[:html] ?
|
417
|
-
opt: (@options[:html] ?
|
415
|
+
alt: (@options[:html] ? %(<code class="grammar-alt">/</code>) : "/ "),
|
416
|
+
star: (@options[:html] ? %(<code class="grammar-star">*</code>) : "*"),
|
417
|
+
plus: (@options[:html] ? %(<code class="grammar-plus">+</code>) : "1*"),
|
418
|
+
opt: (@options[:html] ? %(<code class="grammar-opt">?</code>) : "?")
|
418
419
|
}
|
419
|
-
lbrac = (@options[:html] ?
|
420
|
-
rbrac = (@options[:html] ?
|
421
|
-
lparen = (@options[:html] ?
|
422
|
-
rparen = (@options[:html] ?
|
420
|
+
lbrac = (@options[:html] ? %(<code class="grammar-brac">[</code>) : "[")
|
421
|
+
rbrac = (@options[:html] ? %(<code class="grammar-brac">]</code>) : "]")
|
422
|
+
lparen = (@options[:html] ? %[<code class="grammar-paren">(</code>] : "(")
|
423
|
+
rparen = (@options[:html] ? %[<code class="grammar-paren">)</code>] : ")")
|
423
424
|
|
424
425
|
case expr.first
|
425
426
|
when :istr
|
@@ -464,6 +465,8 @@ module EBNF
|
|
464
465
|
"#{parts[:star]}#{r}"
|
465
466
|
elsif min > 0 && max == '*'
|
466
467
|
"#{min}#{parts[:star]}#{r}"
|
468
|
+
elsif min == 0
|
469
|
+
"#{parts[:star]}#{max}#{r}"
|
467
470
|
else
|
468
471
|
"#{min}#{parts[:star]}#{max}#{r}"
|
469
472
|
end
|
@@ -503,6 +506,7 @@ module EBNF
|
|
503
506
|
# Append any decimal values
|
504
507
|
alt << "%d" + deces.join(".") unless deces.empty?
|
505
508
|
deces = []
|
509
|
+
hex = hex.upcase
|
506
510
|
|
507
511
|
if in_range
|
508
512
|
# Add "." sequences for any previous hexes
|
@@ -552,7 +556,7 @@ module EBNF
|
|
552
556
|
when 0x0100..0xffff then "%04X"
|
553
557
|
else "%08X"
|
554
558
|
end
|
555
|
-
char = "%x" + (fmt % u.ord)
|
559
|
+
char = "%x" + (fmt % u.ord).upcase
|
556
560
|
if @options[:html]
|
557
561
|
if u.ord <= 0x20
|
558
562
|
char = %(<abbr title="#{ASCII_ESCAPE_NAMES[u.ord]}">#{@coder.encode char}</abbr>)
|
@@ -593,11 +597,11 @@ module EBNF
|
|
593
597
|
end
|
594
598
|
end
|
595
599
|
parts = {
|
596
|
-
alt: (@options[:html] ?
|
597
|
-
diff: (@options[:html] ?
|
600
|
+
alt: (@options[:html] ? %(<code class="grammar-alt">|</code> ) : "| "),
|
601
|
+
diff: (@options[:html] ? %(<code class="grammar-diff">-</code> ) : "- "),
|
598
602
|
}
|
599
|
-
lparen = (@options[:html] ?
|
600
|
-
rparen = (@options[:html] ?
|
603
|
+
lparen = (@options[:html] ? %[<code class="grammar-paren">(</code>] : "(")
|
604
|
+
rparen = (@options[:html] ? %[<code class="grammar-paren">)</code>] : ")")
|
601
605
|
|
602
606
|
case expr.first
|
603
607
|
when :istr
|
@@ -705,6 +709,7 @@ module EBNF
|
|
705
709
|
end
|
706
710
|
|
707
711
|
ERB_DESC = %q(
|
712
|
+
<!-- Generated with ebnf version #{EBNF::VERSION}. See https://github.com/dryruby/ebnf. -->
|
708
713
|
<table class="grammar">
|
709
714
|
<tbody id="grammar-productions" class="<%= @format %>">
|
710
715
|
<% for rule in @rules %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ebnf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregg Kellogg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sxp
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '1.
|
75
|
+
version: '1.8'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '1.
|
82
|
+
version: '1.8'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: amazing_print
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '1.4'
|
90
|
-
type: :
|
90
|
+
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
@@ -128,14 +128,20 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '1.
|
131
|
+
version: '1.13'
|
132
|
+
- - ">="
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: 1.13.4
|
132
135
|
type: :development
|
133
136
|
prerelease: false
|
134
137
|
version_requirements: !ruby/object:Gem::Requirement
|
135
138
|
requirements:
|
136
139
|
- - "~>"
|
137
140
|
- !ruby/object:Gem::Version
|
138
|
-
version: '1.
|
141
|
+
version: '1.13'
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: 1.13.4
|
139
145
|
- !ruby/object:Gem::Dependency
|
140
146
|
name: erubis
|
141
147
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,14 +162,14 @@ dependencies:
|
|
156
162
|
requirements:
|
157
163
|
- - "~>"
|
158
164
|
- !ruby/object:Gem::Version
|
159
|
-
version: '3.
|
165
|
+
version: '3.12'
|
160
166
|
type: :development
|
161
167
|
prerelease: false
|
162
168
|
version_requirements: !ruby/object:Gem::Requirement
|
163
169
|
requirements:
|
164
170
|
- - "~>"
|
165
171
|
- !ruby/object:Gem::Version
|
166
|
-
version: '3.
|
172
|
+
version: '3.12'
|
167
173
|
- !ruby/object:Gem::Dependency
|
168
174
|
name: rspec-its
|
169
175
|
requirement: !ruby/object:Gem::Requirement
|
@@ -294,7 +300,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
294
300
|
- !ruby/object:Gem::Version
|
295
301
|
version: '0'
|
296
302
|
requirements: []
|
297
|
-
rubygems_version: 3.
|
303
|
+
rubygems_version: 3.4.6
|
298
304
|
signing_key:
|
299
305
|
specification_version: 4
|
300
306
|
summary: EBNF parser and parser generator in Ruby.
|