Lightweight Universal BNF Parser, pure JavaScript, ~300 LOC
var parser = BNFParser(32, 'Your BNF grammar'+'\n');
var tree = parser('Text to parse'+'\n');
https://steamclub.net/public_library/omnom.js/demo/
Download:
https://github.com/myfoundation/OmNom.js
Original code: https://github.com/calder/omnom