Jison 解析器返回计算结果:
calculator.parse("2^3"); // returns 8
calculator.parse("x^2"); // gives a parse err
我希望它返回符号表达式:
calculator.parse("x^2");
// should return
// "Math.pow(x,2)"
和
calculator.parse("x^(x+1)");
// should return
// "Math.pow(x,x+1)"
和
calculator.parse("cos(x)");
// should return
// "Math.cos(x)"