# BNF grammar for AS3 (or ECMAScript would be good too)

**URL:** <https://forum.kirupa.com/t/bnf-grammar-for-as3-or-ecmascript-would-be-good-too/323227>\
**Category:** flash\
**Created:** [June 21, 2011, 7:05pm UTC](https://forum.kirupa.com/t/bnf-grammar-for-as3-or-ecmascript-would-be-good-too/323227 "2011-06-21T19:05:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wvxvw](https://avatars.discourse-cdn.com/v4/letter/w/a9a28c/32.png) [@wvxvw](https://forum.kirupa.com/u/wvxvw)\
**Post date:** [June 21, 2011, 7:05pm UTC](https://forum.kirupa.com/t/bnf-grammar-for-as3-or-ecmascript-would-be-good-too/323227/1 "2011-06-21T19:05:37Z")

</div>

Hi. I’m looking for a conscious all-in-one-place BNF description of our cherished language 🙂 I’ve found some results in Google, but they are incomplete or bizarre 🙂  
I need this because I think I’ve made already 3 attempts at writing a proper syntax highlighter for AS3 (just so you know, not a single program in the entire world highlights it properly). But I keep running into a dead end with every next technique I try. So, I was thinking about trying more scientific approach, and I’d need a formal description of the language for that. Who knew it would be so hard to find? 🙂  
OK, to tell you what I’ve found already: [http://stackoverflow.com/questions/1786565/ebnf-for-ecmascript](http://stackoverflow.com/questions/1786565/ebnf-for-ecmascript) and I’ve followed every single link in that discussion. ECMA’s standard is the best approach so far, but it’s still a lot of work of consolidating all parts that are distributed randomly across 252 pages…

Just for the record - ANTRL file puts ‘this’, ‘void’, ‘in’ and ‘if’ in the same category, which is unacceptable / essentially wrong. I’ve no idea why did they come with this strange definition… :S
