1 #ifndef MSP_GL_SL_EVALUATE_H_
2 #define MSP_GL_SL_EVALUATE_H_
10 class ExpressionEvaluator: public NodeVisitor
13 typedef std::map<VariableDeclaration *, Expression *> ValueMap;
16 const ValueMap *variable_values;
21 ExpressionEvaluator();
22 ExpressionEvaluator(const ValueMap &);
24 float get_result() const { return result; }
25 bool is_result_valid() const { return result_valid; }
27 using NodeVisitor::visit;
28 virtual void visit(Literal &);
29 virtual void visit(ParenthesizedExpression &);
30 virtual void visit(VariableReference &);
31 virtual void visit(UnaryExpression &);
32 virtual void visit(BinaryExpression &);