26 :Expression(expr,type),dummyFunc(dummyFuncX,0,16)
35 for(
typename T_MAP::iterator i=map.begin();i!=map.end();++i)
delete i->second;
48 Expression::setExpr(str);
53 if(name==
"u")
return &
u;
54 else if(name==
"v")
return &
v;
55 else if(name==
"P")
return &
P;
58 VARMAP::iterator i=
varmap.find(name);
59 if(i!=
varmap.end())
return i->second;
void deleteAndClear(T_MAP &map)
</pre >< h2 > Evaluating expressions</h2 > Evaluating an expression is pretty easy But before we can do that we need to make an instance< pre > GrapherExpr expr("x+x^2")
Function Definition, used in parse tree and func table.
SeExpr2::ExprVarRef * resolveVar(const std::string &name) const
static const ExprFunc * lookup(const std::string &name)
Lookup a builtin function by name.
void setExpr(const std::string &str)
virtual ~BasicExpression()
SeExpr2::ExprFunc * resolveFunc(const std::string &name) const
abstract class for implementing variable references
SeExpr2::ExprFunc dummyFunc
BasicExpression(const std::string &expr, const SeExpr2::ExprType &type=SeExpr2::ExprType().FP(3))