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

ActStatement Class Reference

#include <actstatement.h>

Inheritance diagram for ActStatement:

Inheritance graph
[legend]
Collaboration diagram for ActStatement:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ActStatement (SrcPosition *position, Identifier *identifier, Expression *expression)
 ActStatement (const ActStatement &actStatement)
virtual ~ActStatement ()
IdentifiergetIdentifier ()
ExpressiongetExpression ()
virtual Astoperator= (const Ast &ast)
virtual bool operator== (const Ast &ast) const
virtual VisitorReturnvisit (Visitor &visitor)
virtual Astclone () const

Private Attributes

Identifieridentifier
Expressionexpression

Constructor & Destructor Documentation

ActStatement::ActStatement SrcPosition position,
Identifier identifier,
Expression expression
[inline]
 

Definition at line 14 of file actstatement.h.

Referenced by clone().

00015                                 : SimpleStatement(position), identifier(identifier), expression(expression) {}

ActStatement::ActStatement const ActStatement &  actStatement  )  [inline]
 

Definition at line 17 of file actstatement.h.

References Ast::position.

00017                                                                : SimpleStatement(actStatement.position) {
00018                         *(this) = actStatement;
00019                 }

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

Definition at line 21 of file actstatement.h.

00021                                         {
00022                         delete this->identifier;
00023                         delete this->expression;
00024                 }


Member Function Documentation

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

Implements Ast.

Definition at line 41 of file actstatement.h.

References ActStatement(), and Ast::clone().

00041                                            {
00042                         return *(new ActStatement(new SrcPosition(*(this->position)),
00043                                          this->identifier ? dynamic_cast<Identifier*>(&(this->identifier->clone())) : 0,
00044                                          this->expression ? dynamic_cast<Expression*>(&(this->expression->clone())) : 0));
00045                 }

Expression* ActStatement::getExpression  )  [inline]
 

Definition at line 30 of file actstatement.h.

Referenced by TypeCheckerVisitor::visitActStatement().

00030                                             {
00031                         return this->expression;
00032                 }

Identifier* ActStatement::getIdentifier  )  [inline]
 

Definition at line 26 of file actstatement.h.

Referenced by TypeCheckerVisitor::visitActStatement().

00026                                             {
00027                         return this->identifier;
00028                 }

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

Reimplemented from SimpleStatement.

Definition at line 5 of file actstatement.cpp.

References Ast::clone(), Identifier::clone(), expression, identifier, and Ast::operator=().

00005                                              {
00006         const ActStatement& actStatement = dynamic_cast<const ActStatement&>(ast);
00007 
00008         Ast::operator=(ast);
00009         this->identifier = actStatement.identifier ? dynamic_cast<Identifier*>(&(actStatement.identifier->clone())) : 0;
00010         this->expression = actStatement.expression ? dynamic_cast<Expression*>(&(actStatement.expression->clone())) : 0;
00011 
00012         return *(this);
00013 }

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

Reimplemented from SimpleStatement.

Definition at line 15 of file actstatement.cpp.

References expression, and identifier.

00015                                                     {
00016         bool result = false;
00017         const ActStatement& actStatement = dynamic_cast<const ActStatement&>(ast);
00018 
00019         if (typeid(ast) != typeid(ActStatement))
00020                 return false;
00021 
00022         if (this->identifier && this->expression)
00023                 result = (*(this->identifier) == *(actStatement.identifier) &&
00024                                    *(this->expression) == *(actStatement.expression));
00025 
00026         return result;
00027 }

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

Implements Ast.

Definition at line 37 of file actstatement.h.

References Visitor::visitActStatement().

00037                                                                {
00038                         return visitor.visitActStatement(this);
00039                 }


Member Data Documentation

Expression* ActStatement::expression [private]
 

Definition at line 11 of file actstatement.h.

Referenced by operator=(), and operator==().

Identifier* ActStatement::identifier [private]
 

Definition at line 10 of file actstatement.h.

Referenced by operator=(), and operator==().


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