Para estudar bem a linguagem temos que entender bem ela, resolvi dar uma ollhadinha se achava a notação bnf (Baccus Formal Normal) de javascript
De acordo com:
https://github.com/luqui/jsexp/blob/7e1ad367545ee482a16a5712a0a7f2a17604d8f5/grammars/javascript.js
var javascript_grammar = {
program: [ [ 'stmts' ] ],
stmts: [ [ ],
[ 'stmt', 'more_stmts' ] ],
more_stmts: [ [ ],
[ /^;/, 'stmts' ] ],
stmt: [ [ 'var_decl' ],
[ 'expr' ],
[ 'block' ],
[ 'return_stmt' ],
[ 'void_stmt' ],
[ 'for_stmt' ],
[ 'foreach_stmt' ],
[ 'if_stmt' ],
[ 'function_stmt' ] ],
return_stmt: [ [ 'return_keyword', /^\s+/, 'expr' ] ],
void_stmt: [ [ 'void_keyword', /^\s+/, 'expr' ] ],
function_stmt: [ [ 'function_keyword', /^\s+/, 'identifier', /^\(/, 'arg_list', /^\)/, 'block' ] ],
// TODO what is the syntactic class of the first clause?
for_stmt: [ [ 'for_keyword', /^\(/, 'stmt', /^;/, 'expr', /^;/, 'expr', /^\)/, 'stmt' ] ],
foreach_stmt: [ [ 'for_keyword', /^\(/, 'foreach_var_decl', /^\s+/, 'in_keyword', 'expr', /^\)/, 'stmt' ] ],
if_stmt: [ [ 'if_keyword', /^\(/, 'expr', /^\)/, 'stmt', 'else_clause' ] ],
else_clause: [ [ ], [ 'else_keyword', 'stmt' ] ],
foreach_var_decl: [ [ 'var_keyword', 'identifier' ],
[ 'identifier' ] ],
var_decl: [ [ 'var_keyword', /^\s+/, 'initializer_list' ] ],
initializer_list: [ [ 'initializer' ],
[ 'initializer_list', /^,/, 'initializer' ] ],
initializer: [ [ 'identifier', /^=/, 'expr' ] ],
identifier: [ [ /^[a-zA-Z_$][\w$]*/ ] ],
expr: [ [ 'assignment_expr' ] ],
assignment_expr: [ [ 'operator_expr' ],
[ 'operator_expr', 'assignment_operator', 'assignment_expr' ] ],
assignment_operator: [ [ /^[+*\/%-]?=/ ] ],
// not modeling all precedence levels
operator_expr: [ [ 'unary_expr' ],
[ 'unary_expr', 'operator', 'operator_expr' ] ],
operator: [ [ /^(\+|-|\*|\/|%|==|!=|>|>=|<|<=|===|!==|\|\||&&|in)/ ] ],
unary_expr: [ [ 'atomic_expr' ],
[ 'prefix_operator', 'unary_expr' ] ],
prefix_operator: [ [ /^(\+\+|--|\+|-|!)/ ] ],
postfix_operator: [ [ /^(\+\+|--)/ ] ],
atomic_expr: [ [ 'literal' ],
[ 'function_expr' ],
[ 'array_expr' ],
[ 'object_expr' ],
[ 'index_expr' ],
[ 'funcall_expr' ],
[ 'variable' ],
[ /^\(/, 'expr', /^\)/ ] ],
literal: [ [ floating_point_regexp ],
[ /^"/, 'dq_string', /^"/ ],
[ /^'/, 'sq_string', /^'/ ],
[ /\//, 'slash_string', /\// ] ],
dq_string: [ [ /^[^"\\]*(\\.[^"\\]*)*/ ] ],
sq_string: [ [ /^[^'\\]*(\\.[^'\\]*)*/ ] ],
slash_string: [ [ /^[^\/\\]*(\\.[^\/\\]*)*/ ] ],
function_expr: [ [ 'function_keyword', /^\(/, 'arg_list', /^\)/, 'block' ] ],
arg_list: [ [ ], [ 'identifier', 'more_arg_list' ] ],
more_arg_list: [ [ ], [ /^,/, 'identifier', 'more_arg_list' ] ],
block: [ [ 'open_brace', 'stmts', /^\}/ ] ],
array_expr: [ [ /^\[/, 'expr_list', /^\]/ ] ],
expr_list: [ [ ], [ 'expr', 'more_expr_list' ] ],
more_expr_list: [ [ ], [ /^,/, 'expr', 'more_expr_list' ] ],
object_expr: [ [ 'open_brace', 'property_list', /^\}/ ] ],
property_list: [ [ ], [ 'property_kv', 'more_property_list' ] ],
more_property_list: [ [ ], [ /^,/, 'property_kv', 'more_property_list' ] ],
property_kv: [ [ 'property_key', /^:/, 'expr' ] ],
property_key: [ [ 'identifier' ],
[ 'literal' ] ], // not exactly right. eg. regexes can't be keys
index_expr: [ [ 'atomic_expr', /^\[/, 'expr', /^\]/ ],
[ 'atomic_expr', /^\./, 'identifier' ] ],
funcall_expr: [ [ 'atomic_expr', /^\(/, 'expr_list', /^\)/ ] ],
variable: [ [ 'identifier' ] ],
var_keyword: [ [ /^var/ ] ],
function_keyword: [ [ /^function/ ] ],
return_keyword: [ [ /^return/ ] ],
void_keyword: [ [ /^void/ ] ],
for_keyword: [ [ /^for/ ] ],
in_keyword: [ [ /^in/ ] ],
if_keyword: [ [ /^if/ ] ],
else_keyword: [ [ /^else/ ] ],
open_brace: [ [ /^{/ ] ],
};
http://javascript.comsci.us/syntax/statement/bnf.html
BNF
- executable-statement
- labeled-statement
- unlabeled-statement
- simple-statement
- ::=
- ::=
- structured-statement
- ::=
- ::=
- ::=
- ::=
- block-statement-list
- block-statement
- compound-statement
- ::= '{' '}'
- do-statement
- ::= 'do' 'while' '(' ')'
- expression-statement
- ::= ';'
- for-statement
- if-statement
- ::= 'if' '(' ')'
- if-else-statement
- ::= 'if' '(' ')' 'else'
- jump-statement
- ::=
- ::=
- ::=
- return-statement
- ::= 'return' ';'
- ::= 'return' ';'
- switch-statement
- ::= 'switch' '(' ')' '{' '}'
- while-statement
- ::= 'while' '(' ')'
-
- http://javascript.comsci.us/syntax/statement/index.html
-
-
-
-
-
-
- Notação BNF do php:
-
- http://php.comsci.us/syntax/statement/bnf.php
- ::=
- ::=
- ::=
- ::=
- ::=
- ::=
- ::=
- ::=
- ::=
- ::=
- ::=
- ::=
- ::=
- ::=
- ::=
- ::=
- ::=
- ::=
- ::=
- ::=
- ::=
- ::=
- ::= 'break' ';'
- ::= 'break' ';'
- ::= '{' '}'
- ::= 'continue' ';'
- ::= 'continue' ';'
- ::= 'do' 'while' '(' ')' ';'
- ::= 'for' '(' ';' ';' ')'
- ::= 'if' '(' ')'
- ::= 'if' '(' ')' 'else'
- ::= 'if' '(' ')'
- ::= 'if' '(' ')'
- ::= 'return' ';'
- ::= 'return' ';'
- ::= 'return' ';'
- ::= 'switch' '(' ')' '{' '}'
- ::= 'while' '(' ')'
-
-
-
- Do Sql:
- http://savage.net.au/SQL/sql-2003-2.bnf.html
- http://savage.net.au/SQL/sql-92.bnf.html
- http://savage.net.au/SQL/index.html
- http://en.wikipedia.org/wiki/Syntax_diagram/
-
- http://en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form
- http://en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form
- http://www.flickr.com/photos/nicksieger/280662871/
- http://blog.nicksieger.com/articles/2006/10/27/visualization-of-rubys-grammar
- Ainda de acordo com o anexo da Standard ECMA-262
ECMAScript Language Specification 5.1 Edition / June 2011:
http://www.ecma-international.org/publications/standards/Ecma-262.htm
- A.1 Lexical Grammar
SourceCharacter :: See clause 6
any Unicode code unit
InputElementDiv :: See clause 7
WhiteSpace
LineTerminator
Comment
Token
DivPunctuator
InputElementRegExp :: See clause 7
WhiteSpace
LineTerminator
Comment
Token
RegularExpressionLiteral
WhiteSpace :: See 7.2
LineTerminator :: See 7.3
LineTerminatorSequence :: See 7.3
[lookahead ]
Comment ::
MultiLineComment
SingleLineComment - MultiLineComment :: See 7.4
/* MultiLineCommentCharsopt */
MultiLineCommentChars :: See 7.4
MultiLineNotAsteriskChar MultiLineCommentCharsopt
* PostAsteriskCommentCharsopt
PostAsteriskCommentChars :: See 7.4
MultiLineNotForwardSlashOrAsteriskChar MultiLineCommentCharsopt
* PostAsteriskCommentCharsopt
MultiLineNotAsteriskChar :: See 7.4
SourceCharacter but not *
MultiLineNotForwardSlashOrAsteriskChar :: See 7.4
SourceCharacter but not one of / or *
SingleLineComment :: See 7.4
// SingleLineCommentCharsopt
SingleLineCommentChars :: See 7.4
SingleLineCommentChar SingleLineCommentCharsopt
SingleLineCommentChar :: See 7.4
SourceCharacter but not LineTerminator
Token :: See 7.5
IdentifierName
Punctuator
NumericLiteral
StringLiteral
Identifier :: See 7.6
IdentifierName but not ReservedWord
IdentifierName :: See 7.6
IdentifierStart
IdentifierName IdentifierPart
IdentifierStart ::
UnicodeLetter
$
_
\ UnicodeEscapeSequence - IdentifierPart ::
IdentifierStart
UnicodeCombiningMark
UnicodeDigit
UnicodeConnectorPunctuation
See 7.6
UnicodeLetter ::
See 7.6
any character in the Unicode categories ―Uppercase letter (Lu)‖, ―Lowercase letter
(Ll)‖, ―Titlecase letter (Lt)‖, ―Modifier letter (Lm)‖, ―Other letter (Lo)‖, or ―Letter
number (Nl)‖.
UnicodeCombiningMark ::
See 7.6
any character in the Unicode categories ―Non-spacing mark (Mn)‖ or ―Combining
spacing mark (Mc)‖
UnicodeDigit :: See 7.6
any character in the Unicode category ―Decimal number (Nd)‖
UnicodeConnectorPunctuation :: See 7.6
any character in the Unicode category ―Connector punctuation (Pc)‖
ReservedWord :: See 7.6.1
Keyword
FutureReservedWord
NullLiteral
BooleanLiteral
Keyword :: one of do instanceof typeof
break else new var
case finally return void
catch for switch while
continue function this with
debugger if throw
default in try
delete
See 7.6.1.1
FutureReservedWord :: one of enum extends super
class export import
const
See 7.6.1.2
The following tokens are also considered to be FutureReservedWords when parsing strict mode
code (see 10.1.1).
implements
interface
yield
let
package
private
protected
public
static
Punctuator :: one of
{
}
See 7.7
( ) [ ]
<=
. ; , < > >= == != === !== + - * % ++ --
<< >> >>> & | ^
! ~ && || ? :
= += -= *= %= <<=
>>= >>>= &= |= ^= DivPunctuator :: one of See 7.7
/
/=
Literal :: See 7.8
NullLiteral
BooleanLiteral
NumericLiteral
StringLiteral
RegularExpressionLiteral
NullLiteral :: See 7.8.1
null
BooleanLiteral :: See 7.8.2
true
false
NumericLiteral :: See 7.8.3
DecimalLiteral
HexIntegerLiteral
DecimalLiteral :: See 7.8.3
DecimalIntegerLiteral . DecimalDigitsopt ExponentPartopt
. DecimalDigits ExponentPartopt
DecimalIntegerLiteral ExponentPartopt
DecimalIntegerLiteral :: See 7.8.3
0
NonZeroDigit DecimalDigitsopt
DecimalDigits :: See 7.8.3
DecimalDigit
DecimalDigits DecimalDigit
DecimalDigit :: one of
0 1 2 3 4 5 6 7 8 9
NonZeroDigit :: one of
1 2 3 4 5
See 7.8.3
6
7
8
9
ExponentPart :: See 7.8.3
ExponentIndicator SignedInteger
ExponentIndicator :: one of See 7.8.3
e E
SignedInteger :: See 7.8.3
DecimalDigits
+ DecimalDigits
- DecimalDigits
HexIntegerLiteral :: See 7.8.3
0x HexDigit
0X HexDigit
HexIntegerLiteral HexDigit
HexDigit :: one of See 7.8.3
0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F
StringLiteral :: See 7.8.4
" DoubleStringCharactersopt "
' SingleStringCharactersopt '
DoubleStringCharacters :: See 7.8.4
DoubleStringCharacter DoubleStringCharactersopt
SingleStringCharacters :: See 7.8.4
SingleStringCharacter SingleStringCharactersopt
DoubleStringCharacter :: See 7.8.4
SourceCharacter but not one of " or \ or LineTerminator
\ EscapeSequence
LineContinuation
SingleStringCharacter :: See 7.8.4
SourceCharacter but not one of ' or \ or LineTerminator
\ EscapeSequence
LineContinuation
LineContinuation :: See 7.8.4
\ LineTerminatorSequence
EscapeSequence :: See 7.8.4
CharacterEscapeSequence
0 [lookahead DecimalDigit]
HexEscapeSequence
UnicodeEscapeSequence
CharacterEscapeSequence :: See 7.8.4
SingleEscapeCharacter
NonEscapeCharacter
SingleEscapeCharacter :: one of
' " \ b f n r t v - NonEscapeCharacter :: See 7.8.4
SourceCharacter but not one of EscapeCharacter or LineTerminator
EscapeCharacter :: See 7.8.4
SingleEscapeCharacter
DecimalDigit
x
u
HexEscapeSequence :: See 7.8.4
x HexDigit HexDigit
UnicodeEscapeSequence :: See 7.8.4
u HexDigit HexDigit HexDigit HexDigit
RegularExpressionLiteral :: See 7.8.5
/ RegularExpressionBody / RegularExpressionFlags
RegularExpressionBody :: See 7.8.5
RegularExpressionFirstChar RegularExpressionChars
RegularExpressionChars :: See 7.8.5
[empty]
RegularExpressionChars RegularExpressionChar
RegularExpressionFirstChar :: See 7.8.5
RegularExpressionNonTerminator but not one of * or \ or / or [
RegularExpressionBackslashSequence
RegularExpressionClass
RegularExpressionChar :: See 7.8.5
RegularExpressionNonTerminator but not \ or / or [
RegularExpressionBackslashSequence
RegularExpressionClass
RegularExpressionBackslashSequence :: See 7.8.5
\ RegularExpressionNonTerminator
RegularExpressionNonTerminator :: See 7.8.5
SourceCharacter but not LineTerminator
RegularExpressionClass :: See 7.8.5
[ RegularExpressionClassChars ]
RegularExpressionClassChars :: See 7.8.5
[empty]
RegularExpressionClassChars RegularExpressionClassChar
RegularExpressionClassChar ::
RegularExpressionNonTerminator but not ] or \
RegularExpressionBackslashSequence - gularExpressionFlags ::
See 7.8.5
[empty]
RegularExpressionFlags IdentifierPart
A.2 Number Conversions
StringNumericLiteral ::: See 9.3.1
StrWhiteSpaceopt
StrWhiteSpaceopt StrNumericLiteral StrWhiteSpaceopt
StrWhiteSpace ::: See 9.3.1
StrWhiteSpaceChar StrWhiteSpaceopt
StrWhiteSpaceChar ::: See 9.3.1
WhiteSpace
LineTerminator
StrNumericLiteral ::: See 9.3.1
StrDecimalLiteral
HexIntegerLiteral
StrDecimalLiteral ::: See 9.3.1
StrUnsignedDecimalLiteral
+ StrUnsignedDecimalLiteral
- StrUnsignedDecimalLiteral
StrUnsignedDecimalLiteral ::: See 9.3.1
Infinity
DecimalDigits . DecimalDigitsopt ExponentPartopt
. DecimalDigits ExponentPartopt
DecimalDigits ExponentPartopt
DecimalDigits ::: See 9.3.1
DecimalDigit
DecimalDigits DecimalDigit
DecimalDigit ::: one of
0 1 2 3 4
See 9.3.1
5
6
7
8
9
ExponentPart ::: See 9.3.1
ExponentIndicator SignedInteger
ExponentIndicator ::: one of See 9.3.1
e E
SignedInteger :::
DecimalDigits
+ DecimalDigits
- DecimalDigits - HexIntegerLiteral ::: See 9.3.1
0x HexDigit
0X HexDigit
HexIntegerLiteral HexDigit
HexDigit ::: one of See 9.3.1
0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F
A.3 Expressions
PrimaryExpression : See 11.1
this
Identifier
Literal
ArrayLiteral
ObjectLiteral
( Expression )
ArrayLiteral : See 11.1.4
[ Elisionopt ]
[ ElementList ]
[ ElementList , Elisionopt ]
ElementList : See 11.1.4
Elisionopt AssignmentExpression
ElementList , Elisionopt AssignmentExpression
Elision : See 11.1.4
,
Elision ,
ObjectLiteral : See 11.1.5
{ }
{ PropertyNameAndValueList }
{ PropertyNameAndValueList , }
PropertyNameAndValueList : See 11.1.5
PropertyAssignment
PropertyNameAndValueList , PropertyAssignment
PropertyAssignment : See 11.1.5
PropertyName : AssignmentExpression
get PropertyName ( ) { FunctionBody }
set PropertyName ( PropertySetParameterList ) { FunctionBody }
PropertyName : See 11.1.5
IdentifierName
StringLiteral
NumericLiteral
PropertySetParameterList :
Identifier
MemberExpression : See 11.2
PrimaryExpression
FunctionExpression
MemberExpression [ Expression ]
MemberExpression . IdentifierName
new MemberExpression Arguments
NewExpression : See 11.2
MemberExpression
new NewExpression
CallExpression : See 11.2
MemberExpression Arguments
CallExpression Arguments
CallExpression [ Expression ]
CallExpression . IdentifierName
Arguments : See 11.2
()
( ArgumentList )
ArgumentList : See 11.2
AssignmentExpression
ArgumentList , AssignmentExpression
LeftHandSideExpression : See 11.2
NewExpression
CallExpression
PostfixExpression : See 11.3
LeftHandSideExpression
LeftHandSideExpression [no LineTerminator here] ++
LeftHandSideExpression [no LineTerminator here] --
UnaryExpression : See 11.4
PostfixExpression
delete UnaryExpression
void UnaryExpression
typeof UnaryExpression
++ UnaryExpression
-- UnaryExpression
+ UnaryExpression
- UnaryExpression
~ UnaryExpression
! UnaryExpression
MultiplicativeExpression :
UnaryExpression
MultiplicativeExpression * UnaryExpression
MultiplicativeExpression / UnaryExpression
MultiplicativeExpression % UnaryExpression - AdditiveExpression : See 11.6
MultiplicativeExpression
AdditiveExpression + MultiplicativeExpression
AdditiveExpression - MultiplicativeExpression
ShiftExpression : See 11.7
AdditiveExpression
ShiftExpression << AdditiveExpression
ShiftExpression >> AdditiveExpression
ShiftExpression >>> AdditiveExpression
RelationalExpression : See 11.8
ShiftExpression
RelationalExpression < ShiftExpression
RelationalExpression > ShiftExpression
RelationalExpression <= ShiftExpression
RelationalExpression >= ShiftExpression
RelationalExpression instanceof ShiftExpression
RelationalExpression in ShiftExpression
RelationalExpressionNoIn : See 11.8
ShiftExpression
RelationalExpressionNoIn < ShiftExpression
RelationalExpressionNoIn > ShiftExpression
RelationalExpressionNoIn <= ShiftExpression
RelationalExpressionNoIn >= ShiftExpression
RelationalExpressionNoIn instanceof ShiftExpression
EqualityExpression : See 11.9
RelationalExpression
EqualityExpression == RelationalExpression
EqualityExpression != RelationalExpression
EqualityExpression === RelationalExpression
EqualityExpression !== RelationalExpression
EqualityExpressionNoIn : See 11.9
RelationalExpressionNoIn
EqualityExpressionNoIn == RelationalExpressionNoIn
EqualityExpressionNoIn != RelationalExpressionNoIn
EqualityExpressionNoIn === RelationalExpressionNoIn
EqualityExpressionNoIn !== RelationalExpressionNoIn
BitwiseANDExpression : See 11.10
EqualityExpression
BitwiseANDExpression & EqualityExpression
BitwiseANDExpressionNoIn :
EqualityExpressionNoIn
BitwiseANDExpressionNoIn & EqualityExpressionNoIn
BitwiseXORExpression : See 11.10
BitwiseANDExpression
BitwiseXORExpression ^ BitwiseANDExpression
BitwiseXORExpressionNoIn : See 11.10
BitwiseANDExpressionNoIn
BitwiseXORExpressionNoIn ^ BitwiseANDExpressionNoIn
BitwiseORExpression : See 11.10
BitwiseXORExpression
BitwiseORExpression | BitwiseXORExpression
BitwiseORExpressionNoIn : See 11.10
BitwiseXORExpressionNoIn
BitwiseORExpressionNoIn | BitwiseXORExpressionNoIn
LogicalANDExpression : See 11.11
BitwiseORExpression
LogicalANDExpression && BitwiseORExpression
LogicalANDExpressionNoIn : See 11.11
BitwiseORExpressionNoIn
LogicalANDExpressionNoIn && BitwiseORExpressionNoIn
LogicalORExpression : See 11.11
LogicalANDExpression
LogicalORExpression || LogicalANDExpression
LogicalORExpressionNoIn : See 11.11
LogicalANDExpressionNoIn
LogicalORExpressionNoIn || LogicalANDExpressionNoIn
ConditionalExpression : See 11.12
LogicalORExpression
LogicalORExpression ? AssignmentExpression : AssignmentExpression
ConditionalExpressionNoIn : See 11.12
LogicalORExpressionNoIn
LogicalORExpressionNoIn ? AssignmentExpression : AssignmentExpressionNoIn
AssignmentExpression : See 11.13
ConditionalExpression
LeftHandSideExpression = AssignmentExpression
LeftHandSideExpression AssignmentOperator AssignmentExpression
AssignmentExpressionNoIn :
ConditionalExpressionNoIn
LeftHandSideExpression = AssignmentExpressionNoIn
LeftHandSideExpression AssignmentOperator AssignmentExpressionNoIn - AssignmentOperator : one of
*=
/=
%=
+=
See 11.13
-=
<<=
>>=
>>>= &=
^=
|=
Expression : See 11.14
AssignmentExpression
Expression , AssignmentExpression
ExpressionNoIn : See 11.14
AssignmentExpressionNoIn
ExpressionNoIn , AssignmentExpressionNoIn
A.4 Statements
Statement : See clause 12
Block
VariableStatement
EmptyStatement
ExpressionStatement
IfStatement
IterationStatement
ContinueStatement
BreakStatement
ReturnStatement
WithStatement
LabelledStatement
SwitchStatement
ThrowStatement
TryStatement
DebuggerStatement
Block : See 12.1
{ StatementListopt }
StatementList : See 12.1
Statement
StatementList Statement
VariableStatement : See 12.2
var VariableDeclarationList ;
VariableDeclarationList : See 12.2
VariableDeclaration
VariableDeclarationList , VariableDeclaration
VariableDeclarationListNoIn : See 12.2
VariableDeclarationNoIn
VariableDeclarationListNoIn , VariableDeclarationNoIn
VariableDeclaration : See 12.2
Identifier Initialiseropt
VariableDeclarationNoIn : See 12.2
Identifier InitialiserNoInopt
Initialiser : See 12.2
= AssignmentExpression
InitialiserNoIn : See 12.2
= AssignmentExpressionNoIn
EmptyStatement : See 12.3
;
ExpressionStatement :
[lookahead {{, function}] Expression
See 12.4
;
IfStatement : See 12.5
if ( Expression ) Statement else Statement
if ( Expression ) Statement
IterationStatement : See 12.6
do Statement while ( Expression );
while ( Expression ) Statement
for (ExpressionNoInopt; Expressionopt ; Expressionopt ) Statement
for ( var VariableDeclarationListNoIn; Expressionopt ; Expressionopt ) Statement
for ( LeftHandSideExpression in Expression ) Statement
for ( var VariableDeclarationNoIn in Expression ) Statement
ContinueStatement : See 12.7
continue ;
continue [no LineTerminator here] Identifier ;
BreakStatement : See 12.8
break ;
break [no LineTerminator here] Identifier ;
ReturnStatement : See 12.9
return ;
return [no LineTerminator here] Expression ;
WithStatement : See 12.10
with ( Expression ) Statement
SwitchStatement : See 12.11
switch ( Expression ) CaseBlock
CaseBlock : See 12.11
{ CaseClausesopt }
{ CaseClausesopt DefaultClause CaseClausesopt }
CaseClauses : See 12.11
CaseClause
CaseClauses CaseClause - CaseClause : See 12.11
case Expression : StatementListopt
DefaultClause : See 12.11
default : StatementListopt
LabelledStatement : See 12.12
Identifier : Statement
ThrowStatement : See 12.13
throw [no LineTerminator here] Expression ;
TryStatement : See 12.14
try Block Catch
try Block Finally
try Block Catch Finally
Catch : See 12.14
catch ( Identifier ) Block
Finally : See 12.14
finally Block
DebuggerStatement : See 12.15
debugger ;
A.5 Functions and Programs
FunctionDeclaration : See clause 13
function Identifier ( FormalParameterListopt ) { FunctionBody }
FunctionExpression : See clause 13
function Identifieropt ( FormalParameterListopt ) { FunctionBody }
FormalParameterList : See clause 13
Identifier
FormalParameterList , Identifier
FunctionBody : See clause 13
SourceElementsopt
Program : See clause 14
SourceElementsopt
SourceElements : See clause 14
SourceElement
SourceElements SourceElement
SourceElement :
Statement
FunctionDeclaration
See clause 14
A.6 Universal Resource Identifier Character Classes
uri :::
See 15.1.3
uriCharactersopt
uriCharacters ::: See 15.1.3
uriCharacter uriCharactersopt
uriCharacter ::: See 15.1.3
uriReserved
uriUnescaped
uriEscaped
uriReserved ::: one of
; / ? : @
See 15.1.3
&
=
+
$
,
uriUnescaped ::: See 15.1.3
uriAlpha
DecimalDigit
uriMark
uriEscaped ::: See 15.1.3
% HexDigit HexDigit
uriAlpha ::: one of e f g h i
a b c d E F G H I
A B C D
uriMark ::: one of ~ * ' ( )
- _ . !
j
J
k
K
l
L
m
M
n
N
o
O
p
P
q
Q
r
R
s
S
t
T
u
U
See 15.1.3
v w x
V W X
y
Y
z
Z
See 15.1.3
A.7 Regular Expressions
Pattern :: See 15.10.1
Disjunction
Disjunction :: See 15.10.1
Alternative
Alternative | Disjunction
Alternative :: See 15.10.1
[empty]
Alternative Term
Term :: See 15.10.1
Assertion
Atom
Atom Quantifier
Assertion :: See 15.10.1
^
$
\ b
\ B
( ? = Disjunction )
( ? ! Disjunction )
Quantifier :: See 15.10.1
QuantifierPrefix
QuantifierPrefix ?
QuantifierPrefix :: See 15.10.1
*
+
?
{ DecimalDigits }
{ DecimalDigits , }
{ DecimalDigits , DecimalDigits }
Atom :: See 15.10.1
PatternCharacter
.
\ AtomEscape
CharacterClass
( Disjunction )
( ? : Disjunction )
PatternCharacter :: See 15.10.1
SourceCharacter but not one of-
^ $ \ . * + ? (
)
[
]
{
}
|
AtomEscape :: See 15.10.1
DecimalEscape
CharacterEscape
CharacterClassEscape
CharacterEscape :: See 15.10.1
ControlEscape
c ControlLetter
HexEscapeSequence
UnicodeEscapeSequence
IdentityEscape
ControlEscape :: one of See 15.10.1
f n r t v
ControlLetter :: one of
a b c d e
A B C D E
f
F
g
G
h
H
i
I
j
J
k
K
l
L
m
M
n
N
o
O
p
P
q
Q
r
R
s
S
t
T
u
U
See 15.10.1
v w x
V W X
IdentityEscape :: See 15.10.1
SourceCharacter but not IdentifierPart
CharacterClassEscape :: one of See 15.10.1
d D s S w W
CharacterClass :: See 15.10.1
[ [lookahead {^}] ClassRanges ]
[ ^ ClassRanges ]
ClassRanges ::
z
Z
See 15.10.1
DecimalEscape ::
DecimalIntegerLiteral [lookahead DecimalDigit]
y
Y
See 15.10.1
[empty]
NonemptyClassRanges
NonemptyClassRanges :: See 15.10.1
ClassAtom
ClassAtom NonemptyClassRangesNoDash
ClassAtom – ClassAtom ClassRanges
NonemptyClassRangesNoDash :: See 15.10.1
ClassAtom
ClassAtomNoDash NonemptyClassRangesNoDash
ClassAtomNoDash – ClassAtom ClassRanges
ClassAtom :: See 15.10.1
-
ClassAtomNoDash
ClassAtomNoDash :: See 15.10.1
SourceCharacter but not one of \ or ] or -
\ ClassEscape
ClassEscape :: See 15.10.1
DecimalEscape
b
CharacterEscape
CharacterClassEscape
A.8 JSON
A.8.1 JSON Lexical Grammar
JSONWhiteSpace :: See 15.12.1.1
JSONString :: See 15.12.1.1
" JSONStringCharactersopt "
JSONStringCharacters :: See 15.12.1.1
JSONStringCharacter JSONStringCharactersopt
JSONStringCharacter :: See 15.12.1.1
SourceCharacter but not one of " or \ or U+0000 through U+001F
\ JSONEscapeSequence
JSONEscapeSequence :: See 15.12.1.1
JSONEscapeCharacter
UnicodeEscapeSequence
JSONEscapeCharacter :: one of See 15.12.1.1
" / \ b f n r t
JSONNumber :: See 15.12.1.1
-opt DecimalIntegerLiteral JSONFractionopt ExponentPartopt
JSONFraction :: See 15.12.1.1
. DecimalDigits
JSONNullLiteral :: See 15.12.1.1
NullLiteral
JSONBooleanLiteral :: See 15.12.1.1
BooleanLiteral
A.8.2 JSON Syntactic Grammar
JSONText : See 15.12.1.2
JSONValue
JSONValue : See 15.12.1.2
JSONNullLiteral
JSONBooleanLiteral
JSONObject
JSONArray
JSONString
JSONNumber
JSONObject : See 15.12.1.2
{ }
{ JSONMemberList }
JSONMember : See 15.12.1.2
JSONString : JSONValue - JSONMemberList : See 15.12.1.2
JSONMember
JSONMemberList , JSONMember
JSONArray : See 15.12.1.2
[ ]
[ JSONElementList ]
JSONElementList : See 15.12.1.2
JSONValue
JSONElementList , JSONValue