计算表达式的时候不能依赖BC方式。
可以使用evaluate方法计算表达式。
然后计算表达式,得到的值将替换目标节点中的现有值。
The expression is then computed, and the resulting value replaces the existing value in the target node.
Literally, return the control from this function, and take the value of the next expression, and return that as the value of the whole computation.
正如字面意义上说的,从这个函数返回,然后取得下一个表达式的值,并把这个值作为整个计算的结果返回。
You might recall from grade school sometimes you put things in parentheses so that your addition happens first, then your multiplication, otherwise multiplication would happen by default first.
你们可能会想起小学时,将一些加法表达式,放在圆括号里,这样加法可以先计算,然后是乘法,否则,乘法默认先发生。
What I'm doing, by the way, here is I'm simply typing in expressions to that interpreter.
顺路说一下,我正在做的就是给计算器传入,一个表达式。
应用推荐