23 #ifndef UTAP_EXPRESSION_HH 24 #define UTAP_EXPRESSION_HH 138 std::string
toString(
bool old =
false)
const;
177 void getSymbols(std::set<symbol_t> &symbols)
const;
196 bool dependsOn(
const std::set<symbol_t> &)
const;
240 const std::vector<expression_t> &,
263 struct expression_data;
264 std::shared_ptr<expression_data> data;
265 int getPrecedence()
const;
266 void toString(
bool,
char *&str,
char *&end,
int &size)
const;
267 void appendBoundType(
char *&str,
char*&end,
int &size,
expression_t e)
const;
static expression_t createDouble(double, position_t=position_t())
expression_t()
Default constructor.
Constants::kind_t getKind() const
Returns the kind of the expression.
void getSymbols(std::set< symbol_t > &symbols) const
Returns the set of symbols this expression might resolve into.
static expression_t createExit(position_t=position_t())
bool changesVariable(const std::set< symbol_t > &) const
True if this expression can change any of the variables identified by the given symbols.
int32_t getIndex() const
Returns the index field of this expression.
bool empty() const
Returns true if this is an empty expression.
expression_t clone() const
Make a shallow clone of the expression.
static expression_t createNary(Constants::kind_t, const std::vector< expression_t > &, position_t=position_t(), type_t=type_t())
Create an n-ary expression.
symbol_t getSymbol()
Returns the symbol of a variable reference.
double getDoubleValue() const
Returns the value field of this expression.
expression_t & operator=(const expression_t &)
Assignment operator.
expression_t & operator[](uint32_t)
Returns the ith subexpression.
static expression_t createDot(expression_t, int32_t=-1, position_t=position_t(), type_t=type_t())
Create a DOT expression.
expression_t subst(symbol_t, expression_t) const
static expression_t createUnary(Constants::kind_t, expression_t, position_t=position_t(), type_t=type_t())
Create a unary expression.
std::ostream & operator<<(std::ostream &os, const SignalFlow::strs_t &s)
const position_t & getPosition() const
Returns the position of this expression.
std::string toString(bool old=false) const
Returns a string representation of the expression.
static expression_t createTernary(Constants::kind_t, expression_t, expression_t, expression_t, position_t=position_t(), type_t=type_t())
Create a ternary expression.
bool dependsOn(const std::set< symbol_t > &) const
True if the evaluation of this expression depends on any of the symbols in the given set...
void collectPossibleWrites(std::set< symbol_t > &) const
static expression_t createDeadlock(position_t=position_t())
Create a DEADLOCK expression.
static int getPrecedence(Constants::kind_t)
expression_t deeperClone() const
Makes a deep clone of the expression.
A reference to an expression.
bool hasDynamicSub() const
type_t getType() const
Returns the type of the expression.
int32_t getValue() const
Returns the value field of this expression.
size_t getSize() const
Returns the number of subexpression.
~expression_t()
Destructor.
static expression_t createSync(expression_t, Constants::synchronisation_t, position_t=position_t())
Create a SYNC expression.
static expression_t createConstant(int32_t, position_t=position_t())
Create a CONSTANT expression.
void setType(type_t)
Sets the type of the expression.
Constants::synchronisation_t getSync() const
Returns the synchronisation type of SYNC operations.
static expression_t createBinary(Constants::kind_t, expression_t, expression_t, position_t=position_t(), type_t=type_t())
Create a binary expression.
void collectPossibleReads(std::set< symbol_t > &, bool collectRandom=false) const
bool operator<(const expression_t) const
Less-than operator.
static expression_t createIdentifier(symbol_t, position_t=position_t())
Create an IDENTIFIER expression.
bool isReferenceTo(const std::set< symbol_t > &) const
Returns true if this expression is a reference to a symbol in the given set.
bool operator==(const expression_t) const
Equality operator.
bool equal(const expression_t &) const
Equality operator.
bool changesAnyVariable() const
True if this expression can change any variable at all.