Go to the documentation of this file.
25 ExprFuncSimple *simple = reinterpret_cast<ExprFuncSimple *>(c[opData[0]]);
33 std::vector<int> operands;
38 std::cerr<<
"we are "<<node->
promote(c)<<
" "<<c<<std::endl;
41 interpreter->
addOp(getTemplatizedOp<Promote>(node->
promote(c)));
45 operand = promotedOperand;
48 operands.push_back(operand);
51 int nargsData = interpreter->
allocFP(1);
56 outoperand = interpreter->
allocPtr();
61 int ptrLoc = interpreter->
allocPtr();
62 int ptrDataLoc = interpreter->
allocPtr();
63 interpreter->
s[ptrLoc] = (
char *)
this;
68 for (
size_t c = 0; c < operands.size(); c++) {
71 interpreter->
endOp(
false);
74 int pc = interpreter->
nextPC() - 1;
75 int *opCurr = (&interpreter->
opData[0]) + interpreter->
ops[pc].second;
80 interpreter->
s[ptrDataLoc] = reinterpret_cast<char *>(data);
119 strArg[0] = reinterpret_cast<char *>(funcSimple);
121 std::vector<int> callStack;
124 handle.
data = funcSimple->evalConstant(node, handle);
125 *funcdata = reinterpret_cast<void *>(handle.
data);
128 handle.
data = reinterpret_cast<SeExpr2::ExprFuncNode::Data *>(*funcdata);
131 funcSimple->eval(handle);
void endOp(bool execute=true)
int numChildren() const
Number of children.
const ExprType & type() const
The type of the node.
int addOp(OpF op)
! adds an operator to the program (pointing to the data at the current location)
std::vector< double > d
Double data (constants and evaluated)
const ExprFunc * func() const
void setData(Data *data) const
associate blind data with this node (subsequently owned by this object)
void SeExpr2LLVMEvalCustomFunction(int *opDataArg, double *fpArg, char **strArg, void **funcdata, const SeExpr2::ExprFuncNode *node)
std::vector< int > opData
Ooperands to op.
Extension function spec, used for complicated argument custom functions.
Node that calls a function.
ExprFuncNode::Data * data
Function Definition, used in parse tree and func table.
const ExprFuncX * funcx() const
return pointer to the funcx
virtual int buildInterpreter(Interpreter *interpreter) const
builds an interpreter. Returns the location index for the evaluated data
int nextPC()
Return the position that the next instruction will be placed at.
int allocFP(int n)
! Allocate a floating point set of data of dimension n
std::vector< int > callStack
virtual int buildInterpreter(const ExprFuncNode *node, Interpreter *interpreter) const
Build an interpreter to evaluate the expression.
bool isFP() const
Direct is predicate checks.
std::vector< char * > s
constant and evaluated pointer data
virtual void eval(ArgHandle args)=0
base class for custom instance data
virtual ExprFuncNode::Data * evalConstant(const ExprFuncNode *node, ArgHandle args) const =0
int allocPtr()
Allocate a pointer location (can be anything, but typically space for char*)
const ExprNode * child(size_t i) const
Get 0 indexed child.
std::vector< std::pair< OpF, int > > ops
static int EvalOp(int *opData, double *fp, char **c, std::vector< int > &callStack)
int addOperand(int param)
! Adds an operand. Note this should be done after doing the addOp!