是否有允许从C ++ API生成js AST的库,然后从此AST创建源代码?
有点像这样:
Expression * expression1 = new Number(42);
Expression * expression2 = new Number(69);
Expression * result = new Addition(expression1, expression2);
Statement * stmt = new Return(result);
string code = Codegen().build(stmt); // "return ((42)+(69));"