Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

SequentialGuardedStatement Class Reference

#include <sequentialguardedstatement.h>

Inheritance diagram for SequentialGuardedStatement:

Inheritance graph
[legend]
Collaboration diagram for SequentialGuardedStatement:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SequentialGuardedStatement (SrcPosition *position, GuardedStatement *guardedStatement, SimpleGuardedStatement *simpleGuardedStatement)
 SequentialGuardedStatement (const SequentialGuardedStatement &sequentialGuardedStatement)
virtual ~SequentialGuardedStatement ()
GuardedStatementgetGuardedStatement ()
SimpleGuardedStatementgetSimpleGuardedStatement ()
virtual Astoperator= (const Ast &ast)
virtual bool operator== (const Ast &ast) const
virtual VisitorReturnvisit (Visitor &visitor)
virtual Astclone () const

Private Attributes

GuardedStatementguardedStatement
SimpleGuardedStatementsimpleGuardedStatement

Constructor & Destructor Documentation

SequentialGuardedStatement::SequentialGuardedStatement SrcPosition position,
GuardedStatement guardedStatement,
SimpleGuardedStatement simpleGuardedStatement
[inline]
 

Definition at line 14 of file sequentialguardedstatement.h.

Referenced by clone().

00015                         : GuardedStatement(position), guardedStatement(guardedStatement), simpleGuardedStatement(simpleGuardedStatement) {}

SequentialGuardedStatement::SequentialGuardedStatement const SequentialGuardedStatement &  sequentialGuardedStatement  )  [inline]
 

Definition at line 17 of file sequentialguardedstatement.h.

References Ast::position.

00017                                                                                                          : GuardedStatement(sequentialGuardedStatement.position) {
00018                         *(this) = sequentialGuardedStatement;
00019                 }

virtual SequentialGuardedStatement::~SequentialGuardedStatement  )  [inline, virtual]
 

Definition at line 21 of file sequentialguardedstatement.h.

00021                                                       {
00022                         delete this->guardedStatement;
00023                         delete this->simpleGuardedStatement;
00024                 }


Member Function Documentation

virtual Ast& SequentialGuardedStatement::clone  )  const [inline, virtual]
 

Implements Ast.

Definition at line 41 of file sequentialguardedstatement.h.

References SimpleGuardedStatement::clone(), and SequentialGuardedStatement().

00041                                            {
00042                         return *(new SequentialGuardedStatement(new SrcPosition(*(this->position)),
00043                                          this->guardedStatement ? dynamic_cast<GuardedStatement*>(&(this->guardedStatement->clone())) : 0,
00044                                          this->simpleGuardedStatement ? dynamic_cast<SimpleGuardedStatement*>(&(this->simpleGuardedStatement->clone())) : 0));
00045                 }

GuardedStatement* SequentialGuardedStatement::getGuardedStatement  )  [inline]
 

Definition at line 26 of file sequentialguardedstatement.h.

Referenced by TypeCheckerVisitor::visitSequentialGuardedStatement().

00026                                                         {
00027                         return this->guardedStatement;
00028                 }

SimpleGuardedStatement* SequentialGuardedStatement::getSimpleGuardedStatement  )  [inline]
 

Definition at line 30 of file sequentialguardedstatement.h.

Referenced by TypeCheckerVisitor::visitSequentialGuardedStatement().

00030                                                                     {
00031                         return this->simpleGuardedStatement;
00032                 }

Ast & SequentialGuardedStatement::operator= const Ast ast  )  [virtual]
 

Reimplemented from GuardedStatement.

Definition at line 5 of file sequentialguardedstatement.cpp.

References SimpleGuardedStatement::clone(), Ast::clone(), guardedStatement, GuardedStatement::operator=(), and simpleGuardedStatement.

00005                                                            {
00006         const SequentialGuardedStatement& sequentialGuardedStatement = dynamic_cast<const SequentialGuardedStatement&>(ast);
00007 
00008         GuardedStatement::operator=(ast);
00009         this->guardedStatement = sequentialGuardedStatement.guardedStatement ? dynamic_cast<GuardedStatement*>(&(sequentialGuardedStatement.guardedStatement->clone())) : 0;
00010         this->simpleGuardedStatement = sequentialGuardedStatement.simpleGuardedStatement ? dynamic_cast<SimpleGuardedStatement*>(&(sequentialGuardedStatement.simpleGuardedStatement->clone())) : 0;
00011 
00012         return *(this);
00013 }

bool SequentialGuardedStatement::operator== const Ast ast  )  const [virtual]
 

Reimplemented from GuardedStatement.

Definition at line 15 of file sequentialguardedstatement.cpp.

References guardedStatement, GuardedStatement::operator==(), and simpleGuardedStatement.

00015                                                                   {
00016         bool result = false;
00017         const SequentialGuardedStatement& sequentialGuardedStatement = dynamic_cast<const SequentialGuardedStatement&>(ast);
00018 
00019         if (typeid(ast) != typeid(SequentialGuardedStatement))
00020                 return false;
00021 
00022         if (this->guardedStatement && this->simpleGuardedStatement)
00023                 result = (*(this->guardedStatement) == *(sequentialGuardedStatement.guardedStatement) &&
00024                                   *(this->simpleGuardedStatement) == *(sequentialGuardedStatement.simpleGuardedStatement));
00025 
00026         return result && GuardedStatement::operator==(ast);
00027 }

virtual VisitorReturn* SequentialGuardedStatement::visit Visitor visitor  )  [inline, virtual]
 

Implements Ast.

Definition at line 37 of file sequentialguardedstatement.h.

References Visitor::visitSequentialGuardedStatement().

00037                                                                {
00038                         return visitor.visitSequentialGuardedStatement(this);
00039                 }


Member Data Documentation

GuardedStatement* SequentialGuardedStatement::guardedStatement [private]
 

Definition at line 9 of file sequentialguardedstatement.h.

Referenced by operator=(), and operator==().

SimpleGuardedStatement* SequentialGuardedStatement::simpleGuardedStatement [private]
 

Definition at line 10 of file sequentialguardedstatement.h.

Referenced by operator=(), and operator==().


The documentation for this class was generated from the following files:
Generated on Mon Dec 1 17:39:18 2003 for Protomake by doxygen1.3