ebnf 0.3.5 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/bin/ebnf +2 -1
- data/etc/ebnf.ebnf +19 -19
- data/etc/ebnf.html +214 -0
- data/etc/ebnf.ll1.sxp +57 -58
- data/etc/ebnf.rb +0 -76
- data/etc/ebnf.sxp +18 -19
- data/lib/ebnf/base.rb +7 -0
- data/lib/ebnf/ll1/scanner.rb +17 -1
- data/lib/ebnf/parser.rb +10 -7
- data/lib/ebnf/rule.rb +5 -2
- data/lib/ebnf/writer.rb +120 -23
- metadata +56 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ff1ded5e44c9136111320f969eaa0825f216155
|
4
|
+
data.tar.gz: f6150889a8250eaecba0123f5589eeb9b0b59959
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60b7be1a7d0aa55e7ce5af2f4569277d78a99741e3d474aeb6957dc5b5bd6983b6a1eec9dba3472e99706fc16f4d1ae1b32eecf9bccfd48739e285198401eb5c
|
7
|
+
data.tar.gz: 68bf7ea88a84cb418e6656e19bee3761ee214c0b0a68a586c557077e7867b4b86af9a55ff9534a52e8f2dfd32aadf9f4dc684e2ef1383038a7ee07f51761dc65
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.6
|
data/bin/ebnf
CHANGED
@@ -48,7 +48,7 @@ OPT_ARGS = [
|
|
48
48
|
["--bnf", GetoptLong::NO_ARGUMENT, "Transform EBNF to BNF"],
|
49
49
|
["--evaluate","-e", GetoptLong::REQUIRED_ARGUMENT,"Evaluate argument as a JSON-LD document"],
|
50
50
|
["--ll1", GetoptLong::REQUIRED_ARGUMENT,"Generate First/Follow rules, argument is start symbol"],
|
51
|
-
["--format", "-f", GetoptLong::REQUIRED_ARGUMENT,"Specify output format one of ebnf, ttl, sxp, or rb"],
|
51
|
+
["--format", "-f", GetoptLong::REQUIRED_ARGUMENT,"Specify output format one of ebnf, html, ttl, sxp, or rb"],
|
52
52
|
["--input-format", GetoptLong::REQUIRED_ARGUMENT,"Specify input format one of ebnf or sxp"],
|
53
53
|
["--mod-name", GetoptLong::REQUIRED_ARGUMENT,"Module name used when creating ruby tables"],
|
54
54
|
["--output", "-o", GetoptLong::REQUIRED_ARGUMENT,"Output to the specified file path"],
|
@@ -105,6 +105,7 @@ ebnf.first_follow(options[:ll1]) if options[:ll1]
|
|
105
105
|
|
106
106
|
res = case options[:output_format]
|
107
107
|
when :ebnf then ebnf.to_s
|
108
|
+
when :html then ebnf.to_html
|
108
109
|
when :sxp then ebnf.to_sxp
|
109
110
|
when :ttl then ebnf.to_ttl(options[:prefix], options[:namespace])
|
110
111
|
when :rb then dump_tables(ARGV[0], ebnf, out, options)
|
data/etc/ebnf.ebnf
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
[3] rule ::= LHS expression
|
7
7
|
|
8
8
|
# Use a terminal to match the identifier, rule name and assignment due to
|
9
|
-
# confusion between the identifier
|
9
|
+
# confusion between the identifier RANGE
|
10
10
|
|
11
11
|
[4] expression ::= alt
|
12
12
|
|
@@ -21,9 +21,7 @@
|
|
21
21
|
[9] primary ::= HEX
|
22
22
|
| SYMBOL
|
23
23
|
| RANGE
|
24
|
-
| ENUM
|
25
24
|
| O_RANGE
|
26
|
-
| O_ENUM
|
27
25
|
| STRING1
|
28
26
|
| STRING2
|
29
27
|
| '(' expression ')'
|
@@ -32,36 +30,38 @@
|
|
32
30
|
|
33
31
|
@terminals
|
34
32
|
|
35
|
-
[11] LHS ::=
|
33
|
+
[11] LHS ::= ('[' SYMBOL+ ']')? SYMBOL "::="
|
36
34
|
|
37
35
|
[12] SYMBOL ::= ([a-z] | [A-Z] | [0-9] | "_" | ".")+
|
38
36
|
|
39
|
-
[13] HEX ::= '#x' ([0-9]|[a-f]|[A-F])
|
37
|
+
[13] HEX ::= '#x' ([0-9]|[a-f]|[A-F])+
|
40
38
|
|
41
|
-
|
39
|
+
# Range is any combination of R_CHAR '-' R_CHAR or R_CHAR+
|
40
|
+
[14] RANGE ::= '[' ((R_BEGIN (HEX | R_CHAR)) | (HEX | R_CHAR))+ ']'
|
42
41
|
|
43
|
-
|
42
|
+
# Range is any combination of R_CHAR '-' R_CHAR or R_CHAR+ preceded by ^
|
43
|
+
[15] O_RANGE ::= '[^' ((R_BEGIN (HEX | R_CHAR)) | (HEX | R_CHAR))+ ']'
|
44
44
|
|
45
|
-
|
45
|
+
# Strings are unescaped Unicode, excepting control characters and hash (#)
|
46
|
+
[16] STRING1 ::= '"' (CHAR - '"')* '"'
|
46
47
|
|
47
|
-
[17]
|
48
|
+
[17] STRING2 ::= "'" (CHAR - "'"))* "'"
|
48
49
|
|
49
|
-
[18]
|
50
|
+
[18] CHAR ::= HEX
|
51
|
+
| [#x20#x21#x22]
|
52
|
+
| [#x24-#x00FFFFFF]
|
50
53
|
|
51
|
-
[19]
|
54
|
+
[19] R_CHAR ::= CHAR - ']'
|
52
55
|
|
53
|
-
[20]
|
54
|
-
| ('\\' [\\trn"'])
|
55
|
-
| [^\t\r\n]
|
56
|
-
|
57
|
-
[21] R_CHAR ::= CHAR - "]"
|
56
|
+
[20] R_BEGIN ::= (HEX | R_CHAR) "-"
|
58
57
|
|
59
58
|
# Should be able to do this inline, but not until terminal regular expressions are created automatically
|
60
|
-
[
|
59
|
+
[21] POSTFIX ::= [?*+]
|
61
60
|
|
62
|
-
[
|
63
|
-
| ( '#' | '//' ) [
|
61
|
+
[22] PASS ::= ( [#x00-#x20]
|
62
|
+
| ( '#' | '//' ) [^#x0A#x0D]*
|
64
63
|
| '/*' (( '*' [^/] )? | [^*] )* '*/'
|
64
|
+
| '(*' (( '*' [^)] )? | [^*] )* '*)'
|
65
65
|
)+
|
66
66
|
|
67
67
|
# Should be able to do this inline, but not until terminal regular expressions are created automatically
|
data/etc/ebnf.html
ADDED
@@ -0,0 +1,214 @@
|
|
1
|
+
<table class='grammar'>
|
2
|
+
<tbody id='grammar-productions'>
|
3
|
+
<tr id='grammar-production-ebnf'>
|
4
|
+
<td>[1]</td>
|
5
|
+
<td><code>ebnf</code></td>
|
6
|
+
<td>::=</td>
|
7
|
+
<td>
|
8
|
+
(<a href="#grammar-production-declaration">declaration</a> <code>|</code> <a href="#grammar-production-rule">rule</a>)<code>*</code>
|
9
|
+
</td>
|
10
|
+
</tr>
|
11
|
+
<tr id='grammar-production-declaration'>
|
12
|
+
<td>[2]</td>
|
13
|
+
<td><code>declaration</code></td>
|
14
|
+
<td>::=</td>
|
15
|
+
<td>
|
16
|
+
"<code class="grammar-literal">@terminals</code>"
|
17
|
+
<code>|</code> <a href="#grammar-production-pass">pass</a>
|
18
|
+
</td>
|
19
|
+
</tr>
|
20
|
+
<tr id='grammar-production-rule'>
|
21
|
+
<td>[3]</td>
|
22
|
+
<td><code>rule</code></td>
|
23
|
+
<td>::=</td>
|
24
|
+
<td>
|
25
|
+
<a href="#grammar-production-LHS">LHS</a>
|
26
|
+
<a href="#grammar-production-expression">expression</a>
|
27
|
+
</td>
|
28
|
+
</tr>
|
29
|
+
<tr id='grammar-production-expression'>
|
30
|
+
<td>[4]</td>
|
31
|
+
<td><code>expression</code></td>
|
32
|
+
<td>::=</td>
|
33
|
+
<td>
|
34
|
+
<a href="#grammar-production-alt">alt</a>
|
35
|
+
</td>
|
36
|
+
</tr>
|
37
|
+
<tr id='grammar-production-alt'>
|
38
|
+
<td>[5]</td>
|
39
|
+
<td><code>alt</code></td>
|
40
|
+
<td>::=</td>
|
41
|
+
<td>
|
42
|
+
<a href="#grammar-production-seq">seq</a>
|
43
|
+
("<code class="grammar-literal">|</code>" <a href="#grammar-production-seq">seq</a>)<code>*</code>
|
44
|
+
</td>
|
45
|
+
</tr>
|
46
|
+
<tr id='grammar-production-seq'>
|
47
|
+
<td>[6]</td>
|
48
|
+
<td><code>seq</code></td>
|
49
|
+
<td>::=</td>
|
50
|
+
<td>
|
51
|
+
<a href="#grammar-production-diff">diff</a><code>+</code>
|
52
|
+
</td>
|
53
|
+
</tr>
|
54
|
+
<tr id='grammar-production-diff'>
|
55
|
+
<td>[7]</td>
|
56
|
+
<td><code>diff</code></td>
|
57
|
+
<td>::=</td>
|
58
|
+
<td>
|
59
|
+
<a href="#grammar-production-postfix">postfix</a>
|
60
|
+
("<code class="grammar-literal">-</code>" <a href="#grammar-production-postfix">postfix</a>)<code>?</code>
|
61
|
+
</td>
|
62
|
+
</tr>
|
63
|
+
<tr id='grammar-production-postfix'>
|
64
|
+
<td>[8]</td>
|
65
|
+
<td><code>postfix</code></td>
|
66
|
+
<td>::=</td>
|
67
|
+
<td>
|
68
|
+
<a href="#grammar-production-primary">primary</a>
|
69
|
+
<a href="#grammar-production-POSTFIX">POSTFIX</a><code>?</code>
|
70
|
+
</td>
|
71
|
+
</tr>
|
72
|
+
<tr id='grammar-production-primary'>
|
73
|
+
<td>[9]</td>
|
74
|
+
<td><code>primary</code></td>
|
75
|
+
<td>::=</td>
|
76
|
+
<td>
|
77
|
+
<a href="#grammar-production-HEX">HEX</a>
|
78
|
+
<code>|</code> <a href="#grammar-production-SYMBOL">SYMBOL</a>
|
79
|
+
<code>|</code> <a href="#grammar-production-RANGE">RANGE</a>
|
80
|
+
<code>|</code> <a href="#grammar-production-O_RANGE">O_RANGE</a>
|
81
|
+
<code>|</code> <a href="#grammar-production-STRING1">STRING1</a>
|
82
|
+
<code>|</code> <a href="#grammar-production-STRING2">STRING2</a>
|
83
|
+
<code>|</code> "<code class="grammar-literal">(</code>" <a href="#grammar-production-expression">expression</a> "<code class="grammar-literal">)</code>"
|
84
|
+
</td>
|
85
|
+
</tr>
|
86
|
+
<tr id='grammar-production-pass'>
|
87
|
+
<td>[10]</td>
|
88
|
+
<td><code>pass</code></td>
|
89
|
+
<td>::=</td>
|
90
|
+
<td>
|
91
|
+
"<code class="grammar-literal">@pass</code>"
|
92
|
+
<a href="#grammar-production-expression">expression</a>
|
93
|
+
</td>
|
94
|
+
</tr>
|
95
|
+
<tr id='grammar-production-LHS'>
|
96
|
+
<td>[11]</td>
|
97
|
+
<td><code>LHS</code></td>
|
98
|
+
<td>::=</td>
|
99
|
+
<td>
|
100
|
+
("<code class="grammar-literal">[</code>" <a href="#grammar-production-SYMBOL">SYMBOL</a><code>+</code> "<code class="grammar-literal">]</code>")<code>?</code>
|
101
|
+
<a href="#grammar-production-SYMBOL">SYMBOL</a>
|
102
|
+
"<code class="grammar-literal">::=</code>"
|
103
|
+
</td>
|
104
|
+
</tr>
|
105
|
+
<tr id='grammar-production-SYMBOL'>
|
106
|
+
<td>[12]</td>
|
107
|
+
<td><code>SYMBOL</code></td>
|
108
|
+
<td>::=</td>
|
109
|
+
<td>
|
110
|
+
(<code>[</code> <code class="grammar-literal">a-z</code><code>]</code> <code>|</code> <code>[</code> <code class="grammar-literal">A-Z</code><code>]</code> <code>|</code> <code>[</code> <code class="grammar-literal">0-9</code><code>]</code> <code>|</code> "<code class="grammar-literal">_</code>" <code>|</code> "<code class="grammar-literal">.</code>")<code>+</code>
|
111
|
+
</td>
|
112
|
+
</tr>
|
113
|
+
<tr id='grammar-production-HEX'>
|
114
|
+
<td>[13]</td>
|
115
|
+
<td><code>HEX</code></td>
|
116
|
+
<td>::=</td>
|
117
|
+
<td>
|
118
|
+
"<code class="grammar-literal">#x</code>"
|
119
|
+
(<code>[</code> <code class="grammar-literal">0-9</code><code>]</code> <code>|</code> <code>[</code> <code class="grammar-literal">a-f</code><code>]</code> <code>|</code> <code>[</code> <code class="grammar-literal">A-F</code><code>]</code> )<code>+</code>
|
120
|
+
</td>
|
121
|
+
</tr>
|
122
|
+
<tr id='grammar-production-RANGE'>
|
123
|
+
<td>[14]</td>
|
124
|
+
<td><code>RANGE</code></td>
|
125
|
+
<td>::=</td>
|
126
|
+
<td>
|
127
|
+
"<code class="grammar-literal">[</code>"
|
128
|
+
(<a href="#grammar-production-R_BEGIN">R_BEGIN</a> <code>(</code> <a href="#grammar-production-HEX">HEX</a> <code>|</code> <a href="#grammar-production-R_CHAR">R_CHAR</a><code>)</code> <code>|</code> <a href="#grammar-production-HEX">HEX</a> <code>|</code> <a href="#grammar-production-R_CHAR">R_CHAR</a>)<code>+</code>
|
129
|
+
"<code class="grammar-literal">]</code>"
|
130
|
+
</td>
|
131
|
+
</tr>
|
132
|
+
<tr id='grammar-production-O_RANGE'>
|
133
|
+
<td>[15]</td>
|
134
|
+
<td><code>O_RANGE</code></td>
|
135
|
+
<td>::=</td>
|
136
|
+
<td>
|
137
|
+
"<code class="grammar-literal">[^</code>"
|
138
|
+
(<a href="#grammar-production-R_BEGIN">R_BEGIN</a> <code>(</code> <a href="#grammar-production-HEX">HEX</a> <code>|</code> <a href="#grammar-production-R_CHAR">R_CHAR</a><code>)</code> <code>|</code> <a href="#grammar-production-HEX">HEX</a> <code>|</code> <a href="#grammar-production-R_CHAR">R_CHAR</a>)<code>+</code>
|
139
|
+
"<code class="grammar-literal">]</code>"
|
140
|
+
</td>
|
141
|
+
</tr>
|
142
|
+
<tr id='grammar-production-STRING1'>
|
143
|
+
<td>[16]</td>
|
144
|
+
<td><code>STRING1</code></td>
|
145
|
+
<td>::=</td>
|
146
|
+
<td>
|
147
|
+
'<code class="grammar-literal">"</code>'
|
148
|
+
(<a href="#grammar-production-CHAR">CHAR</a> <code>-</code> '<code class="grammar-literal">"</code>')<code>*</code>
|
149
|
+
'<code class="grammar-literal">"</code>'
|
150
|
+
</td>
|
151
|
+
</tr>
|
152
|
+
<tr id='grammar-production-STRING2'>
|
153
|
+
<td>[17]</td>
|
154
|
+
<td><code>STRING2</code></td>
|
155
|
+
<td>::=</td>
|
156
|
+
<td>
|
157
|
+
"<code class="grammar-literal">'</code>"
|
158
|
+
<code>(</code> <a href="#grammar-production-CHAR">CHAR</a> <code>-</code> "<code class="grammar-literal">'</code>"<code>)</code>
|
159
|
+
</td>
|
160
|
+
</tr>
|
161
|
+
<tr id='grammar-production-CHAR'>
|
162
|
+
<td>[18]</td>
|
163
|
+
<td><code>CHAR</code></td>
|
164
|
+
<td>::=</td>
|
165
|
+
<td>
|
166
|
+
<a href="#grammar-production-HEX">HEX</a>
|
167
|
+
<code>|</code> <code>[</code> <code class="grammar-char-escape">#x20</code><code class="grammar-char-escape">#x21</code><code class="grammar-char-escape">#x22</code><code>]</code>
|
168
|
+
<code>|</code> <code>[</code> <code class="grammar-char-escape">#x24</code><code class="grammar-literal">-</code><code class="grammar-char-escape">#x00FFFFFF</code><code>]</code>
|
169
|
+
</td>
|
170
|
+
</tr>
|
171
|
+
<tr id='grammar-production-R_CHAR'>
|
172
|
+
<td>[19]</td>
|
173
|
+
<td><code>R_CHAR</code></td>
|
174
|
+
<td>::=</td>
|
175
|
+
<td>
|
176
|
+
<a href="#grammar-production-CHAR">CHAR</a>
|
177
|
+
<code>-</code> "<code class="grammar-literal">]</code>"
|
178
|
+
</td>
|
179
|
+
</tr>
|
180
|
+
<tr id='grammar-production-R_BEGIN'>
|
181
|
+
<td>[20]</td>
|
182
|
+
<td><code>R_BEGIN</code></td>
|
183
|
+
<td>::=</td>
|
184
|
+
<td>
|
185
|
+
<code>(</code> <a href="#grammar-production-HEX">HEX</a> <code>|</code> <a href="#grammar-production-R_CHAR">R_CHAR</a><code>)</code>
|
186
|
+
"<code class="grammar-literal">-</code>"
|
187
|
+
</td>
|
188
|
+
</tr>
|
189
|
+
<tr id='grammar-production-POSTFIX'>
|
190
|
+
<td>[21]</td>
|
191
|
+
<td><code>POSTFIX</code></td>
|
192
|
+
<td>::=</td>
|
193
|
+
<td>
|
194
|
+
<code>[</code> <code class="grammar-literal">?*+</code><code>]</code>
|
195
|
+
</td>
|
196
|
+
</tr>
|
197
|
+
<tr id='grammar-production-PASS'>
|
198
|
+
<td>[22]</td>
|
199
|
+
<td><code>PASS</code></td>
|
200
|
+
<td>::=</td>
|
201
|
+
<td>
|
202
|
+
(<code>[</code> <code class="grammar-char-escape">#x00</code><code class="grammar-literal">-</code><code class="grammar-char-escape">#x20</code><code>]</code> <code>|</code> <code>(</code> "<code class="grammar-literal">#</code>" <code>|</code> "<code class="grammar-literal">//</code>"<code>)</code> (<code>[</code> <code class="grammar-literal">^</code><code class="grammar-char-escape">#x0A</code><code class="grammar-char-escape">#x0D</code><code>]</code> )<code>*</code> <code>|</code> "<code class="grammar-literal">/*</code>" ("<code class="grammar-literal">*</code>" <code>[</code> <code class="grammar-literal">^/</code><code>]</code> )<code>?</code> <code>|</code> <code>[</code> <code class="grammar-literal">^*</code><code>]</code> <code>*</code> "<code class="grammar-literal">*/</code>" <code>|</code> "<code class="grammar-literal">(*</code>" ("<code class="grammar-literal">*</code>" <code>[</code> <code class="grammar-literal">^)</code><code>]</code> )<code>?</code> <code>|</code> <code>[</code> <code class="grammar-literal">^*</code><code>]</code> <code>*</code> "<code class="grammar-literal">*)</code>")<code>+</code>
|
203
|
+
</td>
|
204
|
+
</tr>
|
205
|
+
<tr id='grammar-production-'>
|
206
|
+
<td colspan='3'>
|
207
|
+
<code>@pass</code>
|
208
|
+
</td>
|
209
|
+
<td>
|
210
|
+
<a href="#grammar-production-PASS">PASS</a>
|
211
|
+
</td>
|
212
|
+
</tr>
|
213
|
+
</tbody>
|
214
|
+
</table>
|
data/etc/ebnf.ll1.sxp
CHANGED
@@ -18,15 +18,15 @@
|
|
18
18
|
(alt "@terminals" pass))
|
19
19
|
(rule rule "3" (first LHS) (follow "@pass" "@terminals" LHS _eof) (seq LHS expression))
|
20
20
|
(rule _rule_1 "3.1"
|
21
|
-
(first "("
|
21
|
+
(first "(" HEX O_RANGE RANGE STRING1 STRING2 SYMBOL)
|
22
22
|
(follow "@pass" "@terminals" LHS _eof)
|
23
23
|
(seq expression))
|
24
24
|
(rule expression "4"
|
25
|
-
(first "("
|
25
|
+
(first "(" HEX O_RANGE RANGE STRING1 STRING2 SYMBOL)
|
26
26
|
(follow ")" "@pass" "@terminals" LHS _eof)
|
27
27
|
(seq alt))
|
28
28
|
(rule alt "5"
|
29
|
-
(first "("
|
29
|
+
(first "(" HEX O_RANGE RANGE STRING1 STRING2 SYMBOL)
|
30
30
|
(follow ")" "@pass" "@terminals" LHS _eof)
|
31
31
|
(seq seq _alt_1))
|
32
32
|
(rule _alt_1 "5.1"
|
@@ -50,115 +50,114 @@
|
|
50
50
|
(follow ")" "@pass" "@terminals" LHS _eof)
|
51
51
|
(seq _alt_1))
|
52
52
|
(rule _alt_6 "5.6"
|
53
|
-
(first "("
|
53
|
+
(first "(" HEX O_RANGE RANGE STRING1 STRING2 SYMBOL)
|
54
54
|
(follow ")" "@pass" "@terminals" LHS _eof "|")
|
55
55
|
(seq seq))
|
56
56
|
(rule seq "6"
|
57
|
-
(first "("
|
57
|
+
(first "(" HEX O_RANGE RANGE STRING1 STRING2 SYMBOL)
|
58
58
|
(follow ")" "@pass" "@terminals" LHS _eof "|")
|
59
59
|
(seq diff _seq_1))
|
60
60
|
(rule _seq_1 "6.1"
|
61
|
-
(first "("
|
61
|
+
(first "(" HEX O_RANGE RANGE STRING1 STRING2 SYMBOL _eps)
|
62
62
|
(follow ")" "@pass" "@terminals" LHS _eof "|")
|
63
63
|
(alt _empty _seq_2))
|
64
64
|
(rule _seq_2 "6.2"
|
65
|
-
(first "("
|
65
|
+
(first "(" HEX O_RANGE RANGE STRING1 STRING2 SYMBOL)
|
66
66
|
(follow ")" "@pass" "@terminals" LHS _eof "|")
|
67
67
|
(seq diff _seq_1))
|
68
68
|
(rule _seq_3 "6.3"
|
69
|
-
(first "("
|
69
|
+
(first "(" HEX O_RANGE RANGE STRING1 STRING2 SYMBOL _eps)
|
70
70
|
(follow ")" "@pass" "@terminals" LHS _eof "|")
|
71
71
|
(seq _seq_1))
|
72
72
|
(rule _seq_4 "6.4"
|
73
|
-
(first "("
|
73
|
+
(first "(" HEX O_RANGE RANGE STRING1 STRING2 SYMBOL _eps)
|
74
74
|
(follow ")" "@pass" "@terminals" LHS _eof "|")
|
75
75
|
(seq _seq_1))
|
76
76
|
(rule diff "7"
|
77
|
-
(first "("
|
78
|
-
(follow "(" ")" "@pass" "@terminals"
|
79
|
-
|
77
|
+
(first "(" HEX O_RANGE RANGE STRING1 STRING2 SYMBOL)
|
78
|
+
(follow "(" ")" "@pass" "@terminals" HEX LHS O_RANGE RANGE STRING1 STRING2
|
79
|
+
SYMBOL _eof "|" )
|
80
80
|
(seq postfix _diff_1))
|
81
81
|
(rule _diff_1 "7.1"
|
82
82
|
(first "-" _eps)
|
83
|
-
(follow "(" ")" "@pass" "@terminals"
|
84
|
-
|
83
|
+
(follow "(" ")" "@pass" "@terminals" HEX LHS O_RANGE RANGE STRING1 STRING2
|
84
|
+
SYMBOL _eof "|" )
|
85
85
|
(alt _empty _diff_2))
|
86
86
|
(rule _diff_2 "7.2"
|
87
87
|
(first "-")
|
88
|
-
(follow "(" ")" "@pass" "@terminals"
|
89
|
-
|
88
|
+
(follow "(" ")" "@pass" "@terminals" HEX LHS O_RANGE RANGE STRING1 STRING2
|
89
|
+
SYMBOL _eof "|" )
|
90
90
|
(seq "-" postfix))
|
91
91
|
(rule _diff_3 "7.3"
|
92
92
|
(first "-" _eps)
|
93
|
-
(follow "(" ")" "@pass" "@terminals"
|
94
|
-
|
93
|
+
(follow "(" ")" "@pass" "@terminals" HEX LHS O_RANGE RANGE STRING1 STRING2
|
94
|
+
SYMBOL _eof "|" )
|
95
95
|
(seq _diff_1))
|
96
96
|
(rule _diff_4 "7.4"
|
97
|
-
(first "("
|
98
|
-
(follow "(" ")" "@pass" "@terminals"
|
99
|
-
|
97
|
+
(first "(" HEX O_RANGE RANGE STRING1 STRING2 SYMBOL)
|
98
|
+
(follow "(" ")" "@pass" "@terminals" HEX LHS O_RANGE RANGE STRING1 STRING2
|
99
|
+
SYMBOL _eof "|" )
|
100
100
|
(seq postfix))
|
101
101
|
(rule postfix "8"
|
102
|
-
(first "("
|
103
|
-
(follow "(" ")" "-" "@pass" "@terminals"
|
104
|
-
|
102
|
+
(first "(" HEX O_RANGE RANGE STRING1 STRING2 SYMBOL)
|
103
|
+
(follow "(" ")" "-" "@pass" "@terminals" HEX LHS O_RANGE RANGE STRING1
|
104
|
+
STRING2 SYMBOL _eof "|" )
|
105
105
|
(seq primary _postfix_1))
|
106
106
|
(rule _postfix_1 "8.1"
|
107
107
|
(first POSTFIX _eps)
|
108
|
-
(follow "(" ")" "-" "@pass" "@terminals"
|
109
|
-
|
108
|
+
(follow "(" ")" "-" "@pass" "@terminals" HEX LHS O_RANGE RANGE STRING1
|
109
|
+
STRING2 SYMBOL _eof "|" )
|
110
110
|
(alt _empty POSTFIX))
|
111
111
|
(rule _postfix_2 "8.2"
|
112
112
|
(first POSTFIX _eps)
|
113
|
-
(follow "(" ")" "-" "@pass" "@terminals"
|
114
|
-
|
113
|
+
(follow "(" ")" "-" "@pass" "@terminals" HEX LHS O_RANGE RANGE STRING1
|
114
|
+
STRING2 SYMBOL _eof "|" )
|
115
115
|
(seq _postfix_1))
|
116
116
|
(rule primary "9"
|
117
|
-
(first "("
|
118
|
-
(follow "(" ")" "-" "@pass" "@terminals"
|
119
|
-
|
120
|
-
(alt HEX SYMBOL RANGE
|
117
|
+
(first "(" HEX O_RANGE RANGE STRING1 STRING2 SYMBOL)
|
118
|
+
(follow "(" ")" "-" "@pass" "@terminals" HEX LHS O_RANGE POSTFIX RANGE
|
119
|
+
STRING1 STRING2 SYMBOL _eof "|" )
|
120
|
+
(alt HEX SYMBOL RANGE O_RANGE STRING1 STRING2 _primary_1))
|
121
121
|
(rule _primary_1 "9.1"
|
122
122
|
(first "(")
|
123
|
-
(follow "(" ")" "-" "@pass" "@terminals"
|
124
|
-
|
123
|
+
(follow "(" ")" "-" "@pass" "@terminals" HEX LHS O_RANGE POSTFIX RANGE
|
124
|
+
STRING1 STRING2 SYMBOL _eof "|" )
|
125
125
|
(seq "(" expression ")"))
|
126
126
|
(rule _primary_2 "9.2"
|
127
|
-
(first "("
|
128
|
-
(follow "(" ")" "-" "@pass" "@terminals"
|
129
|
-
|
127
|
+
(first "(" HEX O_RANGE RANGE STRING1 STRING2 SYMBOL)
|
128
|
+
(follow "(" ")" "-" "@pass" "@terminals" HEX LHS O_RANGE POSTFIX RANGE
|
129
|
+
STRING1 STRING2 SYMBOL _eof "|" )
|
130
130
|
(seq expression ")"))
|
131
131
|
(rule _primary_3 "9.3"
|
132
132
|
(first ")")
|
133
|
-
(follow "(" ")" "-" "@pass" "@terminals"
|
134
|
-
|
133
|
+
(follow "(" ")" "-" "@pass" "@terminals" HEX LHS O_RANGE POSTFIX RANGE
|
134
|
+
STRING1 STRING2 SYMBOL _eof "|" )
|
135
135
|
(seq ")"))
|
136
136
|
(rule pass "10"
|
137
137
|
(first "@pass")
|
138
138
|
(follow "@pass" "@terminals" LHS _eof)
|
139
139
|
(seq "@pass" expression))
|
140
140
|
(rule _pass_1 "10.1"
|
141
|
-
(first "("
|
141
|
+
(first "(" HEX O_RANGE RANGE STRING1 STRING2 SYMBOL)
|
142
142
|
(follow "@pass" "@terminals" LHS _eof)
|
143
143
|
(seq expression))
|
144
|
-
(terminal LHS "11" (seq (opt
|
144
|
+
(terminal LHS "11" (seq (opt (seq "[" (plus SYMBOL) "]")) SYMBOL "::="))
|
145
145
|
(terminal SYMBOL "12" (plus (alt (range "a-z") (range "A-Z") (range "0-9") "_" ".")))
|
146
|
-
(terminal HEX "13"
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
(terminal
|
152
|
-
(terminal
|
153
|
-
(terminal
|
154
|
-
(terminal
|
155
|
-
(terminal
|
156
|
-
(terminal
|
157
|
-
(terminal
|
158
|
-
(terminal POSTFIX "22" (range "?*+"))
|
159
|
-
(terminal PASS "23"
|
146
|
+
(terminal HEX "13" (seq "#x" (plus (alt (range "0-9") (range "a-f") (range "A-F")))))
|
147
|
+
(terminal RANGE "14"
|
148
|
+
(seq "[" (plus (alt (seq R_BEGIN (alt HEX R_CHAR)) (alt HEX R_CHAR))) "]"))
|
149
|
+
(terminal O_RANGE "15"
|
150
|
+
(seq "[^" (plus (alt (seq R_BEGIN (alt HEX R_CHAR)) (alt HEX R_CHAR))) "]"))
|
151
|
+
(terminal STRING1 "16" (seq "\"" (star (diff CHAR "\"")) "\""))
|
152
|
+
(terminal STRING2 "17" (seq "'" (diff CHAR "'")))
|
153
|
+
(terminal CHAR "18" (alt HEX (range "#x20#x21#x22") (range "#x24-#x00FFFFFF")))
|
154
|
+
(terminal R_CHAR "19" (diff CHAR "]"))
|
155
|
+
(terminal R_BEGIN "20" (seq (alt HEX R_CHAR) "-"))
|
156
|
+
(terminal POSTFIX "21" (range "?*+"))
|
157
|
+
(terminal PASS "22"
|
160
158
|
(plus
|
161
159
|
(alt
|
162
|
-
(range "#x20
|
163
|
-
(seq (alt "#" "//") (star (range "
|
164
|
-
(seq "/*" (star (alt (opt (seq "*" (range "^/"))) (range "^*"))) "*/")
|
160
|
+
(range "#x00-#x20")
|
161
|
+
(seq (alt "#" "//") (star (range "^#x0A#x0D")))
|
162
|
+
(seq "/*" (star (alt (opt (seq "*" (range "^/"))) (range "^*"))) "*/")
|
163
|
+
(seq "(*" (star (alt (opt (seq "*" (range "^)"))) (range "^*"))) "*)")) )) )
|