Skip to content

Instantly share code, notes, and snippets.

@ryanjdew
ryanjdew / es6.ebnf
Last active August 15, 2018 21:27 — forked from avdg/es6.ebnf
ES6 bnf grammer - See https://avdg.github.io/es6.xhtml
/* ebnf file for es 6 - MAY CONTAIN ERRORS / DISAMBIGUITY */
/* Edited by @ryanjdew for compatiblity with REx Parser: es6.ebnf -ll 1 -backtrack -javascript -faster */
Program ::= (Shebang? Grammar+|Script|Module) EOF
Grammar ::= Statement
/* Expressions */
IdentifierReference ::= Identifier | /* [~Yield] */ "yield"
BindingIdentifier ::= Identifier | /* [~Yield] */ "yield"
LabelIdentifier ::= Identifier | /* [~Yield] */ "yield"
Identifier ::= /* IdentifierName but not ReservedWord */ IdentifierName