ebnf 1.1.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +218 -196
  3. data/UNLICENSE +1 -1
  4. data/VERSION +1 -1
  5. data/bin/ebnf +40 -21
  6. data/etc/abnf-core.ebnf +52 -0
  7. data/etc/abnf.abnf +121 -0
  8. data/etc/abnf.ebnf +124 -0
  9. data/etc/abnf.sxp +45 -0
  10. data/etc/doap.ttl +13 -12
  11. data/etc/ebnf.ebnf +21 -33
  12. data/etc/ebnf.html +171 -160
  13. data/etc/{ebnf.rb → ebnf.ll1.rb} +30 -107
  14. data/etc/ebnf.ll1.sxp +182 -183
  15. data/etc/ebnf.peg.rb +90 -0
  16. data/etc/ebnf.peg.sxp +84 -0
  17. data/etc/ebnf.sxp +40 -41
  18. data/etc/iso-ebnf.ebnf +140 -0
  19. data/etc/iso-ebnf.isoebnf +138 -0
  20. data/etc/iso-ebnf.sxp +65 -0
  21. data/etc/sparql.ebnf +4 -4
  22. data/etc/sparql.html +1603 -1751
  23. data/etc/sparql.ll1.sxp +7372 -7372
  24. data/etc/sparql.peg.rb +532 -0
  25. data/etc/sparql.peg.sxp +597 -0
  26. data/etc/sparql.sxp +363 -362
  27. data/etc/turtle.ebnf +3 -3
  28. data/etc/turtle.html +465 -517
  29. data/etc/{turtle.rb → turtle.ll1.rb} +3 -4
  30. data/etc/turtle.ll1.sxp +425 -425
  31. data/etc/turtle.peg.rb +182 -0
  32. data/etc/turtle.peg.sxp +199 -0
  33. data/etc/turtle.sxp +103 -101
  34. data/lib/ebnf.rb +7 -2
  35. data/lib/ebnf/abnf.rb +301 -0
  36. data/lib/ebnf/abnf/core.rb +23 -0
  37. data/lib/ebnf/abnf/meta.rb +111 -0
  38. data/lib/ebnf/base.rb +128 -87
  39. data/lib/ebnf/bnf.rb +1 -26
  40. data/lib/ebnf/ebnf/meta.rb +90 -0
  41. data/lib/ebnf/isoebnf.rb +229 -0
  42. data/lib/ebnf/isoebnf/meta.rb +75 -0
  43. data/lib/ebnf/ll1.rb +140 -8
  44. data/lib/ebnf/ll1/lexer.rb +37 -32
  45. data/lib/ebnf/ll1/parser.rb +113 -73
  46. data/lib/ebnf/ll1/scanner.rb +84 -51
  47. data/lib/ebnf/native.rb +320 -0
  48. data/lib/ebnf/parser.rb +285 -302
  49. data/lib/ebnf/peg.rb +39 -0
  50. data/lib/ebnf/peg/parser.rb +554 -0
  51. data/lib/ebnf/peg/rule.rb +241 -0
  52. data/lib/ebnf/rule.rb +453 -163
  53. data/lib/ebnf/terminals.rb +21 -0
  54. data/lib/ebnf/writer.rb +554 -85
  55. metadata +98 -20
  56. data/etc/sparql.rb +0 -45773
@@ -1,362 +1,363 @@
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
- (terminal IRIREF "139" (seq "<" (range "^#x00-#x20<>\"{}|^`] | UCHAR)* '>'")))
286
- (terminal PNAME_NS "140" (seq (opt PN_PREFIX) ":"))
287
- (terminal PNAME_LN "141" (seq PNAME_NS PN_LOCAL))
288
- (terminal BLANK_NODE_LABEL "142"
289
- (seq "_:" (alt PN_CHARS_U (range "0-9")) (opt (seq (star (alt PN_CHARS ".")) PN_CHARS))))
290
- (terminal VAR1 "143" (seq "?" VARNAME))
291
- (terminal VAR2 "144" (seq "$" VARNAME))
292
- (terminal LANGTAG "145"
293
- (seq "@" (plus (range "a-zA-Z")) (star (seq "-" (plus (range "a-zA-Z0-9"))))))
294
- (terminal INTEGER "146" (plus (range "0-9")))
295
- (terminal DECIMAL "147" (seq (star (range "0-9")) "." (plus (range "0-9"))))
296
- (terminal DOUBLE "148"
297
- (alt
298
- (seq (plus (range "0-9")) "." (star (range "0-9")) EXPONENT)
299
- (seq "." (plus (range "0-9")) EXPONENT)
300
- (seq (plus (range "0-9")) EXPONENT)) )
301
- (terminal INTEGER_POSITIVE "149" (seq "+" INTEGER))
302
- (terminal DECIMAL_POSITIVE "150" (seq "+" DECIMAL))
303
- (terminal DOUBLE_POSITIVE "151" (seq "+" DOUBLE))
304
- (terminal INTEGER_NEGATIVE "152" (seq "-" INTEGER))
305
- (terminal DECIMAL_NEGATIVE "153" (seq "-" DECIMAL))
306
- (terminal DOUBLE_NEGATIVE "154" (seq "-" DOUBLE))
307
- (terminal EXPONENT "155" (seq (range "eE") (opt (range "+-")) (plus (range "0-9"))))
308
- (terminal STRING_LITERAL1 "156"
309
- (seq "'" (star (alt (range "^#x27#x5C#xA#xD") ECHAR)) "'"))
310
- (terminal STRING_LITERAL2 "157"
311
- (seq "\"" (star (alt (range "^#x22#x5C#xA#xD") ECHAR)) "\""))
312
- (terminal STRING_LITERAL_LONG1 "158"
313
- (seq "'''" (seq (opt (alt "'" "''")) (range "^'] | ECHAR ))* \"'''\""))))
314
- (terminal STRING_LITERAL_LONG2 "159"
315
- (seq "\"\"\"" (seq (opt (alt "\"" "\"\"")) (range "^\"] | ECHAR ))* '\"\"\"'"))))
316
- (terminal ECHAR "160" (seq "\\" (range "tbnrf\"'")))
317
- (terminal NIL "161" (seq "(" (star WS) ")"))
318
- (terminal WS "162" (alt (hex "#x20") (hex "#x9") (hex "#xD") (hex "#xA")))
319
- (terminal ANON "163" (seq "[" (star WS) "]"))
320
- (terminal PN_CHARS_BASE "164"
321
- (alt
322
- (range "A-Z")
323
- (range "a-z")
324
- (range "#x00C0-#x00D6")
325
- (range "#x00D8-#x00F6")
326
- (range "#x00F8-#x02FF")
327
- (range "#x0370-#x037D")
328
- (range "#x037F-#x1FFF")
329
- (range "#x200C-#x200D")
330
- (range "#x2070-#x218F")
331
- (range "#x2C00-#x2FEF")
332
- (range "#x3001-#xD7FF")
333
- (range "#xF900-#xFDCF")
334
- (range "#xFDF0-#xFFFD")
335
- (range "#x10000-#xEFFFF")) )
336
- (terminal PN_CHARS_U "165" (alt PN_CHARS_BASE "_"))
337
- (terminal VARNAME "166"
338
- (seq
339
- (alt PN_CHARS_U (range "0-9"))
340
- (star
341
- (alt PN_CHARS_U
342
- (range "0-9")
343
- (hex "#x00B7")
344
- (range "#x0300-#x036F")
345
- (range "#x203F-#x2040")) )) )
346
- (terminal PN_CHARS "167"
347
- (alt PN_CHARS_U "-"
348
- (range "0-9")
349
- (hex "#x00B7")
350
- (range "#x0300-#x036F")
351
- (range "#x203F-#x2040")) )
352
- (terminal PN_PREFIX "168"
353
- (seq PN_CHARS_BASE (opt (seq (star (alt PN_CHARS ".")) PN_CHARS))))
354
- (terminal PN_LOCAL "169"
355
- (seq (alt PN_CHARS_U (range "0-9")) (opt (seq (star (alt PN_CHARS ".")) PN_CHARS))))
356
- (terminal PLX "170" (alt PERCENT PN_LOCAL_ESC))
357
- (terminal PERCENT "171" (seq "%" HEX HEX))
358
- (terminal HEX "172" (alt (range "0-9") (range "A-F") (range "a-f")))
359
- (terminal PN_LOCAL_ESC "173"
360
- (seq "\\"
361
- (alt "_" "~" "." "-" "!" "$" "&" "'" "(" ")" "*" "+" "," ";" "=" "/" "?" "#"
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
+ "@" "%" )) ))