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;
78 interpreter->
s[ptrDataLoc] =
reinterpret_cast<char *
>(
evalConstant(node, args));
117 strArg[0]=
reinterpret_cast<char *
>(funcSimple);
119 std::vector<int> callStack;
123 *funcdata =
reinterpret_cast<void *
>(handle.
data);
128 funcSimple->
eval(handle);
std::vector< int > callStack
int allocFP(int n)
! Allocate a floating point set of data of dimension n
const ExprType & type() const
The type of the node.
virtual void eval(ArgHandle args)=0
int nextPC()
Return the position that the next instruction will be placed at.
const ExprFuncX * funcx() const
return pointer to the funcx
std::vector< char * > s
constant and evaluated pointer data
bool isFP() const
Direct is predicate checks.
Function Definition, used in parse tree and func table.
virtual ExprFuncNode::Data * evalConstant(const ExprFuncNode *node, ArgHandle args) const =0
ExprFuncNode::Data * data
void SeExpr2LLVMEvalCustomFunction(int *opDataArg, double *fpArg, char **strArg, void **funcdata, const SeExpr2::ExprFuncNode *node)
int allocPtr()
Allocate a pointer location (can be anything, but typically space for char*)
virtual int buildInterpreter(Interpreter *interpreter) const
builds an interpreter. Returns the location index for the evaluated data
Node that calls a function.
std::vector< std::pair< OpF, int > > ops
int addOperand(int param)
! Adds an operand. Note this should be done after doing the addOp!
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)
base class for custom instance data
int numChildren() const
Number of children.
void endOp(bool execute=true)
const ExprFunc * func() const
std::vector< int > opData
Ooperands to op.
static int EvalOp(int *opData, double *fp, char **c, std::vector< int > &callStack)
virtual int buildInterpreter(const ExprFuncNode *node, Interpreter *interpreter) const
Build an interpreter to evaluate the expression.
const ExprNode * child(size_t i) const
Get 0 indexed child.
Extension function spec, used for complicated argument custom functions.