ebnf 2.3.5 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/VERSION +1 -1
- data/etc/abnf.sxp +1 -1
- data/etc/ebnf.html +13 -13
- data/etc/ebnf.ll1.rb +1 -1
- data/etc/ebnf.ll1.sxp +94 -94
- data/etc/ebnf.peg.rb +1 -1
- data/etc/ebnf.peg.sxp +29 -29
- data/etc/ebnf.sxp +18 -18
- data/etc/iso-ebnf.sxp +27 -27
- data/etc/sparql.sxp +195 -195
- data/etc/turtle.ebnf +70 -67
- data/etc/turtle.html +56 -106
- data/etc/turtle.peg.sxp +182 -191
- data/etc/turtle.sxp +64 -70
- data/lib/ebnf/abnf.rb +3 -3
- data/lib/ebnf/base.rb +1 -1
- data/lib/ebnf/isoebnf.rb +1 -1
- data/lib/ebnf/native.rb +3 -2
- data/lib/ebnf/parser.rb +4 -2
- data/lib/ebnf/rule.rb +1 -2
- data/lib/ebnf/unescape.rb +1 -1
- data/lib/ebnf/writer.rb +9 -7
- data/lib/ebnf.rb +2 -0
- metadata +16 -23
- data/etc/sparql.html +0 -1425
- data/etc/sparql.ll1.sxp +0 -7372
- data/etc/sparql.peg.rb +0 -532
- data/etc/sparql.peg.sxp +0 -597
- data/etc/turtle.ll1.rb +0 -1482
- data/etc/turtle.ll1.sxp +0 -425
- data/etc/turtle.peg.rb +0 -182
data/etc/ebnf.peg.sxp
CHANGED
@@ -1,54 +1,54 @@
|
|
1
1
|
(
|
2
2
|
(rule ebnf "1" (star _ebnf_1))
|
3
3
|
(rule _ebnf_1 "1.1" (alt declaration rule))
|
4
|
-
(rule declaration "2" (alt
|
4
|
+
(rule declaration "2" (alt '@terminals' pass))
|
5
5
|
(rule rule "3" (seq LHS expression))
|
6
6
|
(rule expression "4" (seq alt))
|
7
7
|
(rule alt "5" (seq seq _alt_1))
|
8
8
|
(rule _alt_1 "5.1" (star _alt_2))
|
9
|
-
(rule _alt_2 "5.2" (seq
|
9
|
+
(rule _alt_2 "5.2" (seq '|' seq))
|
10
10
|
(rule seq "6" (plus diff))
|
11
11
|
(rule diff "7" (seq postfix _diff_1))
|
12
12
|
(rule _diff_1 "7.1" (opt _diff_2))
|
13
|
-
(rule _diff_2 "7.2" (seq
|
13
|
+
(rule _diff_2 "7.2" (seq '-' postfix))
|
14
14
|
(rule postfix "8" (seq primary _postfix_1))
|
15
15
|
(rule _postfix_1 "8.1" (opt POSTFIX))
|
16
16
|
(rule primary "9" (alt HEX SYMBOL O_RANGE RANGE STRING1 STRING2 _primary_1))
|
17
|
-
(rule _primary_1 "9.1" (seq
|
18
|
-
(rule pass "10" (seq
|
17
|
+
(rule _primary_1 "9.1" (seq '(' expression ')'))
|
18
|
+
(rule pass "10" (seq '@pass' expression))
|
19
19
|
(terminals _terminals (seq))
|
20
|
-
(terminal LHS "11" (seq _LHS_1 SYMBOL _LHS_2
|
20
|
+
(terminal LHS "11" (seq _LHS_1 SYMBOL _LHS_2 '::='))
|
21
21
|
(terminal _LHS_1 "11.1" (opt _LHS_3))
|
22
|
-
(terminal _LHS_3 "11.3" (seq
|
23
|
-
(terminal _LHS_4 "11.4" (plus
|
24
|
-
(terminal _LHS_2 "11.2" (star
|
22
|
+
(terminal _LHS_3 "11.3" (seq '[' SYMBOL ']' _LHS_4))
|
23
|
+
(terminal _LHS_4 "11.4" (plus ' '))
|
24
|
+
(terminal _LHS_2 "11.2" (star ' '))
|
25
25
|
(terminal SYMBOL "12" (plus _SYMBOL_1))
|
26
|
-
(terminal _SYMBOL_1 "12.1" (alt _SYMBOL_2 _SYMBOL_3 _SYMBOL_4
|
26
|
+
(terminal _SYMBOL_1 "12.1" (alt _SYMBOL_2 _SYMBOL_3 _SYMBOL_4 '_' '.'))
|
27
27
|
(terminal _SYMBOL_2 "12.2" (range "a-z"))
|
28
28
|
(terminal _SYMBOL_3 "12.3" (range "A-Z"))
|
29
29
|
(terminal _SYMBOL_4 "12.4" (range "0-9"))
|
30
|
-
(terminal HEX "13" (seq
|
30
|
+
(terminal HEX "13" (seq '#x' _HEX_1))
|
31
31
|
(terminal _HEX_1 "13.1" (plus _HEX_2))
|
32
32
|
(terminal _HEX_2 "13.2" (alt _HEX_3 _HEX_4 _HEX_5))
|
33
33
|
(terminal _HEX_3 "13.3" (range "a-f"))
|
34
34
|
(terminal _HEX_4 "13.4" (range "A-F"))
|
35
35
|
(terminal _HEX_5 "13.5" (range "0-9"))
|
36
|
-
(terminal RANGE "14" (seq
|
36
|
+
(terminal RANGE "14" (seq '[' _RANGE_1 _RANGE_2 _RANGE_3))
|
37
37
|
(terminal _RANGE_1 "14.1" (plus _RANGE_4))
|
38
38
|
(terminal _RANGE_4 "14.4" (alt _RANGE_5 _RANGE_6 R_CHAR HEX))
|
39
|
-
(terminal _RANGE_5 "14.5" (seq R_CHAR
|
40
|
-
(terminal _RANGE_6 "14.6" (seq HEX
|
41
|
-
(terminal _RANGE_2 "14.2" (opt
|
42
|
-
(terminal _RANGE_3 "14.3" (diff
|
43
|
-
(terminal O_RANGE "15" (seq
|
39
|
+
(terminal _RANGE_5 "14.5" (seq R_CHAR '-' R_CHAR))
|
40
|
+
(terminal _RANGE_6 "14.6" (seq HEX '-' HEX))
|
41
|
+
(terminal _RANGE_2 "14.2" (opt '-'))
|
42
|
+
(terminal _RANGE_3 "14.3" (diff ']' LHS))
|
43
|
+
(terminal O_RANGE "15" (seq '[^' _O_RANGE_1 _O_RANGE_2 ']'))
|
44
44
|
(terminal _O_RANGE_1 "15.1" (plus _O_RANGE_3))
|
45
45
|
(terminal _O_RANGE_3 "15.3" (alt _O_RANGE_4 _O_RANGE_5 R_CHAR HEX))
|
46
|
-
(terminal _O_RANGE_4 "15.4" (seq R_CHAR
|
47
|
-
(terminal _O_RANGE_5 "15.5" (seq HEX
|
48
|
-
(terminal _O_RANGE_2 "15.2" (opt
|
49
|
-
(terminal STRING1 "16" (seq "
|
46
|
+
(terminal _O_RANGE_4 "15.4" (seq R_CHAR '-' R_CHAR))
|
47
|
+
(terminal _O_RANGE_5 "15.5" (seq HEX '-' HEX))
|
48
|
+
(terminal _O_RANGE_2 "15.2" (opt '-'))
|
49
|
+
(terminal STRING1 "16" (seq '"' _STRING1_1 '"'))
|
50
50
|
(terminal _STRING1_1 "16.1" (star _STRING1_2))
|
51
|
-
(terminal _STRING1_2 "16.2" (diff CHAR "
|
51
|
+
(terminal _STRING1_2 "16.2" (diff CHAR '"'))
|
52
52
|
(terminal STRING2 "17" (seq "'" _STRING2_1 "'"))
|
53
53
|
(terminal _STRING2_1 "17.1" (star _STRING2_2))
|
54
54
|
(terminal _STRING2_2 "17.2" (diff CHAR "'"))
|
@@ -58,27 +58,27 @@
|
|
58
58
|
(terminal _CHAR_3 "18.3" (range "#xE000-#xFFFD"))
|
59
59
|
(terminal _CHAR_4 "18.4" (range "#x10000-#x10FFFF"))
|
60
60
|
(terminal R_CHAR "19" (diff CHAR _R_CHAR_1))
|
61
|
-
(terminal _R_CHAR_1 "19.1" (alt
|
61
|
+
(terminal _R_CHAR_1 "19.1" (alt ']' '-' HEX))
|
62
62
|
(terminal POSTFIX "20" (range "?*+"))
|
63
63
|
(terminal PASS "21" (alt _PASS_1 _PASS_2 _PASS_3 _PASS_4))
|
64
64
|
(terminal _PASS_1 "21.1" (range "#x9#xA#xD#x20"))
|
65
65
|
(terminal _PASS_2 "21.2" (seq _PASS_5 _PASS_6))
|
66
|
-
(terminal _PASS_5 "21.5" (alt _PASS_7
|
67
|
-
(terminal _PASS_7 "21.7" (diff
|
66
|
+
(terminal _PASS_5 "21.5" (alt _PASS_7 '//'))
|
67
|
+
(terminal _PASS_7 "21.7" (diff '#' '#x'))
|
68
68
|
(terminal _PASS_6 "21.6" (star _PASS_8))
|
69
69
|
(terminal _PASS_8 "21.8" (range "^#xA#xD"))
|
70
|
-
(terminal _PASS_3 "21.3" (seq
|
70
|
+
(terminal _PASS_3 "21.3" (seq '/*' _PASS_9 '*/'))
|
71
71
|
(terminal _PASS_9 "21.9" (star _PASS_10))
|
72
72
|
(terminal _PASS_10 "21.10" (alt _PASS_11 _PASS_12))
|
73
73
|
(terminal _PASS_11 "21.11" (opt _PASS_13))
|
74
|
-
(terminal _PASS_13 "21.13" (seq
|
74
|
+
(terminal _PASS_13 "21.13" (seq '*' _PASS_14))
|
75
75
|
(terminal _PASS_14 "21.14" (range "^/"))
|
76
76
|
(terminal _PASS_12 "21.12" (range "^*"))
|
77
|
-
(terminal _PASS_4 "21.4" (seq
|
77
|
+
(terminal _PASS_4 "21.4" (seq '(*' _PASS_15 '*)'))
|
78
78
|
(terminal _PASS_15 "21.15" (star _PASS_16))
|
79
79
|
(terminal _PASS_16 "21.16" (alt _PASS_17 _PASS_18))
|
80
80
|
(terminal _PASS_17 "21.17" (opt _PASS_19))
|
81
|
-
(terminal _PASS_19 "21.19" (seq
|
81
|
+
(terminal _PASS_19 "21.19" (seq '*' _PASS_20))
|
82
82
|
(terminal _PASS_20 "21.20" (range "^)"))
|
83
83
|
(terminal _PASS_18 "21.18" (range "^*"))
|
84
84
|
(pass _pass (seq PASS)))
|
data/etc/ebnf.sxp
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
(
|
2
2
|
(rule ebnf "1" (star (alt declaration rule)))
|
3
|
-
(rule declaration "2" (alt
|
3
|
+
(rule declaration "2" (alt '@terminals' pass))
|
4
4
|
(rule rule "3" (seq LHS expression))
|
5
5
|
(rule expression "4" (seq alt))
|
6
|
-
(rule alt "5" (seq seq (star (seq
|
6
|
+
(rule alt "5" (seq seq (star (seq '|' seq))))
|
7
7
|
(rule seq "6" (plus diff))
|
8
|
-
(rule diff "7" (seq postfix (opt (seq
|
8
|
+
(rule diff "7" (seq postfix (opt (seq '-' postfix))))
|
9
9
|
(rule postfix "8" (seq primary (opt POSTFIX)))
|
10
10
|
(rule primary "9"
|
11
|
-
(alt HEX SYMBOL O_RANGE RANGE STRING1 STRING2 (seq
|
12
|
-
(rule pass "10" (seq
|
11
|
+
(alt HEX SYMBOL O_RANGE RANGE STRING1 STRING2 (seq '(' expression ')')))
|
12
|
+
(rule pass "10" (seq '@pass' expression))
|
13
13
|
(terminals _terminals (seq))
|
14
|
-
(terminal LHS "11" (seq (opt (seq
|
15
|
-
(terminal SYMBOL "12" (plus (alt (range "a-z") (range "A-Z") (range "0-9")
|
16
|
-
(terminal HEX "13" (seq
|
14
|
+
(terminal LHS "11" (seq (opt (seq '[' SYMBOL ']' (plus ' '))) SYMBOL (star ' ') '::='))
|
15
|
+
(terminal SYMBOL "12" (plus (alt (range "a-z") (range "A-Z") (range "0-9") '_' '.')))
|
16
|
+
(terminal HEX "13" (seq '#x' (plus (alt (range "a-f") (range "A-F") (range "0-9")))))
|
17
17
|
(terminal RANGE "14"
|
18
|
-
(seq
|
19
|
-
(plus (alt (seq R_CHAR
|
20
|
-
(opt
|
21
|
-
(diff
|
18
|
+
(seq '['
|
19
|
+
(plus (alt (seq R_CHAR '-' R_CHAR) (seq HEX '-' HEX) R_CHAR HEX))
|
20
|
+
(opt '-')
|
21
|
+
(diff ']' LHS)) )
|
22
22
|
(terminal O_RANGE "15"
|
23
|
-
(seq
|
24
|
-
(terminal STRING1 "16" (seq "
|
23
|
+
(seq '[^' (plus (alt (seq R_CHAR '-' R_CHAR) (seq HEX '-' HEX) R_CHAR HEX)) (opt '-') ']'))
|
24
|
+
(terminal STRING1 "16" (seq '"' (star (diff CHAR '"')) '"'))
|
25
25
|
(terminal STRING2 "17" (seq "'" (star (diff CHAR "'")) "'"))
|
26
26
|
(terminal CHAR "18"
|
27
27
|
(alt
|
@@ -29,12 +29,12 @@
|
|
29
29
|
(range "#x20-#xD7FF")
|
30
30
|
(range "#xE000-#xFFFD")
|
31
31
|
(range "#x10000-#x10FFFF")) )
|
32
|
-
(terminal R_CHAR "19" (diff CHAR (alt
|
32
|
+
(terminal R_CHAR "19" (diff CHAR (alt ']' '-' HEX)))
|
33
33
|
(terminal POSTFIX "20" (range "?*+"))
|
34
34
|
(terminal PASS "21"
|
35
35
|
(alt
|
36
36
|
(range "#x9#xA#xD#x20")
|
37
|
-
(seq (alt (diff
|
38
|
-
(seq
|
39
|
-
(seq
|
37
|
+
(seq (alt (diff '#' '#x') '//') (star (range "^#xA#xD")))
|
38
|
+
(seq '/*' (star (alt (opt (seq '*' (range "^/"))) (range "^*"))) '*/')
|
39
|
+
(seq '(*' (star (alt (opt (seq '*' (range "^)"))) (range "^*"))) '*)')) )
|
40
40
|
(pass _pass (seq PASS)))
|
data/etc/iso-ebnf.sxp
CHANGED
@@ -4,10 +4,10 @@
|
|
4
4
|
(seq meta_identifier defining_symbol definitions_list terminator_symbol))
|
5
5
|
(rule definitions_list
|
6
6
|
(seq single_definition (star (seq definition_separator_symbol definitions_list))))
|
7
|
-
(rule single_definition (seq term (star (seq
|
8
|
-
(rule term (seq factor (opt (seq
|
7
|
+
(rule single_definition (seq term (star (seq ',' term))))
|
8
|
+
(rule term (seq factor (opt (seq '-' exception))))
|
9
9
|
(rule exception (seq factor))
|
10
|
-
(rule factor (seq (opt (seq integer
|
10
|
+
(rule factor (seq (opt (seq integer '*')) primary))
|
11
11
|
(rule primary
|
12
12
|
(alt optional_sequence repeated_sequence special_sequence grouped_sequence
|
13
13
|
meta_identifier terminal_string empty ))
|
@@ -15,25 +15,25 @@
|
|
15
15
|
(seq start_option_symbol definitions_list end_option_symbol))
|
16
16
|
(rule repeated_sequence
|
17
17
|
(seq start_repeat_symbol definitions_list end_repeat_symbol))
|
18
|
-
(rule grouped_sequence (seq
|
18
|
+
(rule grouped_sequence (seq '(' definitions_list ')'))
|
19
19
|
(terminals _terminals (seq))
|
20
20
|
(terminal terminal_string
|
21
21
|
(alt
|
22
22
|
(seq "'" (plus first_terminal_character) "'")
|
23
|
-
(seq "
|
23
|
+
(seq '"' (plus second_terminal_character) '"')) )
|
24
24
|
(terminal meta_identifier (seq letter (star meta_identifier_character)))
|
25
25
|
(terminal integer (plus decimal_digit))
|
26
|
-
(terminal special_sequence (seq
|
26
|
+
(terminal special_sequence (seq '?' (star special_sequence_character) '?'))
|
27
27
|
(terminal comment (seq start_comment_symbol (star comment_symbol) end_comment_symbol))
|
28
28
|
(terminal comment_symbol (alt comment commentless_symbol other_character))
|
29
29
|
(terminal commentless_symbol
|
30
30
|
(alt terminal_character meta_identifier integer terminal_string special_sequence))
|
31
31
|
(terminal letter (range "a-zA-Z"))
|
32
32
|
(terminal decimal_digit (range "0-9"))
|
33
|
-
(terminal meta_identifier_character (alt letter decimal_digit
|
33
|
+
(terminal meta_identifier_character (alt letter decimal_digit '_'))
|
34
34
|
(terminal first_terminal_character (diff terminal_character "'"))
|
35
|
-
(terminal second_terminal_character (diff terminal_character "
|
36
|
-
(terminal special_sequence_character (diff terminal_character
|
35
|
+
(terminal second_terminal_character (diff terminal_character '"'))
|
36
|
+
(terminal special_sequence_character (diff terminal_character '?'))
|
37
37
|
(terminal terminal_character
|
38
38
|
(alt letter decimal_digit concatenate_symbol defining_symbol
|
39
39
|
definition_separator_symbol end_comment_symbol end_group_symbol
|
@@ -41,25 +41,25 @@
|
|
41
41
|
repetition_symbol second_quote_symbol special_sequence_symbol
|
42
42
|
start_comment_symbol start_group_symbol start_option_symbol
|
43
43
|
start_repeat_symbol terminator_symbol other_character ))
|
44
|
-
(terminal other_character (alt (range ":+_%@&$<>^` ̃#x20#x23")
|
44
|
+
(terminal other_character (alt (range ":+_%@&$<>^` ̃#x20#x23") '\\'))
|
45
45
|
(terminal gap_separator (range "#x9#xa#xb#xc#xd#x20"))
|
46
46
|
(pass _pass (alt (plus gap_separator) comment))
|
47
|
-
(terminal empty (seq
|
48
|
-
(terminal concatenate_symbol (seq
|
49
|
-
(terminal repetition_symbol (seq
|
50
|
-
(terminal except_symbol (seq
|
47
|
+
(terminal empty (seq ''))
|
48
|
+
(terminal concatenate_symbol (seq ','))
|
49
|
+
(terminal repetition_symbol (seq '*'))
|
50
|
+
(terminal except_symbol (seq '-'))
|
51
51
|
(terminal first_quote_symbol (seq "'"))
|
52
|
-
(terminal second_quote_symbol (seq "
|
53
|
-
(terminal start_comment_symbol (seq
|
54
|
-
(terminal end_comment_symbol (seq
|
55
|
-
(terminal start_group_symbol (seq
|
56
|
-
(terminal end_group_symbol (seq
|
57
|
-
(terminal special_sequence_symbol (seq
|
58
|
-
(terminal defining_symbol (alt
|
59
|
-
(terminal definition_separator_symbol (alt
|
60
|
-
(terminal terminator_symbol (alt
|
61
|
-
(terminal start_option_symbol (seq
|
62
|
-
(terminal end_option_symbol (seq
|
63
|
-
(terminal start_repeat_symbol (alt
|
64
|
-
(terminal end_repeat_symbol (alt
|
52
|
+
(terminal second_quote_symbol (seq '"'))
|
53
|
+
(terminal start_comment_symbol (seq '(*'))
|
54
|
+
(terminal end_comment_symbol (seq '*)'))
|
55
|
+
(terminal start_group_symbol (seq '('))
|
56
|
+
(terminal end_group_symbol (seq ')'))
|
57
|
+
(terminal special_sequence_symbol (seq '?'))
|
58
|
+
(terminal defining_symbol (alt '=' ':'))
|
59
|
+
(terminal definition_separator_symbol (alt '|' '/' '!'))
|
60
|
+
(terminal terminator_symbol (alt ';' '.'))
|
61
|
+
(terminal start_option_symbol (seq '['))
|
62
|
+
(terminal end_option_symbol (seq ']'))
|
63
|
+
(terminal start_repeat_symbol (alt '{' '(:'))
|
64
|
+
(terminal end_repeat_symbol (alt '}' ':)'))
|
65
65
|
(terminal gap_free_symbol (alt (diff terminal_character (range "'\"")) terminal_string)))
|