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

SimpleGuardedStatement Class Reference

#include <simpleguardedstatement.h>

Inheritance diagram for SimpleGuardedStatement:

Inheritance graph
[legend]
Collaboration diagram for SimpleGuardedStatement:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SimpleGuardedStatement (SrcPosition *position, Expression *expression, Statement *statement)
 SimpleGuardedStatement (const SimpleGuardedStatement &simpleGuardedStatement)
virtual ~SimpleGuardedStatement ()
ExpressiongetExpression ()
StatementgetStatement ()
virtual Astoperator= (const Ast &ast)
virtual bool operator== (const Ast &ast) const
virtual VisitorReturnvisit (Visitor &visitor)
virtual Astclone () const

Private Attributes

Expressionexpression
Statementstatement

Constructor & Destructor Documentation

SimpleGuardedStatement::SimpleGuardedStatement SrcPosition position,
Expression expression,
Statement statement
[inline]
 

Definition at line 14 of file simpleguardedstatement.h.

Referenced by clone().

00015                         : GuardedStatement(position), expression(expression), statement(statement) {}

SimpleGuardedStatement::SimpleGuardedStatement const SimpleGuardedStatement &  simpleGuardedStatement  )  [inline]
 

Definition at line 17 of file simpleguardedstatement.h.

References Ast::position.

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

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

Definition at line 21 of file simpleguardedstatement.h.

00021                                                   {
00022                         delete this->expression;
00023                         delete this->statement;
00024                 }


Member Function Documentation

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

Implements Ast.

Definition at line 41 of file simpleguardedstatement.h.

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

Referenced by SequentialGuardedStatement::clone(), and SequentialGuardedStatement::operator=().

00041                                            {
00042                         return *(new SimpleGuardedStatement(new SrcPosition(*(this->position)),
00043                                          this->expression ? dynamic_cast<Expression*>(&(this->expression->clone())) : 0,
00044                                          this->statement ? dynamic_cast<Statement*>(&(this->statement->clone())) : 0));
00045                 }

Expression* SimpleGuardedStatement::getExpression  )  [inline]
 

Definition at line 26 of file simpleguardedstatement.h.

Referenced by TypeCheckerVisitor::visitSimpleGuardedStatement().

00026                                             {
00027                         return this->expression;
00028                 }

Statement* SimpleGuardedStatement::getStatement  )  [inline]
 

Definition at line 30 of file simpleguardedstatement.h.

Referenced by TypeCheckerVisitor::visitSimpleGuardedStatement().

00030                                           {
00031                         return this->statement;
00032                 }

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

Reimplemented from GuardedStatement.

Definition at line 5 of file simpleguardedstatement.cpp.

References Ast::clone(), expression, GuardedStatement::operator=(), and statement.

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

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

Reimplemented from GuardedStatement.

Definition at line 15 of file simpleguardedstatement.cpp.

References expression, GuardedStatement::operator==(), and statement.

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

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

Implements Ast.

Definition at line 37 of file simpleguardedstatement.h.

References Visitor::visitSimpleGuardedStatement().

Referenced by TypeCheckerVisitor::visitSequentialGuardedStatement().

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


Member Data Documentation

Expression* SimpleGuardedStatement::expression [private]
 

Definition at line 10 of file simpleguardedstatement.h.

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

Statement* SimpleGuardedStatement::statement [private]
 

Definition at line 11 of file simpleguardedstatement.h.

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


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