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