#include <simpleguardedstatement.h>
Inheritance diagram for SimpleGuardedStatement:
Public Member Functions | |
SimpleGuardedStatement (SrcPosition *position, Expression *expression, Statement *statement) | |
SimpleGuardedStatement (const SimpleGuardedStatement &simpleGuardedStatement) | |
virtual | ~SimpleGuardedStatement () |
Expression * | getExpression () |
Statement * | getStatement () |
virtual Ast & | operator= (const Ast &ast) |
virtual bool | operator== (const Ast &ast) const |
virtual VisitorReturn * | visit (Visitor &visitor) |
virtual Ast & | clone () const |
Private Attributes | |
Expression * | expression |
Statement * | statement |
|
Definition at line 14 of file simpleguardedstatement.h. Referenced by clone().
00015 : GuardedStatement(position), expression(expression), statement(statement) {} |
|
Definition at line 17 of file simpleguardedstatement.h. References Ast::position.
00017 : GuardedStatement(simpleGuardedStatement.position) { 00018 *(this) = simpleGuardedStatement; 00019 } |
|
Definition at line 21 of file simpleguardedstatement.h.
00021 { 00022 delete this->expression; 00023 delete this->statement; 00024 } |
|
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 } |
|
Definition at line 26 of file simpleguardedstatement.h. Referenced by TypeCheckerVisitor::visitSimpleGuardedStatement().
00026 { 00027 return this->expression; 00028 } |
|
Definition at line 30 of file simpleguardedstatement.h. Referenced by TypeCheckerVisitor::visitSimpleGuardedStatement().
00030 { 00031 return this->statement; 00032 } |
|
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 } |
|
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 } |
|
Implements Ast. Definition at line 37 of file simpleguardedstatement.h. References Visitor::visitSimpleGuardedStatement(). Referenced by TypeCheckerVisitor::visitSequentialGuardedStatement().
00037 { 00038 return visitor.visitSimpleGuardedStatement(this); 00039 } |
|
Definition at line 10 of file simpleguardedstatement.h. Referenced by operator=(), and operator==(). |
|
Definition at line 11 of file simpleguardedstatement.h. Referenced by operator=(), and operator==(). |