expression_addition Class Reference

#include <addition.h>

Inheritance diagram for expression_addition:

expression expression_addition_address expression_addition_integer expression_addition_pretty expression_addition_real List of all members.

Public Member Functions

virtual ~expression_addition ()
 expression_addition (const expression::pointer &lhs, const expression::pointer &rhs)

Protected Member Functions

int get_precedence () const
void traversal (int pprec)
type::pointer get_type () const
bool is_lvalue () const
side_effect_t has_side_effect () const
bool is_constant () const
virtual void pre_order_traversal (int pprec)
virtual void infix_order_traversal (int pprec)
virtual void post_order_traversal (int pprec)
expression::pointer get_lhs () const
expression::pointer get_rhs () const

Private Member Functions

 expression_addition ()
 expression_addition (const expression_addition &)
expression_additionoperator= (const expression_addition &)

Private Attributes

expression::pointer lhs
expression::pointer rhs

Detailed Description

The expression_addition class is used to represent an abstract addition expression node.

Definition at line 30 of file addition.h.


Constructor & Destructor Documentation

virtual expression_addition::~expression_addition (  )  [virtual]

The destructor.

expression_addition::expression_addition ( const expression::pointer lhs,
const expression::pointer rhs 
)

The constructor.

expression_addition::expression_addition (  )  [private]

The default constructor. Do not use.

expression_addition::expression_addition ( const expression_addition  )  [private]

The copy constructor. Do not use.


Member Function Documentation

int expression_addition::get_precedence (  )  const [protected, virtual]

The get_precedence method is used to obtain the precedence of this expression node.

The highest precedence has the highest absolute value, the lowest precedence gets the lowest absolute value.

Implements expression.

void expression_addition::traversal ( int  pprec  )  [protected, virtual]

The traversal method may be used to traverse each of the declaractions in the list.

Parameters:
pprec The precedence of the parent expression node.

Implements expression.

type::pointer expression_addition::get_type (  )  const [protected, virtual]

The get_type method is used to get the type of this expression.

Implements expression.

Reimplemented in expression_addition_address.

bool expression_addition::is_lvalue (  )  const [protected, virtual]

The is_lvalue method is used to determine whether or not this expression is suitable to appear on the left hand side of an assignment expression.

Implements expression.

side_effect_t expression_addition::has_side_effect (  )  const [protected, virtual]

The has_side_effect method is used to determine if an expression has any effect. It is used by the parse to produce "statement with no effect" warnings.

Implements expression.

bool expression_addition::is_constant (  )  const [protected, virtual]

The is_constant method may be used to determine whether this expression node is a constant, or this tree would evaluate to a constant.

The default implementation is conservative, and always returns false.

Returns:
bool; true if constant, false if not.

Reimplemented from expression.

virtual void expression_addition::pre_order_traversal ( int  pprec  )  [protected, virtual]

The pre_order_traversal method is used to perform actions required before the left hand expression is traversed.

Parameters:
pprec The parent expressions precedence. Not much use to code generators, but essential for pretty printers to get the parentheses correct.

Reimplemented in expression_addition_pretty.

virtual void expression_addition::infix_order_traversal ( int  pprec  )  [protected, virtual]

The infix_order_traversal method is used to perform actions required between the left and right hand expression traversals.

Parameters:
pprec The parent expressions precedence.

Reimplemented in expression_addition_pretty.

virtual void expression_addition::post_order_traversal ( int  pprec  )  [protected, virtual]

The post_order_traversal method is used to perform actions required after the right hand expression has been traversed.

Parameters:
pprec The parent expressions precedence. Not much use to code generators, but essential for pretty printers to get the parentheses correct.

Reimplemented in expression_addition_address, expression_addition_integer, expression_addition_real, and expression_addition_pretty.

expression::pointer expression_addition::get_lhs (  )  const [inline, protected]

Definition at line 95 of file addition.h.

References lhs.

expression::pointer expression_addition::get_rhs (  )  const [inline, protected]

Definition at line 96 of file addition.h.

References rhs.

expression_addition& expression_addition::operator= ( const expression_addition  )  [private]

The assignment operator. Do not use.


Member Data Documentation

expression::pointer expression_addition::lhs [private]

Definition at line 99 of file addition.h.

Referenced by get_lhs().

expression::pointer expression_addition::rhs [private]

Definition at line 100 of file addition.h.

Referenced by get_rhs().


The documentation for this class was generated from the following file:
Generated on Sun Feb 25 01:27:11 2007 for UCSDp-SystemCrossCompiler by  doxygen 1.5.1