See Standard ECMA-262
5.1 Edition / June 2011/
5.1.1 Context-Free Grammars
A context-free grammar consists of a number of productions. Each
production has an abstract symbol called a nonterminal as its
left-hand side, and a sequence of zero or more nonterminal and
terminal symbols as its right-hand side. For each grammar, the
terminal symbols are drawn from a specified alphabet.
Starting from a sentence consisting of a single distinguished
nonterminal, called the goal symbol, a given context-free grammar
specifies a language, namely, the (perhaps infinite) set of possible
sequences of terminal symbols that can result from repeatedly
replacing any nonterminal in the sequence with a right-hand side of a
production for which the nonterminal is the left-hand side.
5.1.6 Grammar Notation
Terminal symbols of the lexical and string grammars, and some of the terminal symbols of the syntactic grammar, are shown in fixed width
font, both in the productions of the grammars and throughout this
specification whenever the text directly refers to such a terminal
symbol. These are to appear in a program exactly as written. All
terminal symbol characters specified in this way are to be understood
as the appropriate Unicode character from the ASCII range, as opposed
to any similar-looking characters from other Unicode ranges.
Nonterminal symbols are shown in italic type. The definition of a
nonterminal is introduced by the name of the nonterminal being defined
followed by one or more colons. (The number of colons indicates to
which grammar the production belongs.) One or more alternative
right-hand sides for the nonterminal then follow on succeeding lines.
For example, the syntactic definition:
WhileStatement :
while(Expression) Statement
states that the nonterminal WhileStatement represents the token while,
followed by a left parenthesis token, followed by an Expression,
followed by a right parenthesis token, followed by a Statement. The
occurrences of Expression and Statement are themselves nonterminals.
As another example, the syntactic definition:
ArgumentList :
AssignmentExpression
ArgumentList , AssignmentExpression
:::
Productions of the numeric string grammar are distinguished by having
three colons ":::" as punctuation.
::
Productions of the lexical and RegExp grammars are distinguished by
having two colons "::" as separating punctuation. The lexical and
RegExp grammars share some productions.
:
Productions of the syntactic grammar are distinguished by having just
one colon ":" as punctuation.
Note,
5.1.5 The JSON Grammar
Productions of the JSON lexical grammar are distinguished by having
two colons "::" as separating punctuation. The JSON lexical grammar
uses some productions from the ECMAScript lexical grammar. The JSON
syntactic grammar is similar to parts of the ECMAScript syntactic
grammar. Productions of the JSON syntactic grammar are distinguished
by using one colon ":" as separating punctuation.