ebnf 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f38cc65305f0cd2ab9e08efb54451ac8d30cb13
4
- data.tar.gz: 946ef35ebd63d45eb33b2b7d3ad01d6c2f6847a4
3
+ metadata.gz: 6ff1ded5e44c9136111320f969eaa0825f216155
4
+ data.tar.gz: f6150889a8250eaecba0123f5589eeb9b0b59959
5
5
  SHA512:
6
- metadata.gz: b50668809f1938d4bd6776162fcca12bc839321a7da9579e14f20ab07d6f8c69753d75771bdfdfd701fa83e86bc5704229c8ee2f90ccbe4000d07bb7a12a2d97
7
- data.tar.gz: 28c2d558b9aaad3395ccfe946f10e746cd9c5e793a76ed195f52d259fd53c452bb464208d255025a84ed59c6bdcf3cc45929a7a8c1b81f55f05c36a94310cd39
6
+ metadata.gz: 60b7be1a7d0aa55e7ce5af2f4569277d78a99741e3d474aeb6957dc5b5bd6983b6a1eec9dba3472e99706fc16f4d1ae1b32eecf9bccfd48739e285198401eb5c
7
+ data.tar.gz: 68bf7ea88a84cb418e6656e19bee3761ee214c0b0a68a586c557077e7867b4b86af9a55ff9534a52e8f2dfd32aadf9f4dc684e2ef1383038a7ee07f51761dc65
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.5
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)
@@ -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 ENUM
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 ::= ENUM? SYMBOL "::="
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]) ([0-9]|[a-f]|[A-F])
37
+ [13] HEX ::= '#x' ([0-9]|[a-f]|[A-F])+
40
38
 
41
- [14] RANGE ::= '[' R_CHAR '-' R_CHAR ']'
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
- [15] ENUM ::= '[' R_CHAR+ ']'
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
- [16] O_RANGE ::= '[^' R_CHAR '-' R_CHAR ']'
45
+ # Strings are unescaped Unicode, excepting control characters and hash (#)
46
+ [16] STRING1 ::= '"' (CHAR - '"')* '"'
46
47
 
47
- [17] O_ENUM ::= '[^' R_CHAR+ ']'
48
+ [17] STRING2 ::= "'" (CHAR - "'"))* "'"
48
49
 
49
- [18] STRING1 ::= '"' ((CHAR - '"') | "\t")* '"'
50
+ [18] CHAR ::= HEX
51
+ | [#x20#x21#x22]
52
+ | [#x24-#x00FFFFFF]
50
53
 
51
- [19] STRING2 ::= "'" ((CHAR - "'") | "\t")* "'"
54
+ [19] R_CHAR ::= CHAR - ']'
52
55
 
53
- [20] CHAR ::= HEX
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
- [22] POSTFIX ::= [?*+]
59
+ [21] POSTFIX ::= [?*+]
61
60
 
62
- [23] PASS ::= ( [#x20\t\r\n]
63
- | ( '#' | '//' ) [^\r\n]*
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
@@ -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>
@@ -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 "(" ENUM HEX O_ENUM O_RANGE RANGE STRING1 STRING2 SYMBOL)
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 "(" ENUM HEX O_ENUM O_RANGE RANGE STRING1 STRING2 SYMBOL)
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 "(" ENUM HEX O_ENUM O_RANGE RANGE STRING1 STRING2 SYMBOL)
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 "(" ENUM HEX O_ENUM O_RANGE RANGE STRING1 STRING2 SYMBOL)
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 "(" ENUM HEX O_ENUM O_RANGE RANGE STRING1 STRING2 SYMBOL)
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 "(" ENUM HEX O_ENUM O_RANGE RANGE STRING1 STRING2 SYMBOL _eps)
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 "(" ENUM HEX O_ENUM O_RANGE RANGE STRING1 STRING2 SYMBOL)
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 "(" ENUM HEX O_ENUM O_RANGE RANGE STRING1 STRING2 SYMBOL _eps)
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 "(" ENUM HEX O_ENUM O_RANGE RANGE STRING1 STRING2 SYMBOL _eps)
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 "(" ENUM HEX O_ENUM O_RANGE RANGE STRING1 STRING2 SYMBOL)
78
- (follow "(" ")" "@pass" "@terminals" ENUM HEX LHS O_ENUM O_RANGE RANGE
79
- STRING1 STRING2 SYMBOL _eof "|" )
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" ENUM HEX LHS O_ENUM O_RANGE RANGE
84
- STRING1 STRING2 SYMBOL _eof "|" )
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" ENUM HEX LHS O_ENUM O_RANGE RANGE
89
- STRING1 STRING2 SYMBOL _eof "|" )
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" ENUM HEX LHS O_ENUM O_RANGE RANGE
94
- STRING1 STRING2 SYMBOL _eof "|" )
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 "(" ENUM HEX O_ENUM O_RANGE RANGE STRING1 STRING2 SYMBOL)
98
- (follow "(" ")" "@pass" "@terminals" ENUM HEX LHS O_ENUM O_RANGE RANGE
99
- STRING1 STRING2 SYMBOL _eof "|" )
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 "(" ENUM HEX O_ENUM O_RANGE RANGE STRING1 STRING2 SYMBOL)
103
- (follow "(" ")" "-" "@pass" "@terminals" ENUM HEX LHS O_ENUM O_RANGE RANGE
104
- STRING1 STRING2 SYMBOL _eof "|" )
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" ENUM HEX LHS O_ENUM O_RANGE RANGE
109
- STRING1 STRING2 SYMBOL _eof "|" )
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" ENUM HEX LHS O_ENUM O_RANGE RANGE
114
- STRING1 STRING2 SYMBOL _eof "|" )
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 "(" ENUM HEX O_ENUM O_RANGE RANGE STRING1 STRING2 SYMBOL)
118
- (follow "(" ")" "-" "@pass" "@terminals" ENUM HEX LHS O_ENUM O_RANGE POSTFIX
119
- RANGE STRING1 STRING2 SYMBOL _eof "|" )
120
- (alt HEX SYMBOL RANGE ENUM O_RANGE O_ENUM STRING1 STRING2 _primary_1))
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" ENUM HEX LHS O_ENUM O_RANGE POSTFIX
124
- RANGE STRING1 STRING2 SYMBOL _eof "|" )
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 "(" ENUM HEX O_ENUM O_RANGE RANGE STRING1 STRING2 SYMBOL)
128
- (follow "(" ")" "-" "@pass" "@terminals" ENUM HEX LHS O_ENUM O_RANGE POSTFIX
129
- RANGE STRING1 STRING2 SYMBOL _eof "|" )
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" ENUM HEX LHS O_ENUM O_RANGE POSTFIX
134
- RANGE STRING1 STRING2 SYMBOL _eof "|" )
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 "(" ENUM HEX O_ENUM O_RANGE RANGE STRING1 STRING2 SYMBOL)
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 ENUM) SYMBOL "::="))
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
- (seq "#x"
148
- (alt (range "0-9") (range "a-f") (range "A-F"))
149
- (alt (range "0-9") (range "a-f") (range "A-F"))) )
150
- (terminal RANGE "14" (seq "[" R_CHAR "-" R_CHAR "]"))
151
- (terminal ENUM "15" (seq "[" (plus R_CHAR) "]"))
152
- (terminal O_RANGE "16" (seq "[^" R_CHAR "-" R_CHAR "]"))
153
- (terminal O_ENUM "17" (seq "[^" (plus R_CHAR) "]"))
154
- (terminal STRING1 "18" (seq "\"" (star (alt (diff CHAR "\"") "\t")) "\""))
155
- (terminal STRING2 "19" (seq "'" (star (alt (diff CHAR "'") "\t")) "'"))
156
- (terminal CHAR "20" (alt HEX (seq "\\" (range "\\trn\"'")) (range "^\t\r\n")))
157
- (terminal R_CHAR "21" (diff CHAR "]"))
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\t\r\n")
163
- (seq (alt "#" "//") (star (range "^\r\n")))
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 "^*"))) "*)")) )) )