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

SimpleBehavior Class Reference

#include <simplebehavior.h>

Inheritance diagram for SimpleBehavior:

Inheritance graph
[legend]
Collaboration diagram for SimpleBehavior:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SimpleBehavior (SrcPosition *position, IdentifierList *identifierList)
 SimpleBehavior (const SimpleBehavior &simpleBehavior)
virtual ~SimpleBehavior ()
IdentifierListgetIdentifierList ()
virtual Astoperator= (const Ast &ast)
virtual bool operator== (const Ast &ast) const
virtual VisitorReturnvisit (Visitor &visitor)
virtual Astclone () const

Private Attributes

IdentifierListidentifierList

Constructor & Destructor Documentation

SimpleBehavior::SimpleBehavior SrcPosition position,
IdentifierList identifierList
[inline]
 

Definition at line 12 of file simplebehavior.h.

Referenced by clone().

00013                         : Behavior(position), identifierList(identifierList) {}

SimpleBehavior::SimpleBehavior const SimpleBehavior &  simpleBehavior  )  [inline]
 

Definition at line 15 of file simplebehavior.h.

References Ast::position.

00015                                                                      : Behavior(simpleBehavior.position) {
00016                         *(this) = simpleBehavior;
00017                 }

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

Definition at line 19 of file simplebehavior.h.

00019                                           {
00020                         delete this->identifierList;
00021                 }


Member Function Documentation

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

Implements Ast.

Definition at line 34 of file simplebehavior.h.

References SimpleBehavior().

Referenced by SequentialBehavior::clone(), and SequentialBehavior::operator=().

00034                                            {
00035                         return *(new SimpleBehavior(new SrcPosition(*(this->position)),
00036                                          this->identifierList ? dynamic_cast<IdentifierList*>(&(this->identifierList->clone())) : 0));
00037                 }

IdentifierList* SimpleBehavior::getIdentifierList  )  [inline]
 

Definition at line 23 of file simplebehavior.h.

Referenced by TypeCheckerVisitor::visitSimpleBehavior().

00023                                                     {
00024                         return this->identifierList;
00025                 }

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

Reimplemented from Behavior.

Definition at line 5 of file simplebehavior.cpp.

References Ast::clone(), identifierList, and Behavior::operator=().

00005                                                {
00006         const SimpleBehavior& simpleBehavior = dynamic_cast<const SimpleBehavior&>(ast);
00007 
00008         Behavior::operator=(ast);
00009         this->identifierList = simpleBehavior.identifierList ? dynamic_cast<IdentifierList*>(&(simpleBehavior.identifierList->clone())) : 0;
00010 
00011         return *(this);
00012 }

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

Reimplemented from Behavior.

Definition at line 14 of file simplebehavior.cpp.

References identifierList, and Behavior::operator==().

00014                                                       {
00015         bool result = false;
00016         const SimpleBehavior& simpleBehavior = dynamic_cast<const SimpleBehavior&>(ast);
00017 
00018         if (typeid(ast) != typeid(SimpleBehavior))
00019                 return false;
00020 
00021         if (this->identifierList)
00022                 result = (*(this->identifierList) == *(simpleBehavior.identifierList));
00023 
00024         return result && Behavior::operator==(ast);
00025 }

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

Implements Ast.

Definition at line 30 of file simplebehavior.h.

References Visitor::visitSimpleBehavior().

Referenced by TypeCheckerVisitor::visitSequentialBehavior().

00030                                                                {
00031                         return visitor.visitSimpleBehavior(this);
00032                 }


Member Data Documentation

IdentifierList* SimpleBehavior::identifierList [private]
 

Definition at line 9 of file simplebehavior.h.

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


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