ebnf 1.2.0 → 2.1.3

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 +4 -4
  2. data/README.md +223 -199
  3. data/UNLICENSE +1 -1
  4. data/VERSION +1 -1
  5. data/bin/ebnf +38 -19
  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 +23 -18
  11. data/etc/ebnf.ebnf +21 -33
  12. data/etc/ebnf.html +76 -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 +6 -1
  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 +114 -69
  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 +131 -3
  44. data/lib/ebnf/ll1/lexer.rb +20 -22
  45. data/lib/ebnf/ll1/parser.rb +97 -64
  46. data/lib/ebnf/ll1/scanner.rb +82 -50
  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 +561 -0
  51. data/lib/ebnf/peg/rule.rb +250 -0
  52. data/lib/ebnf/rule.rb +442 -148
  53. data/lib/ebnf/terminals.rb +21 -0
  54. data/lib/ebnf/writer.rb +587 -82
  55. metadata +125 -18
  56. data/etc/sparql.rb +0 -45773
data/etc/turtle.peg.rb ADDED
@@ -0,0 +1,182 @@
1
+ # This file is automatically generated by ebnf version 2.0.0
2
+ # Derived from etc/turtle.ebnf
3
+ module Meta
4
+ RULES = [
5
+ EBNF::Rule.new(:turtleDoc, "1", [:star, :statement]).extend(EBNF::PEG::Rule),
6
+ EBNF::Rule.new(:statement, "2", [:alt, :directive, :_statement_1]).extend(EBNF::PEG::Rule),
7
+ EBNF::Rule.new(:_statement_1, "2.1", [:seq, :triples, "."]).extend(EBNF::PEG::Rule),
8
+ EBNF::Rule.new(:directive, "3", [:alt, :prefixID, :base, :sparqlPrefix, :sparqlBase]).extend(EBNF::PEG::Rule),
9
+ EBNF::Rule.new(:prefixID, "4", [:seq, "@prefix", :PNAME_NS, :IRIREF, "."]).extend(EBNF::PEG::Rule),
10
+ EBNF::Rule.new(:base, "5", [:seq, "@base", :IRIREF, "."]).extend(EBNF::PEG::Rule),
11
+ EBNF::Rule.new(:sparqlPrefix, "28s", [:seq, :SPARQL_PREFIX, :PNAME_NS, :IRIREF]).extend(EBNF::PEG::Rule),
12
+ EBNF::Rule.new(:sparqlBase, "29s", [:seq, :SPARQL_BASE, :IRIREF]).extend(EBNF::PEG::Rule),
13
+ EBNF::Rule.new(:triples, "6", [:alt, :_triples_1, :_triples_2]).extend(EBNF::PEG::Rule),
14
+ EBNF::Rule.new(:_triples_1, "6.1", [:seq, :subject, :predicateObjectList]).extend(EBNF::PEG::Rule),
15
+ EBNF::Rule.new(:_triples_2, "6.2", [:seq, :blankNodePropertyList, :_triples_3]).extend(EBNF::PEG::Rule),
16
+ EBNF::Rule.new(:_triples_3, "6.3", [:opt, :predicateObjectList]).extend(EBNF::PEG::Rule),
17
+ EBNF::Rule.new(:predicateObjectList, "7", [:seq, :verb, :objectList, :_predicateObjectList_1]).extend(EBNF::PEG::Rule),
18
+ EBNF::Rule.new(:_predicateObjectList_1, "7.1", [:star, :_predicateObjectList_2]).extend(EBNF::PEG::Rule),
19
+ EBNF::Rule.new(:_predicateObjectList_2, "7.2", [:seq, ";", :_predicateObjectList_3]).extend(EBNF::PEG::Rule),
20
+ EBNF::Rule.new(:_predicateObjectList_3, "7.3", [:opt, :_predicateObjectList_4]).extend(EBNF::PEG::Rule),
21
+ EBNF::Rule.new(:_predicateObjectList_4, "7.4", [:seq, :verb, :objectList]).extend(EBNF::PEG::Rule),
22
+ EBNF::Rule.new(:objectList, "8", [:seq, :object, :_objectList_1]).extend(EBNF::PEG::Rule),
23
+ EBNF::Rule.new(:_objectList_1, "8.1", [:star, :_objectList_2]).extend(EBNF::PEG::Rule),
24
+ EBNF::Rule.new(:_objectList_2, "8.2", [:seq, ",", :object]).extend(EBNF::PEG::Rule),
25
+ EBNF::Rule.new(:verb, "9", [:alt, :predicate, "a"]).extend(EBNF::PEG::Rule),
26
+ EBNF::Rule.new(:subject, "10", [:alt, :iri, :BlankNode, :collection]).extend(EBNF::PEG::Rule),
27
+ EBNF::Rule.new(:predicate, "11", [:seq, :iri]).extend(EBNF::PEG::Rule),
28
+ EBNF::Rule.new(:object, "12", [:alt, :iri, :BlankNode, :collection, :blankNodePropertyList, :literal]).extend(EBNF::PEG::Rule),
29
+ EBNF::Rule.new(:literal, "13", [:alt, :RDFLiteral, :NumericLiteral, :BooleanLiteral]).extend(EBNF::PEG::Rule),
30
+ EBNF::Rule.new(:blankNodePropertyList, "14", [:seq, "[", :predicateObjectList, "]"]).extend(EBNF::PEG::Rule),
31
+ EBNF::Rule.new(:collection, "15", [:seq, "(", :_collection_1, ")"]).extend(EBNF::PEG::Rule),
32
+ EBNF::Rule.new(:_collection_1, "15.1", [:star, :object]).extend(EBNF::PEG::Rule),
33
+ EBNF::Rule.new(:NumericLiteral, "16", [:alt, :INTEGER, :DECIMAL, :DOUBLE]).extend(EBNF::PEG::Rule),
34
+ EBNF::Rule.new(:RDFLiteral, "128s", [:seq, :String, :_RDFLiteral_1]).extend(EBNF::PEG::Rule),
35
+ EBNF::Rule.new(:_RDFLiteral_1, "128s.1", [:opt, :_RDFLiteral_2]).extend(EBNF::PEG::Rule),
36
+ EBNF::Rule.new(:_RDFLiteral_2, "128s.2", [:alt, :LANGTAG, :_RDFLiteral_3]).extend(EBNF::PEG::Rule),
37
+ EBNF::Rule.new(:_RDFLiteral_3, "128s.3", [:seq, "^^", :iri]).extend(EBNF::PEG::Rule),
38
+ EBNF::Rule.new(:BooleanLiteral, "133s", [:alt, "true", "false"]).extend(EBNF::PEG::Rule),
39
+ EBNF::Rule.new(:String, "17", [:alt, :STRING_LITERAL_QUOTE, :STRING_LITERAL_SINGLE_QUOTE, :STRING_LITERAL_LONG_SINGLE_QUOTE, :STRING_LITERAL_LONG_QUOTE]).extend(EBNF::PEG::Rule),
40
+ EBNF::Rule.new(:iri, "135s", [:alt, :IRIREF, :PrefixedName]).extend(EBNF::PEG::Rule),
41
+ EBNF::Rule.new(:PrefixedName, "136s", [:alt, :PNAME_LN, :PNAME_NS]).extend(EBNF::PEG::Rule),
42
+ EBNF::Rule.new(:BlankNode, "137s", [:alt, :BLANK_NODE_LABEL, :ANON]).extend(EBNF::PEG::Rule),
43
+ EBNF::Rule.new(:IRIREF, "18", [:seq, "<", :_IRIREF_1], kind: :terminal).extend(EBNF::PEG::Rule),
44
+ EBNF::Rule.new(:_IRIREF_1, "18.1", [:range, "^#x00-#x20<>\"{}|^`] | UCHAR)* '>'"], kind: :terminal).extend(EBNF::PEG::Rule),
45
+ EBNF::Rule.new(:PNAME_NS, "139s", [:seq, :_PNAME_NS_1, ":"], kind: :terminal).extend(EBNF::PEG::Rule),
46
+ EBNF::Rule.new(:_PNAME_NS_1, "139s.1", [:opt, :PN_PREFIX], kind: :terminal).extend(EBNF::PEG::Rule),
47
+ EBNF::Rule.new(:PNAME_LN, "140s", [:seq, :PNAME_NS, :PN_LOCAL], kind: :terminal).extend(EBNF::PEG::Rule),
48
+ EBNF::Rule.new(:BLANK_NODE_LABEL, "141s", [:seq, "_:", :_BLANK_NODE_LABEL_1, :_BLANK_NODE_LABEL_2], kind: :terminal).extend(EBNF::PEG::Rule),
49
+ EBNF::Rule.new(:_BLANK_NODE_LABEL_1, "141s.1", [:alt, :PN_CHARS_U, :_BLANK_NODE_LABEL_3], kind: :terminal).extend(EBNF::PEG::Rule),
50
+ EBNF::Rule.new(:_BLANK_NODE_LABEL_3, "141s.3", [:range, "0-9"], kind: :terminal).extend(EBNF::PEG::Rule),
51
+ EBNF::Rule.new(:_BLANK_NODE_LABEL_2, "141s.2", [:opt, :_BLANK_NODE_LABEL_4], kind: :terminal).extend(EBNF::PEG::Rule),
52
+ EBNF::Rule.new(:_BLANK_NODE_LABEL_4, "141s.4", [:seq, :_BLANK_NODE_LABEL_5, :PN_CHARS], kind: :terminal).extend(EBNF::PEG::Rule),
53
+ EBNF::Rule.new(:_BLANK_NODE_LABEL_5, "141s.5", [:star, :_BLANK_NODE_LABEL_6], kind: :terminal).extend(EBNF::PEG::Rule),
54
+ EBNF::Rule.new(:_BLANK_NODE_LABEL_6, "141s.6", [:alt, :PN_CHARS, "."], kind: :terminal).extend(EBNF::PEG::Rule),
55
+ EBNF::Rule.new(:LANGTAG, "144s", [:seq, "@", :_LANGTAG_1, :_LANGTAG_2], kind: :terminal).extend(EBNF::PEG::Rule),
56
+ EBNF::Rule.new(:_LANGTAG_1, "144s.1", [:plus, :_LANGTAG_3], kind: :terminal).extend(EBNF::PEG::Rule),
57
+ EBNF::Rule.new(:_LANGTAG_3, "144s.3", [:range, "a-zA-Z"], kind: :terminal).extend(EBNF::PEG::Rule),
58
+ EBNF::Rule.new(:_LANGTAG_2, "144s.2", [:star, :_LANGTAG_4], kind: :terminal).extend(EBNF::PEG::Rule),
59
+ EBNF::Rule.new(:_LANGTAG_4, "144s.4", [:seq, "-", :_LANGTAG_5], kind: :terminal).extend(EBNF::PEG::Rule),
60
+ EBNF::Rule.new(:_LANGTAG_5, "144s.5", [:plus, :_LANGTAG_6], kind: :terminal).extend(EBNF::PEG::Rule),
61
+ EBNF::Rule.new(:_LANGTAG_6, "144s.6", [:range, "a-zA-Z0-9"], kind: :terminal).extend(EBNF::PEG::Rule),
62
+ EBNF::Rule.new(:INTEGER, "19", [:seq, :_INTEGER_1, :_INTEGER_2], kind: :terminal).extend(EBNF::PEG::Rule),
63
+ EBNF::Rule.new(:_INTEGER_1, "19.1", [:opt, :_INTEGER_3], kind: :terminal).extend(EBNF::PEG::Rule),
64
+ EBNF::Rule.new(:_INTEGER_3, "19.3", [:range, "+-"], kind: :terminal).extend(EBNF::PEG::Rule),
65
+ EBNF::Rule.new(:_INTEGER_2, "19.2", [:plus, :_INTEGER_4], kind: :terminal).extend(EBNF::PEG::Rule),
66
+ EBNF::Rule.new(:_INTEGER_4, "19.4", [:range, "0-9"], kind: :terminal).extend(EBNF::PEG::Rule),
67
+ EBNF::Rule.new(:DECIMAL, "20", [:seq, :_DECIMAL_1, :_DECIMAL_2], kind: :terminal).extend(EBNF::PEG::Rule),
68
+ EBNF::Rule.new(:_DECIMAL_1, "20.1", [:opt, :_DECIMAL_3], kind: :terminal).extend(EBNF::PEG::Rule),
69
+ EBNF::Rule.new(:_DECIMAL_3, "20.3", [:range, "+-"], kind: :terminal).extend(EBNF::PEG::Rule),
70
+ EBNF::Rule.new(:_DECIMAL_2, "20.2", [:seq, :_DECIMAL_4, ".", :_DECIMAL_5], kind: :terminal).extend(EBNF::PEG::Rule),
71
+ EBNF::Rule.new(:_DECIMAL_4, "20.4", [:star, :_DECIMAL_6], kind: :terminal).extend(EBNF::PEG::Rule),
72
+ EBNF::Rule.new(:_DECIMAL_6, "20.6", [:range, "0-9"], kind: :terminal).extend(EBNF::PEG::Rule),
73
+ EBNF::Rule.new(:_DECIMAL_5, "20.5", [:plus, :_DECIMAL_7], kind: :terminal).extend(EBNF::PEG::Rule),
74
+ EBNF::Rule.new(:_DECIMAL_7, "20.7", [:range, "0-9"], kind: :terminal).extend(EBNF::PEG::Rule),
75
+ EBNF::Rule.new(:DOUBLE, "21", [:seq, :_DOUBLE_1, :_DOUBLE_2], kind: :terminal).extend(EBNF::PEG::Rule),
76
+ EBNF::Rule.new(:_DOUBLE_1, "21.1", [:opt, :_DOUBLE_3], kind: :terminal).extend(EBNF::PEG::Rule),
77
+ EBNF::Rule.new(:_DOUBLE_3, "21.3", [:range, "+-"], kind: :terminal).extend(EBNF::PEG::Rule),
78
+ EBNF::Rule.new(:_DOUBLE_2, "21.2", [:alt, :_DOUBLE_4, :_DOUBLE_5, :_DOUBLE_6], kind: :terminal).extend(EBNF::PEG::Rule),
79
+ EBNF::Rule.new(:_DOUBLE_4, "21.4", [:seq, :_DOUBLE_7, ".", :_DOUBLE_8, :EXPONENT], kind: :terminal).extend(EBNF::PEG::Rule),
80
+ EBNF::Rule.new(:_DOUBLE_7, "21.7", [:plus, :_DOUBLE_9], kind: :terminal).extend(EBNF::PEG::Rule),
81
+ EBNF::Rule.new(:_DOUBLE_9, "21.9", [:range, "0-9"], kind: :terminal).extend(EBNF::PEG::Rule),
82
+ EBNF::Rule.new(:_DOUBLE_8, "21.8", [:star, :_DOUBLE_10], kind: :terminal).extend(EBNF::PEG::Rule),
83
+ EBNF::Rule.new(:_DOUBLE_10, "21.10", [:range, "0-9"], kind: :terminal).extend(EBNF::PEG::Rule),
84
+ EBNF::Rule.new(:_DOUBLE_5, "21.5", [:seq, ".", :_DOUBLE_11, :EXPONENT], kind: :terminal).extend(EBNF::PEG::Rule),
85
+ EBNF::Rule.new(:_DOUBLE_11, "21.11", [:plus, :_DOUBLE_12], kind: :terminal).extend(EBNF::PEG::Rule),
86
+ EBNF::Rule.new(:_DOUBLE_12, "21.12", [:range, "0-9"], kind: :terminal).extend(EBNF::PEG::Rule),
87
+ EBNF::Rule.new(:_DOUBLE_6, "21.6", [:seq, :_DOUBLE_13, :EXPONENT], kind: :terminal).extend(EBNF::PEG::Rule),
88
+ EBNF::Rule.new(:_DOUBLE_13, "21.13", [:plus, :_DOUBLE_14], kind: :terminal).extend(EBNF::PEG::Rule),
89
+ EBNF::Rule.new(:_DOUBLE_14, "21.14", [:range, "0-9"], kind: :terminal).extend(EBNF::PEG::Rule),
90
+ EBNF::Rule.new(:EXPONENT, "154s", [:seq, :_EXPONENT_1, :_EXPONENT_2, :_EXPONENT_3], kind: :terminal).extend(EBNF::PEG::Rule),
91
+ EBNF::Rule.new(:_EXPONENT_1, "154s.1", [:range, "eE"], kind: :terminal).extend(EBNF::PEG::Rule),
92
+ EBNF::Rule.new(:_EXPONENT_2, "154s.2", [:opt, :_EXPONENT_4], kind: :terminal).extend(EBNF::PEG::Rule),
93
+ EBNF::Rule.new(:_EXPONENT_4, "154s.4", [:range, "+-"], kind: :terminal).extend(EBNF::PEG::Rule),
94
+ EBNF::Rule.new(:_EXPONENT_3, "154s.3", [:plus, :_EXPONENT_5], kind: :terminal).extend(EBNF::PEG::Rule),
95
+ EBNF::Rule.new(:_EXPONENT_5, "154s.5", [:range, "0-9"], kind: :terminal).extend(EBNF::PEG::Rule),
96
+ EBNF::Rule.new(:STRING_LITERAL_QUOTE, "22", [:seq, "\"", :_STRING_LITERAL_QUOTE_1, "\""], kind: :terminal).extend(EBNF::PEG::Rule),
97
+ EBNF::Rule.new(:_STRING_LITERAL_QUOTE_1, "22.1", [:star, :_STRING_LITERAL_QUOTE_2], kind: :terminal).extend(EBNF::PEG::Rule),
98
+ EBNF::Rule.new(:_STRING_LITERAL_QUOTE_2, "22.2", [:alt, :_STRING_LITERAL_QUOTE_3, :ECHAR, :UCHAR], kind: :terminal).extend(EBNF::PEG::Rule),
99
+ EBNF::Rule.new(:_STRING_LITERAL_QUOTE_3, "22.3", [:range, "^#x22#x5C#xA#xD"], kind: :terminal).extend(EBNF::PEG::Rule),
100
+ EBNF::Rule.new(:STRING_LITERAL_SINGLE_QUOTE, "23", [:seq, "'", :_STRING_LITERAL_SINGLE_QUOTE_1, "'"], kind: :terminal).extend(EBNF::PEG::Rule),
101
+ EBNF::Rule.new(:_STRING_LITERAL_SINGLE_QUOTE_1, "23.1", [:star, :_STRING_LITERAL_SINGLE_QUOTE_2], kind: :terminal).extend(EBNF::PEG::Rule),
102
+ EBNF::Rule.new(:_STRING_LITERAL_SINGLE_QUOTE_2, "23.2", [:alt, :_STRING_LITERAL_SINGLE_QUOTE_3, :ECHAR, :UCHAR], kind: :terminal).extend(EBNF::PEG::Rule),
103
+ EBNF::Rule.new(:_STRING_LITERAL_SINGLE_QUOTE_3, "23.3", [:range, "^#x27#x5C#xA#xD"], kind: :terminal).extend(EBNF::PEG::Rule),
104
+ EBNF::Rule.new(:STRING_LITERAL_LONG_SINGLE_QUOTE, "24", [:seq, "'''", :_STRING_LITERAL_LONG_SINGLE_QUOTE_1], kind: :terminal).extend(EBNF::PEG::Rule),
105
+ EBNF::Rule.new(:_STRING_LITERAL_LONG_SINGLE_QUOTE_1, "24.1", [:seq, :_STRING_LITERAL_LONG_SINGLE_QUOTE_2, :_STRING_LITERAL_LONG_SINGLE_QUOTE_3], kind: :terminal).extend(EBNF::PEG::Rule),
106
+ EBNF::Rule.new(:_STRING_LITERAL_LONG_SINGLE_QUOTE_2, "24.2", [:opt, :_STRING_LITERAL_LONG_SINGLE_QUOTE_4], kind: :terminal).extend(EBNF::PEG::Rule),
107
+ EBNF::Rule.new(:_STRING_LITERAL_LONG_SINGLE_QUOTE_4, "24.4", [:alt, "'", "''"], kind: :terminal).extend(EBNF::PEG::Rule),
108
+ EBNF::Rule.new(:_STRING_LITERAL_LONG_SINGLE_QUOTE_3, "24.3", [:range, "^'] | ECHAR | UCHAR ) )* \"'''\""], kind: :terminal).extend(EBNF::PEG::Rule),
109
+ EBNF::Rule.new(:STRING_LITERAL_LONG_QUOTE, "25", [:seq, "\"\"\"", :_STRING_LITERAL_LONG_QUOTE_1], kind: :terminal).extend(EBNF::PEG::Rule),
110
+ EBNF::Rule.new(:_STRING_LITERAL_LONG_QUOTE_1, "25.1", [:seq, :_STRING_LITERAL_LONG_QUOTE_2, :_STRING_LITERAL_LONG_QUOTE_3], kind: :terminal).extend(EBNF::PEG::Rule),
111
+ EBNF::Rule.new(:_STRING_LITERAL_LONG_QUOTE_2, "25.2", [:opt, :_STRING_LITERAL_LONG_QUOTE_4], kind: :terminal).extend(EBNF::PEG::Rule),
112
+ EBNF::Rule.new(:_STRING_LITERAL_LONG_QUOTE_4, "25.4", [:alt, "\"", "\"\""], kind: :terminal).extend(EBNF::PEG::Rule),
113
+ EBNF::Rule.new(:_STRING_LITERAL_LONG_QUOTE_3, "25.3", [:range, "^\"] | ECHAR | UCHAR ) )* '\"\"\"'"], kind: :terminal).extend(EBNF::PEG::Rule),
114
+ EBNF::Rule.new(:UCHAR, "26", [:alt, :_UCHAR_1, :_UCHAR_2], kind: :terminal).extend(EBNF::PEG::Rule),
115
+ EBNF::Rule.new(:_UCHAR_1, "26.1", [:seq, "u", :HEX, :HEX, :HEX, :HEX], kind: :terminal).extend(EBNF::PEG::Rule),
116
+ EBNF::Rule.new(:_UCHAR_2, "26.2", [:seq, "U", :HEX, :HEX, :HEX, :HEX, :HEX, :HEX, :HEX, :HEX], kind: :terminal).extend(EBNF::PEG::Rule),
117
+ EBNF::Rule.new(:ECHAR, "159s", [:seq, "\\", :_ECHAR_1], kind: :terminal).extend(EBNF::PEG::Rule),
118
+ EBNF::Rule.new(:_ECHAR_1, "159s.1", [:range, "tbnrf\"'"], kind: :terminal).extend(EBNF::PEG::Rule),
119
+ EBNF::Rule.new(:SPARQL_PREFIX, "28t", [:seq, :_SPARQL_PREFIX_1, :_SPARQL_PREFIX_2, :_SPARQL_PREFIX_3, :_SPARQL_PREFIX_4, :_SPARQL_PREFIX_5, :_SPARQL_PREFIX_6], kind: :terminal).extend(EBNF::PEG::Rule),
120
+ EBNF::Rule.new(:_SPARQL_PREFIX_1, "28t.1", [:range, "Pp"], kind: :terminal).extend(EBNF::PEG::Rule),
121
+ EBNF::Rule.new(:_SPARQL_PREFIX_2, "28t.2", [:range, "Rr"], kind: :terminal).extend(EBNF::PEG::Rule),
122
+ EBNF::Rule.new(:_SPARQL_PREFIX_3, "28t.3", [:range, "Ee"], kind: :terminal).extend(EBNF::PEG::Rule),
123
+ EBNF::Rule.new(:_SPARQL_PREFIX_4, "28t.4", [:range, "Ff"], kind: :terminal).extend(EBNF::PEG::Rule),
124
+ EBNF::Rule.new(:_SPARQL_PREFIX_5, "28t.5", [:range, "Ii"], kind: :terminal).extend(EBNF::PEG::Rule),
125
+ EBNF::Rule.new(:_SPARQL_PREFIX_6, "28t.6", [:range, "Xx"], kind: :terminal).extend(EBNF::PEG::Rule),
126
+ EBNF::Rule.new(:SPARQL_BASE, "29t", [:seq, :_SPARQL_BASE_1, :_SPARQL_BASE_2, :_SPARQL_BASE_3, :_SPARQL_BASE_4], kind: :terminal).extend(EBNF::PEG::Rule),
127
+ EBNF::Rule.new(:_SPARQL_BASE_1, "29t.1", [:range, "Bb"], kind: :terminal).extend(EBNF::PEG::Rule),
128
+ EBNF::Rule.new(:_SPARQL_BASE_2, "29t.2", [:range, "Aa"], kind: :terminal).extend(EBNF::PEG::Rule),
129
+ EBNF::Rule.new(:_SPARQL_BASE_3, "29t.3", [:range, "Ss"], kind: :terminal).extend(EBNF::PEG::Rule),
130
+ EBNF::Rule.new(:_SPARQL_BASE_4, "29t.4", [:range, "Ee"], kind: :terminal).extend(EBNF::PEG::Rule),
131
+ EBNF::Rule.new(:WS, "161s", [:alt, :_WS_1, :_WS_2, :_WS_3, :_WS_4], kind: :terminal).extend(EBNF::PEG::Rule),
132
+ EBNF::Rule.new(:_WS_1, "161s.1", [:hex, "#x20"], kind: :terminal).extend(EBNF::PEG::Rule),
133
+ EBNF::Rule.new(:_WS_2, "161s.2", [:hex, "#x9"], kind: :terminal).extend(EBNF::PEG::Rule),
134
+ EBNF::Rule.new(:_WS_3, "161s.3", [:hex, "#xD"], kind: :terminal).extend(EBNF::PEG::Rule),
135
+ EBNF::Rule.new(:_WS_4, "161s.4", [:hex, "#xA"], kind: :terminal).extend(EBNF::PEG::Rule),
136
+ EBNF::Rule.new(:ANON, "162s", [:seq, "[", :_ANON_1, "]"], kind: :terminal).extend(EBNF::PEG::Rule),
137
+ EBNF::Rule.new(:_ANON_1, "162s.1", [:star, :WS], kind: :terminal).extend(EBNF::PEG::Rule),
138
+ EBNF::Rule.new(:PN_CHARS_BASE, "163s", [:alt, :_PN_CHARS_BASE_1, :_PN_CHARS_BASE_2, :_PN_CHARS_BASE_3, :_PN_CHARS_BASE_4, :_PN_CHARS_BASE_5, :_PN_CHARS_BASE_6, :_PN_CHARS_BASE_7, :_PN_CHARS_BASE_8, :_PN_CHARS_BASE_9, :_PN_CHARS_BASE_10, :_PN_CHARS_BASE_11, :_PN_CHARS_BASE_12, :_PN_CHARS_BASE_13, :_PN_CHARS_BASE_14], kind: :terminal).extend(EBNF::PEG::Rule),
139
+ EBNF::Rule.new(:_PN_CHARS_BASE_1, "163s.1", [:range, "A-Z"], kind: :terminal).extend(EBNF::PEG::Rule),
140
+ EBNF::Rule.new(:_PN_CHARS_BASE_2, "163s.2", [:range, "a-z"], kind: :terminal).extend(EBNF::PEG::Rule),
141
+ EBNF::Rule.new(:_PN_CHARS_BASE_3, "163s.3", [:range, "#x00C0-#x00D6"], kind: :terminal).extend(EBNF::PEG::Rule),
142
+ EBNF::Rule.new(:_PN_CHARS_BASE_4, "163s.4", [:range, "#x00D8-#x00F6"], kind: :terminal).extend(EBNF::PEG::Rule),
143
+ EBNF::Rule.new(:_PN_CHARS_BASE_5, "163s.5", [:range, "#x00F8-#x02FF"], kind: :terminal).extend(EBNF::PEG::Rule),
144
+ EBNF::Rule.new(:_PN_CHARS_BASE_6, "163s.6", [:range, "#x0370-#x037D"], kind: :terminal).extend(EBNF::PEG::Rule),
145
+ EBNF::Rule.new(:_PN_CHARS_BASE_7, "163s.7", [:range, "#x037F-#x1FFF"], kind: :terminal).extend(EBNF::PEG::Rule),
146
+ EBNF::Rule.new(:_PN_CHARS_BASE_8, "163s.8", [:range, "#x200C-#x200D"], kind: :terminal).extend(EBNF::PEG::Rule),
147
+ EBNF::Rule.new(:_PN_CHARS_BASE_9, "163s.9", [:range, "#x2070-#x218F"], kind: :terminal).extend(EBNF::PEG::Rule),
148
+ EBNF::Rule.new(:_PN_CHARS_BASE_10, "163s.10", [:range, "#x2C00-#x2FEF"], kind: :terminal).extend(EBNF::PEG::Rule),
149
+ EBNF::Rule.new(:_PN_CHARS_BASE_11, "163s.11", [:range, "#x3001-#xD7FF"], kind: :terminal).extend(EBNF::PEG::Rule),
150
+ EBNF::Rule.new(:_PN_CHARS_BASE_12, "163s.12", [:range, "#xF900-#xFDCF"], kind: :terminal).extend(EBNF::PEG::Rule),
151
+ EBNF::Rule.new(:_PN_CHARS_BASE_13, "163s.13", [:range, "#xFDF0-#xFFFD"], kind: :terminal).extend(EBNF::PEG::Rule),
152
+ EBNF::Rule.new(:_PN_CHARS_BASE_14, "163s.14", [:range, "#x10000-#xEFFFF"], kind: :terminal).extend(EBNF::PEG::Rule),
153
+ EBNF::Rule.new(:PN_CHARS_U, "164s", [:alt, :PN_CHARS_BASE, "_"], kind: :terminal).extend(EBNF::PEG::Rule),
154
+ EBNF::Rule.new(:PN_CHARS, "166s", [:alt, :PN_CHARS_U, "-", :_PN_CHARS_1, :_PN_CHARS_2, :_PN_CHARS_3, :_PN_CHARS_4], kind: :terminal).extend(EBNF::PEG::Rule),
155
+ EBNF::Rule.new(:_PN_CHARS_1, "166s.1", [:range, "0-9"], kind: :terminal).extend(EBNF::PEG::Rule),
156
+ EBNF::Rule.new(:_PN_CHARS_2, "166s.2", [:hex, "#x00B7"], kind: :terminal).extend(EBNF::PEG::Rule),
157
+ EBNF::Rule.new(:_PN_CHARS_3, "166s.3", [:range, "#x0300-#x036F"], kind: :terminal).extend(EBNF::PEG::Rule),
158
+ EBNF::Rule.new(:_PN_CHARS_4, "166s.4", [:range, "#x203F-#x2040"], kind: :terminal).extend(EBNF::PEG::Rule),
159
+ EBNF::Rule.new(:PN_PREFIX, "167s", [:seq, :PN_CHARS_BASE, :_PN_PREFIX_1], kind: :terminal).extend(EBNF::PEG::Rule),
160
+ EBNF::Rule.new(:_PN_PREFIX_1, "167s.1", [:opt, :_PN_PREFIX_2], kind: :terminal).extend(EBNF::PEG::Rule),
161
+ EBNF::Rule.new(:_PN_PREFIX_2, "167s.2", [:seq, :_PN_PREFIX_3, :PN_CHARS], kind: :terminal).extend(EBNF::PEG::Rule),
162
+ EBNF::Rule.new(:_PN_PREFIX_3, "167s.3", [:star, :_PN_PREFIX_4], kind: :terminal).extend(EBNF::PEG::Rule),
163
+ EBNF::Rule.new(:_PN_PREFIX_4, "167s.4", [:alt, :PN_CHARS, "."], kind: :terminal).extend(EBNF::PEG::Rule),
164
+ EBNF::Rule.new(:PN_LOCAL, "168s", [:seq, :_PN_LOCAL_1, :_PN_LOCAL_2], kind: :terminal).extend(EBNF::PEG::Rule),
165
+ EBNF::Rule.new(:_PN_LOCAL_1, "168s.1", [:alt, :PN_CHARS_U, ":", :_PN_LOCAL_3, :PLX], kind: :terminal).extend(EBNF::PEG::Rule),
166
+ EBNF::Rule.new(:_PN_LOCAL_3, "168s.3", [:range, "0-9"], kind: :terminal).extend(EBNF::PEG::Rule),
167
+ EBNF::Rule.new(:_PN_LOCAL_2, "168s.2", [:opt, :_PN_LOCAL_4], kind: :terminal).extend(EBNF::PEG::Rule),
168
+ EBNF::Rule.new(:_PN_LOCAL_4, "168s.4", [:seq, :_PN_LOCAL_5, :_PN_LOCAL_6], kind: :terminal).extend(EBNF::PEG::Rule),
169
+ EBNF::Rule.new(:_PN_LOCAL_5, "168s.5", [:star, :_PN_LOCAL_7], kind: :terminal).extend(EBNF::PEG::Rule),
170
+ EBNF::Rule.new(:_PN_LOCAL_7, "168s.7", [:alt, :PN_CHARS, ".", ":", :PLX], kind: :terminal).extend(EBNF::PEG::Rule),
171
+ EBNF::Rule.new(:_PN_LOCAL_6, "168s.6", [:alt, :PN_CHARS, ":", :PLX], kind: :terminal).extend(EBNF::PEG::Rule),
172
+ EBNF::Rule.new(:PLX, "169s", [:alt, :PERCENT, :PN_LOCAL_ESC], kind: :terminal).extend(EBNF::PEG::Rule),
173
+ EBNF::Rule.new(:PERCENT, "170s", [:seq, "%", :HEX, :HEX], kind: :terminal).extend(EBNF::PEG::Rule),
174
+ EBNF::Rule.new(:HEX, "171s", [:alt, :_HEX_1, :_HEX_2, :_HEX_3], kind: :terminal).extend(EBNF::PEG::Rule),
175
+ EBNF::Rule.new(:_HEX_1, "171s.1", [:range, "0-9"], kind: :terminal).extend(EBNF::PEG::Rule),
176
+ EBNF::Rule.new(:_HEX_2, "171s.2", [:range, "A-F"], kind: :terminal).extend(EBNF::PEG::Rule),
177
+ EBNF::Rule.new(:_HEX_3, "171s.3", [:range, "a-f"], kind: :terminal).extend(EBNF::PEG::Rule),
178
+ EBNF::Rule.new(:PN_LOCAL_ESC, "172s", [:seq, "\\", :_PN_LOCAL_ESC_1], kind: :terminal).extend(EBNF::PEG::Rule),
179
+ EBNF::Rule.new(:_PN_LOCAL_ESC_1, "172s.1", [:alt, "_", "~", ".", "-", "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=", "/", "?", "#", "@", "%"], kind: :terminal).extend(EBNF::PEG::Rule),
180
+ ]
181
+ end
182
+
@@ -0,0 +1,199 @@
1
+ (
2
+ (rule turtleDoc "1" (star statement))
3
+ (rule statement "2" (alt directive _statement_1))
4
+ (rule _statement_1 "2.1" (seq triples "."))
5
+ (rule directive "3" (alt prefixID base sparqlPrefix sparqlBase))
6
+ (rule prefixID "4" (seq "@prefix" PNAME_NS IRIREF "."))
7
+ (rule base "5" (seq "@base" IRIREF "."))
8
+ (rule triples "6" (alt _triples_1 _triples_2))
9
+ (rule _triples_1 "6.1" (seq subject predicateObjectList))
10
+ (rule _triples_2 "6.2" (seq blankNodePropertyList _triples_3))
11
+ (rule _triples_3 "6.3" (opt predicateObjectList))
12
+ (rule predicateObjectList "7" (seq verb objectList _predicateObjectList_1))
13
+ (rule _predicateObjectList_1 "7.1" (star _predicateObjectList_2))
14
+ (rule _predicateObjectList_2 "7.2" (seq ";" _predicateObjectList_3))
15
+ (rule _predicateObjectList_3 "7.3" (opt _predicateObjectList_4))
16
+ (rule _predicateObjectList_4 "7.4" (seq verb objectList))
17
+ (rule objectList "8" (seq object _objectList_1))
18
+ (rule _objectList_1 "8.1" (star _objectList_2))
19
+ (rule _objectList_2 "8.2" (seq "," object))
20
+ (rule verb "9" (alt predicate "a"))
21
+ (rule subject "10" (alt iri BlankNode collection))
22
+ (rule predicate "11" (seq iri))
23
+ (rule object "12" (alt iri BlankNode collection blankNodePropertyList literal))
24
+ (rule literal "13" (alt RDFLiteral NumericLiteral BooleanLiteral))
25
+ (rule blankNodePropertyList "14" (seq "[" predicateObjectList "]"))
26
+ (rule collection "15" (seq "(" _collection_1 ")"))
27
+ (rule _collection_1 "15.1" (star object))
28
+ (rule NumericLiteral "16" (alt INTEGER DECIMAL DOUBLE))
29
+ (rule String "17"
30
+ (alt STRING_LITERAL_QUOTE STRING_LITERAL_SINGLE_QUOTE
31
+ STRING_LITERAL_LONG_SINGLE_QUOTE STRING_LITERAL_LONG_QUOTE ))
32
+ (terminal IRIREF "18" (seq "<" _IRIREF_1))
33
+ (terminal _IRIREF_1 "18.1" (range "^#x00-#x20<>\"{}|^`] | UCHAR)* '>'"))
34
+ (terminal INTEGER "19" (seq _INTEGER_1 _INTEGER_2))
35
+ (terminal _INTEGER_1 "19.1" (opt _INTEGER_3))
36
+ (terminal _INTEGER_2 "19.2" (plus _INTEGER_4))
37
+ (terminal _INTEGER_3 "19.3" (range "+-"))
38
+ (terminal _INTEGER_4 "19.4" (range "0-9"))
39
+ (terminal DECIMAL "20" (seq _DECIMAL_1 _DECIMAL_2))
40
+ (terminal _DECIMAL_1 "20.1" (opt _DECIMAL_3))
41
+ (terminal _DECIMAL_2 "20.2" (seq _DECIMAL_4 "." _DECIMAL_5))
42
+ (terminal _DECIMAL_3 "20.3" (range "+-"))
43
+ (terminal _DECIMAL_4 "20.4" (star _DECIMAL_6))
44
+ (terminal _DECIMAL_5 "20.5" (plus _DECIMAL_7))
45
+ (terminal _DECIMAL_6 "20.6" (range "0-9"))
46
+ (terminal _DECIMAL_7 "20.7" (range "0-9"))
47
+ (terminal DOUBLE "21" (seq _DOUBLE_1 _DOUBLE_2))
48
+ (terminal _DOUBLE_1 "21.1" (opt _DOUBLE_3))
49
+ (terminal _DOUBLE_10 "21.10" (range "0-9"))
50
+ (terminal _DOUBLE_11 "21.11" (plus _DOUBLE_12))
51
+ (terminal _DOUBLE_12 "21.12" (range "0-9"))
52
+ (terminal _DOUBLE_13 "21.13" (plus _DOUBLE_14))
53
+ (terminal _DOUBLE_14 "21.14" (range "0-9"))
54
+ (terminal _DOUBLE_2 "21.2" (alt _DOUBLE_4 _DOUBLE_5 _DOUBLE_6))
55
+ (terminal _DOUBLE_3 "21.3" (range "+-"))
56
+ (terminal _DOUBLE_4 "21.4" (seq _DOUBLE_7 "." _DOUBLE_8 EXPONENT))
57
+ (terminal _DOUBLE_5 "21.5" (seq "." _DOUBLE_11 EXPONENT))
58
+ (terminal _DOUBLE_6 "21.6" (seq _DOUBLE_13 EXPONENT))
59
+ (terminal _DOUBLE_7 "21.7" (plus _DOUBLE_9))
60
+ (terminal _DOUBLE_8 "21.8" (star _DOUBLE_10))
61
+ (terminal _DOUBLE_9 "21.9" (range "0-9"))
62
+ (terminal STRING_LITERAL_QUOTE "22" (seq "\"" _STRING_LITERAL_QUOTE_1 "\""))
63
+ (terminal _STRING_LITERAL_QUOTE_1 "22.1" (star _STRING_LITERAL_QUOTE_2))
64
+ (terminal _STRING_LITERAL_QUOTE_2 "22.2" (alt _STRING_LITERAL_QUOTE_3 ECHAR UCHAR))
65
+ (terminal _STRING_LITERAL_QUOTE_3 "22.3" (range "^#x22#x5C#xA#xD"))
66
+ (terminal STRING_LITERAL_SINGLE_QUOTE "23"
67
+ (seq "'" _STRING_LITERAL_SINGLE_QUOTE_1 "'"))
68
+ (terminal _STRING_LITERAL_SINGLE_QUOTE_1 "23.1"
69
+ (star _STRING_LITERAL_SINGLE_QUOTE_2))
70
+ (terminal _STRING_LITERAL_SINGLE_QUOTE_2 "23.2"
71
+ (alt _STRING_LITERAL_SINGLE_QUOTE_3 ECHAR UCHAR))
72
+ (terminal _STRING_LITERAL_SINGLE_QUOTE_3 "23.3" (range "^#x27#x5C#xA#xD"))
73
+ (terminal STRING_LITERAL_LONG_SINGLE_QUOTE "24"
74
+ (seq "'''" _STRING_LITERAL_LONG_SINGLE_QUOTE_1))
75
+ (terminal _STRING_LITERAL_LONG_SINGLE_QUOTE_1 "24.1"
76
+ (seq _STRING_LITERAL_LONG_SINGLE_QUOTE_2 _STRING_LITERAL_LONG_SINGLE_QUOTE_3))
77
+ (terminal _STRING_LITERAL_LONG_SINGLE_QUOTE_2 "24.2"
78
+ (opt _STRING_LITERAL_LONG_SINGLE_QUOTE_4))
79
+ (terminal _STRING_LITERAL_LONG_SINGLE_QUOTE_3 "24.3"
80
+ (range "^'] | ECHAR | UCHAR ))* \"'''\""))
81
+ (terminal _STRING_LITERAL_LONG_SINGLE_QUOTE_4 "24.4" (alt "'" "''"))
82
+ (terminal STRING_LITERAL_LONG_QUOTE "25"
83
+ (seq "\"\"\"" _STRING_LITERAL_LONG_QUOTE_1))
84
+ (terminal _STRING_LITERAL_LONG_QUOTE_1 "25.1"
85
+ (seq _STRING_LITERAL_LONG_QUOTE_2 _STRING_LITERAL_LONG_QUOTE_3))
86
+ (terminal _STRING_LITERAL_LONG_QUOTE_2 "25.2" (opt _STRING_LITERAL_LONG_QUOTE_4))
87
+ (terminal _STRING_LITERAL_LONG_QUOTE_3 "25.3"
88
+ (range "^\"] | ECHAR | UCHAR ))* '\"\"\"'"))
89
+ (terminal _STRING_LITERAL_LONG_QUOTE_4 "25.4" (alt "\"" "\"\""))
90
+ (terminal UCHAR "26" (alt _UCHAR_1 _UCHAR_2))
91
+ (terminal _UCHAR_1 "26.1" (seq "u" HEX HEX HEX HEX))
92
+ (terminal _UCHAR_2 "26.2" (seq "U" HEX HEX HEX HEX HEX HEX HEX HEX))
93
+ (terminal _SPARQL_PREFIX_4 "28t.4" (range "Ff"))
94
+ (terminal _SPARQL_PREFIX_3 "28t.3" (range "Ee"))
95
+ (terminal _SPARQL_PREFIX_2 "28t.2" (range "Rr"))
96
+ (terminal _SPARQL_PREFIX_1 "28t.1" (range "Pp"))
97
+ (terminal SPARQL_PREFIX "28t"
98
+ (seq _SPARQL_PREFIX_1 _SPARQL_PREFIX_2 _SPARQL_PREFIX_3 _SPARQL_PREFIX_4
99
+ _SPARQL_PREFIX_5 _SPARQL_PREFIX_6 ))
100
+ (rule sparqlPrefix "28s" (seq SPARQL_PREFIX PNAME_NS IRIREF))
101
+ (terminal _SPARQL_PREFIX_6 "28t.6" (range "Xx"))
102
+ (terminal _SPARQL_PREFIX_5 "28t.5" (range "Ii"))
103
+ (terminal _SPARQL_BASE_3 "29t.3" (range "Ss"))
104
+ (terminal _SPARQL_BASE_4 "29t.4" (range "Ee"))
105
+ (terminal _SPARQL_BASE_2 "29t.2" (range "Aa"))
106
+ (terminal _SPARQL_BASE_1 "29t.1" (range "Bb"))
107
+ (terminal SPARQL_BASE "29t"
108
+ (seq _SPARQL_BASE_1 _SPARQL_BASE_2 _SPARQL_BASE_3 _SPARQL_BASE_4))
109
+ (rule sparqlBase "29s" (seq SPARQL_BASE IRIREF))
110
+ (rule RDFLiteral "128s" (seq String _RDFLiteral_1))
111
+ (rule _RDFLiteral_1 "128s.1" (opt _RDFLiteral_2))
112
+ (rule _RDFLiteral_2 "128s.2" (alt LANGTAG _RDFLiteral_3))
113
+ (rule _RDFLiteral_3 "128s.3" (seq "^^" iri))
114
+ (rule BooleanLiteral "133s" (alt "true" "false"))
115
+ (rule iri "135s" (alt IRIREF PrefixedName))
116
+ (rule PrefixedName "136s" (alt PNAME_LN PNAME_NS))
117
+ (rule BlankNode "137s" (alt BLANK_NODE_LABEL ANON))
118
+ (terminal PNAME_NS "139s" (seq _PNAME_NS_1 ":"))
119
+ (terminal _PNAME_NS_1 "139s.1" (opt PN_PREFIX))
120
+ (terminal PNAME_LN "140s" (seq PNAME_NS PN_LOCAL))
121
+ (terminal _BLANK_NODE_LABEL_2 "141s.2" (opt _BLANK_NODE_LABEL_4))
122
+ (terminal _BLANK_NODE_LABEL_6 "141s.6" (alt PN_CHARS "."))
123
+ (terminal _BLANK_NODE_LABEL_4 "141s.4" (seq _BLANK_NODE_LABEL_5 PN_CHARS))
124
+ (terminal _BLANK_NODE_LABEL_5 "141s.5" (star _BLANK_NODE_LABEL_6))
125
+ (terminal BLANK_NODE_LABEL "141s"
126
+ (seq "_:" _BLANK_NODE_LABEL_1 _BLANK_NODE_LABEL_2))
127
+ (terminal _BLANK_NODE_LABEL_1 "141s.1" (alt PN_CHARS_U _BLANK_NODE_LABEL_3))
128
+ (terminal _BLANK_NODE_LABEL_3 "141s.3" (range "0-9"))
129
+ (terminal _LANGTAG_4 "144s.4" (seq "-" _LANGTAG_5))
130
+ (terminal _LANGTAG_5 "144s.5" (plus _LANGTAG_6))
131
+ (terminal _LANGTAG_6 "144s.6" (range "a-zA-Z0-9"))
132
+ (terminal LANGTAG "144s" (seq "@" _LANGTAG_1 _LANGTAG_2))
133
+ (terminal _LANGTAG_1 "144s.1" (plus _LANGTAG_3))
134
+ (terminal _LANGTAG_3 "144s.3" (range "a-zA-Z"))
135
+ (terminal _LANGTAG_2 "144s.2" (star _LANGTAG_4))
136
+ (terminal _EXPONENT_3 "154s.3" (plus _EXPONENT_5))
137
+ (terminal _EXPONENT_5 "154s.5" (range "0-9"))
138
+ (terminal _EXPONENT_1 "154s.1" (range "eE"))
139
+ (terminal EXPONENT "154s" (seq _EXPONENT_1 _EXPONENT_2 _EXPONENT_3))
140
+ (terminal _EXPONENT_2 "154s.2" (opt _EXPONENT_4))
141
+ (terminal _EXPONENT_4 "154s.4" (range "+-"))
142
+ (terminal _ECHAR_1 "159s.1" (range "tbnrf\"'"))
143
+ (terminal ECHAR "159s" (seq "\\" _ECHAR_1))
144
+ (terminal _WS_2 "161s.2" (hex "#x9"))
145
+ (terminal _WS_3 "161s.3" (hex "#xD"))
146
+ (terminal _WS_4 "161s.4" (hex "#xA"))
147
+ (terminal _WS_1 "161s.1" (hex "#x20"))
148
+ (terminal WS "161s" (alt _WS_1 _WS_2 _WS_3 _WS_4))
149
+ (terminal ANON "162s" (seq "[" _ANON_1 "]"))
150
+ (terminal _ANON_1 "162s.1" (star WS))
151
+ (terminal _PN_CHARS_BASE_7 "163s.7" (range "#x037F-#x1FFF"))
152
+ (terminal _PN_CHARS_BASE_8 "163s.8" (range "#x200C-#x200D"))
153
+ (terminal _PN_CHARS_BASE_9 "163s.9" (range "#x2070-#x218F"))
154
+ (terminal _PN_CHARS_BASE_10 "163s.10" (range "#x2C00-#x2FEF"))
155
+ (terminal _PN_CHARS_BASE_11 "163s.11" (range "#x3001-#xD7FF"))
156
+ (terminal _PN_CHARS_BASE_12 "163s.12" (range "#xF900-#xFDCF"))
157
+ (terminal _PN_CHARS_BASE_13 "163s.13" (range "#xFDF0-#xFFFD"))
158
+ (terminal _PN_CHARS_BASE_14 "163s.14" (range "#x10000-#xEFFFF"))
159
+ (terminal _PN_CHARS_BASE_4 "163s.4" (range "#x00D8-#x00F6"))
160
+ (terminal PN_CHARS_BASE "163s"
161
+ (alt _PN_CHARS_BASE_1 _PN_CHARS_BASE_2 _PN_CHARS_BASE_3 _PN_CHARS_BASE_4
162
+ _PN_CHARS_BASE_5 _PN_CHARS_BASE_6 _PN_CHARS_BASE_7 _PN_CHARS_BASE_8
163
+ _PN_CHARS_BASE_9 _PN_CHARS_BASE_10 _PN_CHARS_BASE_11 _PN_CHARS_BASE_12
164
+ _PN_CHARS_BASE_13 _PN_CHARS_BASE_14 ))
165
+ (terminal _PN_CHARS_BASE_1 "163s.1" (range "A-Z"))
166
+ (terminal _PN_CHARS_BASE_2 "163s.2" (range "a-z"))
167
+ (terminal _PN_CHARS_BASE_3 "163s.3" (range "#x00C0-#x00D6"))
168
+ (terminal _PN_CHARS_BASE_5 "163s.5" (range "#x00F8-#x02FF"))
169
+ (terminal _PN_CHARS_BASE_6 "163s.6" (range "#x0370-#x037D"))
170
+ (terminal PN_CHARS_U "164s" (alt PN_CHARS_BASE "_"))
171
+ (terminal _PN_CHARS_1 "166s.1" (range "0-9"))
172
+ (terminal PN_CHARS "166s"
173
+ (alt PN_CHARS_U "-" _PN_CHARS_1 _PN_CHARS_2 _PN_CHARS_3 _PN_CHARS_4))
174
+ (terminal _PN_CHARS_2 "166s.2" (hex "#x00B7"))
175
+ (terminal _PN_CHARS_3 "166s.3" (range "#x0300-#x036F"))
176
+ (terminal _PN_CHARS_4 "166s.4" (range "#x203F-#x2040"))
177
+ (terminal _PN_PREFIX_4 "167s.4" (alt PN_CHARS "."))
178
+ (terminal _PN_PREFIX_1 "167s.1" (opt _PN_PREFIX_2))
179
+ (terminal PN_PREFIX "167s" (seq PN_CHARS_BASE _PN_PREFIX_1))
180
+ (terminal _PN_PREFIX_2 "167s.2" (seq _PN_PREFIX_3 PN_CHARS))
181
+ (terminal _PN_PREFIX_3 "167s.3" (star _PN_PREFIX_4))
182
+ (terminal _PN_LOCAL_4 "168s.4" (seq _PN_LOCAL_5 _PN_LOCAL_6))
183
+ (terminal _PN_LOCAL_7 "168s.7" (alt PN_CHARS "." ":" PLX))
184
+ (terminal _PN_LOCAL_6 "168s.6" (alt PN_CHARS ":" PLX))
185
+ (terminal _PN_LOCAL_5 "168s.5" (star _PN_LOCAL_7))
186
+ (terminal PN_LOCAL "168s" (seq _PN_LOCAL_1 _PN_LOCAL_2))
187
+ (terminal _PN_LOCAL_1 "168s.1" (alt PN_CHARS_U ":" _PN_LOCAL_3 PLX))
188
+ (terminal _PN_LOCAL_3 "168s.3" (range "0-9"))
189
+ (terminal _PN_LOCAL_2 "168s.2" (opt _PN_LOCAL_4))
190
+ (terminal PLX "169s" (alt PERCENT PN_LOCAL_ESC))
191
+ (terminal PERCENT "170s" (seq "%" HEX HEX))
192
+ (terminal _HEX_1 "171s.1" (range "0-9"))
193
+ (terminal _HEX_3 "171s.3" (range "a-f"))
194
+ (terminal _HEX_2 "171s.2" (range "A-F"))
195
+ (terminal HEX "171s" (alt _HEX_1 _HEX_2 _HEX_3))
196
+ (terminal PN_LOCAL_ESC "172s" (seq "\\" _PN_LOCAL_ESC_1))
197
+ (terminal _PN_LOCAL_ESC_1 "172s.1"
198
+ (alt "_" "~" "." "-" "!" "$" "&" "'" "(" ")" "*" "+" "," ";" "=" "/" "?" "#"
199
+ "@" "%" )) )
data/etc/turtle.sxp CHANGED
@@ -1,101 +1,103 @@
1
- (
2
- (rule turtleDoc "1" (star statement))
3
- (rule statement "2" (alt directive (seq triples ".")))
4
- (rule directive "3" (alt prefixID base sparqlPrefix sparqlBase))
5
- (rule prefixID "4" (seq "@prefix" PNAME_NS IRIREF "."))
6
- (rule base "5" (seq "@base" IRIREF "."))
7
- (rule triples "6"
8
- (alt
9
- (seq subject predicateObjectList)
10
- (seq blankNodePropertyList (opt predicateObjectList))) )
11
- (rule predicateObjectList "7"
12
- (seq verb objectList (star (seq ";" (opt (seq verb objectList))))))
13
- (rule objectList "8" (seq object (star (seq "," object))))
14
- (rule verb "9" (alt predicate "a"))
15
- (rule subject "10" (alt iri BlankNode collection))
16
- (rule predicate "11" (seq iri))
17
- (rule object "12" (alt iri BlankNode collection blankNodePropertyList literal))
18
- (rule literal "13" (alt RDFLiteral NumericLiteral BooleanLiteral))
19
- (rule blankNodePropertyList "14" (seq "[" predicateObjectList "]"))
20
- (rule collection "15" (seq "(" (star object) ")"))
21
- (rule NumericLiteral "16" (alt INTEGER DECIMAL DOUBLE))
22
- (rule String "17"
23
- (alt STRING_LITERAL_QUOTE STRING_LITERAL_SINGLE_QUOTE
24
- STRING_LITERAL_LONG_SINGLE_QUOTE STRING_LITERAL_LONG_QUOTE ))
25
- (terminal IRIREF "18" (seq "<" (range "^#x00-#x20<>\"{}|^`] | UCHAR)* '>'")))
26
- (terminal INTEGER "19" (seq (opt (range "+-")) (plus (range "0-9"))))
27
- (terminal DECIMAL "20"
28
- (seq (opt (range "+-")) (seq (star (range "0-9")) "." (plus (range "0-9")))))
29
- (terminal DOUBLE "21"
30
- (seq
31
- (opt (range "+-"))
32
- (alt
33
- (seq (plus (range "0-9")) "." (star (range "0-9")) EXPONENT)
34
- (seq "." (plus (range "0-9")) EXPONENT)
35
- (seq (plus (range "0-9")) EXPONENT)) ))
36
- (terminal STRING_LITERAL_QUOTE "22"
37
- (seq "\"" (star (alt (range "^#x22#x5C#xA#xD") ECHAR UCHAR)) "\""))
38
- (terminal STRING_LITERAL_SINGLE_QUOTE "23"
39
- (seq "'" (star (alt (range "^#x27#x5C#xA#xD") ECHAR UCHAR)) "'"))
40
- (terminal STRING_LITERAL_LONG_SINGLE_QUOTE "24"
41
- (seq "'''" (seq (opt (alt "'" "''")) (range "^'] | ECHAR | UCHAR ))* \"'''\""))))
42
- (terminal STRING_LITERAL_LONG_QUOTE "25"
43
- (seq "\"\"\"" (seq (opt (alt "\"" "\"\"")) (range "^\"] | ECHAR | UCHAR ))* '\"\"\"'"))))
44
- (terminal UCHAR "26"
45
- (alt (seq "u" HEX HEX HEX HEX) (seq "U" HEX HEX HEX HEX HEX HEX HEX HEX)))
46
- (rule sparqlPrefix "28s" (seq SPARQL_PREFIX PNAME_NS IRIREF))
47
- (terminal SPARQL_PREFIX "28t"
48
- (seq (range "Pp") (range "Rr") (range "Ee") (range "Ff") (range "Ii") (range "Xx")))
49
- (terminal SPARQL_BASE "29t" (seq (range "Bb") (range "Aa") (range "Ss") (range "Ee")))
50
- (rule sparqlBase "29s" (seq SPARQL_BASE IRIREF))
51
- (rule RDFLiteral "128s" (seq String (opt (alt LANGTAG (seq "^^" iri)))))
52
- (rule BooleanLiteral "133s" (alt "true" "false"))
53
- (rule iri "135s" (alt IRIREF PrefixedName))
54
- (rule PrefixedName "136s" (alt PNAME_LN PNAME_NS))
55
- (rule BlankNode "137s" (alt BLANK_NODE_LABEL ANON))
56
- (terminal PNAME_NS "139s" (seq (opt PN_PREFIX) ":"))
57
- (terminal PNAME_LN "140s" (seq PNAME_NS PN_LOCAL))
58
- (terminal BLANK_NODE_LABEL "141s"
59
- (seq "_:" (alt PN_CHARS_U (range "0-9")) (opt (seq (star (alt PN_CHARS ".")) PN_CHARS))))
60
- (terminal LANGTAG "144s"
61
- (seq "@" (plus (range "a-zA-Z")) (star (seq "-" (plus (range "a-zA-Z0-9"))))))
62
- (terminal EXPONENT "154s" (seq (range "eE") (opt (range "+-")) (plus (range "0-9"))))
63
- (terminal ECHAR "159s" (seq "\\" (range "tbnrf\"'")))
64
- (terminal WS "161s" (alt (hex "#x20") (hex "#x9") (hex "#xD") (hex "#xA")))
65
- (terminal ANON "162s" (seq "[" (star WS) "]"))
66
- (terminal PN_CHARS_BASE "163s"
67
- (alt
68
- (range "A-Z")
69
- (range "a-z")
70
- (range "#x00C0-#x00D6")
71
- (range "#x00D8-#x00F6")
72
- (range "#x00F8-#x02FF")
73
- (range "#x0370-#x037D")
74
- (range "#x037F-#x1FFF")
75
- (range "#x200C-#x200D")
76
- (range "#x2070-#x218F")
77
- (range "#x2C00-#x2FEF")
78
- (range "#x3001-#xD7FF")
79
- (range "#xF900-#xFDCF")
80
- (range "#xFDF0-#xFFFD")
81
- (range "#x10000-#xEFFFF")) )
82
- (terminal PN_CHARS_U "164s" (alt PN_CHARS_BASE "_"))
83
- (terminal PN_CHARS "166s"
84
- (alt PN_CHARS_U "-"
85
- (range "0-9")
86
- (hex "#x00B7")
87
- (range "#x0300-#x036F")
88
- (range "#x203F-#x2040")) )
89
- (terminal PN_PREFIX "167s"
90
- (seq PN_CHARS_BASE (opt (seq (star (alt PN_CHARS ".")) PN_CHARS))))
91
- (terminal PN_LOCAL "168s"
92
- (seq
93
- (alt PN_CHARS_U ":" (range "0-9") PLX)
94
- (opt (seq (star (alt PN_CHARS "." ":" PLX)) (alt PN_CHARS ":" PLX)))) )
95
- (terminal PLX "169s" (alt PERCENT PN_LOCAL_ESC))
96
- (terminal PERCENT "170s" (seq "%" HEX HEX))
97
- (terminal HEX "171s" (alt (range "0-9") (range "A-F") (range "a-f")))
98
- (terminal PN_LOCAL_ESC "172s"
99
- (seq "\\"
100
- (alt "_" "~" "." "-" "!" "$" "&" "'" "(" ")" "*" "+" "," ";" "=" "/" "?" "#"
101
- "@" "%" )) ))
1
+ (
2
+ (rule turtleDoc "1" (star statement))
3
+ (rule statement "2" (alt directive (seq triples ".")))
4
+ (rule directive "3" (alt prefixID base sparqlPrefix sparqlBase))
5
+ (rule prefixID "4" (seq "@prefix" PNAME_NS IRIREF "."))
6
+ (rule base "5" (seq "@base" IRIREF "."))
7
+ (rule sparqlPrefix "28s" (seq SPARQL_PREFIX PNAME_NS IRIREF))
8
+ (rule sparqlBase "29s" (seq SPARQL_BASE IRIREF))
9
+ (rule triples "6"
10
+ (alt
11
+ (seq subject predicateObjectList)
12
+ (seq blankNodePropertyList (opt predicateObjectList))) )
13
+ (rule predicateObjectList "7"
14
+ (seq verb objectList (star (seq ";" (opt (seq verb objectList))))))
15
+ (rule objectList "8" (seq object (star (seq "," object))))
16
+ (rule verb "9" (alt predicate "a"))
17
+ (rule subject "10" (alt iri BlankNode collection))
18
+ (rule predicate "11" (seq iri))
19
+ (rule object "12" (alt iri BlankNode collection blankNodePropertyList literal))
20
+ (rule literal "13" (alt RDFLiteral NumericLiteral BooleanLiteral))
21
+ (rule blankNodePropertyList "14" (seq "[" predicateObjectList "]"))
22
+ (rule collection "15" (seq "(" (star object) ")"))
23
+ (rule NumericLiteral "16" (alt INTEGER DECIMAL DOUBLE))
24
+ (rule RDFLiteral "128s" (seq String (opt (alt LANGTAG (seq "^^" iri)))))
25
+ (rule BooleanLiteral "133s" (alt "true" "false"))
26
+ (rule String "17"
27
+ (alt STRING_LITERAL_QUOTE STRING_LITERAL_SINGLE_QUOTE
28
+ STRING_LITERAL_LONG_SINGLE_QUOTE STRING_LITERAL_LONG_QUOTE ))
29
+ (rule iri "135s" (alt IRIREF PrefixedName))
30
+ (rule PrefixedName "136s" (alt PNAME_LN PNAME_NS))
31
+ (rule BlankNode "137s" (alt BLANK_NODE_LABEL ANON))
32
+ (terminals _terminals (seq))
33
+ (terminal IRIREF "18"
34
+ (seq "<" (star (alt (diff (range "^<>\"{}|^`\\") (range "#x00-#x20")) UCHAR)) ">"))
35
+ (terminal PNAME_NS "139s" (seq (opt PN_PREFIX) ":"))
36
+ (terminal PNAME_LN "140s" (seq PNAME_NS PN_LOCAL))
37
+ (terminal BLANK_NODE_LABEL "141s"
38
+ (seq "_:" (alt PN_CHARS_U (range "0-9")) (opt (seq (star (alt PN_CHARS ".")) PN_CHARS))))
39
+ (terminal LANGTAG "144s"
40
+ (seq "@" (plus (range "a-zA-Z")) (star (seq "-" (plus (range "a-zA-Z0-9"))))))
41
+ (terminal INTEGER "19" (seq (opt (range "+-")) (plus (range "0-9"))))
42
+ (terminal DECIMAL "20"
43
+ (seq (opt (range "+-")) (seq (star (range "0-9")) "." (plus (range "0-9")))))
44
+ (terminal DOUBLE "21"
45
+ (seq
46
+ (opt (range "+-"))
47
+ (alt
48
+ (seq (plus (range "0-9")) "." (star (range "0-9")) EXPONENT)
49
+ (seq "." (plus (range "0-9")) EXPONENT)
50
+ (seq (plus (range "0-9")) EXPONENT)) ))
51
+ (terminal EXPONENT "154s" (seq (range "eE") (opt (range "+-")) (plus (range "0-9"))))
52
+ (terminal STRING_LITERAL_QUOTE "22"
53
+ (seq "\"" (star (alt (range "^#x22#x5C#xA#xD") ECHAR UCHAR)) "\""))
54
+ (terminal STRING_LITERAL_SINGLE_QUOTE "23"
55
+ (seq "'" (star (alt (range "^#x27#x5C#xA#xD") ECHAR UCHAR)) "'"))
56
+ (terminal STRING_LITERAL_LONG_SINGLE_QUOTE "24"
57
+ (seq "'''" (star (seq (opt (alt "'" "''")) (alt (range "^'\\") ECHAR UCHAR))) "'''"))
58
+ (terminal STRING_LITERAL_LONG_QUOTE "25"
59
+ (seq "\"\"\"" (star (seq (opt (alt "\"" "\"\"")) (alt (range "^\"\\") ECHAR UCHAR))) "\"\"\""))
60
+ (terminal UCHAR "26"
61
+ (alt (seq "\\u" HEX HEX HEX HEX) (seq "\\U" HEX HEX HEX HEX HEX HEX HEX HEX)))
62
+ (terminal ECHAR "159s" (seq "\\" (range "tbnrf\\\"'")))
63
+ (terminal SPARQL_PREFIX "28t"
64
+ (seq (range "Pp") (range "Rr") (range "Ee") (range "Ff") (range "Ii") (range "Xx")))
65
+ (terminal SPARQL_BASE "29t" (seq (range "Bb") (range "Aa") (range "Ss") (range "Ee")))
66
+ (terminal WS "161s" (alt (hex "#x20") (hex "#x9") (hex "#xD") (hex "#xA")))
67
+ (terminal ANON "162s" (seq "[" (star WS) "]"))
68
+ (terminal PN_CHARS_BASE "163s"
69
+ (alt
70
+ (range "A-Z")
71
+ (range "a-z")
72
+ (range "#x00C0-#x00D6")
73
+ (range "#x00D8-#x00F6")
74
+ (range "#x00F8-#x02FF")
75
+ (range "#x0370-#x037D")
76
+ (range "#x037F-#x1FFF")
77
+ (range "#x200C-#x200D")
78
+ (range "#x2070-#x218F")
79
+ (range "#x2C00-#x2FEF")
80
+ (range "#x3001-#xD7FF")
81
+ (range "#xF900-#xFDCF")
82
+ (range "#xFDF0-#xFFFD")
83
+ (range "#x10000-#xEFFFF")) )
84
+ (terminal PN_CHARS_U "164s" (alt PN_CHARS_BASE "_"))
85
+ (terminal PN_CHARS "166s"
86
+ (alt PN_CHARS_U "-"
87
+ (range "0-9")
88
+ (hex "#x00B7")
89
+ (range "#x0300-#x036F")
90
+ (range "#x203F-#x2040")) )
91
+ (terminal PN_PREFIX "167s"
92
+ (seq PN_CHARS_BASE (opt (seq (star (alt PN_CHARS ".")) PN_CHARS))))
93
+ (terminal PN_LOCAL "168s"
94
+ (seq
95
+ (alt PN_CHARS_U ":" (range "0-9") PLX)
96
+ (opt (seq (star (alt PN_CHARS "." ":" PLX)) (alt PN_CHARS ":" PLX)))) )
97
+ (terminal PLX "169s" (alt PERCENT PN_LOCAL_ESC))
98
+ (terminal PERCENT "170s" (seq "%" HEX HEX))
99
+ (terminal HEX "171s" (range "0-9A-Fa-f"))
100
+ (terminal PN_LOCAL_ESC "172s"
101
+ (seq "\\"
102
+ (alt "_" "~" "." "-" "!" "$" "&" "'" "(" ")" "*" "+" "," ";" "=" "/" "?" "#"
103
+ "@" "%" )) ))