UTAP::ExpressionBuilder Class Reference

Partial implementation of the builder interface: The ExpressionBuilder implements all expression related methods. More...

#include <expressionbuilder.h>

Inheritance diagram for UTAP::ExpressionBuilder:

UTAP::AbstractBuilder UTAP::ParserBuilder UTAP::StatementBuilder UTAP::SystemBuilder List of all members.

Public Member Functions

 ExpressionBuilder (TimedAutomataSystem *)
ExpressionFragmentsgetExpressions ()
virtual void addPosition (uint32_t position, uint32_t offset, uint32_t line, std::string path)
 Add mapping from an absolute position to a relative XML element.
virtual void handleError (std::string)
virtual void handleWarning (std::string)
virtual void typeDuplicate ()
 Duplicate type at the top of the type stack.
virtual void typePop ()
 Pop type at the topof the type stack.
virtual void typeBool (PREFIX)
virtual void typeInt (PREFIX)
virtual void typeBoundedInt (PREFIX)
virtual void typeChannel (PREFIX)
virtual void typeClock ()
 Called whenever a clock type is parsed.
virtual void typeVoid ()
 Called whenever a void type is parsed.
virtual void typeScalar (PREFIX)
virtual void typeName (PREFIX, const char *name)
virtual bool isType (const char *)
 Must return true if and only if name is registered in the symbol table as a named type, for instance, "int" or "bool" or a user defined type.
virtual void exprTrue ()
virtual void exprFalse ()
virtual void exprId (const char *varName)
virtual void exprNat (int32_t)
virtual void exprCallBegin ()
virtual void exprCallEnd (uint32_t n)
virtual void exprArray ()
virtual void exprPostIncrement ()
virtual void exprPreIncrement ()
virtual void exprPostDecrement ()
virtual void exprPreDecrement ()
virtual void exprAssignment (Constants::kind_t op)
virtual void exprUnary (Constants::kind_t unaryop)
virtual void exprBinary (Constants::kind_t binaryop)
virtual void exprTernary (Constants::kind_t ternaryop, bool firstMissing)
virtual void exprInlineIf ()
virtual void exprComma ()
virtual void exprDot (const char *)
virtual void exprDeadlock ()
virtual void exprForAllBegin (const char *name)
virtual void exprForAllEnd (const char *name)
virtual void exprExistsBegin (const char *name)
virtual void exprExistsEnd (const char *name)

Protected Member Functions

void pushFrame (frame_t)
 Push a new frame.
void popFrame ()
 Pop the topmost frame.
bool resolve (std::string, symbol_t &)
expression_t makeConstant (int value)
type_t applyPrefix (PREFIX, type_t type)
 Given a prefix and a type, this method creates a new type by applying the prefix.
virtual bool allowProcessReferences ()
 If this method returns true, it is allowed to access the private identifiers of a process by prefixing the identifier with the process name.

Protected Attributes

ExpressionFragments fragments
 Expression stack.
TypeFragments typeFragments
 Type stack.
std::stack< frame_tframes
 Frame stack.
TimedAutomataSystemsystem
 Pointer to the system under construction.
template_tcurrentTemplate
 The template currently being parsed.
int32_t scalar_count
 Counter for creating unique scalarset names.

Classes

class  ExpressionFragments
class  TypeFragments

Detailed Description

Partial implementation of the builder interface: The ExpressionBuilder implements all expression related methods.

In order to support quantifier expressions, this class also handles the type related methods.

This class does not implement any declaration related methods.

Internally, three stacks are maintained: One for expressions, one for types and for frames (scopes).


Constructor & Destructor Documentation

ExpressionBuilder::ExpressionBuilder ( TimedAutomataSystem  ) 


Member Function Documentation

void ExpressionBuilder::addPosition ( uint32_t  position,
uint32_t  offset,
uint32_t  line,
std::string  path 
) [virtual]

Add mapping from an absolute position to a relative XML element.

Implements UTAP::ParserBuilder.

virtual bool UTAP::ExpressionBuilder::allowProcessReferences (  )  [inline, protected, virtual]

If this method returns true, it is allowed to access the private identifiers of a process by prefixing the identifier with the process name.

This is only interesting when parsing properties. In this case the method should be overridden by a sub class.

type_t ExpressionBuilder::applyPrefix ( PREFIX  ,
type_t  type 
) [protected]

Given a prefix and a type, this method creates a new type by applying the prefix.

TypeExceptions might be thrown if the combination of the prefix and the type is illegal.

void ExpressionBuilder::exprArray (  )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

virtual void UTAP::ExpressionBuilder::exprAssignment ( Constants::kind_t  op  )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

virtual void UTAP::ExpressionBuilder::exprBinary ( Constants::kind_t  binaryop  )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::exprCallBegin (  )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

Reimplemented in UTAP::StatementBuilder.

void ExpressionBuilder::exprCallEnd ( uint32_t  n  )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::exprComma (  )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::exprDeadlock (  )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::exprDot ( const char *   )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::exprExistsBegin ( const char *  name  )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::exprExistsEnd ( const char *  name  )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::exprFalse (  )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::exprForAllBegin ( const char *  name  )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::exprForAllEnd ( const char *  name  )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::exprId ( const char *  varName  )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::exprInlineIf (  )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::exprNat ( int32_t   )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::exprPostDecrement (  )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::exprPostIncrement (  )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::exprPreDecrement (  )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::exprPreIncrement (  )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

virtual void UTAP::ExpressionBuilder::exprTernary ( Constants::kind_t  ternaryop,
bool  firstMissing 
) [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::exprTrue (  )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

virtual void UTAP::ExpressionBuilder::exprUnary ( Constants::kind_t  unaryop  )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

ExpressionBuilder::ExpressionFragments & ExpressionBuilder::getExpressions (  ) 

virtual void UTAP::ExpressionBuilder::handleError ( std::string   )  [virtual]

Implements UTAP::ParserBuilder.

virtual void UTAP::ExpressionBuilder::handleWarning ( std::string   )  [virtual]

Implements UTAP::ParserBuilder.

bool ExpressionBuilder::isType ( const char *   )  [virtual]

Must return true if and only if name is registered in the symbol table as a named type, for instance, "int" or "bool" or a user defined type.

Reimplemented from UTAP::AbstractBuilder.

expression_t ExpressionBuilder::makeConstant ( int  value  )  [protected]

void ExpressionBuilder::popFrame (  )  [protected]

Pop the topmost frame.

void ExpressionBuilder::pushFrame ( frame_t   )  [protected]

Push a new frame.

bool ExpressionBuilder::resolve ( std::string  ,
symbol_t  
) [protected]

void ExpressionBuilder::typeBool ( PREFIX   )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::typeBoundedInt ( PREFIX   )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::typeChannel ( PREFIX   )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::typeClock (  )  [virtual]

Called whenever a clock type is parsed.

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::typeDuplicate (  )  [virtual]

Duplicate type at the top of the type stack.

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::typeInt ( PREFIX   )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::typeName ( PREFIX  ,
const char *  name 
) [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::typePop (  )  [virtual]

Pop type at the topof the type stack.

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::typeScalar ( PREFIX   )  [virtual]

Reimplemented from UTAP::AbstractBuilder.

void ExpressionBuilder::typeVoid (  )  [virtual]

Called whenever a void type is parsed.

Reimplemented from UTAP::AbstractBuilder.


Member Data Documentation

template_t* UTAP::ExpressionBuilder::currentTemplate [protected]

The template currently being parsed.

ExpressionFragments UTAP::ExpressionBuilder::fragments [protected]

Expression stack.

std::stack<frame_t> UTAP::ExpressionBuilder::frames [protected]

Frame stack.

int32_t UTAP::ExpressionBuilder::scalar_count [protected]

Counter for creating unique scalarset names.

TimedAutomataSystem* UTAP::ExpressionBuilder::system [protected]

Pointer to the system under construction.

TypeFragments UTAP::ExpressionBuilder::typeFragments [protected]

Type stack.


The documentation for this class was generated from the following files:
Generated on Thu Feb 22 14:46:52 2007 for libutap by  doxygen 1.4.7