29 #ifndef SCIMATH_FUNCEXPRESSION_H
30 #define SCIMATH_FUNCEXPRESSION_H
33 #include <casacore/casa/aips.h>
34 #include <casacore/casa/BasicSL/String.h>
35 #include <casacore/scimath/Functionals/FuncExprData.h>
36 #include <casacore/casa/stdvector.h>
37 #include <casacore/casa/Arrays/ArrayFwd.h>
40 #include <casacore/casa/iosfwd.h>
107 const vector<FuncExprData::ExprOperator> &
getCode()
const;
128 vector<FuncExprData::ExprOperator>
code_p;
130 vector<FuncExprData::ExprOperator>
rps_p;
Bool setVal(const Double &val)
Save a value on constant stack.
FuncExprData::ExprCompState state_p
The current state of the compilation.
FuncExpression()
Construct an empty executable expression.
const String & errorMessage()
Get the current error message.
const vector< Double > & getConst()
Get reference to compiled constants.
Bool compTerm(MUString &prg)
Compile a term (in prg, which will be adjusted)
uInt ndim_p
The number of dimensions of expression.
FuncExpression(const FuncExpression &other)
Make this object a (deep) copy of other.
FuncExpression & operator=(const FuncExpression &other)
Make this object a (deep) copy of other.
FuncExprData exd
The expression data /// later into a singleton.
vector< FuncExprData::ExprOperator > rps_p
The reverse Polish work stack (a vector, since deque did not work on gcc)
void initState()
Initialise the state.
uInt npar_p
The number of parameters in code.
Bool exec(Double &res) const
Execute the program.
Bool setOp(FuncExprData::ExprOperator &oper)
Save an operation on compilation RP stack.
void print(ostream &os) const
Print the stack information (mainly for debugging)
const vector< FuncExprData::ExprOperator > & getCode() const
Get the executable program.
~FuncExpression()
Destructor.
Bool create(const String &prog)
Create an executable program.
FuncExpression(const String &prog)
Construct an executable expression from the given string.
uInt getNdim() const
Get the number of dimensions of executable program.
const vector< FuncExprData::ExprOperator > & getCode()
Get reference to the compiled program.
uInt getNpar() const
Get the number of parameters in executable program.
Bool compStmt(MUString &prg)
Compile a statement (in prg, which will be adjusted)
vector< Double > const_p
The current constant stack.
Bool setCode(const FuncExprData::ExprOperator &oper)
Save an executable code.
String error_p
The latest error message.
vector< Double > exec_p
Executing stack.
vector< FuncExprData::ExprOperator > code_p
The executable code stack (a vector, since it is a re-usable stack)
Bool compExpr(MUString &prg)
Compile an expression (in prg, which will be adjusted)
String: the storage and methods of handling collections of characters.
this file contains all the compiler specific defines
bool Bool
Define the standard types used by Casacore.
ostream & operator<<(ostream &os, const IComplex &)
Show on ostream.
The compilation state descriptor.
The operator description: code; priority; # of arguments; # of arguments used up (or produced for fun...