expression_addition_address Class Reference

#include <address.h>

Inheritance diagram for expression_addition_address:

expression_addition expression List of all members.

Public Member Functions

virtual ~expression_addition_address ()
 expression_addition_address (const type::pointer &tp, const expression::pointer &lhs, const expression::pointer &rhs, const symbol *hint, translator_compile *cntxt)

Protected Member Functions

type::pointer get_type () const
void post_order_traversal (int pprec)
void logical_traversal (int pprec, label::pointer &true_branch, label::pointer &false_branch, bool fall_through_preference)
expression::pointer optimize () const
const symbolget_symbol_hint () const

Private Member Functions

 expression_addition_address ()
 expression_addition_address (const expression_addition_address &)
expression_addition_addressoperator= (const expression_addition_address &)

Private Attributes

translator_compilecode
type::pointer tp
const symbolhint

Detailed Description

The expression_addition_address class is used to represent adding an address and a word offset together. The type of the result is specified explicitly, as opposed to the expression_addition_pointer class (which optimises to this class eventually).

Definition at line 34 of file address.h.


Constructor & Destructor Documentation

virtual expression_addition_address::~expression_addition_address (  )  [virtual]

The destructor.

expression_addition_address::expression_addition_address ( const type::pointer tp,
const expression::pointer lhs,
const expression::pointer rhs,
const symbol hint,
translator_compile cntxt 
)

The default constructor.

Parameters:
tp The type of this expression node
lhs The base address
rhs The word offset to be applied.
hint The symbol most recently related to this expression, or NULL for no hint.
cntxt where to send our generated code.

expression_addition_address::expression_addition_address (  )  [private]

The default constructor. Do not use.

expression_addition_address::expression_addition_address ( const expression_addition_address  )  [private]

The copy constructor. Do not use.


Member Function Documentation

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

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

Reimplemented from expression_addition.

void expression_addition_address::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 from expression_addition.

void expression_addition_address::logical_traversal ( int  pprec,
label::pointer true_branch,
label::pointer false_branch,
bool  fall_through_preference 
) [protected]

expression::pointer expression_addition_address::optimize (  )  const [protected, virtual]

The optimize method may be used to evaluate constant expressions, or substitute more efficient expressions.

This is intended to be called by the translator:: expression_statement method, or similar, where the expression is in its final form, and will get no deeper. In other words, when all available information has been provided.

There is no default implementation, even though most optimize implementations return self(), because this gives the compiler no opportunity to remind the authors of new classes that they have forgotten something.

Returns:
If the expression tree is not constant, or it is already as reduced as it can get, it returns itself. Otherwise, it returns a new expression node.

Implements expression.

const symbol* expression_addition_address::get_symbol_hint (  )  const [protected, virtual]

The get_symbol_hint method is used to get the symbol associated with the expression.

Returns:
pointer to a symbol, or NULL if there is no hint present

Reimplemented from expression.

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

The assignment operator. Do not use.


Member Data Documentation

translator_compile& expression_addition_address::code [private]

The code instance variable is used to remember where to send our generated code.

Definition at line 84 of file address.h.

type::pointer expression_addition_address::tp [private]

The tp instance variable is used to remember the type of this expression node

Definition at line 90 of file address.h.

const symbol* expression_addition_address::hint [private]

The hint instance variable is used to remember the symbol most recently related to this expression, or NULL for no hint.

Definition at line 96 of file address.h.


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