I find myself drawn to the Parsing Expression Grammar formalism for describing domain specific languages, but so far the implementation code I\'ve found has been written in
There is in fact one for Javascript: OMeta. http://www.tinlizzie.org/ometa/
I also implemented a version of this in Python: http://github.com/python-parsley/parsley