ebnf 2.3.2 → 2.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c74fb8dfe53ab905e6c329a9135845b7a8064b64755d594a0595ae7ab52316a
4
- data.tar.gz: 76d3101062440b05bb878cf626c67b4891abeaa99754568a181ca583d2115f57
3
+ metadata.gz: 507c2fb1540ade02c7fd97e8379a9da0175025f9658b14f00111748d46ab86a5
4
+ data.tar.gz: 51e580981bec7097249da661cb76c9a2ae0cf97e2a3e87c500494aad9147a603
5
5
  SHA512:
6
- metadata.gz: 7252bcc2e3f658607d89db824a0e56a67d5b4ab7a0b21fa194269e03fbf8813dfe27ae8172d51282f86d2abb326e590d506e2fd1374b74eba763d2e3179b71f2
7
- data.tar.gz: 38511111c2a6769741b85893d5df222c5d4ab39f62fabc8a97fb4aff9bf5784ae9e75e9a56e2e4bf0553c46ae369b56c53e6fd3ab6be74c2b0e69357cc51382a
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.png)](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.2
1
+ 2.3.4
data/etc/turtle.html CHANGED
@@ -1,467 +1,337 @@
1
- <table class='grammar'>
2
- <tbody id='grammar-productions'>
3
- <tr id='grammar-production-turtleDoc'>
4
- <td>[1]</td>
5
- <td><code>turtleDoc</code></td>
6
- <td>::=</td>
7
- <td>
8
- statement*
9
- </td>
10
- </tr>
11
- <tr id='grammar-production-statement'>
12
- <td>[2]</td>
13
- <td><code>statement</code></td>
14
- <td>::=</td>
15
- <td>
16
- directive | triples "."
17
- </td>
18
- </tr>
19
- <tr id='grammar-production-directive'>
20
- <td>[3]</td>
21
- <td><code>directive</code></td>
22
- <td>::=</td>
23
- <td>
24
- prefixID
25
- | base
26
- | sparqlPrefix
27
- | sparqlBase
28
- </td>
29
- </tr>
30
- <tr id='grammar-production-prefixID'>
31
- <td>[4]</td>
32
- <td><code>prefixID</code></td>
33
- <td>::=</td>
34
- <td>
35
- "@prefix" PNAME_NS IRIREF "."
36
- </td>
37
- </tr>
38
- <tr id='grammar-production-base'>
39
- <td>[5]</td>
40
- <td><code>base</code></td>
41
- <td>::=</td>
42
- <td>
43
- "@base" IRIREF "."
44
- </td>
45
- </tr>
46
- <tr id='grammar-production-sparqlPrefix'>
47
- <td>[28s]</td>
48
- <td><code>sparqlPrefix</code></td>
49
- <td>::=</td>
50
- <td>
51
- SPARQL_PREFIX PNAME_NS IRIREF
52
- </td>
53
- </tr>
54
- <tr id='grammar-production-sparqlBase'>
55
- <td>[29s]</td>
56
- <td><code>sparqlBase</code></td>
57
- <td>::=</td>
58
- <td>
59
- SPARQL_BASE IRIREF
60
- </td>
61
- </tr>
62
- <tr id='grammar-production-triples'>
63
- <td>[6]</td>
64
- <td><code>triples</code></td>
65
- <td>::=</td>
66
- <td>
67
- subject predicateObjectList
68
- | blankNodePropertyList predicateObjectList?
69
- </td>
70
- </tr>
71
- <tr id='grammar-production-predicateObjectList'>
72
- <td>[7]</td>
73
- <td><code>predicateObjectList</code></td>
74
- <td>::=</td>
75
- <td>
76
- verb
77
- objectList
78
- (";" (verb objectList)?)*
79
- </td>
80
- </tr>
81
- <tr id='grammar-production-objectList'>
82
- <td>[8]</td>
83
- <td><code>objectList</code></td>
84
- <td>::=</td>
85
- <td>
86
- object ("," object)*
87
- </td>
88
- </tr>
89
- <tr id='grammar-production-verb'>
90
- <td>[9]</td>
91
- <td><code>verb</code></td>
92
- <td>::=</td>
93
- <td>
94
- predicate | "a"
95
- </td>
96
- </tr>
97
- <tr id='grammar-production-subject'>
98
- <td>[10]</td>
99
- <td><code>subject</code></td>
100
- <td>::=</td>
101
- <td>
102
- iri | BlankNode | collection
103
- </td>
104
- </tr>
105
- <tr id='grammar-production-predicate'>
106
- <td>[11]</td>
107
- <td><code>predicate</code></td>
108
- <td>::=</td>
109
- <td>
110
- iri
111
- </td>
112
- </tr>
113
- <tr id='grammar-production-object'>
114
- <td>[12]</td>
115
- <td><code>object</code></td>
116
- <td>::=</td>
117
- <td>
118
- iri
119
- | BlankNode
120
- | collection
121
- | blankNodePropertyList
122
- | literal
123
- </td>
124
- </tr>
125
- <tr id='grammar-production-literal'>
126
- <td>[13]</td>
127
- <td><code>literal</code></td>
128
- <td>::=</td>
129
- <td>
130
- RDFLiteral
131
- | NumericLiteral
132
- | BooleanLiteral
133
- </td>
134
- </tr>
135
- <tr id='grammar-production-blankNodePropertyList'>
136
- <td>[14]</td>
137
- <td><code>blankNodePropertyList</code></td>
138
- <td>::=</td>
139
- <td>
140
- "[" predicateObjectList "]"
141
- </td>
142
- </tr>
143
- <tr id='grammar-production-collection'>
144
- <td>[15]</td>
145
- <td><code>collection</code></td>
146
- <td>::=</td>
147
- <td>
148
- "(" object* ")"
149
- </td>
150
- </tr>
151
- <tr id='grammar-production-NumericLiteral'>
152
- <td>[16]</td>
153
- <td><code>NumericLiteral</code></td>
154
- <td>::=</td>
155
- <td>
156
- INTEGER | DECIMAL | DOUBLE
157
- </td>
158
- </tr>
159
- <tr id='grammar-production-RDFLiteral'>
160
- <td>[128s]</td>
161
- <td><code>RDFLiteral</code></td>
162
- <td>::=</td>
163
- <td>
164
- String (LANGTAG | "^^" iri)?
165
- </td>
166
- </tr>
167
- <tr id='grammar-production-BooleanLiteral'>
168
- <td>[133s]</td>
169
- <td><code>BooleanLiteral</code></td>
170
- <td>::=</td>
171
- <td>
172
- "true" | "false"
173
- </td>
174
- </tr>
175
- <tr id='grammar-production-String'>
176
- <td>[17]</td>
177
- <td><code>String</code></td>
178
- <td>::=</td>
179
- <td>
180
- STRING_LITERAL_QUOTE
181
- | STRING_LITERAL_SINGLE_QUOTE
182
- | STRING_LITERAL_LONG_SINGLE_QUOTE
183
- | STRING_LITERAL_LONG_QUOTE
184
- </td>
185
- </tr>
186
- <tr id='grammar-production-iri'>
187
- <td>[135s]</td>
188
- <td><code>iri</code></td>
189
- <td>::=</td>
190
- <td>
191
- IRIREF | PrefixedName
192
- </td>
193
- </tr>
194
- <tr id='grammar-production-PrefixedName'>
195
- <td>[136s]</td>
196
- <td><code>PrefixedName</code></td>
197
- <td>::=</td>
198
- <td>
199
- PNAME_LN | PNAME_NS
200
- </td>
201
- </tr>
202
- <tr id='grammar-production-BlankNode'>
203
- <td>[137s]</td>
204
- <td><code>BlankNode</code></td>
205
- <td>::=</td>
206
- <td>
207
- BLANK_NODE_LABEL | ANON
208
- </td>
209
- </tr>
210
- <tr id='grammar-production-IRIREF'>
211
- <td>[18]</td>
212
- <td><code>IRIREF</code></td>
213
- <td>::=</td>
214
- <td>
215
- "<"
216
- [^#x00-#x20<>"{}|^`]#x20|#x20UCHAR)*#x20'>']
217
- </td>
218
- </tr>
219
- <tr id='grammar-production-PNAME_NS'>
220
- <td>[139s]</td>
221
- <td><code>PNAME_NS</code></td>
222
- <td>::=</td>
223
- <td>
224
- PN_PREFIX? ":"
225
- </td>
226
- </tr>
227
- <tr id='grammar-production-PNAME_LN'>
228
- <td>[140s]</td>
229
- <td><code>PNAME_LN</code></td>
230
- <td>::=</td>
231
- <td>
232
- PNAME_NS PN_LOCAL
233
- </td>
234
- </tr>
235
- <tr id='grammar-production-BLANK_NODE_LABEL'>
236
- <td>[141s]</td>
237
- <td><code>BLANK_NODE_LABEL</code></td>
238
- <td>::=</td>
239
- <td>
240
- "_:"
241
- (PN_CHARS_U | [0-9])
242
- (PN_CHARS | ".")* PN_CHARS?
243
- </td>
244
- </tr>
245
- <tr id='grammar-production-LANGTAG'>
246
- <td>[144s]</td>
247
- <td><code>LANGTAG</code></td>
248
- <td>::=</td>
249
- <td>
250
- "@" ([a-zA-Z])+ ("-" ([a-zA-Z0-9])+)*
251
- </td>
252
- </tr>
253
- <tr id='grammar-production-INTEGER'>
254
- <td>[19]</td>
255
- <td><code>INTEGER</code></td>
256
- <td>::=</td>
257
- <td>
258
- ([+-])? ([0-9])+
259
- </td>
260
- </tr>
261
- <tr id='grammar-production-DECIMAL'>
262
- <td>[20]</td>
263
- <td><code>DECIMAL</code></td>
264
- <td>::=</td>
265
- <td>
266
- ([+-])? (([0-9])* "." ([0-9])+)
267
- </td>
268
- </tr>
269
- <tr id='grammar-production-DOUBLE'>
270
- <td>[21]</td>
271
- <td><code>DOUBLE</code></td>
272
- <td>::=</td>
273
- <td>
274
- ([+-])?
275
- (([0-9])+ "." ([0-9])* EXPONENT | "." ([0-9])+ EXPONENT | ([0-9])+ EXPONENT)
276
- </td>
277
- </tr>
278
- <tr id='grammar-production-EXPONENT'>
279
- <td>[154s]</td>
280
- <td><code>EXPONENT</code></td>
281
- <td>::=</td>
282
- <td>
283
- [eE] ([+-])? ([0-9])+
284
- </td>
285
- </tr>
286
- <tr id='grammar-production-STRING_LITERAL_QUOTE'>
287
- <td>[22]</td>
288
- <td><code>STRING_LITERAL_QUOTE</code></td>
289
- <td>::=</td>
290
- <td>
291
- '"'
292
- ([^#x22#x5C#xA#xD] | ECHAR | UCHAR)*
293
- '"'
294
- </td>
295
- </tr>
296
- <tr id='grammar-production-STRING_LITERAL_SINGLE_QUOTE'>
297
- <td>[23]</td>
298
- <td><code>STRING_LITERAL_SINGLE_QUOTE</code></td>
299
- <td>::=</td>
300
- <td>
301
- "'"
302
- ([^#x27#x5C#xA#xD] | ECHAR | UCHAR)*
303
- "'"
304
- </td>
305
- </tr>
306
- <tr id='grammar-production-STRING_LITERAL_LONG_SINGLE_QUOTE'>
307
- <td>[24]</td>
308
- <td><code>STRING_LITERAL_LONG_SINGLE_QUOTE</code></td>
309
- <td>::=</td>
310
- <td>
311
- "'''"
312
- (("'" | "''")? [^']#x20|#x20ECHAR#x20|#x20UCHAR#x20)#x20)*#x20"'''"])
313
- </td>
314
- </tr>
315
- <tr id='grammar-production-STRING_LITERAL_LONG_QUOTE'>
316
- <td>[25]</td>
317
- <td><code>STRING_LITERAL_LONG_QUOTE</code></td>
318
- <td>::=</td>
319
- <td>
320
- '"""'
321
- (('"' | '""')? [^"]#x20|#x20ECHAR#x20|#x20UCHAR#x20)#x20)*#x20'"""'])
322
- </td>
323
- </tr>
324
- <tr id='grammar-production-UCHAR'>
325
- <td>[26]</td>
326
- <td><code>UCHAR</code></td>
327
- <td>::=</td>
328
- <td>
329
- "u" HEX HEX HEX HEX
330
- | "U" HEX HEX HEX HEX HEX HEX HEX HEX
331
- </td>
332
- </tr>
333
- <tr id='grammar-production-ECHAR'>
334
- <td>[159s]</td>
335
- <td><code>ECHAR</code></td>
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">&lt;</code>" <code class="grammar-paren">(</code><code class="grammar-paren">(</code><code class="grammar-brac">[</code><code class="grammar-literal">^&lt;&gt;&quot;{}|^`\</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">&gt;</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">&quot;</code>' <code class="grammar-paren">(</code><code class="grammar-brac">[</code><code class="grammar-literal">^</code><code class="grammar-char-escape"><abbr title="quot">>&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">&quot;</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">&apos;</code>" <code class="grammar-paren">(</code><code class="grammar-brac">[</code><code class="grammar-literal">^</code><code class="grammar-char-escape"><abbr title="ascii '&apos;'">#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">&apos;</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">&apos;&apos;&apos;</code>" <code class="grammar-paren">(</code><code class="grammar-paren">(</code>"<code class="grammar-literal">&apos;</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">&apos;&apos;</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">^&apos;\</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">&apos;&apos;&apos;</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">&quot;&quot;&quot;</code>' <code class="grammar-paren">(</code><code class="grammar-paren">(</code>'<code class="grammar-literal">&quot;</code>' <code class="grammar-alt">|</code> '<code class="grammar-literal">&quot;&quot;</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">^&quot;\</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">&quot;&quot;&quot;</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&quot;&apos;</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">&amp;</code>" <code class="grammar-alt">|</code> "<code class="grammar-literal">&apos;</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
+
@@ -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
- until scanner.eos? || tok = match_token(*types)
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
- l, s = s[1..-1].split(/(?<=[^\\])\]/, 2)
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
- sym: nil,
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>\|</code>\s*}, '')
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] ? "<code>|</code> " : "| "),
250
- diff: (@options[:html] ? "<code>-</code> " : "- "),
251
- star: (@options[:html] ? "<code>*</code> " : "*"),
252
- plus: (@options[:html] ? "<code>+</code> " : "+"),
253
- opt: (@options[:html] ? "<code>?</code> " : "?")
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] ? "<code>(</code> " : "(")
256
- rparen = (@options[:html] ? "<code>)</code> " : ")")
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] ? "<code>[</code> " : "[")
327
- rbrac = (@options[:html] ? "<code>]</code> " : "]")
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 = "#{quote}#{string}#{quote}"
355
- @options[:html] ? @coder.encode(res) : res
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] ? "<code>/</code>" : "/ "),
416
- star: (@options[:html] ? "<code>*</code>" : "*"),
417
- plus: (@options[:html] ? "<code>+</code>" : "1*"),
418
- opt: (@options[:html] ? "<code>?</code>" : "?")
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] ? "<code>[</code> " : "[")
421
- rbrac = (@options[:html] ? "<code>]</code> " : "]")
422
- lparen = (@options[:html] ? "<code>(</code> " : "(")
423
- rparen = (@options[:html] ? "<code>)</code> " : ")")
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] ? "<code>|</code> " : "| "),
601
- diff: (@options[:html] ? "<code>-</code> " : "- "),
603
+ alt: (@options[:html] ? %(<code class="grammar-alt">|</code> ) : "| "),
604
+ diff: (@options[:html] ? %(<code class="grammar-diff">-</code> ) : "- "),
602
605
  }
603
- lparen = (@options[:html] ? "<code>(</code> " : "(")
604
- rparen = (@options[:html] ? "<code>)</code> " : ")")
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 = %q(
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-production-#{rule.sym}"} unless %w(=/ |).include?(rule.assign) || rule.sym.nil?%>>
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.2
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-02-20 00:00:00.000000000 Z
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.6
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.