module('ometa.lk-parser-extensions').requires('ometa.parser','ometa.bs-ometa-optimizer','ometa.bs-js-compiler','ometa.bs-ometa-compiler').toRun(function() {
{LKJSParser=Object.delegated(BSJSParser,{
"regexp":function(){var $elf=this,cs,fs,flag;return (function(){this._applyWithArgs("exactly","/");cs=this._many((function(){return this._or((function(){return this._apply("escapeChar")}),(function(){return (function(){this._not((function(){return this._applyWithArgs("exactly","/")}));this._not((function(){return this._applyWithArgs("exactly","\n")}));return this._apply("char")}).call(this)}))}));this._applyWithArgs("exactly","/");flag=this._or((function(){return (function(){fs=this._many1((function(){return (function(){switch(this._apply('anything')){case "m":return "m";case "g":return "g";case "i":return "i";case "y":return "y";default: throw fail}}).call(this)}));return fs.join("")}).call(this)}),(function(){return (function(){this._apply("empty");return ""}).call(this)}));return ["regexp",((("/" + cs.join("")) + "/") + flag)]}).call(this)},
"tok":function(){var $elf=this;return (function(){this._apply("spaces");return this._or((function(){return this._apply("name")}),(function(){return this._apply("keyword")}),(function(){return this._apply("number")}),(function(){return this._apply("str")}),(function(){return this._apply("regexp")}),(function(){return this._apply("special")}))}).call(this)},
"relExpr":function(){var $elf=this,x,y,y,y,y,y,y;return this._or((function(){return (function(){x=this._apply("relExpr");return this._or((function(){return (function(){this._applyWithArgs("token",">");y=this._apply("addExpr");return ["binop",">",x,y]}).call(this)}),(function(){return (function(){this._applyWithArgs("token",">=");y=this._apply("addExpr");return ["binop",">=",x,y]}).call(this)}),(function(){return (function(){this._applyWithArgs("token","<");y=this._apply("addExpr");return ["binop","<",x,y]}).call(this)}),(function(){return (function(){this._applyWithArgs("token","<=");y=this._apply("addExpr");return ["binop","<=",x,y]}).call(this)}),(function(){return (function(){this._applyWithArgs("token","instanceof");y=this._apply("addExpr");return ["binop","instanceof",x,y]}).call(this)}),(function(){return (function(){this._applyWithArgs("token","in");y=this._apply("addExpr");return ["binop","in",x,y]}).call(this)}))}).call(this)}),(function(){return this._apply("addExpr")}))},
"primExprHd":function(){var $elf=this,e,n,n,s,r,n,f,n,name,as,newExpr,as,es;return this._or((function(){return (function(){this._applyWithArgs("token","(");e=this._apply("expr");this._applyWithArgs("token",")");return e}).call(this)}),(function(){return (function(){this._applyWithArgs("token","this");return ["this"]}).call(this)}),(function(){return (function(){n=this._applyWithArgs("token","name");return ["get",n]}).call(this)}),(function(){return (function(){n=this._applyWithArgs("token","number");return ["number",n]}).call(this)}),(function(){return (function(){s=this._applyWithArgs("token","string");return ["string",s]}).call(this)}),(function(){return (function(){r=this._applyWithArgs("token","regexp");return ["regexp",r]}).call(this)}),(function(){return (function(){this._applyWithArgs("token","function");return this._apply("funcRest")}).call(this)}),(function(){return (function(){this._applyWithArgs("token","function");n=this._applyWithArgs("token","name");f=this._apply("funcRest");return ["var",n,f]}).call(this)}),(function(){return (function(){this._applyWithArgs("token","new");name=this._many((function(){return (function(){n=this._applyWithArgs("token","name");this._or((function(){return (function(){switch(this._apply('anything')){case ".":return ".";default: throw fail}}).call(this)}),(function(){return this._apply("empty")}));return n}).call(this)}));this._applyWithArgs("token","(");as=this._applyWithArgs("listOf","expr",",");this._applyWithArgs("token",")");return ["new",name.join(".")].concat(as)}).call(this)}),(function(){return (function(){this._applyWithArgs("token","new");this._applyWithArgs("token","(");newExpr=this._apply("expr");this._applyWithArgs("token",")");this._applyWithArgs("token","(");as=this._applyWithArgs("listOf","expr",",");this._applyWithArgs("token",")");return ["newExpr",newExpr].concat(as)}).call(this)}),(function(){return (function(){this._applyWithArgs("token","[");es=this._applyWithArgs("listOf","expr",",");this._or((function(){return (function(){switch(this._apply('anything')){case ",":return ",";default: throw fail}}).call(this)}),(function(){return this._apply("empty")}));this._applyWithArgs("token","]");return ["arr"].concat(es)}).call(this)}),(function(){return this._apply("json")}))},
"json":function(){var $elf=this,bs;return (function(){this._applyWithArgs("token","{");bs=this._applyWithArgs("listOf","jsonBinding",",");this._or((function(){return (function(){switch(this._apply('anything')){case ",":return ",";default: throw fail}}).call(this)}),(function(){return this._apply("empty")}));this._applyWithArgs("token","}");return ["json"].concat(bs)}).call(this)},
"varBinding":function(){var $elf=this,n,v;return (function(){n=this._applyWithArgs("token","name");v=this._or((function(){return (function(){this._applyWithArgs("token","=");return this._apply("expr")}).call(this)}),(function(){return (function(){this._apply("empty");return ["get","undefined"]}).call(this)}));return ["var",n,v]}).call(this)},
"stmt":function(){var $elf=this,bs,c,t,f,c,s,s,c,vars,i,c,u,s,n,v,e,s,e,c,cs,cs,cs,e,t,e,c,ca,f,e,x,s,e;return this._or((function(){return this._apply("block")}),(function(){return (function(){this._applyWithArgs("token","var");bs=this._applyWithArgs("listOf","varBinding",",");this._apply("sc");return ["begin"].concat(bs)}).call(this)}),(function(){return (function(){this._applyWithArgs("token","if");this._applyWithArgs("token","(");c=this._apply("expr");this._applyWithArgs("token",")");t=this._apply("stmt");f=this._or((function(){return (function(){this._applyWithArgs("token","else");return this._apply("stmt")}).call(this)}),(function(){return (function(){this._apply("empty");return ["get","undefined"]}).call(this)}));return ["if",c,t,f]}).call(this)}),(function(){return (function(){this._applyWithArgs("token","while");this._applyWithArgs("token","(");c=this._apply("expr");this._applyWithArgs("token",")");s=this._apply("stmt");return ["while",c,s]}).call(this)}),(function(){return (function(){this._applyWithArgs("token","do");s=this._apply("stmt");this._applyWithArgs("token","while");this._applyWithArgs("token","(");c=this._apply("expr");this._applyWithArgs("token",")");this._apply("sc");return ["doWhile",s,c]}).call(this)}),(function(){return (function(){this._applyWithArgs("token","for");this._applyWithArgs("token","(");i=this._or((function(){return (function(){this._applyWithArgs("token","var");vars=this._applyWithArgs("listOf","varBinding",",");return ["multiVar",vars]}).call(this)}),(function(){return this._apply("expr")}),(function(){return (function(){this._apply("empty");return ["get","undefined"]}).call(this)}));this._applyWithArgs("token",";");c=this._or((function(){return this._apply("expr")}),(function(){return (function(){this._apply("empty");return ["get","true"]}).call(this)}));this._applyWithArgs("token",";");u=this._or((function(){return this._apply("expr")}),(function(){return (function(){this._apply("empty");return ["get","undefined"]}).call(this)}));this._applyWithArgs("token",")");s=this._apply("stmt");return ["for",i,c,u,s]}).call(this)}),(function(){return (function(){this._applyWithArgs("token","for");this._applyWithArgs("token","(");v=this._or((function(){return (function(){this._applyWithArgs("token","var");n=this._applyWithArgs("token","name");return ["var",n,["get","undefined"]]}).call(this)}),(function(){return this._apply("expr")}));this._applyWithArgs("token","in");e=this._apply("expr");this._applyWithArgs("token",")");s=this._apply("stmt");return ["forIn",v,e,s]}).call(this)}),(function(){return (function(){this._applyWithArgs("token","switch");this._applyWithArgs("token","(");e=this._apply("expr");this._applyWithArgs("token",")");this._applyWithArgs("token","{");cs=this._many((function(){return this._or((function(){return (function(){this._applyWithArgs("token","case");c=this._apply("expr");this._applyWithArgs("token",":");cs=this._apply("srcElems");return ["case",c,cs]}).call(this)}),(function(){return (function(){this._applyWithArgs("token","default");this._applyWithArgs("token",":");cs=this._apply("srcElems");return ["default",cs]}).call(this)}))}));this._applyWithArgs("token","}");return ["switch",e].concat(cs)}).call(this)}),(function(){return (function(){this._applyWithArgs("token","break");this._apply("sc");return ["break"]}).call(this)}),(function(){return (function(){this._applyWithArgs("token","continue");this._apply("sc");return ["continue"]}).call(this)}),(function(){return (function(){this._applyWithArgs("token","throw");this._apply("spacesNoNl");e=this._apply("expr");this._apply("sc");return ["throw",e]}).call(this)}),(function(){return (function(){this._applyWithArgs("token","try");t=this._apply("block");ca=this._or((function(){return (function(){this._applyWithArgs("token","catch");this._applyWithArgs("token","(");e=this._applyWithArgs("token","name");this._applyWithArgs("token",")");c=this._apply("block");return [e,c]}).call(this)}),(function(){return (function(){this._apply("empty");return ["",["get","undefined"]]}).call(this)}));f=this._or((function(){return (function(){this._applyWithArgs("token","finally");return this._apply("block")}).call(this)}),(function(){return (function(){this._apply("empty");return ["get","undefined"]}).call(this)}));return ["try",t].concat(ca).concat([f])}).call(this)}),(function(){return (function(){this._applyWithArgs("token","return");e=this._or((function(){return this._apply("expr")}),(function(){return (function(){this._apply("empty");return ["get","undefined"]}).call(this)}));this._apply("sc");return ["return",e]}).call(this)}),(function(){return (function(){this._applyWithArgs("token","with");this._applyWithArgs("token","(");x=this._apply("expr");this._applyWithArgs("token",")");s=this._apply("stmt");return ["with",x,s]}).call(this)}),(function(){return (function(){e=this._apply("expr");this._apply("sc");return e}).call(this)}),(function(){return (function(){this._applyWithArgs("token",";");return ["get","undefined"]}).call(this)}))}});LKJSTranslator=Object.delegated(BSJSTranslator,{
"regexp":function(){var $elf=this,re;return (function(){re=this._apply("anything");return re}).call(this)},
"preopSpace":function(){var $elf=this,op,x;return (function(){op=this._apply("anything");x=this._apply("trans");return ((op + " ") + x)}).call(this)},
"newExpr":function(){var $elf=this,newExpr,args;return (function(){newExpr=this._apply("trans");args=this._many((function(){return this._apply("trans")}));return (((((("new " + "(") + newExpr) + ")") + "(") + args.join(",")) + ")")}).call(this)},
"singleVar":function(){var $elf=this,name,val;return (function(){this._form((function(){return (function(){this._applyWithArgs("exactly","var");name=this._apply("anything");return val=this._apply("trans")}).call(this)}));return ((name + "=") + val)}).call(this)},
"multiVar":function(){var $elf=this,xs;return (function(){this._form((function(){return xs=this._many((function(){return this._apply("singleVar")}))}));return ("var " + xs.join(","))}).call(this)},
"try":function(){var $elf=this,x,name,c,f;return (function(){x=this._apply("curlyTrans");name=this._apply("anything");c=this._apply("curlyTrans");f=this._apply("curlyTrans");return (((("try " + x) + (name?((("catch(" + name) + ")") + c):"")) + "finally") + f)}).call(this)}});LKOMetaParser=Object.delegated(BSOMetaParser,{
"hostExpr":function(){var $elf=this,r;return (function(){r=this._applyWithArgs("foreign",LKJSParser,'expr');return this._applyWithArgs("foreign",BSJSTranslator,'trans',r)}).call(this)},
"atomicHostExpr":function(){var $elf=this,r;return (function(){r=this._applyWithArgs("foreign",LKJSParser,'semAction');return this._applyWithArgs("foreign",BSJSTranslator,'trans',r)}).call(this)},
"curlyHostExpr":function(){var $elf=this,r;return (function(){r=this._applyWithArgs("foreign",LKJSParser,'curlySemAction');return this._applyWithArgs("foreign",BSJSTranslator,'trans',r)}).call(this)}});LKOMetaJSParser=Object.delegated(LKJSParser,{
"srcElem":function(){var $elf=this,r;return this._or((function(){return (function(){this._apply("spaces");r=this._applyWithArgs("foreign",LKOMetaParser,'grammar');this._apply("sc");return r}).call(this)}),(function(){return LKJSParser._superApplyWithArgs(this,'srcElem')}))}});LKOMetaJSTranslator=Object.delegated(LKJSTranslator,{
"Grammar":function(){var $elf=this;return this._applyWithArgs("foreign",BSOMetaTranslator,'Grammar')}})}
});