here's the spec
ECMAScript 2015 §Notational Conventions#sec-notational-conventions
here's some interesting things.
• they divided the grammar into
- lexical grammar
- regex grammar
- numeric string grammar
- syntactic grammar
- lex and regex grammar uses 3 colon
:::to separate lhs (left-hand-side) and rhs (right-hand-side) in the grammar production notation.
- numeric string grammar uses 2 colon
- syntactic grammar uses 1 colon
• Instead of the typical VERTICAL LINE
| for rhs alternatives, it uses multiple lines. That is, each line is a alternative.
• it uses subscript opt to indicate optional nonterminal, instead of the more traditional square bracket
• it uses a subscript [xyz] to represent alternatives of nonterminal on lhs. This is getting complex.
• the subscript [xyz] notation can be on the rhs, and combined with the opt
• now the sub-scripted nonterminal on the rhs, can be prefixed with a question mark, depends on which of the subscribed nonterminal on lhs is used.
• the rhs may start with square bracketed notation like this
[+xyz]. It means, this alternative is valid only if the lhs has the same parameter
It may start with
[~xyz], means, this alternative is valid only if the lhs does not have the same parameter.
• now, comes “not apparently context-free” things. A lookhead notation.
• another non-standard notation, is “[no LineTerminator here]”.
• and now adding plain English word “but not” into the BNF.
If you have a question, put $5 at patreon and message me.