double right = ((NumberLiteral) boe.rightExpression).value;
Token op = boe.operator;
if (op == Token.OPERATOR_PLUS) {
return new NumberLiteral(left + right);
} else if (op == Token.OPERATOR_MINUS) {
return new NumberLiteral(left - right);
} else if (op == Token.OPERATOR_MULTIPLY) {
return new NumberLiteral(left * right);
} else if (op == Token.OPERATOR_DIVIDE) {
return new NumberLiteral(left / right);
} else if (op == Token.OPERATOR_MODULO) {
return new NumberLiteral(left % right);
}
}
return boe;
}