KSeExpr
4.0.4.0
|
#include <BasicExpression.h>
Classes | |
struct | DummyFuncX |
struct | ScalarRef |
struct | VectorRef |
Public Types | |
using | VARMAP = std::map< std::string, VectorRef * > |
using | FUNCMAP = std::map< std::string, bool > |
![]() | |
enum | EvaluationStrategy { UseInterpreter , UseLLVM } |
Types of evaluation strategies that are available. More... | |
Public Member Functions | |
BasicExpression (const std::string &expr, const KSeExpr::ExprType &type=KSeExpr::ExprType().FP(3)) | |
~BasicExpression () override | |
BasicExpression & | operator= (BasicExpression &&)=delete |
BasicExpression & | operator= (const BasicExpression &)=delete |
BasicExpression (BasicExpression &&)=delete | |
BasicExpression (const BasicExpression &)=delete | |
KSeExpr::ExprVarRef * | resolveVar (const std::string &name) const override |
KSeExpr::ExprFunc * | resolveFunc (const std::string &name) const override |
void | setExpr (const std::string &str) |
void | clearVars () |
![]() | |
Expression (EvaluationStrategy be=Expression::defaultEvaluationStrategy) | |
Expression (const std::string &e, const ExprType &type=ExprType().FP(3), EvaluationStrategy be=Expression::defaultEvaluationStrategy, const Context &context=Context::global()) | |
virtual | ~Expression () |
void | setDesiredReturnType (const ExprType &type) |
void | setExpr (const std::string &e) |
const std::string & | getExpr () const |
Get the string that this expression is currently set to evaluate. More... | |
bool | syntaxOK () const |
bool | isValid () const |
const ErrorCode & | parseError () const |
const std::vector< std::string > & | parseErrorArgs () const |
const std::vector< Error > & | getErrors () const |
const std::vector< std::pair< int, int > > & | getComments () const |
bool | isConstant () const |
bool | usesVar (const std::string &name) const |
bool | usesFunc (const std::string &name) const |
bool | isThreadSafe () const |
void | setThreadUnsafe (const std::string &functionName) const |
const std::vector< std::string > & | getThreadUnsafeFunctionCalls () const |
bool | wantVec () const |
bool | isVec () const |
const ExprType & | returnType () const |
void | evalMultiple (VarBlock *varBlock, int outputVarBlockOffset, size_t rangeStart, size_t rangeEnd) const |
Evaluate multiple blocks. More... | |
const double * | evalFP (VarBlock *varBlock=nullptr) const |
const char * | evalStr (VarBlock *varBlock=nullptr) const |
void | reset () |
void | addError (const ErrorCode error, const std::vector< std::string > ids, const int startPos, const int endPos) const |
void | addComment (int pos, int length) |
const Context & | context () const |
void | setContext (const Context &context) |
void | debugPrintParseTree () const |
void | debugPrintInterpreter () const |
void | debugPrintLLVM () const |
void | setVarBlockCreator (const VarBlockCreator *varBlockCreator) |
const VarBlockCreator * | varBlockCreator () const |
void | addVar (const char *n) const |
add local variable (this is for internal use) More... | |
void | addFunc (const char *n) const |
add function evaluation (this is for internal use) More... | |
Public Attributes | |
BasicExpression::DummyFuncX | dummyFuncX |
KSeExpr::ExprFunc | dummyFunc |
ScalarRef | u |
ScalarRef | v |
VectorRef | P |
VARMAP | varmap |
FUNCMAP | funcmap |
Additional Inherited Members | |
![]() | |
static EvaluationStrategy | defaultEvaluationStrategy = chooseDefaultEvaluationStrategy() |
What evaluation strategy to use by default. More... | |
static bool | debugging = getenv("SE_EXPR_DEBUG") != nullptr |
Whether to debug expressions. More... | |
![]() | |
void | prepIfNeeded () const |
![]() | |
ExprType | _desiredReturnType |
ExprVarEnvBuilder | _envBuilder |
ExprNode * | _parseTree |
Definition at line 19 of file BasicExpression.h.
using BasicExpression::FUNCMAP = std::map<std::string, bool> |
Definition at line 97 of file BasicExpression.h.
using BasicExpression::VARMAP = std::map<std::string, VectorRef *> |
Definition at line 95 of file BasicExpression.h.
BasicExpression::BasicExpression | ( | const std::string & | expr, |
const KSeExpr::ExprType & | type = KSeExpr::ExprType().FP(3) |
||
) |
Definition at line 14 of file BasicExpression.cpp.
|
override |
Definition at line 20 of file BasicExpression.cpp.
References clearVars().
|
delete |
|
delete |
void BasicExpression::clearVars | ( | ) |
Definition at line 32 of file BasicExpression.cpp.
References deleteAndClear(), funcmap, and varmap.
Referenced by setExpr(), and ~BasicExpression().
|
delete |
|
delete |
|
overridevirtual |
override resolveFunc to add external functions
Reimplemented from KSeExpr::Expression.
Definition at line 64 of file BasicExpression.cpp.
References dummyFunc, funcmap, and KSeExpr::ExprFunc::lookup().
|
overridevirtual |
override resolveVar to add external variables
Reimplemented from KSeExpr::Expression.
Definition at line 44 of file BasicExpression.cpp.
void BasicExpression::setExpr | ( | const std::string & | str | ) |
Definition at line 38 of file BasicExpression.cpp.
References clearVars().
|
mutable |
Definition at line 89 of file BasicExpression.h.
Referenced by resolveFunc().
BasicExpression::DummyFuncX BasicExpression::dummyFuncX |
|
mutable |
Definition at line 98 of file BasicExpression.h.
Referenced by clearVars(), and resolveFunc().
|
mutable |
Definition at line 93 of file BasicExpression.h.
Referenced by resolveVar().
|
mutable |
Definition at line 91 of file BasicExpression.h.
Referenced by resolveVar().
|
mutable |
Definition at line 92 of file BasicExpression.h.
Referenced by resolveVar().
|
mutable |
Definition at line 96 of file BasicExpression.h.
Referenced by clearVars(), and resolveVar().