RPA Toolkit
work on AST
[rpatk.git] / tests / astecma262.rpa
1 # 6 Source Text
2 SourceCharacter         ::= .
3
4 # 7.2 White space
5 WhiteSpace              ::= [#0x0009] | [#0x000B] | [#0x000C] | [#0x0020] | [#0x00A0] | [#0xFEFF]
6
7 # 7.3 Line Terminators
8 LineTerminator          ::= [#0x000D] [#0x000A] | [#0x000A] | [#0x000D] | [#0x2028] | [#0x2029]
9 LineTerminatorSequence  ::= [#0x000D] [#0x000A] |
10                             [#0x000A] | 
11                             [#0x000D] | 
12                             [#0x2028] | 
13                             [#0x2029]
14
15 S                       ::= ( <WhiteSpace> | <LineTerminator> )+
16
17 # 7.4 Comments
18 Comment                 ::= <:MultiLineComment:> | <:SingleLineComment:>
19 MultiLineComment        ::= '/*' <:MultiLineCommentChar:>* '*/'
20 MultiLineCommentChar    ::= . - '*/'
21 SingleLineComment       ::= '//' <:SingleLineCommentChar:>*
22 SingleLineCommentChar   ::= <:SourceCharacter:> - <:LineTerminator:>
23
24
25 # 7.5 Tokens
26 Token                   ::= <:IdentifierName:> |
27                             <:Punctuator:> |
28                             <:NumericLiteral:> |
29                             <:StringLiteral:>
30
31 # 7.6 Identifier Names and Identifiers
32
33 Identifier              ::= <IdentifierName> - <ReservedWord> - <ReservedWord> <IdentifierPart>
34 IdentifierName          ::= <IdentifierStart> <IdentifierPart>*
35 IdentifierStart         ::= <UnicodeLetter> | '$' | '_' | '\' <:UnicodeEscapeSequence:>
36 UnicodeLetter           ::= <Lu> |
37                         <Ll> |
38                         <Lt> |
39                         <Lm> |
40                         <Lo> |
41                         <Nl>
42
43 Lu                      ::= [#0x0041-#0x005A] | [#0x00C0-#0x00DE] | [#0x0100-#0x0232]   # TBD
44 Ll                      ::= [#0x0061-#0x007A] | [#0x00C0-#0x00DE]                       # TBD
45 IdentifierPart          ::= <IdentifierStart> | 
46                         <:UnicodeCombiningMark:> |
47                         <:UnicodeDigit:> | 
48                         <:UnicodeConnectorPunctuation:>                                 # TBD
49
50 UnicodeDigit            ::= [0-9] | [#0x0660-#0x0669]                                   # TBD
51 ReservedWord            ::= <:Keyword:>
52                         <:Keyword:> | 
53                         <:FutureReservedWord:> |
54                         <:NullLiteral:> |
55                         <:BooleanLiteral:>
56
57 Keyword                 ::= 'instanceof' | 'typeof'     | 'break' | 
58                             'do' | 'new' | 'var' |
59                             'case' | 'else' | 'return' | 'void' | 
60                             'catch' | 'finally' | 'continue' | 'for' | 
61                             'switch' | 'while' | 'this' | 'with' | 
62                             'debugger' | 'function' | 'throw' | 'default' |  
63                             'if' | 'try' | 'delete' | 'in'
64
65 FutureReservedWord      ::= 'class' | 'enum' | 'extends' | 'import' | 'const' | 'export' |
66                             'implements' | 'let' | 'private' | 'public' |
67                             'static' | 'interface' | 'package' | 'protected'
68
69 NullLiteral             ::= 'null'
70 BooleanLiteral          ::= 'true' | 'false'
71 Literal                 ::= <:NullLiteral:> |
72                             <:BooleanLiteral:> |
73                             <:NumericLiteral:> |
74                             <:StringLiteral:> |
75                             <:RegularExpressionLiteral:>
76
77
78
79 # 7.7 Punctuators
80 Punctuator              ::= '{' | '}' | '(' | ')' | '[' | ']' |
81                             '===' | '!==' | '>=' | '<=' | '==' | '!=' |
82                             '<<' | '>>>' | '>>' | '&' | '^=' | '^' |
83                             '!' | '~' | '&&' | '||' | '?' | ':' |
84                             '>>=' | '>>>=' | '&=' | '|=' |
85                             '=' | '+='| '-=' | '*=' | '%=' | '<<=' |
86                             '.' | ';' | ',' | '<' | '>' | '|' |
87                             '+' | '-' | '*' | '%' | '++' | '--'
88 DivPunctuator           ::= '/' | '/='
89
90
91
92 # 7.8.3 Numeric Literals
93 NumericLiteral          ::= <:HexIntegerLiteral:> | <:DecimalLiteral:>
94 DecimalLiteral          ::= <:DecimalIntegerLiteral:> '.' <:DecimalDigits:>? <:ExponentPart:>? |
95                             '.' <:DecimalDigits:> <:ExponentPart:>? |
96                             <:DecimalIntegerLiteral:> <:ExponentPart:>?
97
98 DecimalIntegerLiteral   ::= '0' |
99                             <:NonZeroDigit:> <:DecimalDigits:>?
100
101 DecimalDigits           ::= <:DecimalDigit:>+
102 DecimalDigit            ::= [0-9]
103 NonZeroDigit            ::= [1-9]
104 ExponentPart            ::= <:ExponentIndicator:> <:SignedInteger:>
105 ExponentIndicator       ::= [eE]
106 SignedInteger           ::= <:DecimalDigits:> |
107                             '+' <:DecimalDigits:> |
108                             '-' <:DecimalDigits:>
109 HexIntegerLiteral       ::= '0' [xX] <:HexDigit:>+
110 HexDigit                ::= [0-9a-fA-F]
111
112
113 # 7.8.4 String Literals
114
115 StringLiteral           ::= '"' <:DoubleStringCharacters:>? '"' |
116                             "'" <:SingleStringCharacters:>? "'"
117
118 DoubleStringCharacters  ::= <:DoubleStringCharacter:>+
119 SingleStringCharacters  ::= <:SingleStringCharacter:>+
120
121
122 DoubleStringCharacter   ::= '\' <:EscapeSequence:> |
123                             <:LineContinuation:> |
124                             <:SourceCharacter:> - ('"' | '\' | <:LineTerminator:>)
125
126 SingleStringCharacter   ::= '\' <:EscapeSequence:> |
127                             <:LineContinuation:> |
128                             <:SourceCharacter:> - ("'" | '\' | <:LineTerminator:>)
129
130 LineContinuation        ::= '\' <:LineTerminatorSequence:>
131
132
133 EscapeSequence          ::= <:CharacterEscapeSequence:> |
134                             '0' ^<:DecimalDigit:> |
135                             <:HexEscapeSequence:> |
136                             <:UnicodeEscapeSequence:>
137
138 CharacterEscapeSequence ::= <:SingleEscapeCharacter:> |
139                             <:NonEscapeCharacter:>
140
141 SingleEscapeCharacter   ::= "'" | '"' | '\' | [bfnrtv]
142 NonEscapeCharacter      ::= <:SourceCharacter:> - (<:EscapeCharacter:> | <:LineTerminator:>)
143 EscapeCharacter         ::= <:SingleEscapeCharacter:> |
144                             <:DecimalDigit:> |
145                             'x' |
146                             'u'
147
148 HexEscapeSequence       ::= 'x' <:HexDigit:> <:HexDigit:>
149 UnicodeEscapeSequence   ::= 'u' <:HexDigit:> <:HexDigit:> <:HexDigit:> <:HexDigit:>
150
151
152 # 7.8.5 Regular Expression Literals
153 RegularExpressionLiteral::= '/' <:RegularExpressionBody:> '/' <:RegularExpressionFlags:>
154 RegularExpressionBody   ::= <:RegularExpressionFirstChar:> <:RegularExpressionChars:>?
155 RegularExpressionChars  ::= <:RegularExpressionChar:>+
156 RegularExpressionFirstChar ::= <:RegularExpressionNonTerminator:> - ( '*' | '\' | '/' | '[' ) |
157                                <:RegularExpressionBackslashSequence:> |
158                                <:RegularExpressionClass:>
159
160 RegularExpressionChar   ::= <:RegularExpressionNonTerminator:> - ( '\' | '/' | '[') |
161                             <:RegularExpressionBackslashSequence:> |
162                             <:RegularExpressionClass:>
163
164
165 RegularExpressionBackslashSequence ::= '\' <:RegularExpressionNonTerminator:>
166 RegularExpressionNonTerminator     ::= <:SourceCharacter:> - <:LineTerminator:>
167 RegularExpressionClass             ::= '[' <:RegularExpressionClassChars:> ']'
168 RegularExpressionClassChars        ::= <:RegularExpressionClassChar:>+
169 RegularExpressionClassChar         ::= <:RegularExpressionNonTerminator:> - ( ']' | '\' ) |
170                                        <:RegularExpressionBackslashSequence:>
171
172 RegularExpressionFlags             ::= <:IdentifierPart:> <:RegularExpressionFlags:> | <:IdentifierPart:>
173
174 # 11.1 Primary Expressions
175
176 PrimaryExpression       ::= <:Identifier:> |
177                             <:Literal:> |
178                             <:ArrayLiteral:> |
179                             <:ObjectLiteral:> |
180                             '(' <S>? <:Expression:> <S>? ')' |
181                             'this'
182
183 ArrayLiteral            ::= '[' <S>? <:Elision:>? <S>? ']' |
184                             '[' <S>? <:ElementList:> <S>? ']' |
185                             '[' <S>? <:ElementList:> <S>? ',' <S>? <:Elision:> <S>? ']'
186
187
188 ElementList             ::= <:Elision:>? <S>? <:AssignmentExpression:> (<S>? ',' <S>? <:Elision:>? <S>? <:AssignmentExpression:> )*
189 Elision                 ::= ',' <S>? <:Elision:> | <S>? ','
190 ObjectLiteral           ::= '{' <S>? '}' |
191                             '{' <S>? <:PropertyNameAndValueList:>  <S>? '}' |
192                             '{' <S>? <:PropertyNameAndValueList:>  <S>? ','  <S>? '}'
193
194 PropertyNameAndValueList::= <:PropertyAssignment:> ( <S>? ','  <S>? <:PropertyAssignment:>)*
195
196 PropertyAssignment      ::= <:PropertyName:>  <S>? ':'  <S>? <:AssignmentExpression:> |
197                             'get'  <S>? <:PropertyName:>  <S>? '(' <S>? ')'  <S>? '{' <S>? <:FunctionBody:>?  <S>? '}' |
198                             'set'  <S>? <:PropertyName:>  <S>? '(' <S>? <:PropertySetParameterList:>  <S>? ')' <S>? '{' <S>? <:FunctionBody:>?  <S>? '}'
199
200
201 PropertyName            ::= <:IdentifierName:> |
202                                                 <:StringLiteral:> |
203                                                 <:NumericLiteral:>
204
205 PropertySetParameterList::= <:Identifier:>
206
207
208 # 11.2 Left-Hand-Side Expressions
209 MemberExpression                                ::= <:MemberExpression:> <S>? '[' <S>? <:Expression:> <S>? ']' |
210                                                                         <:MemberExpression:> '.' <:IdentifierName:> |
211                                                                         'new' <S> <:MemberExpression:> <S>? <:Arguments:> |
212                                                                         <:FunctionExpression:> |
213                                                                         <:PrimaryExpression:>
214
215 NewExpression                                   ::= <:NewKeyword:> <S>? <:NewExpression:> |
216                                                                         <:MemberExpression:>
217
218
219 CallExpression                                  ::= <:CallExpression:> <:Arguments:> |
220                                                                         <:CallExpression:> <S>? '[' <S>? Expression <S>? ']' |
221                                                                         <:CallExpression:> '.' <:IdentifierName:> |
222                                                                         <:MemberExpression:> <S>? <:Arguments:>
223
224 Arguments                                               ::= '(' <S>? ')' |
225                                                                 '(' <S>? <:ArgumentList:> <S>? ')'
226 ArgumentList                                    ::= <:ArgumentList:> <S>? ',' <S>? <:AssignmentExpression:> |
227                                                                         <:AssignmentExpression:>
228 LeftHandSideExpression                  ::= <:CallExpression:> | <:NewExpression:>
229         
230 # 11.3 Postfix Expressions
231 PostfixOperator         ::= '++' | '--'
232 PostfixExpression       ::= <:LeftHandSideExpression:> <:PostfixOperator:>?
233
234 # 11.4 Unary Operators
235 UnaryOperator               ::= 'delete' | 'void' | 'typeof' | '++' | '--' | '+' | '-' | '~' | '!'
236 UnaryExpression             ::= <S>? <:UnaryOperator:> <S>? <:UnaryExpression:> | <:PostfixExpression:>
237
238
239 # 11.5 Multiplicative Operators
240 MultiplicativeOperator  ::= '*' | '/' | '%'
241 MultiplicativeExpressionOp              ::= <:MultiplicativeExpression:> <S>? <:MultiplicativeOperator:> <S>? <:UnaryExpression:>
242 MultiplicativeExpression                ::= <:MultiplicativeExpressionOp:> |
243                                                                 <:UnaryExpression:>
244
245
246 # 11.6 Additive Operators
247 AdditiveOperator                                ::= '+' | '-'
248 AdditiveExpressionOp                    ::= <:AdditiveExpression:> <S>? <:AdditiveOperator:> <S>? <:MultiplicativeExpression:>
249 AdditiveExpression                              ::= <:AdditiveExpressionOp:> |
250                                                                 <:MultiplicativeExpression:>
251
252 11.7 Bitwise Shift Operators
253 ShiftOperator                                   ::= '>>>' | '<<' | '>>'
254 ShiftExpression                                 ::= <:ShiftExpression:> <S>? <:ShiftOperator:> <S>? <:AdditiveExpression:> |
255                                                                 <:AdditiveExpression:>
256
257 # 11.8 Relational Operators
258 RelationalOperatorNoIn  ::= '<=' | '>=' | '<' | '>' | 'instanceof'
259 RelationalOperator      ::= <:RelationalOperatorNoIn:> | 'in'
260 RelationalExpression    ::= <:RelationalExpression:> <S>? <:RelationalOperator:> <S>? <:ShiftExpression:> |
261                             <:ShiftExpression:>
262 RelationalExpressionNoIn::= <:RelationalExpressionNoIn:> <S>? <:RelationalOperatorNoIn:> <S>? <:ShiftExpression:> |
263                             <:ShiftExpression:>
264
265
266 # 11.9 Equality Operators
267 EqualityOperator        ::= '===' | '==' | '!==' | '!='
268 EqualityExpression      ::= <:EqualityExpression:> <S>? <:EqualityOperator:> <S>? <:RelationalExpression:> |
269                             <:RelationalExpression:>
270 EqualityExpressionNoIn  ::= <:EqualityExpression:> <S>? <:EqualityOperator:> <S>? <:RelationalExpressionNoIn:> |
271                             <:RelationalExpressionNoIn:>
272
273 # 11.10 Binary Bitwise Operators
274 BitwiseANDExpression    ::= <:BitwiseANDExpression:> <S>? <:BitwiseANDOperator:> <S>? <:EqualityExpression:> |
275                             <:EqualityExpression:>
276 BitwiseANDExpressionNoIn::= <:BitwiseANDExpressionNoIn:> <S>? <:BitwiseANDOperator:> <S>? <:EqualityExpressionNoIn:> |
277                             <:EqualityExpressionNoIn:>
278 BitwiseANDOperator      ::= '&'
279
280
281 BitwiseXORExpression    ::= <:BitwiseXORExpression:> <S>? <:BitwiseXOROperator:> <S>? <:BitwiseANDExpression:> |
282                             <:BitwiseANDExpression:>
283 BitwiseXORExpressionNoIn::= <:BitwiseXORExpressionNoIn:> <S>? <:BitwiseXOROperator:> <S>? <:BitwiseANDExpressionNoIn:> |
284                             <:BitwiseANDExpressionNoIn:>
285 BitwiseXOROperator      ::= '^'
286
287 BitwiseORExpression     ::= <:BitwiseORExpression:> <S>? <:BitwiseOROperator:> <S>? <:BitwiseXORExpression:> |
288                             <:BitwiseXORExpression:>
289 BitwiseORExpressionNoIn::= <:BitwiseORExpressionNoIn:> <S>? <:BitwiseOROperator:> <S>? <:BitwiseXORExpressionNoIn:> |
290                            <:BitwiseXORExpressionNoIn:>
291 BitwiseOROperator       ::= '|'
292
293
294
295 # 11.11 Binary Logical Operators
296 LogicalANDExpression    ::= <:LogicalANDExpression:> <S>? <:LogicalANDOperator:>  <S>? <:BitwiseORExpression:> |
297                             <:BitwiseORExpression:>
298 LogicalANDExpressionNoIn::= <:LogicalANDExpressionNoIn:> <S>? <:LogicalANDOperator:>  <S>? <:BitwiseORExpressionNoIn:> |
299                             <:BitwiseORExpressionNoIn:>
300 LogicalANDOperator      ::= '&&'
301
302 LogicalORExpression     ::= <:LogicalORExpression:> <S>? <:LogicalOROperator:> <S>? <:LogicalANDExpression:> |
303                             <:LogicalANDExpression:>
304 LogicalORExpressionNoIn ::= <:LogicalORExpressionNoIn:> <S>? <:LogicalOROperator:> <S>? <:LogicalANDExpressionNoIn:> |
305                             <:LogicalANDExpressionNoIn:> 
306 LogicalOROperator       ::= '||'
307
308 # 11.12 Conditional Operator ( ? : )
309 ConditionalExpression   ::= <:LogicalORExpression:> ( <S>? '?' <S>? <:AssignmentExpression:> <S>? ':' <S>? <:AssignmentExpression:> )?
310 ConditionalExpressionNoIn::=<:LogicalORExpressionNoIn:> ( <S>? '?' <S>? <:AssignmentExpression:> <S>? ':' <S>? <:AssignmentExpressionNoIn:> )?
311
312 # 11.13 Assignment Operators
313 AssignmentExpression    ::= <:LeftHandSideExpression:> <S>? <:AssignmentOperator:> <S>? <:AssignmentExpression:> | <:ConditionalExpression:>
314 AssignmentExpressionNoIn::= <:LeftHandSideExpression:> <S>? <:AssignmentOperator:> <S>? <:AssignmentExpressionNoIn:> | <:ConditionalExpressionNoIn:>
315 AssignmentOperator      ::= '=' | '*=' | '/=' | '%=' | '+=' | '-=' | '<<=' | '>>=' | '>>>=' | '&=' | '^=' | '|='
316
317
318 # 11.14 Comma Operator  ( , )
319 Expression              ::= <:AssignmentExpression:> ( <S>? ',' <S>? <:AssignmentExpression:> )*
320 ExpressionNoIn          ::= <:AssignmentExpressionNoIn:> ( <S>? ',' <S>? <:AssignmentExpressionNoIn:> )*
321
322
323 # 12 Statements
324
325 Statement               ::= <:Block:> |
326                             <:Comment:> |
327                             <:VariableStatement:> |
328                             <:EmptyStatement:> |
329                             <:ExpressionStatement:> |
330                             <:IfStatement:> |
331                             <:IterationStatement:> |
332                             <:ContinueStatement:> |
333                             <:BreakStatement:> |
334                             <:ReturnStatement:> |
335                             <:ImportStatement:> |
336                             <:WithStatement:> |
337                             <:LabelledStatement:> |
338                             <:SwitchStatement:> |
339                             <:ThrowStatement:> |
340                             <:TryStatement:> |
341                             <:DebuggerStatement:>
342
343 # 12.1 Block
344 Block                   ::= '{' <S>? <:StatementList:>? <S>? '}'
345 StatementList           ::= (<S>? <:Statement:>)+
346
347 # 12.2 Variable Statement
348 VariableStatement       ::= 'var' <S>? <:VariableDeclarationList:> (<S>? ';')
349 VariableDeclarationList ::= <:VariableDeclaration:> (<S>? ',' <S>? <:VariableDeclaration:> )*
350 VariableDeclarationListNoIn::= <:VariableDeclarationNoIn:> (<S>? ',' <S>? <:VariableDeclarationNoIn:> )*
351 VariableDeclaration     ::= <:Identifier:> <:Initialiser:>?
352 VariableDeclarationNoIn ::= <:Identifier:> <:InitialiserNoIn:>?
353 Initialiser             ::= <S>? '=' <S>? <:AssignmentExpression:>
354 InitialiserNoIn         ::= <S>? '=' <S>? <:AssignmentExpressionNoIn:>
355
356 # 12.3 Empty Statement
357 EmptyStatement          ::= <S>? ';'
358
359
360 # 12.4 Expression Statement
361 ExpressionStatement     ::= (<:Expression:> - ('function' | '{')) (<S>? ';')
362
363 12.5 The if Statement
364 IfStatement             ::= 'if' <S>? '(' <S>? <:Expression:> <S>? ')'<S>? <:Statement:> <S>? 'else' <S>? <:Statement:> |
365                             'if' <S>? '(' <S>? <:Expression:> <S>? ')'<S>? <:Statement:> 
366
367
368
369
370 # 12.6 Iteration Statements
371 IterationStatement      ::= 'do' <S>? <:Statement:> <S>? 'while' <S>? '(' <S>? <:Expression:> <S>? ')' (<S>? ';') |
372             'while' <S>? '(' <S>? <:Expression:> <S>? ')' <S>? <:Statement:> |
373             'for' <S>? '(' <S>?'var' <S>? <:VariableDeclarationListNoIn:> <S>? ';' <S>? <:Expression:>? <S>? ';'<S>? <:Expression:>? <S>? ')' <S>? <:Statement:> |
374             'for' <S>? '(' <S>?'var' <S>? <:VariableDeclarationNoIn:> <S>? 'in' <S>? <:Expression:> <S>? ')' <S>?  <:Statement:> |
375             'for' <S>? '(' <S>? <:LeftHandSideExpression:> <S>? 'in' <S>? <:Expression:> <S>? ')' <S>?  <:Statement:> |
376             'for' <S>? '(' <S>? <:ExpressionNoIn:>? <S>? ';' <S>? <:Expression:>? <S>? ';' <S>? <:Expression:>? <S>? ')' <S>? <:Statement:>
377
378
379 # 12.7 The continue Statement
380 ContinueStatement       ::= ('continue' - 'continue' <:IdentifierPart:>) <WhiteSpace>* <:Identifier:>? (<S>? ';')
381
382
383 # 12.8 The break Statement
384 BreakStatement          ::= ('break' - 'break' <:IdentifierPart:>)<WhiteSpace>* <:Identifier:>? (<S>? ';')
385
386
387 # 12.9 The return Statement
388 ReturnStatement         ::= ('return' - 'return' <:IdentifierPart:>) <WhiteSpace>* <:Expression:>? (<S>? ';')
389
390
391 # 12.10 The with Statement
392 WithStatement           ::= 'with' <S>? '(' <S>? <:Expression:> <S>? ')' <S>? <:Statement:>
393
394
395 # 12.11 The switch Statement
396 SwitchStatement         ::= 'switch' <S>? '(' <S>? <:Expression:> <S>? ')' <S>? <:CaseBlock:>
397
398 CaseBlock               ::= '{' <S>? <:CaseClauses:>? <S>? <:DefaultClause:> <S>? <:CaseClauses:>? <S>? '}' |
399                             '{' <S>? <:CaseClauses:>? <S>? '}'
400
401
402
403 CaseClauses             ::= (<S>? <:CaseClause:>)+
404
405 CaseClause              ::= 'case' <S>? <:Expression:> <S>? ':' <S>? <:StatementList:>?
406 DefaultClause           ::= 'default' <S>? ':' <S>? <:StatementList:>
407
408 # 12.12 Labelled Statements
409 LabelledStatement       ::= <:Identifier:> <S>? ':' <S>? <:Statement:>
410
411 # 12.13 The throw Statement
412 ThrowStatement          ::= ('throw' - 'throw' <:IdentifierPart:>) <WhiteSpace>* <:Expression:> (<S>? ';')
413
414 12.14 The try Statement
415 TryStatement            ::= 'try' <S>? <:Block:> <S>? <:Catch:> <S>? <:Finally:> |
416                             'try' <S>? <:Block:> <S>? <:Catch:> |
417                             'try' <S>? <:Block:> <S>? <:Finally:>
418
419
420 Catch                   ::= 'catch' <S>? '(' <:Identifier:> ')' <S>? <:Block:>
421 Finally                 ::= 'finally' <S>? <:Block:>
422
423 # 12.15 The debugger statement
424 DebuggerStatement       ::= 'debugger' <S>? ';'
425
426
427 # 13 Function Definition
428 FunctionDeclaration     ::= ('function'-'function'<:IdentifierPart:>)<S>?<:Identifier:><S>?'('<S>?<:FormalParameterList:>?<S>?')'<S>?'{'<S>?<:FunctionBody:>?<S>?'}'
429 FunctionExpression      ::= ('function'-'function'<:IdentifierPart:>)<S>?<:Identifier:>?<S>?'('<S>?<:FormalParameterList:>?<S>?')'<S>?'{'<S>?<:FunctionBody:>?<S>?'}'
430 FormalParameterList     ::= <:Identifier:> ( <S>? ',' <S>? <:Identifier:> )*
431 FunctionBody            ::= <:SourceElements:>
432
433
434 # Other
435 ImportStatement         ::= 'import' <:Name:> ( '.' '*' )? (<S>? ';')
436 Name                    ::= <:IdentifierName:> ( '.' <:IdentifierName:> )*
437
438
439 # 14 Program
440 SourceElements          ::= (<S>? <:SourceElement:>)+
441 SourceElement           ::= <:FunctionDeclaration:> |
442                             <:Statement:>
443 Program                 ::= <:SourceElements:>?
444
445 <:Program:>