I've been looking at parser generators for Javascript and have a found a few (PEG.js, namely).
Whats not clear, though, is how well these would play with something like the Google Closure Compiler.
E.g, it looks like in PEG.js, I can give it code to execute as part of the rules, but how can I bind functions (that might be renamed by the compiler) to the rules?
Additionally, its unclear to me which parsers support passing in a symbol table. E.g, I want to define a grammar that accepts an expression like "A or B", where the value of "A" and "B" are defined at runtime, e.g., as attributes of a record a user is viewing.
PEG.js isn't a requirement of course, just the only parser generator that seems to turn up in search results and looks usable.
org.antlr.Toolon your grammar to generate a parser. - Bart Kiers