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

SimpleExpressionList Class Reference

#include <simpleexpressionlist.h>

Inheritance diagram for SimpleExpressionList:

Inheritance graph
[legend]
Collaboration diagram for SimpleExpressionList:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SimpleExpressionList (SrcPosition *position, Expression *expression)
 SimpleExpressionList (const SimpleExpressionList &simpleExpressionList)
virtual ~SimpleExpressionList ()
ExpressiongetExpression ()
virtual Astoperator= (const Ast &ast)
virtual bool operator== (const Ast &ast) const
virtual VisitorReturnvisit (Visitor &visitor)
virtual Astclone () const

Private Attributes

Expressionexpression

Constructor & Destructor Documentation

SimpleExpressionList::SimpleExpressionList SrcPosition position,
Expression expression
[inline]
 

Definition at line 12 of file simpleexpressionlist.h.

Referenced by clone().

00013                         : ExpressionList(position), expression(expression) {}

SimpleExpressionList::SimpleExpressionList const SimpleExpressionList &  simpleExpressionList  )  [inline]
 

Definition at line 15 of file simpleexpressionlist.h.

References Ast::position.

00015                                                                                        : ExpressionList(simpleExpressionList.position) {
00016                         *(this) = simpleExpressionList;
00017                 }

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

Definition at line 19 of file simpleexpressionlist.h.

00019                                                 {
00020                         delete this->expression;
00021                 }


Member Function Documentation

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

Implements Ast.

Definition at line 34 of file simpleexpressionlist.h.

References SimpleExpressionList().

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

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

Expression* SimpleExpressionList::getExpression  )  [inline]
 

Definition at line 23 of file simpleexpressionlist.h.

Referenced by TypeCheckerVisitor::visitSimpleExpressionList().

00023                                             {
00024                         return this->expression;
00025                 }

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

Reimplemented from ExpressionList.

Definition at line 5 of file simpleexpressionlist.cpp.

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

00005                                                      {
00006         const SimpleExpressionList& simpleExpressionList = dynamic_cast<const SimpleExpressionList&>(ast);
00007 
00008         ExpressionList::operator=(ast);
00009         this->expression = simpleExpressionList.expression ? dynamic_cast<Expression*>(&(simpleExpressionList.expression->clone())) : 0;
00010 
00011         return *(this);
00012 }

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

Reimplemented from ExpressionList.

Definition at line 14 of file simpleexpressionlist.cpp.

References expression, and ExpressionList::operator==().

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

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

Implements Ast.

Definition at line 30 of file simpleexpressionlist.h.

References Visitor::visitSimpleExpressionList().

Referenced by TypeCheckerVisitor::visitSequentialExpressionList().

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


Member Data Documentation

Expression* SimpleExpressionList::expression [private]
 

Definition at line 9 of file simpleexpressionlist.h.

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


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