26#ifndef SCIMATH_FUNCEXPRESSION_H
27#define SCIMATH_FUNCEXPRESSION_H
30#include <casacore/casa/aips.h>
31#include <casacore/casa/BasicSL/String.h>
32#include <casacore/scimath/Functionals/FuncExprData.h>
33#include <casacore/casa/stdvector.h>
34#include <casacore/casa/Arrays/ArrayFwd.h>
37#include <casacore/casa/iosfwd.h>
104 const vector<FuncExprData::ExprOperator> &
getCode()
const;
125 vector<FuncExprData::ExprOperator>
code_p;
127 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.
const vector< FuncExprData::ExprOperator > & getCode() const
Get the executable program.
FuncExpression()
Construct an empty executable expression.
Bool compTerm(MUString &prg)
Compile a term (in prg, which will be adjusted)
uInt ndim_p
The number of dimensions of expression.
const vector< Double > & getConst()
Get reference to compiled constants.
FuncExpression(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.
const vector< FuncExprData::ExprOperator > & getCode()
Get reference to the compiled program.
const String & errorMessage()
Get the current error message.
Bool setOp(FuncExprData::ExprOperator &oper)
Save an operation on compilation RP stack.
void print(ostream &os) const
Print the stack information (mainly for debugging)
~FuncExpression()
Destructor.
FuncExpression & operator=(const FuncExpression &other)
Make this object a (deep) copy of other.
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.
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
ostream & operator<<(ostream &os, const IComplex &)
Show on ostream.
bool Bool
Define the standard types used by Casacore.
The compilation state descriptor.
The operator description: code; priority; # of arguments; # of arguments used up (or produced for fun...
T FuncExecute(const Vector< T > &x, const Vector< T > &par)
Execute the program.
ostream & operator<<(ostream &os, const FuncExpression &ed)
Show the program.