I'm trying to find a good EBNF description of ECMAScript, but so far I've not found anything complete.
Any ideas?
I'm trying to find a good EBNF description of ECMAScript, but so far I've not found anything complete.
Any ideas?
How about the ECMAScript standard? Complete by definition :-}
EDIT: If you want an existing grammar, try one of the grammar generator tools sites. For ANTLR, here's the ECMAScript grammar. I know nothing of its quality but the ANTLR can produce good parsers if the grammer is constructed with care. You'll probably find the grammar also interwoven with bunch of ANTLR stuff, so it may suffer from some of the same problem as the standard from your point of view. At least you can delete all that stuff out.
Chapter 2 of Crockford's JavaScript: The Good Parts diagrams (you guessed it) the good parts.
Here are a couple stabs at BNF for JavaScript:
from this earlier SO question:
http://stackoverflow.com/questions/334479/repository-of-bnf-grammars/334539#334539