-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBNF
More file actions
310 lines (235 loc) · 8.03 KB
/
BNF
File metadata and controls
310 lines (235 loc) · 8.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
JS3AllowedBlockStatement :=
JS3TDZCheck | JS3DebuggerStatement | JS3WithStatement | JS3VariableDeclaration | JS3ReturnStatement | JS3IfStatement | JS3TryStatement | JS3ThrowStatement | JS3FunctionDeclaration | JS3EmptyStatement | JS3WhileStatement | JS3BreakStatement | JS3ContinueStatement | JS3BlockStatement | JS3ForInStatement | JS3LabeledStatement | JS3ForStatement | JS3DoWhileStatement | JS3SwitchStatement | JS3ForOfStatement
JS3Literals :=
DecimalLiteral | BigIntLiteral | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral
JS3ContainedExprKey :=
Identifier | JS3Literals | OptionalCallExpression | OptionalMemberExpression | Expression
JS3AllowedFunctionArgs :=
Identifier | ArrayPattern | ObjectPattern | AssignmentPattern | RestElement
JS3VarDeclLVal :=
Identifier | JS3ArrayPattern | JS3ObjectPattern
JS3AssnLVal :=
Identifier | ArrayPattern | JS3ObjectPattern | JS3MemberExpression
JS3AssnInit :=
JS3Literals | JS3RegExpLiteral | JS3TemplateLiteral | JS3ImportExpression | JS3TaggedTemplateExpression | JS3MetaProperty | JS3YieldExpression | ThisExpression | JS3FunctionExpression | Identifier | JS3MemberExpression | JS3CallExpression | JS3ObjectExpression | JS3NewExpression | JS3BinaryExpression | JS3AssignmentExpression | JS3UnaryExpression | JS3ArrowFunctionExpression | JS3ClassExpression | JS3ArrayExpression | JS3UpdateExpression | JS3AwaitExpression | JS3AnonMemberExpression | OptionalMemberExpression | OptionalCallExpression | JS3ContextualCallExpression | JS3JSXCallExpression | JS3ConditionalExpression | JS3DefaultExportMemberExpression
JS3AllowedProgStatement :=
JS3ImportDeclaration | JS3ExportDefaultDeclaration | JS3ExportNamedDeclaration | JS3ExportAllDeclaration | JS3AllowedBlockStatement
JS3ClassPropValue :=
JS3ClassExpression | JS3ArrowFunctionExpression | JS3FunctionExpression | JS3ContainedExprKey | null
JS3ArrayTerminals :=
Identifier | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | ThisExpression | BigIntLiteral | DecimalLiteral
JS3ObjectTerminals :=
Identifier | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | ThisExpression | BigIntLiteral | DecimalLiteral
JS3ConditionalExpression :=
test = Identifier
consequent = JS3ContainedExprKey
alternate = JS3ContainedExprKey
JS3DebuggerStatement :=
(empty)
JS3ArrayPattern :=
elements = [Identifier | JS3RestElement]
JS3ObjectPattern :=
properties = [JS3AssnObjectProperty | JS3RestElement]
JS3RestElement :=
argument = Identifier
JS3WithStatement :=
object = Identifier
body = JS3BlockStatement
JS3TaggedTemplateExpression :=
tag = JS3MemberExpression | Identifier
quasi = JS3TemplateLiteral
typeParameters = null
JS3TemplateLiteral :=
quasis = [TemplateElement]
expressions = [Identifier]
JS3UpdateExpression :=
argument = Identifier | JS3MemberExpression
JS3SwitchCase :=
test = JS3ContainedExprKey | null
consequent = [JS3AllowedBlockStatement]
JS3SwitchStatement :=
discriminant = Identifier
cases = [JS3SwitchCase]
JS3BreakStatement :=
label = Identifier | null
JS3ContinueStatement :=
label = Identifier | null
JS3DoWhileStatement :=
test = JS3ContainedExprKey
body = JS3BlockStatement
JS3ForStatement :=
init = VariableDeclaration | JS3ContainedExprKey | null
test = JS3ContainedExprKey | null
update = JS3ContainedExprKey | null
body = JS3BlockStatement
JS3ForInStatement :=
left = VariableDeclaration | LVal
right = Identifier
body = JS3BlockStatement
JS3ForOfStatement :=
left = VariableDeclaration | LVal
right = Identifier
body = JS3BlockStatement
JS3WhileStatement :=
test = JS3ContainedExprKey
body = JS3BlockStatement
JS3VariableDeclarator :=
id = JS3VarDeclLVal
init = null | undefined | JS3AssnInit
JS3VariableDeclaration :=
declarations = [JS3VariableDeclarator]
JS3ArrayExpression :=
elements = [null | JS3ArrayTerminals | JS3SpreadElement]
JS3CallExpression :=
callee = JS3Import | Identifier | Super | V8IntrinsicIdentifier
arguments = [ Identifier | JS3SpreadElement ]
typeArguments = null
typeParameters = null
JS3UnaryExpression :=
argument = Identifier | JS3MemberExpression
JS3IfStatement :=
test = Identifier
consequent = JS3BlockStatement
alternate = null | undefined | JS3BlockStatement
JS3BinaryExpression :=
left = Identifier | JS3PrivateName
right = Identifier
JS3AssignmentExpression :=
left = JS3AssnLVal
right = JS3AssnInit
operator = "="
JS3MemberExpression :=
object = Identifier | ThisExpression | Super
property = Identifier | JS3PrivateName
JS3ReturnStatement :=
argument = undefined | null | Identifier
JS3RegExpLiteral :=
(empty)
JS3PrivateName :=
(empty)
JS3EmptyStatement :=
(empty)
JS3ExportNamespaceSpecifier :=
(empty)
JS3ObjectExpression :=
properties = [JS3ObjectMethod | JS3ObjectProperty | JS3SpreadElement]
JS3ObjectMethod :=
key = Identifier | StringLiteral | NumericLiteral | BigIntLiteral
params = [JS3AllowedFunctionArgs]
body = JS3BlockStatement
decorators = null
returnType = null
typeParameters = null
JS3ObjectProperty :=
key = Identifier | StringLiteral | NumericLiteral | BigIntLiteral
value = JS3ObjectTerminals
decorators = null
JS3SpreadElement :=
argument = Identifier
JS3MetaProperty :=
(empty)
JS3ClassExpression :=
superClass = null | undefined | JS3ContainedExprKey
body = JS3ClassBody
decorators = null
implements = null
mixins = null
superTypeParameters = null
typeParameters = null
JS3ClassBody :=
body = [JS3StaticBlock | JS3ClassProperty | JS3ClassMethod | JS3ClassPrivateProperty | JS3ClassPrivateMethod]
JS3ClassProperty :=
key = JS3ContainedExprKey
value = JS3ClassPropValue
typeAnnotation = null
decorators = null
variance = null
JS3ClassMethod :=
key = JS3ContainedExprKey
params = [JS3AllowedFunctionArgs]
body = JS3BlockStatement
decorators = null
returnType = null
typeParameters = null
JS3ClassPrivateProperty :=
key = JS3PrivateName
value = JS3ClassPropValue
decorators = null
typeAnnotation = null
variance = null
JS3ClassPrivateMethod :=
key = JS3PrivateName
params = [JS3AllowedFunctionArgs]
body = JS3BlockStatement
decorators = null
returnType = null
typeParameters = null
JS3StaticBlock :=
body = [JS3AllowedBlockStatement]
JS3YieldExpression :=
argument = Identifier | null
JS3AwaitExpression :=
argument = Identifier
JS3NewExpression :=
callee = Identifier | Super | V8IntrinsicIdentifier
arguments = [Identifier | JS3SpreadElement]
typeArguments = null
typeParameters = null
JS3LabeledStatement :=
body = JS3AllowedBlockStatement
JS3BlockStatement :=
body = [JS3AllowedBlockStatement]
JS3FunctionDeclaration :=
id = Identifier
params = [JS3AllowedFunctionArgs]
body = JS3BlockStatement
predicate = undefined | null
returnType = undefined | null
typeParameters = undefined | null
JS3FunctionExpression :=
id = null | Identifier | undefined
params = [JS3AllowedFunctionArgs]
body = JS3BlockStatement
predicate = undefined | null
returnType = undefined | null
typeParameters = undefined | null
JS3ArrowFunctionExpression :=
params = [JS3AllowedFunctionArgs]
body = JS3BlockStatement
predicate = null
returnType = null
typeParameters = null
JS3ExportSpecifier :=
(empty)
JS3ExportNamedDeclaration :=
declaration = null
specifiers = [JS3ExportSpecifier | JS3ExportNamespaceSpecifier]
assertions = null
attributes = null
JS3ExportAllDeclaration :=
assertions = null
attributes = null
JS3ExportDefaultDeclaration :=
declaration = Identifier
JS3ThrowStatement :=
argument = Identifier
JS3CatchClause :=
body = JS3BlockStatement
param = Identifier | null
JS3TryStatement :=
block = JS3BlockStatement
handler = null | undefined | JS3CatchClause
finalizer = null | undefined | JS3BlockStatement
JS3Import :=
(empty)
JS3ImportExpression :=
source = Identifier
options = Identifier | null
JS3ImportDeclaration :=
specifiers = [ImportSpecifier | ImportNamespaceSpecifier]
assertions = undefined | null
attributes = undefined | null
JS3Program :=
body = [ JS3AllowedProgStatement ]
JS3File :=
program = JS3Program