Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

FieldType Class Reference

#include <fieldtype.h>

Inheritance diagram for FieldType:

Inheritance graph
[legend]
Collaboration diagram for FieldType:

Collaboration graph
[legend]
List of all members.

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 ()
ExpressiongetExpression ()
FType getType () const
virtual Astoperator= (const Ast &ast)
virtual bool operator== (const Ast &ast) const
virtual VisitorReturnvisit (Visitor &visitor)
virtual Astclone () const

Private Attributes

Expressionexpression
FType type

Member Enumeration Documentation

enum FieldType::FType
 

Enumeration values:
BIT 
BYTE 
STRN 
STRCTE 
STRTERM 
STRTERMSTOP 
BLANKS 

Definition at line 9 of file fieldtype.h.

Referenced by getType().


Constructor & Destructor Documentation

FieldType::FieldType SrcPosition position,
Expression expression,
FType  type
[inline]
 

Definition at line 11 of file fieldtype.h.

References type.

Referenced by clone().

00012                                 : Ast(position), expression(expression), type(type) {}

FieldType::FieldType const FieldType &  fieldType  )  [inline]
 

Definition at line 14 of file fieldtype.h.

References Ast::position.

00014                                                       : Ast(fieldType.position) {
00015                         *(this) = fieldType;
00016                 }

virtual FieldType::~FieldType  )  [inline, virtual]
 

Definition at line 18 of file fieldtype.h.

References expression.

00018                                      {
00019                         if (this->expression)
00020                                 delete this->expression;
00021                 }


Member Function Documentation

virtual Ast& FieldType::clone  )  const [inline, virtual]
 

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                 }

Expression* FieldType::getExpression  )  [inline]
 

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                 }

FType FieldType::getType  )  const [inline]
 

Definition at line 27 of file fieldtype.h.

References FType, and type.

Referenced by TypeCheckerVisitor::visitFieldType(), JavaCodeGeneratorVisitor::visitSimpleFieldDeclaration(), and JavaCodeGeneratorVisitor::visitSimpleMessage().

00027                                       {
00028                         return this->type;
00029                 }

Ast & FieldType::operator= const Ast ast  )  [virtual]
 

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 }

bool FieldType::operator== const Ast ast  )  const [virtual]
 

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 }

virtual VisitorReturn* FieldType::visit Visitor visitor  )  [inline, virtual]
 

Implements Ast.

Definition at line 34 of file fieldtype.h.

References Visitor::visitFieldType().

Referenced by TypeCheckerVisitor::visitSimpleFieldDeclaration().

00034                                                                {
00035                         return visitor.visitFieldType(this);
00036                 }


Member Data Documentation

Expression* FieldType::expression [private]
 

Definition at line 44 of file fieldtype.h.

Referenced by getExpression(), operator=(), operator==(), and ~FieldType().

FType FieldType::type [private]
 

Definition at line 45 of file fieldtype.h.

Referenced by clone(), FieldType(), getType(), operator=(), and operator==().


The documentation for this class was generated from the following files:
Generated on Mon Dec 1 17:39:02 2003 for Protomake by doxygen1.3