A parser generator? Why oh why? It sounds so 80s. JavaScript is strong enough to express parser combinators, e.g. see Chris Double's implementation (also based on the PEG formalism):
http://www.bluishcoder.co.nz/2007/10/javascript-parser-combi...
I did the same thing in ActionScript. It's easy and fun.