ebnf 1.2.0 → 2.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +223 -199
- data/UNLICENSE +1 -1
- data/VERSION +1 -1
- data/bin/ebnf +38 -19
- data/etc/abnf-core.ebnf +52 -0
- data/etc/abnf.abnf +121 -0
- data/etc/abnf.ebnf +124 -0
- data/etc/abnf.sxp +45 -0
- data/etc/doap.ttl +23 -18
- data/etc/ebnf.ebnf +21 -33
- data/etc/ebnf.html +76 -160
- data/etc/{ebnf.rb → ebnf.ll1.rb} +30 -107
- data/etc/ebnf.ll1.sxp +182 -183
- data/etc/ebnf.peg.rb +90 -0
- data/etc/ebnf.peg.sxp +84 -0
- data/etc/ebnf.sxp +40 -41
- data/etc/iso-ebnf.ebnf +140 -0
- data/etc/iso-ebnf.isoebnf +138 -0
- data/etc/iso-ebnf.sxp +65 -0
- data/etc/sparql.ebnf +4 -4
- data/etc/sparql.html +1603 -1751
- data/etc/sparql.ll1.sxp +7372 -7372
- data/etc/sparql.peg.rb +532 -0
- data/etc/sparql.peg.sxp +597 -0
- data/etc/sparql.sxp +363 -362
- data/etc/turtle.ebnf +3 -3
- data/etc/turtle.html +465 -517
- data/etc/{turtle.rb → turtle.ll1.rb} +3 -4
- data/etc/turtle.ll1.sxp +425 -425
- data/etc/turtle.peg.rb +182 -0
- data/etc/turtle.peg.sxp +199 -0
- data/etc/turtle.sxp +103 -101
- data/lib/ebnf.rb +6 -1
- data/lib/ebnf/abnf.rb +301 -0
- data/lib/ebnf/abnf/core.rb +23 -0
- data/lib/ebnf/abnf/meta.rb +111 -0
- data/lib/ebnf/base.rb +114 -69
- data/lib/ebnf/bnf.rb +1 -26
- data/lib/ebnf/ebnf/meta.rb +90 -0
- data/lib/ebnf/isoebnf.rb +229 -0
- data/lib/ebnf/isoebnf/meta.rb +75 -0
- data/lib/ebnf/ll1.rb +131 -3
- data/lib/ebnf/ll1/lexer.rb +20 -22
- data/lib/ebnf/ll1/parser.rb +97 -64
- data/lib/ebnf/ll1/scanner.rb +82 -50
- data/lib/ebnf/native.rb +320 -0
- data/lib/ebnf/parser.rb +285 -302
- data/lib/ebnf/peg.rb +39 -0
- data/lib/ebnf/peg/parser.rb +561 -0
- data/lib/ebnf/peg/rule.rb +250 -0
- data/lib/ebnf/rule.rb +442 -148
- data/lib/ebnf/terminals.rb +21 -0
- data/lib/ebnf/writer.rb +587 -82
- metadata +125 -18
- data/etc/sparql.rb +0 -45773
data/etc/sparql.sxp
CHANGED
@@ -1,362 +1,363 @@
|
|
1
|
-
(
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
(
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
(
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
(
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
(
|
355
|
-
|
356
|
-
(
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
1
|
+
(
|
2
|
+
(rule QueryUnit "1" (opt Query))
|
3
|
+
(rule Query "2"
|
4
|
+
(seq Prologue (alt SelectQuery ConstructQuery DescribeQuery AskQuery)))
|
5
|
+
(rule UpdateUnit "3" (seq Update))
|
6
|
+
(rule Prologue "4" (star (alt BaseDecl PrefixDecl)))
|
7
|
+
(rule BaseDecl "5" (seq "BASE" IRIREF))
|
8
|
+
(rule PrefixDecl "6" (seq "PREFIX" PNAME_NS IRIREF))
|
9
|
+
(rule SelectQuery "7"
|
10
|
+
(seq SelectClause (star DatasetClause) WhereClause SolutionModifier ValuesClause))
|
11
|
+
(rule SubSelect "8" (seq SelectClause WhereClause SolutionModifier ValuesClause))
|
12
|
+
(rule SelectClause "9"
|
13
|
+
(seq "SELECT"
|
14
|
+
(opt (alt "DISTINCT" "REDUCED"))
|
15
|
+
(alt (plus (alt Var (seq "(" Expression "AS" Var ")"))) "*")) )
|
16
|
+
(rule ConstructQuery "10"
|
17
|
+
(seq "CONSTRUCT"
|
18
|
+
(alt
|
19
|
+
(seq ConstructTemplate (star DatasetClause) WhereClause SolutionModifier)
|
20
|
+
(seq (star DatasetClause) "WHERE" "{" (opt TriplesTemplate) "}" SolutionModifier)) ValuesClause ))
|
21
|
+
(rule DescribeQuery "11"
|
22
|
+
(seq "DESCRIBE"
|
23
|
+
(alt (plus VarOrIri) "*")
|
24
|
+
(star DatasetClause)
|
25
|
+
(opt WhereClause) SolutionModifier ValuesClause ))
|
26
|
+
(rule AskQuery "12" (seq "ASK" (star DatasetClause) WhereClause ValuesClause))
|
27
|
+
(rule DatasetClause "13" (seq "FROM" (alt DefaultGraphClause NamedGraphClause)))
|
28
|
+
(rule DefaultGraphClause "14" (seq SourceSelector))
|
29
|
+
(rule NamedGraphClause "15" (seq "NAMED" SourceSelector))
|
30
|
+
(rule SourceSelector "16" (seq iri))
|
31
|
+
(rule WhereClause "17" (seq (opt "WHERE") GroupGraphPattern))
|
32
|
+
(rule SolutionModifier "18"
|
33
|
+
(seq (opt GroupClause) (opt HavingClause) (opt OrderClause) (opt LimitOffsetClauses)))
|
34
|
+
(rule GroupClause "19" (seq "GROUP" "BY" (plus GroupCondition)))
|
35
|
+
(rule GroupCondition "20"
|
36
|
+
(alt BuiltInCall FunctionCall (seq "(" Expression (opt (seq "AS" Var)) ")") Var))
|
37
|
+
(rule HavingClause "21" (seq "HAVING" (plus HavingCondition)))
|
38
|
+
(rule HavingCondition "22" (seq Constraint))
|
39
|
+
(rule OrderClause "23" (seq "ORDER" "BY" (plus OrderCondition)))
|
40
|
+
(rule OrderCondition "24"
|
41
|
+
(alt (seq (alt "ASC" "DESC") BrackettedExpression) (alt Constraint Var)))
|
42
|
+
(rule LimitOffsetClauses "25"
|
43
|
+
(alt (seq LimitClause (opt OffsetClause)) (seq OffsetClause (opt LimitClause))))
|
44
|
+
(rule LimitClause "26" (seq "LIMIT" INTEGER))
|
45
|
+
(rule OffsetClause "27" (seq "OFFSET" INTEGER))
|
46
|
+
(rule ValuesClause "28" (opt (seq "VALUES" DataBlock)))
|
47
|
+
(rule Update "29" (seq Prologue (opt (seq Update1 (opt (seq ";" Update))))))
|
48
|
+
(rule Update1 "30"
|
49
|
+
(alt Load Clear Drop Add Move Copy Create InsertData DeleteData DeleteWhere
|
50
|
+
Modify ))
|
51
|
+
(rule Load "31" (seq "LOAD" (opt "SILENT") iri (opt (seq "INTO" GraphRef))))
|
52
|
+
(rule Clear "32" (seq "CLEAR" (opt "SILENT") GraphRefAll))
|
53
|
+
(rule Drop "33" (seq "DROP" (opt "SILENT") GraphRefAll))
|
54
|
+
(rule Create "34" (seq "CREATE" (opt "SILENT") GraphRef))
|
55
|
+
(rule Add "35" (seq "ADD" (opt "SILENT") GraphOrDefault "TO" GraphOrDefault))
|
56
|
+
(rule Move "36" (seq "MOVE" (opt "SILENT") GraphOrDefault "TO" GraphOrDefault))
|
57
|
+
(rule Copy "37" (seq "COPY" (opt "SILENT") GraphOrDefault "TO" GraphOrDefault))
|
58
|
+
(rule InsertData "38" (seq "INSERT DATA" QuadData))
|
59
|
+
(rule DeleteData "39" (seq "DELETE DATA" QuadData))
|
60
|
+
(rule DeleteWhere "40" (seq "DELETE WHERE" QuadPattern))
|
61
|
+
(rule Modify "41"
|
62
|
+
(seq
|
63
|
+
(opt (seq "WITH" iri))
|
64
|
+
(alt (seq DeleteClause (opt InsertClause)) InsertClause)
|
65
|
+
(star UsingClause) "WHERE" GroupGraphPattern ))
|
66
|
+
(rule DeleteClause "42" (seq "DELETE" QuadPattern))
|
67
|
+
(rule InsertClause "43" (seq "INSERT" QuadPattern))
|
68
|
+
(rule UsingClause "44" (seq "USING" (alt iri (seq "NAMED" iri))))
|
69
|
+
(rule GraphOrDefault "45" (alt "DEFAULT" (seq (opt "GRAPH") iri)))
|
70
|
+
(rule GraphRef "46" (seq "GRAPH" iri))
|
71
|
+
(rule GraphRefAll "47" (alt GraphRef "DEFAULT" "NAMED" "ALL"))
|
72
|
+
(rule QuadPattern "48" (seq "{" Quads "}"))
|
73
|
+
(rule QuadData "49" (seq "{" Quads "}"))
|
74
|
+
(rule Quads "50"
|
75
|
+
(seq (opt TriplesTemplate) (star (seq QuadsNotTriples (opt ".") (opt TriplesTemplate)))))
|
76
|
+
(rule QuadsNotTriples "51" (seq "GRAPH" VarOrIri "{" (opt TriplesTemplate) "}"))
|
77
|
+
(rule TriplesTemplate "52" (seq TriplesSameSubject (opt (seq "." (opt TriplesTemplate)))))
|
78
|
+
(rule GroupGraphPattern "53" (seq "{" (alt SubSelect GroupGraphPatternSub) "}"))
|
79
|
+
(rule GroupGraphPatternSub "54"
|
80
|
+
(seq (opt TriplesBlock) (star (seq GraphPatternNotTriples (opt ".") (opt TriplesBlock)))))
|
81
|
+
(rule TriplesBlock "55" (seq TriplesSameSubjectPath (opt (seq "." (opt TriplesBlock)))))
|
82
|
+
(rule GraphPatternNotTriples "56"
|
83
|
+
(alt GroupOrUnionGraphPattern OptionalGraphPattern MinusGraphPattern
|
84
|
+
GraphGraphPattern ServiceGraphPattern Filter Bind InlineData ))
|
85
|
+
(rule OptionalGraphPattern "57" (seq "OPTIONAL" GroupGraphPattern))
|
86
|
+
(rule GraphGraphPattern "58" (seq "GRAPH" VarOrIri GroupGraphPattern))
|
87
|
+
(rule ServiceGraphPattern "59"
|
88
|
+
(seq "SERVICE" (opt "SILENT") VarOrIri GroupGraphPattern))
|
89
|
+
(rule Bind "60" (seq "BIND" "(" Expression "AS" Var ")"))
|
90
|
+
(rule InlineData "61" (seq "VALUES" DataBlock))
|
91
|
+
(rule DataBlock "62" (alt InlineDataOneVar InlineDataFull))
|
92
|
+
(rule InlineDataOneVar "63" (seq Var "{" (star DataBlockValue) "}"))
|
93
|
+
(rule InlineDataFull "64"
|
94
|
+
(seq
|
95
|
+
(alt NIL (seq "(" (star Var) ")")) "{"
|
96
|
+
(star (alt (seq "(" (star DataBlockValue) ")") NIL)) "}" ))
|
97
|
+
(rule DataBlockValue "65"
|
98
|
+
(alt iri RDFLiteral NumericLiteral BooleanLiteral "UNDEF"))
|
99
|
+
(rule MinusGraphPattern "66" (seq "MINUS" GroupGraphPattern))
|
100
|
+
(rule GroupOrUnionGraphPattern "67"
|
101
|
+
(seq GroupGraphPattern (star (seq "UNION" GroupGraphPattern))))
|
102
|
+
(rule Filter "68" (seq "FILTER" Constraint))
|
103
|
+
(rule Constraint "69" (alt BrackettedExpression BuiltInCall FunctionCall))
|
104
|
+
(rule FunctionCall "70" (seq iri ArgList))
|
105
|
+
(rule ArgList "71"
|
106
|
+
(alt NIL (seq "(" (opt "DISTINCT") Expression (star (seq "," Expression)) ")")))
|
107
|
+
(rule ExpressionList "72" (alt NIL (seq "(" Expression (star (seq "," Expression)) ")")))
|
108
|
+
(rule ConstructTemplate "73" (seq "{" (opt ConstructTriples) "}"))
|
109
|
+
(rule ConstructTriples "74"
|
110
|
+
(seq TriplesSameSubject (opt (seq "." (opt ConstructTriples)))))
|
111
|
+
(rule TriplesSameSubject "75"
|
112
|
+
(alt (seq VarOrTerm PropertyListNotEmpty) (seq TriplesNode PropertyList)))
|
113
|
+
(rule PropertyList "76" (opt PropertyListNotEmpty))
|
114
|
+
(rule PropertyListNotEmpty "77"
|
115
|
+
(seq Verb ObjectList (star (seq ";" (opt (seq Verb ObjectList))))))
|
116
|
+
(rule Verb "78" (alt VarOrIri "a"))
|
117
|
+
(rule ObjectList "79" (seq Object (star (seq "," Object))))
|
118
|
+
(rule Object "80" (seq GraphNode))
|
119
|
+
(rule TriplesSameSubjectPath "81"
|
120
|
+
(alt (seq VarOrTerm PropertyListNotEmptyPath) (seq TriplesNode PropertyListPath)))
|
121
|
+
(rule PropertyListPath "82" (opt PropertyListNotEmpty))
|
122
|
+
(rule PropertyListNotEmptyPath "83"
|
123
|
+
(seq
|
124
|
+
(alt VerbPath VerbSimple) ObjectList
|
125
|
+
(star (seq ";" (opt (seq (alt VerbPath VerbSimple) ObjectList))))) )
|
126
|
+
(rule VerbPath "84" (seq Path))
|
127
|
+
(rule VerbSimple "85" (seq Var))
|
128
|
+
(rule ObjectListPath "86" (seq ObjectPath (star (seq "," ObjectPath))))
|
129
|
+
(rule ObjectPath "87" (seq GraphNodePath))
|
130
|
+
(rule Path "88" (seq PathAlternative))
|
131
|
+
(rule PathAlternative "89" (seq PathSequence (star (seq "|" PathSequence))))
|
132
|
+
(rule PathSequence "90" (seq PathEltOrInverse (star (seq "/" PathEltOrInverse))))
|
133
|
+
(rule PathElt "91" (seq PathPrimary (opt PathMod)))
|
134
|
+
(rule PathEltOrInverse "92" (alt PathElt (seq "^" PathElt)))
|
135
|
+
(rule PathMod "93"
|
136
|
+
(alt "*" "?" "+"
|
137
|
+
(seq "{"
|
138
|
+
(alt (seq Integer (alt (seq "," (alt "}" (seq Integer "}"))) "}")) (seq "," Integer "}"))) ))
|
139
|
+
(rule PathPrimary "94"
|
140
|
+
(alt iri "a" (seq "!" PathNegatedPropertySet) (seq "(" Path ")")))
|
141
|
+
(rule PathNegatedPropertySet "95"
|
142
|
+
(alt PathOneInPropertySet
|
143
|
+
(seq "(" (opt (seq PathOneInPropertySet (star (seq "|" PathOneInPropertySet)))) ")")) )
|
144
|
+
(rule PathOneInPropertySet "96" (alt iri "a" (seq "^" (alt iri "a"))))
|
145
|
+
(rule Integer "97" (seq INTEGER))
|
146
|
+
(rule TriplesNode "98" (alt Collection BlankNodePropertyList))
|
147
|
+
(rule BlankNodePropertyList "99" (seq "[" PropertyListNotEmpty "]"))
|
148
|
+
(rule TriplesNodePath "100" (alt CollectionPath BlankNodePropertyListPath))
|
149
|
+
(rule BlankNodePropertyListPath "101" (seq "[" PropertyListPathNotEmpty "]"))
|
150
|
+
(rule Collection "102" (seq "(" (plus GraphNode) ")"))
|
151
|
+
(rule CollectionPath "103" (seq "(" (plus GraphNodePath) ")"))
|
152
|
+
(rule GraphNode "104" (alt VarOrTerm TriplesNode))
|
153
|
+
(rule GraphNodePath "105" (alt VarOrTerm TriplesNodePath))
|
154
|
+
(rule VarOrTerm "106" (alt Var GraphTerm))
|
155
|
+
(rule VarOrIri "107" (alt Var iri))
|
156
|
+
(rule Var "108" (alt VAR1 VAR2))
|
157
|
+
(rule GraphTerm "109"
|
158
|
+
(alt iri RDFLiteral NumericLiteral BooleanLiteral BlankNode NIL))
|
159
|
+
(rule Expression "110" (seq ConditionalOrExpression))
|
160
|
+
(rule ConditionalOrExpression "111"
|
161
|
+
(seq ConditionalAndExpression (star (seq "||" ConditionalAndExpression))))
|
162
|
+
(rule ConditionalAndExpression "112" (seq ValueLogical (star (seq "&&" ValueLogical))))
|
163
|
+
(rule ValueLogical "113" (seq RelationalExpression))
|
164
|
+
(rule RelationalExpression "114"
|
165
|
+
(seq NumericExpression
|
166
|
+
(opt
|
167
|
+
(alt
|
168
|
+
(seq "=" NumericExpression)
|
169
|
+
(seq "!=" NumericExpression)
|
170
|
+
(seq "<" NumericExpression)
|
171
|
+
(seq ">" NumericExpression)
|
172
|
+
(seq "<=" NumericExpression)
|
173
|
+
(seq ">=" NumericExpression)
|
174
|
+
(seq "IN" ExpressionList)
|
175
|
+
(seq "NOT" "IN" ExpressionList)) )) )
|
176
|
+
(rule NumericExpression "115" (seq AdditiveExpression))
|
177
|
+
(rule AdditiveExpression "116"
|
178
|
+
(seq MultiplicativeExpression
|
179
|
+
(star
|
180
|
+
(alt
|
181
|
+
(seq "+" MultiplicativeExpression)
|
182
|
+
(seq "-" MultiplicativeExpression)
|
183
|
+
(seq
|
184
|
+
(alt NumericLiteralPositive NumericLiteralNegative)
|
185
|
+
(opt (alt (seq "*" UnaryExpression) (seq "/" UnaryExpression)))) )) ))
|
186
|
+
(rule MultiplicativeExpression "117"
|
187
|
+
(seq UnaryExpression (star (alt (seq "*" UnaryExpression) (seq "/" UnaryExpression)))))
|
188
|
+
(rule UnaryExpression "118"
|
189
|
+
(alt
|
190
|
+
(seq "!" PrimaryExpression)
|
191
|
+
(seq "+" PrimaryExpression)
|
192
|
+
(seq "-" PrimaryExpression) PrimaryExpression ))
|
193
|
+
(rule PrimaryExpression "119"
|
194
|
+
(alt BrackettedExpression BuiltInCall iriOrFunction RDFLiteral NumericLiteral
|
195
|
+
BooleanLiteral Var ))
|
196
|
+
(rule BrackettedExpression "120" (seq "(" Expression ")"))
|
197
|
+
(rule BuiltInCall "121"
|
198
|
+
(alt Aggregate
|
199
|
+
(seq "STR" "(" Expression ")")
|
200
|
+
(seq "LANG" "(" Expression ")")
|
201
|
+
(seq "LANGMATCHES" "(" Expression "," Expression ")")
|
202
|
+
(seq "DATATYPE" "(" Expression ")")
|
203
|
+
(seq "BOUND" "(" Var ")")
|
204
|
+
(seq "IRI" "(" Expression ")")
|
205
|
+
(seq "URI" "(" Expression ")")
|
206
|
+
(seq "BNODE" (alt (seq "(" Expression ")") NIL))
|
207
|
+
(seq "RAND" NIL)
|
208
|
+
(seq "ABS" "(" Expression ")")
|
209
|
+
(seq "CEIL" "(" Expression ")")
|
210
|
+
(seq "FLOOR" "(" Expression ")")
|
211
|
+
(seq "ROUND" "(" Expression ")")
|
212
|
+
(seq "CONCAT" ExpressionList) SubstringExpression
|
213
|
+
(seq "STRLEN" "(" Expression ")") StrReplaceExpression
|
214
|
+
(seq "UCASE" "(" Expression ")")
|
215
|
+
(seq "LCASE" "(" Expression ")")
|
216
|
+
(seq "ENCODE_FOR_URI" "(" Expression ")")
|
217
|
+
(seq "CONTAINS" "(" Expression "," Expression ")")
|
218
|
+
(seq "STRSTARTS" "(" Expression "," Expression ")")
|
219
|
+
(seq "STRENDS" "(" Expression "," Expression ")")
|
220
|
+
(seq "STRBEFORE" "(" Expression "," Expression ")")
|
221
|
+
(seq "STRAFTER" "(" Expression "," Expression ")")
|
222
|
+
(seq "YEAR" "(" Expression ")")
|
223
|
+
(seq "MONTH" "(" Expression ")")
|
224
|
+
(seq "DAY" "(" Expression ")")
|
225
|
+
(seq "HOURS" "(" Expression ")")
|
226
|
+
(seq "MINUTES" "(" Expression ")")
|
227
|
+
(seq "SECONDS" "(" Expression ")")
|
228
|
+
(seq "TIMEZONE" "(" Expression ")")
|
229
|
+
(seq "TZ" "(" Expression ")")
|
230
|
+
(seq "NOW" NIL)
|
231
|
+
(seq "UUID" NIL)
|
232
|
+
(seq "STRUUID" NIL)
|
233
|
+
(seq "MD5" "(" Expression ")")
|
234
|
+
(seq "SHA1" "(" Expression ")")
|
235
|
+
(seq "SHA224" "(" Expression ")")
|
236
|
+
(seq "SHA256" "(" Expression ")")
|
237
|
+
(seq "SHA384" "(" Expression ")")
|
238
|
+
(seq "SHA512" "(" Expression ")")
|
239
|
+
(seq "COALESCE" ExpressionList)
|
240
|
+
(seq "IF" "(" Expression "," Expression "," Expression ")")
|
241
|
+
(seq "STRLANG" "(" Expression "," Expression ")")
|
242
|
+
(seq "STRDT" "(" Expression "," Expression ")")
|
243
|
+
(seq "sameTerm" "(" Expression "," Expression ")")
|
244
|
+
(seq "isIRI" "(" Expression ")")
|
245
|
+
(seq "isURI" "(" Expression ")")
|
246
|
+
(seq "isBLANK" "(" Expression ")")
|
247
|
+
(seq "isLITERAL" "(" Expression ")")
|
248
|
+
(seq "isNUMERIC" "(" Expression ")") RegexExpression ExistsFunc
|
249
|
+
NotExistsFunc ))
|
250
|
+
(rule RegexExpression "122"
|
251
|
+
(seq "REGEX" "(" Expression "," Expression (opt (seq "," Expression)) ")"))
|
252
|
+
(rule SubstringExpression "123"
|
253
|
+
(seq "SUBSTR" "(" Expression "," Expression (opt (seq "," Expression)) ")"))
|
254
|
+
(rule StrReplaceExpression "124"
|
255
|
+
(seq "REPLACE" "(" Expression "," Expression "," Expression
|
256
|
+
(opt (seq "," Expression)) ")" ))
|
257
|
+
(rule ExistsFunc "125" (seq "EXISTS" GroupGraphPattern))
|
258
|
+
(rule NotExistsFunc "126" (seq "NOT" "EXISTS" GroupGraphPattern))
|
259
|
+
(rule Aggregate "127"
|
260
|
+
(alt
|
261
|
+
(seq "COUNT" "(" (opt "DISTINCT") (alt "*" Expression) ")")
|
262
|
+
(seq "SUM" "(" (opt "DISTINCT") Expression ")")
|
263
|
+
(seq "MIN" "(" (opt "DISTINCT") Expression ")")
|
264
|
+
(seq "MAX" "(" (opt "DISTINCT") Expression ")")
|
265
|
+
(seq "AVG" "(" (opt "DISTINCT") Expression ")")
|
266
|
+
(seq "SAMPLE" "(" (opt "DISTINCT") Expression ")")
|
267
|
+
(seq "GROUP_CONCAT" "("
|
268
|
+
(opt "DISTINCT") Expression
|
269
|
+
(opt (seq ";" "SEPARATOR" "=" String)) ")" )) )
|
270
|
+
(rule iriOrFunction "128" (seq iri (opt ArgList)))
|
271
|
+
(rule RDFLiteral "129" (seq String (opt (alt LANGTAG (seq "^^" iri)))))
|
272
|
+
(rule NumericLiteral "130"
|
273
|
+
(alt NumericLiteralUnsigned NumericLiteralPositive NumericLiteralNegative))
|
274
|
+
(rule NumericLiteralUnsigned "131" (alt INTEGER DECIMAL DOUBLE))
|
275
|
+
(rule NumericLiteralPositive "132"
|
276
|
+
(alt INTEGER_POSITIVE DECIMAL_POSITIVE DOUBLE_POSITIVE))
|
277
|
+
(rule NumericLiteralNegative "133"
|
278
|
+
(alt INTEGER_NEGATIVE DECIMAL_NEGATIVE DOUBLE_NEGATIVE))
|
279
|
+
(rule BooleanLiteral "134" (alt "true" "false"))
|
280
|
+
(rule String "135"
|
281
|
+
(alt STRING_LITERAL1 STRING_LITERAL2 STRING_LITERAL_LONG1 STRING_LITERAL_LONG2))
|
282
|
+
(rule iri "136" (alt IRIREF PrefixedName))
|
283
|
+
(rule PrefixedName "137" (alt PNAME_LN PNAME_NS))
|
284
|
+
(rule BlankNode "138" (alt BLANK_NODE_LABEL ANON))
|
285
|
+
(terminals _terminals (seq))
|
286
|
+
(terminal IRIREF "139"
|
287
|
+
(seq "<" (star (diff (range "^<>\"{}|^`\\") (range "#x00-#x20"))) ">"))
|
288
|
+
(terminal PNAME_NS "140" (seq (opt PN_PREFIX) ":"))
|
289
|
+
(terminal PNAME_LN "141" (seq PNAME_NS PN_LOCAL))
|
290
|
+
(terminal BLANK_NODE_LABEL "142"
|
291
|
+
(seq "_:" (alt PN_CHARS_U (range "0-9")) (opt (seq (star (alt PN_CHARS ".")) PN_CHARS))))
|
292
|
+
(terminal VAR1 "143" (seq "?" VARNAME))
|
293
|
+
(terminal VAR2 "144" (seq "$" VARNAME))
|
294
|
+
(terminal LANGTAG "145"
|
295
|
+
(seq "@" (plus (range "a-zA-Z")) (star (seq "-" (plus (range "a-zA-Z0-9"))))))
|
296
|
+
(terminal INTEGER "146" (plus (range "0-9")))
|
297
|
+
(terminal DECIMAL "147" (seq (star (range "0-9")) "." (plus (range "0-9"))))
|
298
|
+
(terminal DOUBLE "148"
|
299
|
+
(alt
|
300
|
+
(seq (plus (range "0-9")) "." (star (range "0-9")) EXPONENT)
|
301
|
+
(seq "." (plus (range "0-9")) EXPONENT)
|
302
|
+
(seq (plus (range "0-9")) EXPONENT)) )
|
303
|
+
(terminal INTEGER_POSITIVE "149" (seq "+" INTEGER))
|
304
|
+
(terminal DECIMAL_POSITIVE "150" (seq "+" DECIMAL))
|
305
|
+
(terminal DOUBLE_POSITIVE "151" (seq "+" DOUBLE))
|
306
|
+
(terminal INTEGER_NEGATIVE "152" (seq "-" INTEGER))
|
307
|
+
(terminal DECIMAL_NEGATIVE "153" (seq "-" DECIMAL))
|
308
|
+
(terminal DOUBLE_NEGATIVE "154" (seq "-" DOUBLE))
|
309
|
+
(terminal EXPONENT "155" (seq (range "eE") (opt (range "+-")) (plus (range "0-9"))))
|
310
|
+
(terminal STRING_LITERAL1 "156"
|
311
|
+
(seq "'" (star (alt (range "^#x27#x5C#xA#xD") ECHAR)) "'"))
|
312
|
+
(terminal STRING_LITERAL2 "157"
|
313
|
+
(seq "\"" (star (alt (range "^#x22#x5C#xA#xD") ECHAR)) "\""))
|
314
|
+
(terminal STRING_LITERAL_LONG1 "158"
|
315
|
+
(seq "'''" (star (seq (opt (alt "'" "''")) (alt (range "^'\\") ECHAR))) "'''"))
|
316
|
+
(terminal STRING_LITERAL_LONG2 "159"
|
317
|
+
(seq "\"\"\"" (star (seq (opt (alt "\"" "\"\"")) (alt (range "^\"\\") ECHAR))) "\"\"\""))
|
318
|
+
(terminal ECHAR "160" (seq "\\" (range "tbnrf\\\"'")))
|
319
|
+
(terminal NIL "161" (seq "(" (star WS) ")"))
|
320
|
+
(terminal WS "162" (alt (hex "#x20") (hex "#x9") (hex "#xD") (hex "#xA")))
|
321
|
+
(terminal ANON "163" (seq "[" (star WS) "]"))
|
322
|
+
(terminal PN_CHARS_BASE "164"
|
323
|
+
(alt
|
324
|
+
(range "A-Za-z")
|
325
|
+
(range "#x00C0-#x00D6")
|
326
|
+
(range "#x00D8-#x00F6")
|
327
|
+
(range "#x00F8-#x02FF")
|
328
|
+
(range "#x0370-#x037D")
|
329
|
+
(range "#x037F-#x1FFF")
|
330
|
+
(range "#x200C-#x200D")
|
331
|
+
(range "#x2070-#x218F")
|
332
|
+
(range "#x2C00-#x2FEF")
|
333
|
+
(range "#x3001-#xD7FF")
|
334
|
+
(range "#xF900-#xFDCF")
|
335
|
+
(range "#xFDF0-#xFFFD")
|
336
|
+
(range "#x10000-#xEFFFF")) )
|
337
|
+
(terminal PN_CHARS_U "165" (alt PN_CHARS_BASE "_"))
|
338
|
+
(terminal VARNAME "166"
|
339
|
+
(seq
|
340
|
+
(alt PN_CHARS_U (range "0-9"))
|
341
|
+
(star
|
342
|
+
(alt PN_CHARS_U
|
343
|
+
(range "0-9")
|
344
|
+
(hex "#x00B7")
|
345
|
+
(range "#x0300-#x036F")
|
346
|
+
(range "#x203F-#x2040")) )) )
|
347
|
+
(terminal PN_CHARS "167"
|
348
|
+
(alt PN_CHARS_U "-"
|
349
|
+
(range "0-9")
|
350
|
+
(hex "#x00B7")
|
351
|
+
(range "#x0300-#x036F")
|
352
|
+
(range "#x203F-#x2040")) )
|
353
|
+
(terminal PN_PREFIX "168"
|
354
|
+
(seq PN_CHARS_BASE (opt (seq (star (alt PN_CHARS ".")) PN_CHARS))))
|
355
|
+
(terminal PN_LOCAL "169"
|
356
|
+
(seq (alt PN_CHARS_U (range "0-9")) (opt (seq (star (alt PN_CHARS ".")) PN_CHARS))))
|
357
|
+
(terminal PLX "170" (alt PERCENT PN_LOCAL_ESC))
|
358
|
+
(terminal PERCENT "171" (seq "%" HEX HEX))
|
359
|
+
(terminal HEX "172" (range "0-9A-Fa-f"))
|
360
|
+
(terminal PN_LOCAL_ESC "173"
|
361
|
+
(seq "\\"
|
362
|
+
(alt "_" "~" "." "-" "!" "$" "&" "'" "(" ")" "*" "+" "," ";" "=" "/" "?" "#"
|
363
|
+
"@" "%" )) ))
|