#include <simpledeclaration.h>
Inheritance diagram for SimpleDeclaration:
Public Member Functions | |
SimpleDeclaration (SrcPosition *position, IdentifierList *identifierList, Type *type, Expression *expression, bool constant) | |
SimpleDeclaration (const SimpleDeclaration &simpleDeclaration) | |
virtual | ~SimpleDeclaration () |
IdentifierList * | getIdentifierList () |
Type * | getType () |
Expression * | getExpression () |
bool | isConstant () 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 | |
IdentifierList * | identifierList |
Type * | type |
Expression * | expression |
bool | constant |
|
Definition at line 17 of file simpledeclaration.h. Referenced by clone().
00019 : Declaration(position), identifierList(identifierList), type(type), 00020 expression(expression), constant(constant) {} |
|
Definition at line 22 of file simpledeclaration.h. References Ast::position.
00022 : Declaration(simpleDeclaration.position) { 00023 *(this) = simpleDeclaration; 00024 } |
|
Definition at line 26 of file simpledeclaration.h.
00026 { 00027 delete this->identifierList; 00028 delete this->type; 00029 delete this->expression; 00030 } |
|
Implements Ast. Definition at line 55 of file simpledeclaration.h. References Ast::clone(), Type::clone(), and SimpleDeclaration(). Referenced by SequentialDeclaration::clone(), and SequentialDeclaration::operator=().
00055 { 00056 return *(new SimpleDeclaration(new SrcPosition(*(this->position)), 00057 this->identifierList ? dynamic_cast<IdentifierList*>(&(this->identifierList->clone())) : 0, 00058 this->type ? dynamic_cast<Type*>(&(this->type->clone())) : 0, 00059 this->expression ? dynamic_cast<Expression*>(&(this->expression->clone())) : 0, 00060 this->constant)); 00061 } |
|
Definition at line 40 of file simpledeclaration.h. Referenced by TypeCheckerVisitor::visitSimpleDeclaration().
00040 { 00041 return this->expression; 00042 } |
|
Definition at line 32 of file simpledeclaration.h. Referenced by TypeCheckerVisitor::visitSimpleDeclaration().
00032 { 00033 return this->identifierList; 00034 } |
|
Definition at line 36 of file simpledeclaration.h. Referenced by TypeCheckerVisitor::visitSimpleDeclaration().
00036 { 00037 return this->type; 00038 } |
|
Definition at line 44 of file simpledeclaration.h.
00044 { 00045 return this->constant; 00046 } |
|
Reimplemented from Declaration. Definition at line 5 of file simpledeclaration.cpp. References Type::clone(), Ast::clone(), constant, expression, identifierList, Declaration::operator=(), and type.
00005 { 00006 const SimpleDeclaration& simpleDeclaration = dynamic_cast<const SimpleDeclaration&>(ast); 00007 00008 Declaration::operator=(ast); 00009 this->identifierList = this->identifierList ? dynamic_cast<IdentifierList*>(&(simpleDeclaration.identifierList->clone())) : 0; 00010 this->type = this->type ? dynamic_cast<Type*>(&(simpleDeclaration.type->clone())) : 0; 00011 this->expression = this->expression ? dynamic_cast<Expression*>(&(simpleDeclaration.expression->clone())) : 0; 00012 this->constant = simpleDeclaration.constant; 00013 00014 return *(this); 00015 } |
|
Reimplemented from Declaration. Definition at line 17 of file simpledeclaration.cpp. References constant, expression, identifierList, Declaration::operator==(), and type.
00017 { 00018 bool result = false; 00019 const SimpleDeclaration& simpleDeclaration = dynamic_cast<const SimpleDeclaration&>(ast); 00020 00021 if (typeid(ast) != typeid(SimpleDeclaration)) 00022 return false; 00023 00024 if (this->identifierList && this->type && this->expression) 00025 result = (*(this->identifierList) == *(simpleDeclaration.identifierList) && 00026 *(this->type) == *(simpleDeclaration.type) && 00027 *(this->expression) == *(simpleDeclaration.expression) && 00028 this->constant == simpleDeclaration.constant); 00029 00030 return result && Declaration::operator==(ast); 00031 } |
|
Implements Ast. Definition at line 51 of file simpledeclaration.h. References Visitor::visitSimpleDeclaration(). Referenced by TypeCheckerVisitor::visitSequentialDeclaration().
00051 { 00052 return visitor.visitSimpleDeclaration(this); 00053 } |
|
Definition at line 14 of file simpledeclaration.h. Referenced by operator=(), and operator==(). |
|
Definition at line 13 of file simpledeclaration.h. Referenced by operator=(), and operator==(). |
|
Definition at line 11 of file simpledeclaration.h. Referenced by operator=(), and operator==(). |
|
Definition at line 12 of file simpledeclaration.h. Referenced by operator=(), and operator==(). |