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

SequentialBehavior Class Reference

#include <sequentialbehavior.h>

Inheritance diagram for SequentialBehavior:

Inheritance graph
[legend]
Collaboration diagram for SequentialBehavior:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SequentialBehavior (SrcPosition *position, Behavior *behavior, SimpleBehavior *simpleBehavior)
 SequentialBehavior (const SequentialBehavior &sequentialBehavior)
virtual ~SequentialBehavior ()
BehaviorgetBehavior ()
SimpleBehaviorgetSimpleBehavior ()
virtual Astoperator= (const Ast &ast)
virtual bool operator== (const Ast &ast) const
virtual VisitorReturnvisit (Visitor &visitor)
virtual Astclone () const

Private Attributes

Behaviorbehavior
SimpleBehaviorsimpleBehavior

Constructor & Destructor Documentation

SequentialBehavior::SequentialBehavior SrcPosition position,
Behavior behavior,
SimpleBehavior simpleBehavior
[inline]
 

Definition at line 14 of file sequentialbehavior.h.

Referenced by clone().

00015                         : Behavior(position), behavior(behavior), simpleBehavior(simpleBehavior) {}

SequentialBehavior::SequentialBehavior const SequentialBehavior &  sequentialBehavior  )  [inline]
 

Definition at line 17 of file sequentialbehavior.h.

References Ast::position.

00017                                                                                  : Behavior(sequentialBehavior.position) {
00018                         *(this) = sequentialBehavior;
00019                 }

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

Definition at line 21 of file sequentialbehavior.h.

00021                                               {
00022                         delete this->behavior;
00023                         delete this->simpleBehavior;
00024                 }


Member Function Documentation

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

Implements Ast.

Definition at line 41 of file sequentialbehavior.h.

References SimpleBehavior::clone(), and SequentialBehavior().

00041                                            {
00042                         return *(new SequentialBehavior(new SrcPosition(*(this->position)),
00043                                          this->behavior ? dynamic_cast<Behavior*>(&(this->behavior->clone())) : 0,
00044                                          this->simpleBehavior ? dynamic_cast<SimpleBehavior*>(&(this->simpleBehavior->clone())) : 0));
00045                 }

Behavior* SequentialBehavior::getBehavior  )  [inline]
 

Definition at line 26 of file sequentialbehavior.h.

Referenced by TypeCheckerVisitor::visitSequentialBehavior().

00026                                         {
00027                         return this->behavior;
00028                 }

SimpleBehavior* SequentialBehavior::getSimpleBehavior  )  [inline]
 

Definition at line 30 of file sequentialbehavior.h.

Referenced by TypeCheckerVisitor::visitSequentialBehavior().

00030                                                     {
00031                         return this->simpleBehavior;
00032                 }

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

Reimplemented from Behavior.

Definition at line 5 of file sequentialbehavior.cpp.

References behavior, SimpleBehavior::clone(), Ast::clone(), Behavior::operator=(), and simpleBehavior.

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

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

Reimplemented from Behavior.

Definition at line 15 of file sequentialbehavior.cpp.

References behavior, Behavior::operator==(), and simpleBehavior.

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

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

Implements Ast.

Definition at line 37 of file sequentialbehavior.h.

References Visitor::visitSequentialBehavior().

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


Member Data Documentation

Behavior* SequentialBehavior::behavior [private]
 

Definition at line 9 of file sequentialbehavior.h.

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

SimpleBehavior* SequentialBehavior::simpleBehavior [private]
 

Definition at line 10 of file sequentialbehavior.h.

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


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