ebnf 2.3.2 → 2.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/VERSION +1 -1
- data/etc/turtle.html +336 -466
- data/lib/ebnf/ll1/lexer.rb +1 -1
- data/lib/ebnf/native.rb +2 -1
- data/lib/ebnf/writer.rb +37 -34
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 507c2fb1540ade02c7fd97e8379a9da0175025f9658b14f00111748d46ab86a5
|
4
|
+
data.tar.gz: 51e580981bec7097249da661cb76c9a2ae0cf97e2a3e87c500494aad9147a603
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51486439b64d9ac1fac9cbea93b9326f37cc59e2125d68ba3ecf86e52b2d5aa653bdd83bd2d366ef4f4a1705ce629e4b927c89f03884a380929378ab7f253ca8
|
7
|
+
data.tar.gz: f2036691fcd52736d63a615db302ef2efc45220a174740af984768a546e250d1b376d54d606d1a34e3886913c740f5c50dedae2a8ee9962e5d5533aec23c432d
|
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)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.4
|
data/etc/turtle.html
CHANGED
@@ -1,467 +1,337 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
<
|
4
|
-
<
|
5
|
-
<
|
6
|
-
<td
|
7
|
-
<td>
|
8
|
-
statement
|
9
|
-
</
|
10
|
-
|
11
|
-
<
|
12
|
-
<td
|
13
|
-
<td><code>
|
14
|
-
|
15
|
-
<
|
16
|
-
|
17
|
-
|
18
|
-
</
|
19
|
-
|
20
|
-
<
|
21
|
-
<td
|
22
|
-
<td>::=</td>
|
23
|
-
<td>
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
</td>
|
29
|
-
</tr>
|
30
|
-
<tr id=
|
31
|
-
<td>[
|
32
|
-
<td
|
33
|
-
<td
|
34
|
-
|
35
|
-
|
36
|
-
</td>
|
37
|
-
|
38
|
-
<
|
39
|
-
|
40
|
-
<
|
41
|
-
<td
|
42
|
-
<td>
|
43
|
-
"
|
44
|
-
</
|
45
|
-
|
46
|
-
<
|
47
|
-
<td
|
48
|
-
<td><code>
|
49
|
-
|
50
|
-
<
|
51
|
-
|
52
|
-
|
53
|
-
</
|
54
|
-
|
55
|
-
<
|
56
|
-
<td
|
57
|
-
<td>::=</td>
|
58
|
-
<td>
|
59
|
-
|
60
|
-
|
61
|
-
</
|
62
|
-
<
|
63
|
-
<td>
|
64
|
-
|
65
|
-
<
|
66
|
-
<td>
|
67
|
-
|
68
|
-
|
69
|
-
</
|
70
|
-
|
71
|
-
<
|
72
|
-
<td
|
73
|
-
<td><code>
|
74
|
-
|
75
|
-
<
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
</
|
80
|
-
|
81
|
-
<
|
82
|
-
<td
|
83
|
-
<td
|
84
|
-
|
85
|
-
<
|
86
|
-
|
87
|
-
|
88
|
-
</
|
89
|
-
|
90
|
-
<
|
91
|
-
<td
|
92
|
-
<td>::=</td>
|
93
|
-
<td>
|
94
|
-
|
95
|
-
|
96
|
-
</
|
97
|
-
<
|
98
|
-
<td>
|
99
|
-
|
100
|
-
<
|
101
|
-
<td>
|
102
|
-
|
103
|
-
</td>
|
104
|
-
</tr>
|
105
|
-
<tr id=
|
106
|
-
<td>[
|
107
|
-
<td
|
108
|
-
<td
|
109
|
-
|
110
|
-
iri
|
111
|
-
</td>
|
112
|
-
|
113
|
-
<
|
114
|
-
|
115
|
-
<
|
116
|
-
<td
|
117
|
-
<td>
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
</td>
|
124
|
-
</tr>
|
125
|
-
<tr id=
|
126
|
-
<td
|
127
|
-
<td
|
128
|
-
<td
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
</td>
|
134
|
-
</tr>
|
135
|
-
<tr id=
|
136
|
-
<td>[
|
137
|
-
<td
|
138
|
-
<td
|
139
|
-
|
140
|
-
|
141
|
-
</td>
|
142
|
-
|
143
|
-
<
|
144
|
-
|
145
|
-
<
|
146
|
-
<td
|
147
|
-
<td>
|
148
|
-
"("
|
149
|
-
</
|
150
|
-
|
151
|
-
<
|
152
|
-
<td
|
153
|
-
<td><code>
|
154
|
-
|
155
|
-
<
|
156
|
-
|
157
|
-
|
158
|
-
</
|
159
|
-
|
160
|
-
<
|
161
|
-
<td
|
162
|
-
<td>::=</td>
|
163
|
-
<td>
|
164
|
-
|
165
|
-
|
166
|
-
</
|
167
|
-
<
|
168
|
-
<td>[
|
169
|
-
|
170
|
-
<
|
171
|
-
<td>
|
172
|
-
|
173
|
-
</td>
|
174
|
-
</tr>
|
175
|
-
<tr id=
|
176
|
-
<td>[
|
177
|
-
<td
|
178
|
-
<td
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
</
|
185
|
-
|
186
|
-
<
|
187
|
-
<td
|
188
|
-
<td><code>
|
189
|
-
|
190
|
-
<
|
191
|
-
|
192
|
-
|
193
|
-
</
|
194
|
-
|
195
|
-
<
|
196
|
-
<td
|
197
|
-
<td>::=</td>
|
198
|
-
<td>
|
199
|
-
|
200
|
-
|
201
|
-
</
|
202
|
-
<
|
203
|
-
<td>[
|
204
|
-
|
205
|
-
<
|
206
|
-
<td>
|
207
|
-
|
208
|
-
</td>
|
209
|
-
</tr>
|
210
|
-
<tr id=
|
211
|
-
<td>[
|
212
|
-
<td
|
213
|
-
<td
|
214
|
-
|
215
|
-
|
216
|
-
[
|
217
|
-
|
218
|
-
</
|
219
|
-
|
220
|
-
<
|
221
|
-
<td
|
222
|
-
<td>::=</td>
|
223
|
-
<td>
|
224
|
-
|
225
|
-
|
226
|
-
</
|
227
|
-
<
|
228
|
-
<td>[
|
229
|
-
|
230
|
-
<
|
231
|
-
<td>
|
232
|
-
|
233
|
-
</td>
|
234
|
-
</tr>
|
235
|
-
<tr
|
236
|
-
<td
|
237
|
-
<td><code
|
238
|
-
<td
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
</td>
|
244
|
-
</tr>
|
245
|
-
<tr
|
246
|
-
<td
|
247
|
-
<td><code
|
248
|
-
<td
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
<
|
254
|
-
|
255
|
-
<
|
256
|
-
<td
|
257
|
-
<td>
|
258
|
-
|
259
|
-
</
|
260
|
-
|
261
|
-
<
|
262
|
-
<td
|
263
|
-
<td><code>
|
264
|
-
|
265
|
-
<
|
266
|
-
|
267
|
-
|
268
|
-
</
|
269
|
-
|
270
|
-
<
|
271
|
-
<td
|
272
|
-
<td
|
273
|
-
<td>
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
<
|
279
|
-
|
280
|
-
<
|
281
|
-
<td
|
282
|
-
<td>
|
283
|
-
|
284
|
-
</
|
285
|
-
|
286
|
-
<
|
287
|
-
<td
|
288
|
-
<td><code>
|
289
|
-
|
290
|
-
<
|
291
|
-
|
292
|
-
|
293
|
-
'"'
|
294
|
-
</
|
295
|
-
|
296
|
-
<
|
297
|
-
<td
|
298
|
-
<td><code>
|
299
|
-
|
300
|
-
<
|
301
|
-
|
302
|
-
|
303
|
-
"'"
|
304
|
-
</
|
305
|
-
|
306
|
-
<
|
307
|
-
<td
|
308
|
-
<td><code>
|
309
|
-
|
310
|
-
<
|
311
|
-
|
312
|
-
|
313
|
-
</td>
|
314
|
-
</tr>
|
315
|
-
<tr id=
|
316
|
-
<td>[
|
317
|
-
<td
|
318
|
-
<td
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
</
|
324
|
-
|
325
|
-
<
|
326
|
-
<td
|
327
|
-
<td>::=</td>
|
328
|
-
<td>
|
329
|
-
|
330
|
-
|
331
|
-
</td>
|
332
|
-
|
333
|
-
<
|
334
|
-
|
335
|
-
|
336
|
-
<td>::=</td>
|
337
|
-
<td>
|
338
|
-
"\" [tbnrf"']
|
339
|
-
</td>
|
340
|
-
</tr>
|
341
|
-
<tr id='grammar-production-SPARQL_PREFIX'>
|
342
|
-
<td>[28t]</td>
|
343
|
-
<td><code>SPARQL_PREFIX</code></td>
|
344
|
-
<td>::=</td>
|
345
|
-
<td>
|
346
|
-
[Pp] [Rr] [Ee] [Ff] [Ii] [Xx]
|
347
|
-
</td>
|
348
|
-
</tr>
|
349
|
-
<tr id='grammar-production-SPARQL_BASE'>
|
350
|
-
<td>[29t]</td>
|
351
|
-
<td><code>SPARQL_BASE</code></td>
|
352
|
-
<td>::=</td>
|
353
|
-
<td>
|
354
|
-
[Bb] [Aa] [Ss] [Ee]
|
355
|
-
</td>
|
356
|
-
</tr>
|
357
|
-
<tr id='grammar-production-WS'>
|
358
|
-
<td>[161s]</td>
|
359
|
-
<td><code>WS</code></td>
|
360
|
-
<td>::=</td>
|
361
|
-
<td>
|
362
|
-
#x20 | #x9 | #xD | #xA
|
363
|
-
</td>
|
364
|
-
</tr>
|
365
|
-
<tr id='grammar-production-ANON'>
|
366
|
-
<td>[162s]</td>
|
367
|
-
<td><code>ANON</code></td>
|
368
|
-
<td>::=</td>
|
369
|
-
<td>
|
370
|
-
"[" WS* "]"
|
371
|
-
</td>
|
372
|
-
</tr>
|
373
|
-
<tr id='grammar-production-PN_CHARS_BASE'>
|
374
|
-
<td>[163s]</td>
|
375
|
-
<td><code>PN_CHARS_BASE</code></td>
|
376
|
-
<td>::=</td>
|
377
|
-
<td>
|
378
|
-
[A-Z]
|
379
|
-
| [a-z]
|
380
|
-
| [#x00C0-#x00D6]
|
381
|
-
| [#x00D8-#x00F6]
|
382
|
-
| [#x00F8-#x02FF]
|
383
|
-
| [#x0370-#x037D]
|
384
|
-
| [#x037F-#x1FFF]
|
385
|
-
| [#x200C-#x200D]
|
386
|
-
| [#x2070-#x218F]
|
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
|
+
<!-- Generated with ebnf version #{EBNF::VERSION}. See https://github.com/dryruby/ebnf. -->
|
3
|
+
<table class="grammar">
|
4
|
+
<tbody id="grammar-productions" class="ebnf">
|
5
|
+
<tr id="grammar-OpenStruct-turtleDoc">
|
6
|
+
<td>[1]</td>
|
7
|
+
<td>::=</td>
|
8
|
+
<td><a href="#grammar-production-statement">statement</a><code class="grammar-star">*</code></td>
|
9
|
+
</tr>
|
10
|
+
<tr id="grammar-OpenStruct-statement">
|
11
|
+
<td>[2]</td>
|
12
|
+
<td>::=</td>
|
13
|
+
<td><a href="#grammar-production-directive">directive</a> <code class="grammar-alt">|</code> <code class="grammar-paren">(</code><a href="#grammar-production-triples">triples</a> "<code class="grammar-literal">.</code>"<code class="grammar-paren">)</code></td>
|
14
|
+
</tr>
|
15
|
+
<tr id="grammar-OpenStruct-directive">
|
16
|
+
<td>[3]</td>
|
17
|
+
<td>::=</td>
|
18
|
+
<td><a href="#grammar-production-prefixID">prefixID</a> <code class="grammar-alt">|</code> <a href="#grammar-production-base">base</a> <code class="grammar-alt">|</code> <a href="#grammar-production-sparqlPrefix">sparqlPrefix</a> <code class="grammar-alt">|</code> <a href="#grammar-production-sparqlBase">sparqlBase</a></td>
|
19
|
+
</tr>
|
20
|
+
<tr id="grammar-OpenStruct-prefixID">
|
21
|
+
<td>[4]</td>
|
22
|
+
<td>::=</td>
|
23
|
+
<td>"<code class="grammar-literal">@prefix</code>" <a href="#grammar-production-PNAME_NS">PNAME_NS</a> <a href="#grammar-production-IRIREF">IRIREF</a> "<code class="grammar-literal">.</code>"</td>
|
24
|
+
</tr>
|
25
|
+
<tr id="grammar-OpenStruct-base">
|
26
|
+
<td>[5]</td>
|
27
|
+
<td>::=</td>
|
28
|
+
<td>"<code class="grammar-literal">@base</code>" <a href="#grammar-production-IRIREF">IRIREF</a> "<code class="grammar-literal">.</code>"</td>
|
29
|
+
</tr>
|
30
|
+
<tr id="grammar-OpenStruct-sparqlPrefix">
|
31
|
+
<td>[28s]</td>
|
32
|
+
<td>::=</td>
|
33
|
+
<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>
|
34
|
+
</tr>
|
35
|
+
<tr id="grammar-OpenStruct-sparqlBase">
|
36
|
+
<td>[29s]</td>
|
37
|
+
<td>::=</td>
|
38
|
+
<td><a href="#grammar-production-SPARQL_BASE">SPARQL_BASE</a> <a href="#grammar-production-IRIREF">IRIREF</a></td>
|
39
|
+
</tr>
|
40
|
+
<tr id="grammar-OpenStruct-triples">
|
41
|
+
<td>[6]</td>
|
42
|
+
<td>::=</td>
|
43
|
+
<td><code class="grammar-paren">(</code><a href="#grammar-production-subject">subject</a> <a href="#grammar-production-predicateObjectList">predicateObjectList</a><code class="grammar-paren">)</code> <code class="grammar-alt">|</code> <code class="grammar-paren">(</code><a href="#grammar-production-blankNodePropertyList">blankNodePropertyList</a> <a href="#grammar-production-predicateObjectList">predicateObjectList</a><code class="grammar-opt">?</code><code class="grammar-paren">)</code></td>
|
44
|
+
</tr>
|
45
|
+
<tr id="grammar-OpenStruct-predicateObjectList">
|
46
|
+
<td>[7]</td>
|
47
|
+
<td>::=</td>
|
48
|
+
<td><a href="#grammar-production-verb">verb</a> <a href="#grammar-production-objectList">objectList</a> <code class="grammar-paren">(</code>"<code class="grammar-literal">;</code>" <code class="grammar-paren">(</code><a href="#grammar-production-verb">verb</a> <a href="#grammar-production-objectList">objectList</a><code class="grammar-paren">)</code><code class="grammar-opt">?</code><code class="grammar-paren">)</code><code class="grammar-star">*</code></td>
|
49
|
+
</tr>
|
50
|
+
<tr id="grammar-OpenStruct-objectList">
|
51
|
+
<td>[8]</td>
|
52
|
+
<td>::=</td>
|
53
|
+
<td><a href="#grammar-production-object">object</a> <code class="grammar-paren">(</code>"<code class="grammar-literal">,</code>" <a href="#grammar-production-object">object</a><code class="grammar-paren">)</code><code class="grammar-star">*</code></td>
|
54
|
+
</tr>
|
55
|
+
<tr id="grammar-OpenStruct-verb">
|
56
|
+
<td>[9]</td>
|
57
|
+
<td>::=</td>
|
58
|
+
<td><a href="#grammar-production-predicate">predicate</a> <code class="grammar-alt">|</code> "<code class="grammar-literal">a</code>"</td>
|
59
|
+
</tr>
|
60
|
+
<tr id="grammar-OpenStruct-subject">
|
61
|
+
<td>[10]</td>
|
62
|
+
<td>::=</td>
|
63
|
+
<td><a href="#grammar-production-iri">iri</a> <code class="grammar-alt">|</code> <a href="#grammar-production-BlankNode">BlankNode</a> <code class="grammar-alt">|</code> <a href="#grammar-production-collection">collection</a></td>
|
64
|
+
</tr>
|
65
|
+
<tr id="grammar-OpenStruct-predicate">
|
66
|
+
<td>[11]</td>
|
67
|
+
<td>::=</td>
|
68
|
+
<td><a href="#grammar-production-iri">iri</a></td>
|
69
|
+
</tr>
|
70
|
+
<tr id="grammar-OpenStruct-object">
|
71
|
+
<td>[12]</td>
|
72
|
+
<td>::=</td>
|
73
|
+
<td><a href="#grammar-production-iri">iri</a> <code class="grammar-alt">|</code> <a href="#grammar-production-BlankNode">BlankNode</a> <code class="grammar-alt">|</code> <a href="#grammar-production-collection">collection</a> <code class="grammar-alt">|</code> <a href="#grammar-production-blankNodePropertyList">blankNodePropertyList</a> <code class="grammar-alt">|</code> <a href="#grammar-production-literal">literal</a></td>
|
74
|
+
</tr>
|
75
|
+
<tr id="grammar-OpenStruct-literal">
|
76
|
+
<td>[13]</td>
|
77
|
+
<td>::=</td>
|
78
|
+
<td><a href="#grammar-production-RDFLiteral">RDFLiteral</a> <code class="grammar-alt">|</code> <a href="#grammar-production-NumericLiteral">NumericLiteral</a> <code class="grammar-alt">|</code> <a href="#grammar-production-BooleanLiteral">BooleanLiteral</a></td>
|
79
|
+
</tr>
|
80
|
+
<tr id="grammar-OpenStruct-blankNodePropertyList">
|
81
|
+
<td>[14]</td>
|
82
|
+
<td>::=</td>
|
83
|
+
<td>"<code class="grammar-literal">[</code>" <a href="#grammar-production-predicateObjectList">predicateObjectList</a> "<code class="grammar-literal">]</code>"</td>
|
84
|
+
</tr>
|
85
|
+
<tr id="grammar-OpenStruct-collection">
|
86
|
+
<td>[15]</td>
|
87
|
+
<td>::=</td>
|
88
|
+
<td>"<code class="grammar-literal">(</code>" <a href="#grammar-production-object">object</a><code class="grammar-star">*</code> "<code class="grammar-literal">)</code>"</td>
|
89
|
+
</tr>
|
90
|
+
<tr id="grammar-OpenStruct-NumericLiteral">
|
91
|
+
<td>[16]</td>
|
92
|
+
<td>::=</td>
|
93
|
+
<td><a href="#grammar-production-INTEGER">INTEGER</a> <code class="grammar-alt">|</code> <a href="#grammar-production-DECIMAL">DECIMAL</a> <code class="grammar-alt">|</code> <a href="#grammar-production-DOUBLE">DOUBLE</a></td>
|
94
|
+
</tr>
|
95
|
+
<tr id="grammar-OpenStruct-RDFLiteral">
|
96
|
+
<td>[128s]</td>
|
97
|
+
<td>::=</td>
|
98
|
+
<td><a href="#grammar-production-String">String</a> <code class="grammar-paren">(</code><a href="#grammar-production-LANGTAG">LANGTAG</a> <code class="grammar-alt">|</code> <code class="grammar-paren">(</code>"<code class="grammar-literal">^^</code>" <a href="#grammar-production-iri">iri</a><code class="grammar-paren">)</code><code class="grammar-paren">)</code><code class="grammar-opt">?</code></td>
|
99
|
+
</tr>
|
100
|
+
<tr id="grammar-OpenStruct-BooleanLiteral">
|
101
|
+
<td>[133s]</td>
|
102
|
+
<td>::=</td>
|
103
|
+
<td>"<code class="grammar-literal">true</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">false</code>"</td>
|
104
|
+
</tr>
|
105
|
+
<tr id="grammar-OpenStruct-String">
|
106
|
+
<td>[17]</td>
|
107
|
+
<td>::=</td>
|
108
|
+
<td><a href="#grammar-production-STRING_LITERAL_QUOTE">STRING_LITERAL_QUOTE</a> <code class="grammar-alt">|</code> <a href="#grammar-production-STRING_LITERAL_SINGLE_QUOTE">STRING_LITERAL_SINGLE_QUOTE</a> <code class="grammar-alt">|</code> <a href="#grammar-production-STRING_LITERAL_LONG_SINGLE_QUOTE">STRING_LITERAL_LONG_SINGLE_QUOTE</a> <code class="grammar-alt">|</code> <a href="#grammar-production-STRING_LITERAL_LONG_QUOTE">STRING_LITERAL_LONG_QUOTE</a></td>
|
109
|
+
</tr>
|
110
|
+
<tr id="grammar-OpenStruct-iri">
|
111
|
+
<td>[135s]</td>
|
112
|
+
<td>::=</td>
|
113
|
+
<td><a href="#grammar-production-IRIREF">IRIREF</a> <code class="grammar-alt">|</code> <a href="#grammar-production-PrefixedName">PrefixedName</a></td>
|
114
|
+
</tr>
|
115
|
+
<tr id="grammar-OpenStruct-PrefixedName">
|
116
|
+
<td>[136s]</td>
|
117
|
+
<td>::=</td>
|
118
|
+
<td><a href="#grammar-production-PNAME_LN">PNAME_LN</a> <code class="grammar-alt">|</code> <a href="#grammar-production-PNAME_NS">PNAME_NS</a></td>
|
119
|
+
</tr>
|
120
|
+
<tr id="grammar-OpenStruct-BlankNode">
|
121
|
+
<td>[137s]</td>
|
122
|
+
<td>::=</td>
|
123
|
+
<td><a href="#grammar-production-BLANK_NODE_LABEL">BLANK_NODE_LABEL</a> <code class="grammar-alt">|</code> <a href="#grammar-production-ANON">ANON</a></td>
|
124
|
+
</tr>
|
125
|
+
<tr id="grammar-declaration-terminals">
|
126
|
+
<td>@terminals</td>
|
127
|
+
<td></td>
|
128
|
+
<td><strong># Productions for terminals</strong></td>
|
129
|
+
</tr>
|
130
|
+
<tr id="grammar-OpenStruct-IRIREF">
|
131
|
+
<td>[18]</td>
|
132
|
+
<td>::=</td>
|
133
|
+
<td>"<code class="grammar-literal"><</code>" <code class="grammar-paren">(</code><code class="grammar-paren">(</code><code class="grammar-brac">[</code><code class="grammar-literal">^<>"{}|^`\</code><code class="grammar-brac">]</code> <code class="grammar-diff">-</code> <code class="grammar-brac">[</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 class="grammar-brac">]</code><code class="grammar-paren">)</code> <code class="grammar-alt">|</code> <a href="#grammar-production-UCHAR">UCHAR</a><code class="grammar-paren">)</code><code class="grammar-star">*</code> "<code class="grammar-literal">></code>"</td>
|
134
|
+
</tr>
|
135
|
+
<tr id="grammar-OpenStruct-PNAME_NS">
|
136
|
+
<td>[139s]</td>
|
137
|
+
<td>::=</td>
|
138
|
+
<td><a href="#grammar-production-PN_PREFIX">PN_PREFIX</a><code class="grammar-opt">?</code> "<code class="grammar-literal">:</code>"</td>
|
139
|
+
</tr>
|
140
|
+
<tr id="grammar-OpenStruct-PNAME_LN">
|
141
|
+
<td>[140s]</td>
|
142
|
+
<td>::=</td>
|
143
|
+
<td><a href="#grammar-production-PNAME_NS">PNAME_NS</a> <a href="#grammar-production-PN_LOCAL">PN_LOCAL</a></td>
|
144
|
+
</tr>
|
145
|
+
<tr id="grammar-OpenStruct-BLANK_NODE_LABEL">
|
146
|
+
<td>[141s]</td>
|
147
|
+
<td>::=</td>
|
148
|
+
<td>"<code class="grammar-literal">_:</code>" <code class="grammar-paren">(</code><a href="#grammar-production-PN_CHARS_U">PN_CHARS_U</a> <code class="grammar-alt">|</code> <code class="grammar-brac">[</code><code class="grammar-literal">0-9</code><code class="grammar-brac">]</code><code class="grammar-paren">)</code> <code class="grammar-paren">(</code><code class="grammar-paren">(</code><a href="#grammar-production-PN_CHARS">PN_CHARS</a> <code class="grammar-alt">|</code> "<code class="grammar-literal">.</code>"<code class="grammar-paren">)</code><code class="grammar-star">*</code> <a href="#grammar-production-PN_CHARS">PN_CHARS</a><code class="grammar-paren">)</code><code class="grammar-opt">?</code></td>
|
149
|
+
</tr>
|
150
|
+
<tr id="grammar-OpenStruct-LANGTAG">
|
151
|
+
<td>[144s]</td>
|
152
|
+
<td>::=</td>
|
153
|
+
<td>"<code class="grammar-literal">@</code>" <code class="grammar-brac">[</code><code class="grammar-literal">a-zA-Z</code><code class="grammar-brac">]</code><code class="grammar-plus">+</code> <code class="grammar-paren">(</code>"<code class="grammar-literal">-</code>" <code class="grammar-brac">[</code><code class="grammar-literal">a-zA-Z0-9</code><code class="grammar-brac">]</code><code class="grammar-plus">+</code><code class="grammar-paren">)</code><code class="grammar-star">*</code></td>
|
154
|
+
</tr>
|
155
|
+
<tr id="grammar-OpenStruct-INTEGER">
|
156
|
+
<td>[19]</td>
|
157
|
+
<td>::=</td>
|
158
|
+
<td><code class="grammar-brac">[</code><code class="grammar-literal">+-</code><code class="grammar-brac">]</code><code class="grammar-opt">?</code> <code class="grammar-brac">[</code><code class="grammar-literal">0-9</code><code class="grammar-brac">]</code><code class="grammar-plus">+</code></td>
|
159
|
+
</tr>
|
160
|
+
<tr id="grammar-OpenStruct-DECIMAL">
|
161
|
+
<td>[20]</td>
|
162
|
+
<td>::=</td>
|
163
|
+
<td><code class="grammar-brac">[</code><code class="grammar-literal">+-</code><code class="grammar-brac">]</code><code class="grammar-opt">?</code> <code class="grammar-paren">(</code><code class="grammar-brac">[</code><code class="grammar-literal">0-9</code><code class="grammar-brac">]</code><code class="grammar-star">*</code> "<code class="grammar-literal">.</code>" <code class="grammar-brac">[</code><code class="grammar-literal">0-9</code><code class="grammar-brac">]</code><code class="grammar-plus">+</code><code class="grammar-paren">)</code></td>
|
164
|
+
</tr>
|
165
|
+
<tr id="grammar-OpenStruct-DOUBLE">
|
166
|
+
<td>[21]</td>
|
167
|
+
<td>::=</td>
|
168
|
+
<td><code class="grammar-brac">[</code><code class="grammar-literal">+-</code><code class="grammar-brac">]</code><code class="grammar-opt">?</code> <code class="grammar-paren">(</code><code class="grammar-paren">(</code><code class="grammar-brac">[</code><code class="grammar-literal">0-9</code><code class="grammar-brac">]</code><code class="grammar-plus">+</code> "<code class="grammar-literal">.</code>" <code class="grammar-brac">[</code><code class="grammar-literal">0-9</code><code class="grammar-brac">]</code><code class="grammar-star">*</code> <a href="#grammar-production-EXPONENT">EXPONENT</a><code class="grammar-paren">)</code> <code class="grammar-alt">|</code> <code class="grammar-paren">(</code>"<code class="grammar-literal">.</code>" <code class="grammar-brac">[</code><code class="grammar-literal">0-9</code><code class="grammar-brac">]</code><code class="grammar-plus">+</code> <a href="#grammar-production-EXPONENT">EXPONENT</a><code class="grammar-paren">)</code> <code class="grammar-alt">|</code> <code class="grammar-paren">(</code><code class="grammar-brac">[</code><code class="grammar-literal">0-9</code><code class="grammar-brac">]</code><code class="grammar-plus">+</code> <a href="#grammar-production-EXPONENT">EXPONENT</a><code class="grammar-paren">)</code><code class="grammar-paren">)</code></td>
|
169
|
+
</tr>
|
170
|
+
<tr id="grammar-OpenStruct-EXPONENT">
|
171
|
+
<td>[154s]</td>
|
172
|
+
<td>::=</td>
|
173
|
+
<td><code class="grammar-brac">[</code><code class="grammar-literal">eE</code><code class="grammar-brac">]</code> <code class="grammar-brac">[</code><code class="grammar-literal">+-</code><code class="grammar-brac">]</code><code class="grammar-opt">?</code> <code class="grammar-brac">[</code><code class="grammar-literal">0-9</code><code class="grammar-brac">]</code><code class="grammar-plus">+</code></td>
|
174
|
+
</tr>
|
175
|
+
<tr id="grammar-OpenStruct-STRING_LITERAL_QUOTE">
|
176
|
+
<td>[22]</td>
|
177
|
+
<td>::=</td>
|
178
|
+
<td>'<code class="grammar-literal">"</code>' <code class="grammar-paren">(</code><code class="grammar-brac">[</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 class="grammar-brac">]</code> <code class="grammar-alt">|</code> <a href="#grammar-production-ECHAR">ECHAR</a> <code class="grammar-alt">|</code> <a href="#grammar-production-UCHAR">UCHAR</a><code class="grammar-paren">)</code><code class="grammar-star">*</code> '<code class="grammar-literal">"</code>'</td>
|
179
|
+
</tr>
|
180
|
+
<tr id="grammar-OpenStruct-STRING_LITERAL_SINGLE_QUOTE">
|
181
|
+
<td>[23]</td>
|
182
|
+
<td>::=</td>
|
183
|
+
<td>"<code class="grammar-literal">'</code>" <code class="grammar-paren">(</code><code class="grammar-brac">[</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 class="grammar-brac">]</code> <code class="grammar-alt">|</code> <a href="#grammar-production-ECHAR">ECHAR</a> <code class="grammar-alt">|</code> <a href="#grammar-production-UCHAR">UCHAR</a><code class="grammar-paren">)</code><code class="grammar-star">*</code> "<code class="grammar-literal">'</code>"</td>
|
184
|
+
</tr>
|
185
|
+
<tr id="grammar-OpenStruct-STRING_LITERAL_LONG_SINGLE_QUOTE">
|
186
|
+
<td>[24]</td>
|
187
|
+
<td>::=</td>
|
188
|
+
<td>"<code class="grammar-literal">'''</code>" <code class="grammar-paren">(</code><code class="grammar-paren">(</code>"<code class="grammar-literal">'</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">''</code>"<code class="grammar-paren">)</code><code class="grammar-opt">?</code> <code class="grammar-paren">(</code><code class="grammar-brac">[</code><code class="grammar-literal">^'\</code><code class="grammar-brac">]</code> <code class="grammar-alt">|</code> <a href="#grammar-production-ECHAR">ECHAR</a> <code class="grammar-alt">|</code> <a href="#grammar-production-UCHAR">UCHAR</a><code class="grammar-paren">)</code><code class="grammar-paren">)</code><code class="grammar-star">*</code> "<code class="grammar-literal">'''</code>"</td>
|
189
|
+
</tr>
|
190
|
+
<tr id="grammar-OpenStruct-STRING_LITERAL_LONG_QUOTE">
|
191
|
+
<td>[25]</td>
|
192
|
+
<td>::=</td>
|
193
|
+
<td>'<code class="grammar-literal">"""</code>' <code class="grammar-paren">(</code><code class="grammar-paren">(</code>'<code class="grammar-literal">"</code>' <code class="grammar-alt">|</code> '<code class="grammar-literal">""</code>'<code class="grammar-paren">)</code><code class="grammar-opt">?</code> <code class="grammar-paren">(</code><code class="grammar-brac">[</code><code class="grammar-literal">^"\</code><code class="grammar-brac">]</code> <code class="grammar-alt">|</code> <a href="#grammar-production-ECHAR">ECHAR</a> <code class="grammar-alt">|</code> <a href="#grammar-production-UCHAR">UCHAR</a><code class="grammar-paren">)</code><code class="grammar-paren">)</code><code class="grammar-star">*</code> '<code class="grammar-literal">"""</code>'</td>
|
194
|
+
</tr>
|
195
|
+
<tr id="grammar-OpenStruct-UCHAR">
|
196
|
+
<td>[26]</td>
|
197
|
+
<td>::=</td>
|
198
|
+
<td><code class="grammar-paren">(</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 class="grammar-paren">)</code> <code class="grammar-alt">|</code> <code class="grammar-paren">(</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 class="grammar-paren">)</code></td>
|
199
|
+
</tr>
|
200
|
+
<tr id="grammar-OpenStruct-ECHAR">
|
201
|
+
<td>[159s]</td>
|
202
|
+
<td>::=</td>
|
203
|
+
<td>"<code class="grammar-literal">\</code>" <code class="grammar-brac">[</code><code class="grammar-literal">tbnrf"'</code><code class="grammar-brac">]</code></td>
|
204
|
+
</tr>
|
205
|
+
<tr id="grammar-OpenStruct-SPARQL_PREFIX">
|
206
|
+
<td>[28t]</td>
|
207
|
+
<td>::=</td>
|
208
|
+
<td><code class="grammar-brac">[</code><code class="grammar-literal">Pp</code><code class="grammar-brac">]</code> <code class="grammar-brac">[</code><code class="grammar-literal">Rr</code><code class="grammar-brac">]</code> <code class="grammar-brac">[</code><code class="grammar-literal">Ee</code><code class="grammar-brac">]</code> <code class="grammar-brac">[</code><code class="grammar-literal">Ff</code><code class="grammar-brac">]</code> <code class="grammar-brac">[</code><code class="grammar-literal">Ii</code><code class="grammar-brac">]</code> <code class="grammar-brac">[</code><code class="grammar-literal">Xx</code><code class="grammar-brac">]</code></td>
|
209
|
+
</tr>
|
210
|
+
<tr id="grammar-OpenStruct-SPARQL_BASE">
|
211
|
+
<td>[29t]</td>
|
212
|
+
<td>::=</td>
|
213
|
+
<td><code class="grammar-brac">[</code><code class="grammar-literal">Bb</code><code class="grammar-brac">]</code> <code class="grammar-brac">[</code><code class="grammar-literal">Aa</code><code class="grammar-brac">]</code> <code class="grammar-brac">[</code><code class="grammar-literal">Ss</code><code class="grammar-brac">]</code> <code class="grammar-brac">[</code><code class="grammar-literal">Ee</code><code class="grammar-brac">]</code></td>
|
214
|
+
</tr>
|
215
|
+
<tr id="grammar-OpenStruct-WS">
|
216
|
+
<td>[161s]</td>
|
217
|
+
<td>::=</td>
|
218
|
+
<td><code class="grammar-char-escape"><abbr title="space">#x20</abbr></code> <code class="grammar-alt">|</code> <code class="grammar-char-escape"><abbr title="horizontal tab">#x09</abbr></code> <code class="grammar-alt">|</code> <code class="grammar-char-escape"><abbr title="carriage return">#x0D</abbr></code> <code class="grammar-alt">|</code> <code class="grammar-char-escape"><abbr title="new line">#x0A</abbr></code></td>
|
219
|
+
</tr>
|
220
|
+
<tr id="grammar-OpenStruct-ANON">
|
221
|
+
<td>[162s]</td>
|
222
|
+
<td>::=</td>
|
223
|
+
<td>"<code class="grammar-literal">[</code>" <a href="#grammar-production-WS">WS</a><code class="grammar-star">*</code> "<code class="grammar-literal">]</code>"</td>
|
224
|
+
</tr>
|
225
|
+
<tr id="grammar-production-PN_CHARS_BASE">
|
226
|
+
<td>[163s]</td>
|
227
|
+
<td>::=</td>
|
228
|
+
<td><code class="grammar-brac">[</code><code class="grammar-literal">A-Z</code><code class="grammar-brac">]</code></td>
|
229
|
+
</tr>
|
230
|
+
<tr>
|
231
|
+
<td colspan=2></td>
|
232
|
+
<td><code class="grammar-alt">|</code></td>
|
233
|
+
<td><code class="grammar-brac">[</code><code class="grammar-literal">a-z</code><code class="grammar-brac">]</code></td>
|
234
|
+
</tr>
|
235
|
+
<tr>
|
236
|
+
<td colspan=2></td>
|
237
|
+
<td><code class="grammar-alt">|</code></td>
|
238
|
+
<td><code class="grammar-brac">[</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 class="grammar-brac">]</code></td>
|
239
|
+
</tr>
|
240
|
+
<tr>
|
241
|
+
<td colspan=2></td>
|
242
|
+
<td><code class="grammar-alt">|</code></td>
|
243
|
+
<td><code class="grammar-brac">[</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 class="grammar-brac">]</code></td>
|
244
|
+
</tr>
|
245
|
+
<tr>
|
246
|
+
<td colspan=2></td>
|
247
|
+
<td><code class="grammar-alt">|</code></td>
|
248
|
+
<td><code class="grammar-brac">[</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 class="grammar-brac">]</code></td>
|
249
|
+
</tr>
|
250
|
+
<tr>
|
251
|
+
<td colspan=2></td>
|
252
|
+
<td><code class="grammar-alt">|</code></td>
|
253
|
+
<td><code class="grammar-brac">[</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 class="grammar-brac">]</code></td>
|
254
|
+
</tr>
|
255
|
+
<tr>
|
256
|
+
<td colspan=2></td>
|
257
|
+
<td><code class="grammar-alt">|</code></td>
|
258
|
+
<td><code class="grammar-brac">[</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 class="grammar-brac">]</code></td>
|
259
|
+
</tr>
|
260
|
+
<tr>
|
261
|
+
<td colspan=2></td>
|
262
|
+
<td><code class="grammar-alt">|</code></td>
|
263
|
+
<td><code class="grammar-brac">[</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 class="grammar-brac">]</code></td>
|
264
|
+
</tr>
|
265
|
+
<tr>
|
266
|
+
<td colspan=2></td>
|
267
|
+
<td><code class="grammar-alt">|</code></td>
|
268
|
+
<td><code class="grammar-brac">[</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 class="grammar-brac">]</code></td>
|
269
|
+
</tr>
|
270
|
+
<tr>
|
271
|
+
<td colspan=2></td>
|
272
|
+
<td><code class="grammar-alt">|</code></td>
|
273
|
+
<td><code class="grammar-brac">[</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 class="grammar-brac">]</code></td>
|
274
|
+
</tr>
|
275
|
+
<tr>
|
276
|
+
<td colspan=2></td>
|
277
|
+
<td><code class="grammar-alt">|</code></td>
|
278
|
+
<td><code class="grammar-brac">[</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 class="grammar-brac">]</code></td>
|
279
|
+
</tr>
|
280
|
+
<tr>
|
281
|
+
<td colspan=2></td>
|
282
|
+
<td><code class="grammar-alt">|</code></td>
|
283
|
+
<td><code class="grammar-brac">[</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 class="grammar-brac">]</code></td>
|
284
|
+
</tr>
|
285
|
+
<tr>
|
286
|
+
<td colspan=2></td>
|
287
|
+
<td><code class="grammar-alt">|</code></td>
|
288
|
+
<td><code class="grammar-brac">[</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 class="grammar-brac">]</code></td>
|
289
|
+
</tr>
|
290
|
+
<tr>
|
291
|
+
<td colspan=2></td>
|
292
|
+
<td><code class="grammar-alt">|</code></td>
|
293
|
+
<td><code class="grammar-brac">[</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 class="grammar-brac">]</code></td>
|
294
|
+
</tr>
|
295
|
+
<tr id="grammar-OpenStruct-PN_CHARS_U">
|
296
|
+
<td>[164s]</td>
|
297
|
+
<td>::=</td>
|
298
|
+
<td><a href="#grammar-production-PN_CHARS_BASE">PN_CHARS_BASE</a> <code class="grammar-alt">|</code> "<code class="grammar-literal">_</code>"</td>
|
299
|
+
</tr>
|
300
|
+
<tr id="grammar-OpenStruct-PN_CHARS">
|
301
|
+
<td>[166s]</td>
|
302
|
+
<td>::=</td>
|
303
|
+
<td><a href="#grammar-production-PN_CHARS_U">PN_CHARS_U</a> <code class="grammar-alt">|</code> "<code class="grammar-literal">-</code>" <code class="grammar-alt">|</code> <code class="grammar-brac">[</code><code class="grammar-literal">0-9</code><code class="grammar-brac">]</code> <code class="grammar-alt">|</code> <code class="grammar-char-escape"><abbr title="extended ascii '#xB7'">#xB7</abbr></code> <code class="grammar-alt">|</code> <code class="grammar-brac">[</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 class="grammar-brac">]</code> <code class="grammar-alt">|</code> <code class="grammar-brac">[</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 class="grammar-brac">]</code></td>
|
304
|
+
</tr>
|
305
|
+
<tr id="grammar-OpenStruct-PN_PREFIX">
|
306
|
+
<td>[167s]</td>
|
307
|
+
<td>::=</td>
|
308
|
+
<td><a href="#grammar-production-PN_CHARS_BASE">PN_CHARS_BASE</a> <code class="grammar-paren">(</code><code class="grammar-paren">(</code><a href="#grammar-production-PN_CHARS">PN_CHARS</a> <code class="grammar-alt">|</code> "<code class="grammar-literal">.</code>"<code class="grammar-paren">)</code><code class="grammar-star">*</code> <a href="#grammar-production-PN_CHARS">PN_CHARS</a><code class="grammar-paren">)</code><code class="grammar-opt">?</code></td>
|
309
|
+
</tr>
|
310
|
+
<tr id="grammar-OpenStruct-PN_LOCAL">
|
311
|
+
<td>[168s]</td>
|
312
|
+
<td>::=</td>
|
313
|
+
<td><code class="grammar-paren">(</code><a href="#grammar-production-PN_CHARS_U">PN_CHARS_U</a> <code class="grammar-alt">|</code> "<code class="grammar-literal">:</code>" <code class="grammar-alt">|</code> <code class="grammar-brac">[</code><code class="grammar-literal">0-9</code><code class="grammar-brac">]</code> <code class="grammar-alt">|</code> <a href="#grammar-production-PLX">PLX</a><code class="grammar-paren">)</code> <code class="grammar-paren">(</code><code class="grammar-paren">(</code><a href="#grammar-production-PN_CHARS">PN_CHARS</a> <code class="grammar-alt">|</code> "<code class="grammar-literal">.</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">:</code>" <code class="grammar-alt">|</code> <a href="#grammar-production-PLX">PLX</a><code class="grammar-paren">)</code><code class="grammar-star">*</code> <code class="grammar-paren">(</code><a href="#grammar-production-PN_CHARS">PN_CHARS</a> <code class="grammar-alt">|</code> "<code class="grammar-literal">:</code>" <code class="grammar-alt">|</code> <a href="#grammar-production-PLX">PLX</a><code class="grammar-paren">)</code><code class="grammar-paren">)</code><code class="grammar-opt">?</code></td>
|
314
|
+
</tr>
|
315
|
+
<tr id="grammar-OpenStruct-PLX">
|
316
|
+
<td>[169s]</td>
|
317
|
+
<td>::=</td>
|
318
|
+
<td><a href="#grammar-production-PERCENT">PERCENT</a> <code class="grammar-alt">|</code> <a href="#grammar-production-PN_LOCAL_ESC">PN_LOCAL_ESC</a></td>
|
319
|
+
</tr>
|
320
|
+
<tr id="grammar-OpenStruct-PERCENT">
|
321
|
+
<td>[170s]</td>
|
322
|
+
<td>::=</td>
|
323
|
+
<td>"<code class="grammar-literal">%</code>" <a href="#grammar-production-HEX">HEX</a> <a href="#grammar-production-HEX">HEX</a></td>
|
324
|
+
</tr>
|
325
|
+
<tr id="grammar-OpenStruct-HEX">
|
326
|
+
<td>[171s]</td>
|
327
|
+
<td>::=</td>
|
328
|
+
<td><code class="grammar-brac">[</code><code class="grammar-literal">0-9A-Fa-f</code><code class="grammar-brac">]</code></td>
|
329
|
+
</tr>
|
330
|
+
<tr id="grammar-OpenStruct-PN_LOCAL_ESC">
|
331
|
+
<td>[172s]</td>
|
332
|
+
<td>::=</td>
|
333
|
+
<td>"<code class="grammar-literal">\</code>" <code class="grammar-paren">(</code>"<code class="grammar-literal">_</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">~</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">.</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">-</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">!</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">$</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">&</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">'</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">(</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">)</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">*</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">+</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">,</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">;</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">=</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">/</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">?</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">#</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">@</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">%</code>"<code class="grammar-paren">)</code></td>
|
334
|
+
</tr>
|
335
|
+
</tbody>
|
467
336
|
</table>
|
337
|
+
|
data/lib/ebnf/ll1/lexer.rb
CHANGED
@@ -201,7 +201,7 @@ module EBNF::LL1
|
|
201
201
|
# @param [Array[Symbol]] types Optional set of types for restricting terminals examined
|
202
202
|
# @return [Token]
|
203
203
|
def recover(*types)
|
204
|
-
|
204
|
+
until scanner.eos? || tok = match_token(*types)
|
205
205
|
if scanner.skip_until(@whitespace || /\s+/m).nil? # Skip past current "token"
|
206
206
|
# No whitespace at the end, must be and end of string
|
207
207
|
scanner.terminate
|
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
@@ -133,7 +133,8 @@ module EBNF
|
|
133
133
|
formatted_rules = rules.map do |rule|
|
134
134
|
if rule.kind == :terminals || rule.kind == :pass
|
135
135
|
OpenStruct.new(id: ("@#{rule.kind}"),
|
136
|
-
|
136
|
+
class: :declaration,
|
137
|
+
sym: rule.kind,
|
137
138
|
assign: nil,
|
138
139
|
formatted: (
|
139
140
|
rule.kind == :terminals ?
|
@@ -150,17 +151,18 @@ module EBNF
|
|
150
151
|
split(/\s*--rule-extensions--\s*/).each_with_index do |formatted, ndx|
|
151
152
|
assign = case format
|
152
153
|
when :ebnf
|
153
|
-
formatted.sub!(%r{\s*<code
|
154
|
-
(ndx > 0 ? (rule.alt? ? '
|
154
|
+
formatted.sub!(%r{\s*<code[^>]*>\|</code>\s*}, '')
|
155
|
+
(ndx > 0 ? (rule.alt? ? '<code class="grammar-alt">|</code>' : '') : '::=')
|
155
156
|
when :abnf
|
156
|
-
formatted.sub!(%r{\s*<code>/</code>\s*}, '')
|
157
|
-
(ndx > 0 ? '
|
157
|
+
formatted.sub!(%r{\s*<code[^>]>/</code>\s*}, '')
|
158
|
+
(ndx > 0 ? '<code class="grammar-alt">=/</code>' : '=')
|
158
159
|
else
|
159
|
-
formatted.sub!(%r{\s*<code>\|</code>\s*}, '')
|
160
|
-
(ndx > 0 ? (rule.alt? ? '
|
160
|
+
formatted.sub!(%r{\s*<code[^>]>\|</code>\s*}, '')
|
161
|
+
(ndx > 0 ? (rule.alt? ? '<code class="grammar-alt">|</code>' : '') : '=')
|
161
162
|
end
|
162
163
|
lines << OpenStruct.new(id: ((ndx == 0 ? "[#{rule.id}]" : "") if rule.id),
|
163
164
|
sym: (rule.sym if ndx == 0 || format == :abnf),
|
165
|
+
class: :production,
|
164
166
|
assign: assign,
|
165
167
|
formatted: formatted)
|
166
168
|
end
|
@@ -170,6 +172,7 @@ module EBNF
|
|
170
172
|
lines
|
171
173
|
else
|
172
174
|
OpenStruct.new(id: ("[#{rule.id}]" if rule.id),
|
175
|
+
class: :production,
|
173
176
|
sym: rule.sym,
|
174
177
|
assign: (format == :ebnf ? '::=' : '='),
|
175
178
|
formatted: (formatted_expr + (format == :isoebnf ? ' ;' : '')))
|
@@ -246,14 +249,14 @@ module EBNF
|
|
246
249
|
format_ebnf_string(expr, expr.include?('"') ? "'" : '"')
|
247
250
|
end
|
248
251
|
parts = {
|
249
|
-
alt: (@options[:html] ?
|
250
|
-
diff: (@options[:html] ?
|
251
|
-
star: (@options[:html] ?
|
252
|
-
plus: (@options[:html] ?
|
253
|
-
opt: (@options[:html] ?
|
252
|
+
alt: (@options[:html] ? %(<code class="grammar-alt">|</code> ) : "| "),
|
253
|
+
diff: (@options[:html] ? %(<code class="grammar-diff">-</code> ) : "- "),
|
254
|
+
star: (@options[:html] ? %(<code class="grammar-star">*</code>) : "*"),
|
255
|
+
plus: (@options[:html] ? %(<code class="grammar-plus">+</code>) : "+"),
|
256
|
+
opt: (@options[:html] ? %(<code class="grammar-opt">?</code>) : "?")
|
254
257
|
}
|
255
|
-
lparen = (@options[:html] ?
|
256
|
-
rparen = (@options[:html] ?
|
258
|
+
lparen = (@options[:html] ? %[<code class="grammar-paren">(</code>] : "(")
|
259
|
+
rparen = (@options[:html] ? %[<code class="grammar-paren">)</code>] : ")")
|
257
260
|
|
258
261
|
case expr.first
|
259
262
|
when :istr
|
@@ -323,8 +326,8 @@ module EBNF
|
|
323
326
|
|
324
327
|
# Format a range
|
325
328
|
def format_ebnf_range(string)
|
326
|
-
lbrac = (@options[:html] ?
|
327
|
-
rbrac = (@options[:html] ?
|
329
|
+
lbrac = (@options[:html] ? %(<code class="grammar-brac">[</code>) : "[")
|
330
|
+
rbrac = (@options[:html] ? %(<code class="grammar-brac">]</code>) : "]")
|
328
331
|
|
329
332
|
buffer = lbrac
|
330
333
|
s = StringScanner.new(string)
|
@@ -351,8 +354,8 @@ module EBNF
|
|
351
354
|
end
|
352
355
|
end
|
353
356
|
|
354
|
-
res = "
|
355
|
-
|
357
|
+
res = @options[:html] ? %(<code class="grammar-literal">#{@coder.encode(string)}</code>) : string
|
358
|
+
res = "#{quote}#{res}#{quote}"
|
356
359
|
end
|
357
360
|
|
358
361
|
def escape_ebnf_hex(u)
|
@@ -412,15 +415,15 @@ module EBNF
|
|
412
415
|
end
|
413
416
|
end
|
414
417
|
parts = {
|
415
|
-
alt: (@options[:html] ?
|
416
|
-
star: (@options[:html] ?
|
417
|
-
plus: (@options[:html] ?
|
418
|
-
opt: (@options[:html] ?
|
418
|
+
alt: (@options[:html] ? %(<code class="grammar-alt">/</code>) : "/ "),
|
419
|
+
star: (@options[:html] ? %(<code class="grammar-star">*</code>) : "*"),
|
420
|
+
plus: (@options[:html] ? %(<code class="grammar-plus">+</code>) : "1*"),
|
421
|
+
opt: (@options[:html] ? %(<code class="grammar-opt">?</code>) : "?")
|
419
422
|
}
|
420
|
-
lbrac = (@options[:html] ?
|
421
|
-
rbrac = (@options[:html] ?
|
422
|
-
lparen = (@options[:html] ?
|
423
|
-
rparen = (@options[:html] ?
|
423
|
+
lbrac = (@options[:html] ? %(<code class="grammar-brac">[</code>) : "[")
|
424
|
+
rbrac = (@options[:html] ? %(<code class="grammar-brac">]</code>) : "]")
|
425
|
+
lparen = (@options[:html] ? %[<code class="grammar-paren">(</code>] : "(")
|
426
|
+
rparen = (@options[:html] ? %[<code class="grammar-paren">)</code>] : ")")
|
424
427
|
|
425
428
|
case expr.first
|
426
429
|
when :istr
|
@@ -597,11 +600,11 @@ module EBNF
|
|
597
600
|
end
|
598
601
|
end
|
599
602
|
parts = {
|
600
|
-
alt: (@options[:html] ?
|
601
|
-
diff: (@options[:html] ?
|
603
|
+
alt: (@options[:html] ? %(<code class="grammar-alt">|</code> ) : "| "),
|
604
|
+
diff: (@options[:html] ? %(<code class="grammar-diff">-</code> ) : "- "),
|
602
605
|
}
|
603
|
-
lparen = (@options[:html] ?
|
604
|
-
rparen = (@options[:html] ?
|
606
|
+
lparen = (@options[:html] ? %[<code class="grammar-paren">(</code>] : "(")
|
607
|
+
rparen = (@options[:html] ? %[<code class="grammar-paren">)</code>] : ")")
|
605
608
|
|
606
609
|
case expr.first
|
607
610
|
when :istr
|
@@ -708,16 +711,16 @@ module EBNF
|
|
708
711
|
chars.length == 1 ? chars.last.inspect : chars.unshift(:alt)
|
709
712
|
end
|
710
713
|
|
711
|
-
ERB_DESC = %
|
712
|
-
<table class="grammar">
|
714
|
+
ERB_DESC = %(<!-- Generated with ebnf version #{EBNF::VERSION}. See https://github.com/dryruby/ebnf. -->\n) +
|
715
|
+
%q(<table class="grammar">
|
713
716
|
<tbody id="grammar-productions" class="<%= @format %>">
|
714
717
|
<% for rule in @rules %>
|
715
|
-
<tr<%= %{ id="grammar
|
718
|
+
<tr<%= %{ id="grammar-#{rule[:class]}-#{rule.sym}"} unless %w(=/ |).include?(rule.assign) || rule.sym.nil?%>>
|
716
719
|
<% if rule.id %>
|
717
720
|
<td<%= " colspan=2" unless rule.sym %>><%= rule.id %></td>
|
718
721
|
<% end %>
|
719
722
|
<% if rule.sym %>
|
720
|
-
<td><code><%== rule.sym %></code></td>
|
723
|
+
<td><code><%== (rule.sym unless rule.class == :declaration) %></code></td>
|
721
724
|
<% end %>
|
722
725
|
<td><%= rule.assign %></td>
|
723
726
|
<td><%= rule.formatted %></td>
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregg Kellogg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sxp
|
@@ -300,7 +300,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
300
300
|
- !ruby/object:Gem::Version
|
301
301
|
version: '0'
|
302
302
|
requirements: []
|
303
|
-
rubygems_version: 3.4.
|
303
|
+
rubygems_version: 3.4.10
|
304
304
|
signing_key:
|
305
305
|
specification_version: 4
|
306
306
|
summary: EBNF parser and parser generator in Ruby.
|