#include <fieldtype.h>
Inheritance diagram for FieldType:
Public Types | |
enum | FType { BIT, BYTE, STRN, STRCTE, STRTERM, STRTERMSTOP, BLANKS } |
Public Member Functions | |
FieldType (SrcPosition *position, Expression *expression, FType type) | |
FieldType (const FieldType &fieldType) | |
virtual | ~FieldType () |
Expression * | getExpression () |
FType | getType () 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 |
FType | type |
|
Definition at line 9 of file fieldtype.h. Referenced by getType().
|
|
Definition at line 11 of file fieldtype.h. References type. Referenced by clone().
00012 : Ast(position), expression(expression), type(type) {} |
|
Definition at line 14 of file fieldtype.h. References Ast::position.
|
|
Definition at line 18 of file fieldtype.h. References expression.
00018 { 00019 if (this->expression) 00020 delete this->expression; 00021 } |
|
Implements Ast. Definition at line 38 of file fieldtype.h. References FieldType(), and type. Referenced by SimpleFieldDeclaration::clone(), and SimpleFieldDeclaration::operator=().
00038 { 00039 return *(new FieldType(new SrcPosition(*(this->position)), 00040 this->expression ? dynamic_cast<Expression*>(&(this->expression->clone())) : 0, 00041 this->type)); 00042 } |
|
Definition at line 23 of file fieldtype.h. References expression. Referenced by TypeCheckerVisitor::visitFieldType(), JavaCodeGeneratorVisitor::visitSimpleFieldDeclaration(), and JavaCodeGeneratorVisitor::visitSimpleMessage().
00023 { 00024 return this->expression; 00025 } |
|
Definition at line 27 of file fieldtype.h. Referenced by TypeCheckerVisitor::visitFieldType(), JavaCodeGeneratorVisitor::visitSimpleFieldDeclaration(), and JavaCodeGeneratorVisitor::visitSimpleMessage().
00027 { 00028 return this->type; 00029 } |
|
Reimplemented from Ast. Definition at line 5 of file fieldtype.cpp. References Ast::clone(), expression, Ast::operator=(), and type.
00005 { 00006 const FieldType& fieldType = dynamic_cast<const FieldType&>(ast); 00007 00008 Ast::operator=(ast); 00009 this->expression = this->expression ? dynamic_cast<Expression*>(&(fieldType.expression->clone())) : 0; 00010 this->type = fieldType.type; 00011 00012 return *(this); 00013 } |
|
Reimplemented from Ast. Definition at line 15 of file fieldtype.cpp. References expression, Ast::operator==(), and type.
00015 { 00016 bool result = false; 00017 const FieldType& fieldType = dynamic_cast<const FieldType&>(ast); 00018 00019 if (typeid(ast) != typeid(FieldType)) 00020 return false; 00021 00022 if (this->expression) 00023 result = (*(this->expression) == *(fieldType.expression)) && (this->type == fieldType.type); 00024 00025 return result && Ast::operator==(ast); 00026 } |
|
Implements Ast. Definition at line 34 of file fieldtype.h. References Visitor::visitFieldType(). Referenced by TypeCheckerVisitor::visitSimpleFieldDeclaration().
00034 { 00035 return visitor.visitFieldType(this); 00036 } |
|
Definition at line 44 of file fieldtype.h. Referenced by getExpression(), operator=(), operator==(), and ~FieldType(). |
|
Definition at line 45 of file fieldtype.h. Referenced by clone(), FieldType(), getType(), operator=(), and operator==(). |