Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

expression.cpp File Reference

#include <cassert>
#include <algorithm>
#include "utap/builder.h"
#include "utap/system.h"
#include "utap/expression.h"

Namespaces

namespace  Constants

Functions

 expression_t::expression_t ()
 expression_t::expression_t (kind_t kind, const position_t &pos)
 expression_t::expression_t (const expression_t &e)
expression_t expression_t::clone () const
 expression_t::~expression_t ()
kind_t expression_t::getKind () const
const position_texpression_t::getPosition () const
uint32_t expression_t::getSize () const
type_t expression_t::getType () const
void expression_t::setType (type_t type)
int32_t expression_t::getValue () const
int32_t expression_t::getIndex () const
synchronisation_t expression_t::getSync () const
expression_texpression_t::operator[] (uint32_t i)
expression_texpression_t::get (uint32_t i)
bool expression_t::empty () const
bool expression_t::equal (const expression_t &e) const
 Two expressions are identical iff all the sub expressions are identical and if the kind, value and symbol of the root are identical.
expression_texpression_t::operator= (const expression_t &e)
symbol_t expression_t::getSymbol ()
 Returns the symbol of a variable reference.
bool expression_t::isReferenceTo (const std::set< symbol_t > &symbols) const
 Returns true if expr might be a reference to a symbol in the set.
static bool changes (function_t *fun, const std::set< symbol_t > &variables)
 Returns true if fun changes any of the variables in variables.
bool expression_t::changesVariable (const std::set< symbol_t > &symbols) const
bool expression_t::dependsOn (const std::set< symbol_t > &symbols) const
int expression_t::getPrecedence () const
int expression_t::getPrecedence (kind_t kind)
static void ensure (char *&str, char *&end, int &size, int len)
static void append (char *&str, char *&end, int &size, const char *s)
static void append (char *&str, char *&end, int &size, char c)
void expression_t::toString (bool old, char *&str, char *&end, int &size) const
bool expression_t::operator< (const expression_t e) const
bool expression_t::operator== (const expression_t e) const
std::string expression_t::toString (bool old) const
 Returns a string representation of the expression.
void expression_t::collectPossibleWrites (set< symbol_t > &symbols) const
void expression_t::collectPossibleReads (set< symbol_t > &symbols) const
expression_t expression_t::createConstant (const position_t &pos, int32_t value)
expression_t expression_t::createIdentifier (const position_t &pos, symbol_t symbol)
expression_t expression_t::createNary (const position_t &pos, kind_t kind, const vector< expression_t > &sub, type_t type)
expression_t expression_t::createUnary (const position_t &pos, kind_t kind, expression_t sub, type_t type)
expression_t expression_t::createBinary (const position_t &pos, kind_t kind, expression_t left, expression_t right, type_t type)
expression_t expression_t::createTernary (const position_t &pos, kind_t kind, expression_t e1, expression_t e2, expression_t e3, type_t type)
expression_t expression_t::createDot (const position_t &pos, expression_t e, int32_t idx, type_t type)
expression_t expression_t::createSync (const position_t &pos, expression_t e, synchronisation_t s)
expression_t expression_t::createDeadlock (const position_t &pos)
ostream & operator<< (ostream &o, const expression_t &e)

Function Documentation

static void append char *&  str,
char *&  end,
int &  size,
char  c
[static]
 

static void append char *&  str,
char *&  end,
int &  size,
const char *  s
[static]
 

static bool changes function_t fun,
const std::set< symbol_t > &  variables
[static]
 

Returns true if fun changes any of the variables in variables.

static void ensure char *&  str,
char *&  end,
int &  size,
int  len
[static]
 

bool expression_t::changesVariable const std::set< symbol_t > &  symbols  )  const
 

expression_t expression_t::clone  )  const
 

void expression_t::collectPossibleReads set< symbol_t > &  symbols  )  const
 

void expression_t::collectPossibleWrites set< symbol_t > &  symbols  )  const
 

expression_t expression_t::createBinary const position_t pos,
kind_t  kind,
expression_t  left,
expression_t  right,
type_t  type
 

expression_t expression_t::createConstant const position_t pos,
int32_t  value
 

expression_t expression_t::createDeadlock const position_t pos  ) 
 

expression_t expression_t::createDot const position_t pos,
expression_t  e,
int32_t  idx,
type_t  type
 

expression_t expression_t::createIdentifier const position_t pos,
symbol_t  symbol
 

expression_t expression_t::createNary const position_t pos,
kind_t  kind,
const vector< expression_t > &  sub,
type_t  type
 

expression_t expression_t::createSync const position_t pos,
expression_t  e,
synchronisation_t  s
 

expression_t expression_t::createTernary const position_t pos,
kind_t  kind,
expression_t  e1,
expression_t  e2,
expression_t  e3,
type_t  type
 

expression_t expression_t::createUnary const position_t pos,
kind_t  kind,
expression_t  sub,
type_t  type
 

bool expression_t::dependsOn const std::set< symbol_t > &  symbols  )  const
 

bool expression_t::empty  )  const
 

bool expression_t::equal const expression_t e  )  const
 

Two expressions are identical iff all the sub expressions are identical and if the kind, value and symbol of the root are identical.

expression_t::expression_t const expression_t e  ) 
 

expression_t::expression_t kind_t  kind,
const position_t pos
 

expression_t::expression_t  ) 
 

expression_t& expression_t::get uint32_t  i  ) 
 

int32_t expression_t::getIndex  )  const
 

kind_t expression_t::getKind  )  const
 

const position_t& expression_t::getPosition  )  const
 

int expression_t::getPrecedence kind_t  kind  ) 
 

int expression_t::getPrecedence  )  const
 

uint32_t expression_t::getSize  )  const
 

symbol_t expression_t::getSymbol  ) 
 

Returns the symbol of a variable reference.

The expression must be a left-hand side value. The symbol returned is the symbol of the variable the expression if resulting in a reference to. NOTE: In case of inline if, the symbol referenced by the 'true' part is returned.

synchronisation_t expression_t::getSync  )  const
 

type_t expression_t::getType  )  const
 

int32_t expression_t::getValue  )  const
 

bool expression_t::isReferenceTo const std::set< symbol_t > &  symbols  )  const
 

Returns true if expr might be a reference to a symbol in the set.

NOTE: This method does not use the getSymbol() call, since that one always returns the 'true' result of an inline if.

bool expression_t::operator< const expression_t  e  )  const
 

expression_t& expression_t::operator= const expression_t e  ) 
 

bool expression_t::operator== const expression_t  e  )  const
 

expression_t& expression_t::operator[] uint32_t  i  ) 
 

void expression_t::setType type_t  type  ) 
 

std::string expression_t::toString bool  old  )  const
 

Returns a string representation of the expression.

The string returned must be deallocated with delete[]. Returns NULL is the expression is empty.

void expression_t::toString bool  old,
char *&  str,
char *&  end,
int &  size
const
 

expression_t::~expression_t  ) 
 

ostream& operator<< ostream &  o,
const expression_t e
 


Generated on Thu Nov 10 13:16:12 2005 for libutap by  doxygen 1.4.2