#include <unaryexpression.h>
Inheritance diagram for UnaryExpression:
Public Member Functions | |
UnaryExpression (SrcPosition *position, Expression *expression, string op) | |
UnaryExpression (const UnaryExpression &unaryExpression) | |
virtual | ~UnaryExpression () |
Expression * | getExpression () |
string | getOp () const |
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 |
string | op |
|
Definition at line 16 of file unaryexpression.h. Referenced by clone().
00017 : Expression(position), Ast(position), expression(expression), op(op) {} |
|
Definition at line 19 of file unaryexpression.h. References Ast::position.
00019 : Expression(unaryExpression.position), Ast(position) { 00020 *(this) = unaryExpression; 00021 } |
|
Definition at line 23 of file unaryexpression.h.
00023 { 00024 delete this->expression; 00025 } |
|
Implements Ast. Definition at line 42 of file unaryexpression.h. References UnaryExpression().
00042 { 00043 return *(new UnaryExpression(new SrcPosition(*(this->position)), 00044 this->expression ? dynamic_cast<Expression*>(&(this->expression->clone())) : 0, 00045 this->op)); 00046 } |
|
Definition at line 27 of file unaryexpression.h. Referenced by TypeCheckerVisitor::visitUnaryExpression().
00027 { 00028 return this->expression; 00029 } |
|
Definition at line 31 of file unaryexpression.h. Referenced by TypeCheckerVisitor::visitUnaryExpression().
00031 { 00032 return this->op; 00033 } |
|
Reimplemented from Expression. Definition at line 5 of file unaryexpression.cpp. References Ast::clone(), expression, op, and Ast::operator=().
00005 { 00006 const UnaryExpression& unaryExpression = dynamic_cast<const UnaryExpression&>(ast); 00007 00008 Ast::operator=(ast); 00009 this->expression = this->expression ? dynamic_cast<Expression*>(&(unaryExpression.expression->clone())) : 0; 00010 this->op = unaryExpression.op; 00011 00012 return *(this); 00013 } |
|
Reimplemented from Expression. Definition at line 15 of file unaryexpression.cpp. References expression, op, and Ast::operator==().
00015 { 00016 bool result = false; 00017 const UnaryExpression& unaryExpression = dynamic_cast<const UnaryExpression&>(ast); 00018 00019 if (typeid(ast) != typeid(UnaryExpression)) 00020 return false; 00021 00022 if (this->expression) 00023 result = (*(this->expression) == *(unaryExpression.expression)); 00024 00025 return result && (this->op == unaryExpression.op) && Ast::operator==(ast); 00026 } |
|
Implements Ast. Definition at line 38 of file unaryexpression.h. References Visitor::visitUnaryExpression().
00038 { 00039 return visitor.visitUnaryExpression(this); 00040 } |
|
Definition at line 12 of file unaryexpression.h. Referenced by operator=(), and operator==(). |
|
Definition at line 13 of file unaryexpression.h. Referenced by operator=(), and operator==(). |