#include <ifstatement.h>
Inheritance diagram for IfStatement:
Public Member Functions | |
IfStatement (SrcPosition *position, GuardedStatement *guardedStatement) | |
IfStatement (const IfStatement &ifStatement) | |
virtual | ~IfStatement () |
GuardedStatement * | getGuardedStatement () |
virtual Ast & | operator= (const Ast &ast) |
virtual bool | operator== (const Ast &ast) const |
virtual VisitorReturn * | visit (Visitor &visitor) |
virtual Ast & | clone () const |
Private Attributes | |
GuardedStatement * | guardedStatement |
|
Definition at line 12 of file ifstatement.h. Referenced by clone().
00013 : SimpleStatement(position), guardedStatement(guardedStatement) {} |
|
Definition at line 15 of file ifstatement.h. References Ast::position.
00015 : SimpleStatement(ifStatement.position) { 00016 *(this) = ifStatement; 00017 } |
|
Definition at line 19 of file ifstatement.h.
00019 { 00020 delete this->guardedStatement; 00021 } |
|
Implements Ast. Definition at line 34 of file ifstatement.h. References IfStatement().
00034 { 00035 return *(new IfStatement(new SrcPosition(*(this->position)), 00036 this->guardedStatement ? dynamic_cast<GuardedStatement*>(&(this->guardedStatement->clone())) : 0)); 00037 } |
|
Definition at line 23 of file ifstatement.h. Referenced by TypeCheckerVisitor::visitIfStatement().
00023 { 00024 return this->guardedStatement; 00025 } |
|
Reimplemented from SimpleStatement. Definition at line 5 of file ifstatement.cpp. References Ast::clone(), guardedStatement, and Ast::operator=().
00005 { 00006 const IfStatement& ifStatement = dynamic_cast<const IfStatement&>(ast); 00007 00008 Ast::operator=(ast); 00009 this->guardedStatement = ifStatement.guardedStatement ? dynamic_cast<GuardedStatement*>(&(ifStatement.guardedStatement->clone())) : 0; 00010 00011 return *(this); 00012 } |
|
Reimplemented from SimpleStatement. Definition at line 14 of file ifstatement.cpp. References guardedStatement.
00014 { 00015 bool result = false; 00016 const IfStatement& ifStatement = dynamic_cast<const IfStatement&>(ast); 00017 00018 if (typeid(ast) != typeid(IfStatement)) 00019 return false; 00020 00021 if (this->guardedStatement) 00022 result = (*(this->guardedStatement) == *(ifStatement.guardedStatement)); 00023 00024 return result; 00025 } |
|
Implements Ast. Definition at line 30 of file ifstatement.h. References Visitor::visitIfStatement().
00030 { 00031 return visitor.visitIfStatement(this); 00032 } |
|
Definition at line 9 of file ifstatement.h. Referenced by operator=(), and operator==(). |