ebnf 2.0.0 → 2.1.0
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/README.md +81 -36
- data/VERSION +1 -1
- data/bin/ebnf +34 -18
- data/etc/abnf-core.ebnf +52 -0
- data/etc/abnf.abnf +121 -0
- data/etc/abnf.ebnf +124 -0
- data/etc/abnf.sxp +45 -0
- data/etc/ebnf.ebnf +19 -25
- data/etc/ebnf.html +251 -206
- data/etc/ebnf.ll1.rb +27 -103
- data/etc/ebnf.ll1.sxp +105 -102
- data/etc/ebnf.peg.rb +54 -62
- data/etc/ebnf.peg.sxp +53 -62
- data/etc/ebnf.sxp +22 -19
- data/etc/iso-ebnf.ebnf +140 -0
- data/etc/iso-ebnf.isoebnf +138 -0
- data/etc/iso-ebnf.sxp +65 -0
- data/etc/sparql.ebnf +4 -4
- data/etc/sparql.sxp +8 -7
- data/etc/turtle.ebnf +3 -3
- data/etc/turtle.sxp +22 -20
- data/lib/ebnf.rb +3 -0
- data/lib/ebnf/abnf.rb +301 -0
- data/lib/ebnf/abnf/core.rb +23 -0
- data/lib/ebnf/abnf/meta.rb +111 -0
- data/lib/ebnf/base.rb +87 -44
- data/lib/ebnf/ebnf/meta.rb +90 -0
- data/lib/ebnf/isoebnf.rb +229 -0
- data/lib/ebnf/isoebnf/meta.rb +75 -0
- data/lib/ebnf/ll1.rb +4 -7
- data/lib/ebnf/ll1/parser.rb +12 -4
- data/lib/ebnf/native.rb +320 -0
- data/lib/ebnf/parser.rb +285 -302
- data/lib/ebnf/peg.rb +1 -1
- data/lib/ebnf/peg/parser.rb +24 -5
- data/lib/ebnf/peg/rule.rb +77 -58
- data/lib/ebnf/rule.rb +352 -121
- data/lib/ebnf/terminals.rb +13 -10
- data/lib/ebnf/writer.rb +550 -78
- metadata +48 -6
data/etc/abnf.ebnf
ADDED
@@ -0,0 +1,124 @@
|
|
1
|
+
rulelist ::= ( rule | (c_wsp* c_nl) )+
|
2
|
+
|
3
|
+
rule ::= rulename defined_as elements c_nl
|
4
|
+
# continues if next line starts
|
5
|
+
# with white space
|
6
|
+
|
7
|
+
elements ::= alternation c_wsp*
|
8
|
+
|
9
|
+
alternation ::= concatenation
|
10
|
+
(c_wsp* "/" c_wsp* concatenation)*
|
11
|
+
|
12
|
+
concatenation::= repetition (c_wsp+ repetition)*
|
13
|
+
|
14
|
+
repetition ::= repeat? element
|
15
|
+
|
16
|
+
repeat ::= (DIGIT* "*" DIGIT*) | DIGIT+
|
17
|
+
|
18
|
+
element ::= rulename | group | option |
|
19
|
+
char_val | num_val | prose_val
|
20
|
+
|
21
|
+
group ::= "(" c_wsp* alternation c_wsp* ")"
|
22
|
+
|
23
|
+
option ::= "[" c_wsp* alternation c_wsp* "]"
|
24
|
+
|
25
|
+
char_val ::= case_insensitive_string |
|
26
|
+
case_sensitive_string
|
27
|
+
|
28
|
+
case_insensitive_string ::=
|
29
|
+
"%i"? quoted_string
|
30
|
+
|
31
|
+
case_sensitive_string ::=
|
32
|
+
"%s" quoted_string
|
33
|
+
|
34
|
+
num_val ::= "%" (bin_val | dec_val | hex_val)
|
35
|
+
|
36
|
+
@terminals
|
37
|
+
|
38
|
+
# Terminals used in ABNF, itself
|
39
|
+
rulename ::= ALPHA (ALPHA | DIGIT | "-")*
|
40
|
+
|
41
|
+
defined_as ::= c_wsp* ("=" | "=/") c_wsp*
|
42
|
+
# basic rules definition and
|
43
|
+
# incremental alternatives
|
44
|
+
|
45
|
+
c_wsp ::= WSP | (c_nl WSP)
|
46
|
+
|
47
|
+
c_nl ::= COMMENT | CRLF
|
48
|
+
# comment or newline
|
49
|
+
|
50
|
+
comment ::= ";" (WSP | VCHAR)* CRLF
|
51
|
+
|
52
|
+
quoted_string::= DQUOTE [#x20-#x21#x23-#x7E]* DQUOTE
|
53
|
+
# quoted string of SP and VCHAR
|
54
|
+
# without DQUOTE
|
55
|
+
|
56
|
+
bin_val ::= "b" BIT+
|
57
|
+
(("." BIT+)+ | ("-" BIT+))?
|
58
|
+
# series of concatenated bit values
|
59
|
+
# or single ONEOF range
|
60
|
+
|
61
|
+
dec_val ::= "d" DIGIT+
|
62
|
+
(("." DIGIT+)+ | ("-" DIGIT+))?
|
63
|
+
|
64
|
+
hex_val ::= "x" HEXDIG+
|
65
|
+
(("." HEXDIG+)+ | ("-" HEXDIG+))?
|
66
|
+
|
67
|
+
prose_val ::= "<" [#x20-#x3D#x3F-#x7E]* ">"
|
68
|
+
# bracketed string of SP and VCHAR
|
69
|
+
# without angles
|
70
|
+
# prose description, to be used as
|
71
|
+
# last resort
|
72
|
+
|
73
|
+
# Core terminals available in uses of ABNF
|
74
|
+
ALPHA ::= [#x41-#x5A#x61-#x7A] # A-Z | a-z
|
75
|
+
|
76
|
+
BIT ::= '0' | '1'
|
77
|
+
|
78
|
+
CHAR ::= [#x01-#x7F]
|
79
|
+
# any 7-bit US-ASCII character,
|
80
|
+
# excluding NUL
|
81
|
+
CR ::= #x0D
|
82
|
+
# carriage return
|
83
|
+
|
84
|
+
CRLF ::= CR? LF
|
85
|
+
# Internet standard newline
|
86
|
+
|
87
|
+
CTL ::= [#x00-#x1F] | #x7F
|
88
|
+
# controls
|
89
|
+
|
90
|
+
DIGIT ::= [#x30-#x39]
|
91
|
+
# 0-9
|
92
|
+
|
93
|
+
DQUOTE ::= #x22
|
94
|
+
# " (Double Quote)
|
95
|
+
|
96
|
+
HEXDIG ::= DIGIT | "A" | "B" | "C" | "D" | "E" | "F"
|
97
|
+
|
98
|
+
HTAB ::= #x09
|
99
|
+
# horizontal tab
|
100
|
+
|
101
|
+
LF ::= #x0A
|
102
|
+
# linefeed
|
103
|
+
|
104
|
+
LWSP ::= (WSP | CRLF WSP)*
|
105
|
+
# Use of this linear-white-space rule
|
106
|
+
# permits lines containing only white
|
107
|
+
# space that are no longer legal in
|
108
|
+
# mail headers and have caused
|
109
|
+
# interoperability problems in other
|
110
|
+
# contexts.
|
111
|
+
# Do not use when defining mail
|
112
|
+
# headers and use with caution in
|
113
|
+
# other contexts.
|
114
|
+
|
115
|
+
OCTET ::= [#x00-#xFF]
|
116
|
+
# 8 bits of data
|
117
|
+
|
118
|
+
SP ::= #x20
|
119
|
+
|
120
|
+
VCHAR ::= [#x21-#x7E]
|
121
|
+
# visible (printing) characters
|
122
|
+
|
123
|
+
WSP ::= SP | HTAB
|
124
|
+
# white space
|
data/etc/abnf.sxp
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
(
|
2
|
+
(rule rulelist (plus (alt rule (seq (star c_wsp) c_nl))))
|
3
|
+
(rule rule (seq rulename defined_as elements c_nl))
|
4
|
+
(rule elements (seq alternation (star c_wsp)))
|
5
|
+
(rule alternation
|
6
|
+
(seq concatenation (star (seq (star c_wsp) "/" (star c_wsp) concatenation))))
|
7
|
+
(rule concatenation (seq repetition (star (seq (plus c_wsp) repetition))))
|
8
|
+
(rule repetition (seq (opt repeat) element))
|
9
|
+
(rule repeat (alt (seq (star DIGIT) "*" (star DIGIT)) (plus DIGIT)))
|
10
|
+
(rule element (alt rulename group option char_val num_val prose_val))
|
11
|
+
(rule group (seq "(" (star c_wsp) alternation (star c_wsp) ")"))
|
12
|
+
(rule option (seq "[" (star c_wsp) alternation (star c_wsp) "]"))
|
13
|
+
(rule char_val (alt case_insensitive_string case_sensitive_string))
|
14
|
+
(rule case_insensitive_string (seq (opt "%i") quoted_string))
|
15
|
+
(rule case_sensitive_string (seq "%s" quoted_string))
|
16
|
+
(rule num_val (seq "%" (alt bin_val dec_val hex_val)))
|
17
|
+
(terminals _terminals (seq))
|
18
|
+
(terminal rulename (seq ALPHA (star (alt ALPHA DIGIT "-"))))
|
19
|
+
(terminal defined_as (seq (star c_wsp) (alt "=" "=/") (star c_wsp)))
|
20
|
+
(terminal c_wsp (alt WSP (seq c_nl WSP)))
|
21
|
+
(terminal c_nl (alt COMMENT CRLF))
|
22
|
+
(terminal comment (seq ";" (star (alt WSP VCHAR)) CRLF))
|
23
|
+
(terminal quoted_string (seq DQUOTE (star (range "#x20-#x21#x23-#x7E")) DQUOTE))
|
24
|
+
(terminal bin_val (seq "b" (plus BIT) (opt (alt (plus (seq "." (plus BIT))) (seq "-" (plus BIT))))))
|
25
|
+
(terminal dec_val
|
26
|
+
(seq "d" (plus DIGIT) (opt (alt (plus (seq "." (plus DIGIT))) (seq "-" (plus DIGIT))))))
|
27
|
+
(terminal hex_val
|
28
|
+
(seq "x" (plus HEXDIG) (opt (alt (plus (seq "." (plus HEXDIG))) (seq "-" (plus HEXDIG))))))
|
29
|
+
(terminal prose_val (seq "<" (star (range "#x20-#x3D#x3F-#x7E")) ">"))
|
30
|
+
(terminal ALPHA (range "#x41-#x5A#x61-#x7A"))
|
31
|
+
(terminal BIT (alt "0" "1"))
|
32
|
+
(terminal CHAR (range "#x01-#x7F"))
|
33
|
+
(terminal CR (hex "#x0D"))
|
34
|
+
(terminal CRLF (seq (opt CR) LF))
|
35
|
+
(terminal CTL (alt (range "#x00-#x1F") (hex "#x7F")))
|
36
|
+
(terminal DIGIT (range "#x30-#x39"))
|
37
|
+
(terminal DQUOTE (hex "#x22"))
|
38
|
+
(terminal HEXDIG (alt DIGIT "A" "B" "C" "D" "E" "F"))
|
39
|
+
(terminal HTAB (hex "#x09"))
|
40
|
+
(terminal LF (hex "#x0A"))
|
41
|
+
(terminal LWSP (star (alt WSP (seq CRLF WSP))))
|
42
|
+
(terminal OCTET (range "#x00-#xFF"))
|
43
|
+
(terminal SP (hex "#x20"))
|
44
|
+
(terminal VCHAR (range "#x21-#x7E"))
|
45
|
+
(terminal WSP (alt SP HTAB)))
|
data/etc/ebnf.ebnf
CHANGED
@@ -3,10 +3,12 @@
|
|
3
3
|
|
4
4
|
[2] declaration ::= '@terminals' | pass
|
5
5
|
|
6
|
-
[3] rule ::= LHS expression
|
7
|
-
|
8
6
|
# Use the LHS terminal to match the identifier, rule name and assignment due to
|
9
|
-
# confusion between the identifier and RANGE
|
7
|
+
# confusion between the identifier and RANGE.
|
8
|
+
# Note, for grammars not using identifiers, it is still possible to confuse
|
9
|
+
# a rule ending with a range the next rule, as it may be interpreted as an identifier.
|
10
|
+
# In such case, best to enclose the rule in '()'.
|
11
|
+
[3] rule ::= LHS expression
|
10
12
|
|
11
13
|
[4] expression ::= alt
|
12
14
|
|
@@ -20,10 +22,8 @@
|
|
20
22
|
|
21
23
|
[9] primary ::= HEX
|
22
24
|
| SYMBOL
|
23
|
-
| ENUM
|
24
|
-
| O_ENUM
|
25
|
-
| RANGE
|
26
25
|
| O_RANGE
|
26
|
+
| RANGE
|
27
27
|
| STRING1
|
28
28
|
| STRING2
|
29
29
|
| '(' expression ')'
|
@@ -32,37 +32,31 @@
|
|
32
32
|
|
33
33
|
@terminals
|
34
34
|
|
35
|
-
[11] LHS ::= ('[' SYMBOL
|
35
|
+
[11] LHS ::= ('[' SYMBOL ']' ' '+)? SYMBOL ' '* '::='
|
36
36
|
|
37
37
|
[12] SYMBOL ::= ([a-z] | [A-Z] | [0-9] | '_' | '.')+
|
38
38
|
|
39
39
|
[13] HEX ::= '#x' ([a-f] | [A-F] | [0-9])+
|
40
40
|
|
41
|
-
[14]
|
42
|
-
|
43
|
-
[15] O_ENUM ::= '[^' R_CHAR+ | HEX+ ']'
|
44
|
-
|
45
|
-
[16] RANGE ::= '[' (R_CHAR '-' R_CHAR) | (HEX - HEX) ']'
|
41
|
+
[14] RANGE ::= '[' ((R_CHAR '-' R_CHAR) | (HEX '-' HEX) | R_CHAR | HEX)+ '-'? ']' - LHS
|
46
42
|
|
47
|
-
[
|
43
|
+
[15] O_RANGE ::= '[^' ((R_CHAR '-' R_CHAR) | (HEX '-' HEX) | R_CHAR | HEX)+ '-'? ']'
|
48
44
|
|
49
45
|
# Strings are unescaped Unicode, excepting control characters and hash (#)
|
50
|
-
[
|
46
|
+
[16] STRING1 ::= '"' (CHAR - '"')* '"'
|
51
47
|
|
52
|
-
[
|
48
|
+
[17] STRING2 ::= "'" (CHAR - "'")* "'"
|
53
49
|
|
54
|
-
[
|
50
|
+
[18] CHAR ::= [#x9#xA#xD] | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
|
55
51
|
|
56
|
-
[
|
52
|
+
[19] R_CHAR ::= CHAR - (']' | '-' | HEX)
|
57
53
|
|
58
|
-
|
59
|
-
[22] POSTFIX ::= [?*+]
|
54
|
+
[20] POSTFIX ::= [?*+]
|
60
55
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
56
|
+
# Ignore all whitespace and comments between non-terminals
|
57
|
+
[21] PASS ::= [#x9#xA#xD#x20]
|
58
|
+
| ( ('#' - '#x') | '//' ) [^#xA#xD]*
|
59
|
+
| '/*' (( '*' [^/] )? | [^*] )* '*/'
|
60
|
+
| '(*' (( '*' [^)] )? | [^*] )* '*)'
|
66
61
|
|
67
|
-
# Should be able to do this inline, but not until terminal regular expressions are created automatically
|
68
62
|
@pass PASS
|
data/etc/ebnf.html
CHANGED
@@ -1,207 +1,252 @@
|
|
1
|
-
|
2
|
-
<
|
3
|
-
<
|
4
|
-
<
|
5
|
-
<td
|
6
|
-
<td
|
7
|
-
<td>
|
8
|
-
(declaration
|
9
|
-
</
|
10
|
-
|
11
|
-
<
|
12
|
-
<td>
|
13
|
-
<td
|
14
|
-
<td
|
15
|
-
|
16
|
-
"
|
17
|
-
</td>
|
18
|
-
</
|
19
|
-
<
|
20
|
-
<td>
|
21
|
-
|
22
|
-
<
|
23
|
-
<td>
|
24
|
-
|
25
|
-
|
26
|
-
</
|
27
|
-
|
28
|
-
<
|
29
|
-
<td
|
30
|
-
<td
|
31
|
-
<td>
|
32
|
-
|
33
|
-
</
|
34
|
-
|
35
|
-
<
|
36
|
-
<td>
|
37
|
-
<td
|
38
|
-
<td
|
39
|
-
|
40
|
-
|
41
|
-
</td>
|
42
|
-
</
|
43
|
-
<
|
44
|
-
<td>
|
45
|
-
|
46
|
-
<
|
47
|
-
<td>
|
48
|
-
|
49
|
-
|
50
|
-
</
|
51
|
-
|
52
|
-
<
|
53
|
-
<td
|
54
|
-
<td
|
55
|
-
<td>
|
56
|
-
|
57
|
-
</
|
58
|
-
|
59
|
-
<
|
60
|
-
<td
|
61
|
-
<td
|
62
|
-
<td
|
63
|
-
|
64
|
-
|
65
|
-
</td>
|
66
|
-
|
67
|
-
<
|
68
|
-
<td>
|
69
|
-
|
70
|
-
<
|
71
|
-
<td>
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
</
|
82
|
-
|
83
|
-
<
|
84
|
-
<td
|
85
|
-
<td
|
86
|
-
<td
|
87
|
-
|
88
|
-
|
89
|
-
</td>
|
90
|
-
|
91
|
-
<
|
92
|
-
<td>
|
93
|
-
|
94
|
-
<
|
95
|
-
<td>
|
96
|
-
|
97
|
-
|
98
|
-
</
|
99
|
-
|
100
|
-
<
|
101
|
-
<td
|
102
|
-
<td
|
103
|
-
<td>
|
104
|
-
|
105
|
-
</
|
106
|
-
|
107
|
-
<
|
108
|
-
<td>
|
109
|
-
<td
|
110
|
-
<td
|
111
|
-
|
112
|
-
"
|
113
|
-
</td>
|
114
|
-
</
|
115
|
-
<
|
116
|
-
<td>[
|
117
|
-
|
118
|
-
<
|
119
|
-
<td>
|
120
|
-
|
121
|
-
|
122
|
-
</
|
123
|
-
|
124
|
-
<
|
125
|
-
<td
|
126
|
-
<td
|
127
|
-
<td>
|
128
|
-
"
|
129
|
-
</
|
130
|
-
|
131
|
-
<
|
132
|
-
<td
|
133
|
-
<td
|
134
|
-
<td
|
135
|
-
|
136
|
-
|
137
|
-
</td>
|
138
|
-
|
139
|
-
<
|
140
|
-
<td>
|
141
|
-
|
142
|
-
<
|
143
|
-
<td>
|
144
|
-
|
145
|
-
|
146
|
-
</
|
147
|
-
|
148
|
-
<
|
149
|
-
<td
|
150
|
-
<td
|
151
|
-
<td>
|
152
|
-
|
153
|
-
</
|
154
|
-
|
155
|
-
<
|
156
|
-
<td
|
157
|
-
<td
|
158
|
-
<td
|
159
|
-
|
160
|
-
"
|
161
|
-
</td>
|
162
|
-
|
163
|
-
<
|
164
|
-
<td>
|
165
|
-
|
166
|
-
<
|
167
|
-
<td>
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
</
|
174
|
-
<
|
175
|
-
<td
|
176
|
-
<td
|
177
|
-
|
178
|
-
<
|
179
|
-
|
180
|
-
</td>
|
181
|
-
|
182
|
-
<
|
183
|
-
|
184
|
-
<
|
185
|
-
<td
|
186
|
-
<td>
|
187
|
-
|
188
|
-
</td>
|
189
|
-
</tr>
|
190
|
-
<tr
|
191
|
-
<td>[
|
192
|
-
<td><code
|
193
|
-
<td
|
194
|
-
<td>
|
195
|
-
|
196
|
-
|
197
|
-
</
|
198
|
-
<
|
199
|
-
<td
|
200
|
-
<code
|
201
|
-
</
|
202
|
-
<
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
</
|
1
|
+
|
2
|
+
<table class="grammar">
|
3
|
+
<tbody id="grammar-productions" class="ebnf">
|
4
|
+
<tr id="grammar-production-ebnf">
|
5
|
+
<td>[1]</td>
|
6
|
+
<td><code>ebnf</code></td>
|
7
|
+
<td>::=</td>
|
8
|
+
<td><code>(</code> <a href="#grammar-production-declaration">declaration</a> <code>|</code> <a href="#grammar-production-rule">rule</a><code>)</code> <code>*</code> </td>
|
9
|
+
</tr>
|
10
|
+
<tr id="grammar-production-declaration">
|
11
|
+
<td>[2]</td>
|
12
|
+
<td><code>declaration</code></td>
|
13
|
+
<td>::=</td>
|
14
|
+
<td>"@terminals" <code>|</code> <a href="#grammar-production-pass">pass</a></td>
|
15
|
+
</tr>
|
16
|
+
<tr id="grammar-production-rule">
|
17
|
+
<td>[3]</td>
|
18
|
+
<td><code>rule</code></td>
|
19
|
+
<td>::=</td>
|
20
|
+
<td><a href="#grammar-production-LHS">LHS</a> <a href="#grammar-production-expression">expression</a></td>
|
21
|
+
</tr>
|
22
|
+
<tr id="grammar-production-expression">
|
23
|
+
<td>[4]</td>
|
24
|
+
<td><code>expression</code></td>
|
25
|
+
<td>::=</td>
|
26
|
+
<td><a href="#grammar-production-alt">alt</a></td>
|
27
|
+
</tr>
|
28
|
+
<tr id="grammar-production-alt">
|
29
|
+
<td>[5]</td>
|
30
|
+
<td><code>alt</code></td>
|
31
|
+
<td>::=</td>
|
32
|
+
<td><a href="#grammar-production-seq">seq</a> <code>(</code> "<code class="grammar-literal">|</code>" <a href="#grammar-production-seq">seq</a><code>)</code> <code>*</code> </td>
|
33
|
+
</tr>
|
34
|
+
<tr id="grammar-production-seq">
|
35
|
+
<td>[6]</td>
|
36
|
+
<td><code>seq</code></td>
|
37
|
+
<td>::=</td>
|
38
|
+
<td><a href="#grammar-production-diff">diff</a><code>+</code> </td>
|
39
|
+
</tr>
|
40
|
+
<tr id="grammar-production-diff">
|
41
|
+
<td>[7]</td>
|
42
|
+
<td><code>diff</code></td>
|
43
|
+
<td>::=</td>
|
44
|
+
<td><a href="#grammar-production-postfix">postfix</a> <code>(</code> "<code class="grammar-literal">-</code>" <a href="#grammar-production-postfix">postfix</a><code>)</code> <code>?</code> </td>
|
45
|
+
</tr>
|
46
|
+
<tr id="grammar-production-postfix">
|
47
|
+
<td>[8]</td>
|
48
|
+
<td><code>postfix</code></td>
|
49
|
+
<td>::=</td>
|
50
|
+
<td><a href="#grammar-production-primary">primary</a> <a href="#grammar-production-POSTFIX">POSTFIX</a><code>?</code> </td>
|
51
|
+
</tr>
|
52
|
+
<tr id="grammar-production-primary">
|
53
|
+
<td>[9]</td>
|
54
|
+
<td><code>primary</code></td>
|
55
|
+
<td>::=</td>
|
56
|
+
<td><a href="#grammar-production-HEX">HEX</a></td>
|
57
|
+
</tr>
|
58
|
+
<tr>
|
59
|
+
<td>[9]</td>
|
60
|
+
<td><code></code></td>
|
61
|
+
<td>|</td>
|
62
|
+
<td><a href="#grammar-production-SYMBOL">SYMBOL</a></td>
|
63
|
+
</tr>
|
64
|
+
<tr>
|
65
|
+
<td>[9]</td>
|
66
|
+
<td><code></code></td>
|
67
|
+
<td>|</td>
|
68
|
+
<td><a href="#grammar-production-O_RANGE">O_RANGE</a></td>
|
69
|
+
</tr>
|
70
|
+
<tr>
|
71
|
+
<td>[9]</td>
|
72
|
+
<td><code></code></td>
|
73
|
+
<td>|</td>
|
74
|
+
<td><a href="#grammar-production-RANGE">RANGE</a></td>
|
75
|
+
</tr>
|
76
|
+
<tr>
|
77
|
+
<td>[9]</td>
|
78
|
+
<td><code></code></td>
|
79
|
+
<td>|</td>
|
80
|
+
<td><a href="#grammar-production-STRING1">STRING1</a></td>
|
81
|
+
</tr>
|
82
|
+
<tr>
|
83
|
+
<td>[9]</td>
|
84
|
+
<td><code></code></td>
|
85
|
+
<td>|</td>
|
86
|
+
<td><a href="#grammar-production-STRING2">STRING2</a></td>
|
87
|
+
</tr>
|
88
|
+
<tr>
|
89
|
+
<td>[9]</td>
|
90
|
+
<td><code></code></td>
|
91
|
+
<td>|</td>
|
92
|
+
<td><code>(</code> "<code class="grammar-literal">(</code>" <a href="#grammar-production-expression">expression</a> "<code class="grammar-literal">)</code>"<code>)</code> </td>
|
93
|
+
</tr>
|
94
|
+
<tr id="grammar-production-pass">
|
95
|
+
<td>[10]</td>
|
96
|
+
<td><code>pass</code></td>
|
97
|
+
<td>::=</td>
|
98
|
+
<td>"@pass" <a href="#grammar-production-expression">expression</a></td>
|
99
|
+
</tr>
|
100
|
+
<tr id="grammar-production-">
|
101
|
+
<td>@terminals</td>
|
102
|
+
<td><code></code></td>
|
103
|
+
<td></td>
|
104
|
+
<td><strong>Productions for terminals</strong></td>
|
105
|
+
</tr>
|
106
|
+
<tr id="grammar-production-LHS">
|
107
|
+
<td>[11]</td>
|
108
|
+
<td><code>LHS</code></td>
|
109
|
+
<td>::=</td>
|
110
|
+
<td><code>(</code> "<code class="grammar-literal">[</code>" <a href="#grammar-production-SYMBOL">SYMBOL</a> "<code class="grammar-literal">]</code>" <code class="grammar-char-escape"><abbr title="space">#x20</abbr></code><code>+</code> <code>)</code> <code>?</code> <a href="#grammar-production-SYMBOL">SYMBOL</a> <code class="grammar-char-escape"><abbr title="space">#x20</abbr></code><code>*</code> "::="</td>
|
111
|
+
</tr>
|
112
|
+
<tr id="grammar-production-SYMBOL">
|
113
|
+
<td>[12]</td>
|
114
|
+
<td><code>SYMBOL</code></td>
|
115
|
+
<td>::=</td>
|
116
|
+
<td><code>(</code> <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> <code>+</code> </td>
|
117
|
+
</tr>
|
118
|
+
<tr id="grammar-production-HEX">
|
119
|
+
<td>[13]</td>
|
120
|
+
<td><code>HEX</code></td>
|
121
|
+
<td>::=</td>
|
122
|
+
<td>"#x" <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> <code>[</code> <code class="grammar-literal">0-9</code><code>]</code> <code>)</code> <code>+</code> </td>
|
123
|
+
</tr>
|
124
|
+
<tr id="grammar-production-RANGE">
|
125
|
+
<td>[14]</td>
|
126
|
+
<td><code>RANGE</code></td>
|
127
|
+
<td>::=</td>
|
128
|
+
<td>"<code class="grammar-literal">[</code>"</td>
|
129
|
+
</tr>
|
130
|
+
<tr id="grammar-production-">
|
131
|
+
<td>[14]</td>
|
132
|
+
<td><code></code></td>
|
133
|
+
<td></td>
|
134
|
+
<td><code>(</code> <code>(</code> <a href="#grammar-production-R_CHAR">R_CHAR</a> "<code class="grammar-literal">-</code>" <a href="#grammar-production-R_CHAR">R_CHAR</a><code>)</code><code>(</code> <a href="#grammar-production-HEX">HEX</a> "<code class="grammar-literal">-</code>" <a href="#grammar-production-HEX">HEX</a><code>)</code> <code>|</code> <a href="#grammar-production-R_CHAR">R_CHAR</a> <code>|</code> <a href="#grammar-production-HEX">HEX</a><code>)</code> <code>+</code></td>
|
135
|
+
</tr>
|
136
|
+
<tr id="grammar-production-">
|
137
|
+
<td>[14]</td>
|
138
|
+
<td><code></code></td>
|
139
|
+
<td></td>
|
140
|
+
<td>"<code class="grammar-literal">-</code>"<code>?</code></td>
|
141
|
+
</tr>
|
142
|
+
<tr id="grammar-production-">
|
143
|
+
<td>[14]</td>
|
144
|
+
<td><code></code></td>
|
145
|
+
<td></td>
|
146
|
+
<td><code>(</code> "<code class="grammar-literal">]</code>" <code>-</code> <a href="#grammar-production-LHS">LHS</a><code>)</code> </td>
|
147
|
+
</tr>
|
148
|
+
<tr id="grammar-production-O_RANGE">
|
149
|
+
<td>[15]</td>
|
150
|
+
<td><code>O_RANGE</code></td>
|
151
|
+
<td>::=</td>
|
152
|
+
<td>"[^"</td>
|
153
|
+
</tr>
|
154
|
+
<tr id="grammar-production-">
|
155
|
+
<td>[15]</td>
|
156
|
+
<td><code></code></td>
|
157
|
+
<td></td>
|
158
|
+
<td><code>(</code> <code>(</code> <a href="#grammar-production-R_CHAR">R_CHAR</a> "<code class="grammar-literal">-</code>" <a href="#grammar-production-R_CHAR">R_CHAR</a><code>)</code><code>(</code> <a href="#grammar-production-HEX">HEX</a> "<code class="grammar-literal">-</code>" <a href="#grammar-production-HEX">HEX</a><code>)</code> <code>|</code> <a href="#grammar-production-R_CHAR">R_CHAR</a> <code>|</code> <a href="#grammar-production-HEX">HEX</a><code>)</code> <code>+</code></td>
|
159
|
+
</tr>
|
160
|
+
<tr id="grammar-production-">
|
161
|
+
<td>[15]</td>
|
162
|
+
<td><code></code></td>
|
163
|
+
<td></td>
|
164
|
+
<td>"<code class="grammar-literal">-</code>"<code>?</code></td>
|
165
|
+
</tr>
|
166
|
+
<tr id="grammar-production-">
|
167
|
+
<td>[15]</td>
|
168
|
+
<td><code></code></td>
|
169
|
+
<td></td>
|
170
|
+
<td>"<code class="grammar-literal">]</code>"</td>
|
171
|
+
</tr>
|
172
|
+
<tr id="grammar-production-STRING1">
|
173
|
+
<td>[16]</td>
|
174
|
+
<td><code>STRING1</code></td>
|
175
|
+
<td>::=</td>
|
176
|
+
<td>'<code class="grammar-literal">"</code>' <code>(</code> <a href="#grammar-production-CHAR">CHAR</a> <code>-</code> '<code class="grammar-literal">"</code>'<code>)</code> <code>*</code> '<code class="grammar-literal">"</code>'</td>
|
177
|
+
</tr>
|
178
|
+
<tr id="grammar-production-STRING2">
|
179
|
+
<td>[17]</td>
|
180
|
+
<td><code>STRING2</code></td>
|
181
|
+
<td>::=</td>
|
182
|
+
<td>"<code class="grammar-literal">'</code>" <code>(</code> <a href="#grammar-production-CHAR">CHAR</a> <code>-</code> "<code class="grammar-literal">'</code>"<code>)</code> <code>*</code> "<code class="grammar-literal">'</code>"</td>
|
183
|
+
</tr>
|
184
|
+
<tr id="grammar-production-CHAR">
|
185
|
+
<td>[18]</td>
|
186
|
+
<td><code>CHAR</code></td>
|
187
|
+
<td>::=</td>
|
188
|
+
<td><code>[</code> <code class="grammar-char-escape"><abbr title="horizontal tab">#x09</abbr></code><code class="grammar-char-escape"><abbr title="new line">#x0A</abbr></code><code class="grammar-char-escape"><abbr title="carriage return">#x0D</abbr></code><code>]</code></td>
|
189
|
+
</tr>
|
190
|
+
<tr>
|
191
|
+
<td>[18]</td>
|
192
|
+
<td><code></code></td>
|
193
|
+
<td>|</td>
|
194
|
+
<td><code>[</code> <code class="grammar-char-escape"><abbr title="space">#x20</abbr></code><code class="grammar-literal">-</code><code class="grammar-char-escape"><abbr title="unicode ''">#xD7FF</abbr></code><code>]</code></td>
|
195
|
+
</tr>
|
196
|
+
<tr>
|
197
|
+
<td>[18]</td>
|
198
|
+
<td><code></code></td>
|
199
|
+
<td>|</td>
|
200
|
+
<td><code>[</code> <code class="grammar-char-escape"><abbr title="unicode ''">#xE000</abbr></code><code class="grammar-literal">-</code><code class="grammar-char-escape"><abbr title="unicode '�'">#xFFFD</abbr></code><code>]</code></td>
|
201
|
+
</tr>
|
202
|
+
<tr>
|
203
|
+
<td>[18]</td>
|
204
|
+
<td><code></code></td>
|
205
|
+
<td>|</td>
|
206
|
+
<td><code>[</code> <code class="grammar-char-escape"><abbr title="unicode '𐀀'">#x00010000</abbr></code><code class="grammar-literal">-</code><code class="grammar-char-escape"><abbr title="unicode ''">#x0010FFFF</abbr></code><code>]</code> </td>
|
207
|
+
</tr>
|
208
|
+
<tr id="grammar-production-R_CHAR">
|
209
|
+
<td>[19]</td>
|
210
|
+
<td><code>R_CHAR</code></td>
|
211
|
+
<td>::=</td>
|
212
|
+
<td><a href="#grammar-production-CHAR">CHAR</a> <code>-</code> <code>(</code> "<code class="grammar-literal">]</code>" <code>|</code> "<code class="grammar-literal">-</code>" <code>|</code> <a href="#grammar-production-HEX">HEX</a><code>)</code> </td>
|
213
|
+
</tr>
|
214
|
+
<tr id="grammar-production-POSTFIX">
|
215
|
+
<td>[20]</td>
|
216
|
+
<td><code>POSTFIX</code></td>
|
217
|
+
<td>::=</td>
|
218
|
+
<td><code>[</code> <code class="grammar-literal">?*+</code><code>]</code> </td>
|
219
|
+
</tr>
|
220
|
+
<tr id="grammar-production-PASS">
|
221
|
+
<td>[21]</td>
|
222
|
+
<td><code>PASS</code></td>
|
223
|
+
<td>::=</td>
|
224
|
+
<td><code>[</code> <code class="grammar-char-escape"><abbr title="horizontal tab">#x09</abbr></code><code class="grammar-char-escape"><abbr title="new line">#x0A</abbr></code><code class="grammar-char-escape"><abbr title="carriage return">#x0D</abbr></code><code class="grammar-char-escape"><abbr title="space">#x20</abbr></code><code>]</code></td>
|
225
|
+
</tr>
|
226
|
+
<tr>
|
227
|
+
<td>[21]</td>
|
228
|
+
<td><code></code></td>
|
229
|
+
<td>|</td>
|
230
|
+
<td><code>(</code> <code>(</code> <code>(</code> "<code class="grammar-literal">#</code>" <code>-</code> "#x"<code>)</code> <code>|</code> "//"<code>)</code> <code>[</code> <code class="grammar-literal">^</code><code class="grammar-char-escape"><abbr title="new line">#x0A</abbr></code><code class="grammar-char-escape"><abbr title="carriage return">#x0D</abbr></code><code>]</code> <code>*</code> <code>)</code></td>
|
231
|
+
</tr>
|
232
|
+
<tr>
|
233
|
+
<td>[21]</td>
|
234
|
+
<td><code></code></td>
|
235
|
+
<td>|</td>
|
236
|
+
<td><code>(</code> "/*" <code>(</code> <code>(</code> "<code class="grammar-literal">*</code>" <code>[</code> <code class="grammar-literal">^/</code><code>]</code> <code>)</code> <code>?</code> <code>|</code> <code>[</code> <code class="grammar-literal">^*</code><code>]</code> <code>)</code> <code>*</code> "*/"<code>)</code></td>
|
237
|
+
</tr>
|
238
|
+
<tr>
|
239
|
+
<td>[21]</td>
|
240
|
+
<td><code></code></td>
|
241
|
+
<td>|</td>
|
242
|
+
<td><code>(</code> "(*" <code>(</code> <code>(</code> "<code class="grammar-literal">*</code>" <code>[</code> <code class="grammar-literal">^)</code><code>]</code> <code>)</code> <code>?</code> <code>|</code> <code>[</code> <code class="grammar-literal">^*</code><code>]</code> <code>)</code> <code>*</code> "*)"<code>)</code> </td>
|
243
|
+
</tr>
|
244
|
+
<tr id="grammar-production-">
|
245
|
+
<td>@pass</td>
|
246
|
+
<td><code></code></td>
|
247
|
+
<td></td>
|
248
|
+
<td></td>
|
249
|
+
</tr>
|
250
|
+
</tbody>
|
207
251
|
</table>
|
252
|
+
|