expression_load_indirect Class Reference

#include <indirect.h>

Inheritance diagram for expression_load_indirect:

expression_load expression List of all members.

Public Member Functions

virtual ~expression_load_indirect ()
 expression_load_indirect (const expression::pointer &operand, translator_compile *cntxt)
void post_order_traversal ()
void logical_traversal (int pprec, label::pointer &true_branch, label::pointer &false_branch, bool fall_through_preference)
expression::pointer evaluate () const
void traversal (int pprec)
expression::pointer optimize () const
expression::pointer assignment_expression_factory (const expression::pointer &rhs) const
expression::pointer dot_expression_factory (const symbol *rhs)
expression::pointer array_index_expression_factory (const expression::pointer &rhs) const
expression::pointer strip_indirection () const
const symbolget_symbol_hint () const

Private Member Functions

 expression_load_indirect ()
 expression_load_indirect (const expression_load_indirect &)
expression_load_indirectoperator= (const expression_load_indirect &)

Private Attributes

translator_compilecode
expression::pointer operand

Detailed Description

The expression_load_indirect class is used to represent an indirect load expression, via a pointer expression.

Definition at line 32 of file indirect.h.


Constructor & Destructor Documentation

virtual expression_load_indirect::~expression_load_indirect (  )  [virtual]

The destructor.

expression_load_indirect::expression_load_indirect ( const expression::pointer operand,
translator_compile cntxt 
)

The constructor.

expression_load_indirect::expression_load_indirect (  )  [private]

The default constructor. Do not use.

expression_load_indirect::expression_load_indirect ( const expression_load_indirect  )  [private]

The copy constructor. Do not use.


Member Function Documentation

void expression_load_indirect::post_order_traversal (  ) 

void expression_load_indirect::logical_traversal ( int  pprec,
label::pointer true_branch,
label::pointer false_branch,
bool  fall_through_preference 
)

expression::pointer expression_load_indirect::evaluate (  )  const

void expression_load_indirect::traversal ( int  pprec  )  [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.

expression::pointer expression_load_indirect::optimize (  )  const [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.

expression::pointer expression_load_indirect::assignment_expression_factory ( const expression::pointer rhs  )  const [virtual]

The assignment_expression_factory method is used by the assignment_expression method to build an assignment expression node.

The default implementation prints and error saying that the left hand side of the assignment is inappropriate.

Parameters:
rhs The right hand side of the assignment ("this" is the left hand side).
Note:
The parser will delete this expression tree once the assignment tree has been manufactored. If you wish to keep using this tree, you will need to self() it.

Reimplemented from expression.

expression::pointer expression_load_indirect::dot_expression_factory ( const symbol rhs  )  [virtual]

The dot_expression_factory method is used to build a record member reference expression.

The default implementation prints and error saying that the left hand side of the dot is inappropriate.

Parameters:
rhs The symbol information corresponding to the member to access
Returns:
pointer to an expression node

Reimplemented from expression.

expression::pointer expression_load_indirect::array_index_expression_factory ( const expression::pointer rhs  )  const [virtual]

The array_index_expression_factory method is used to build an array index expression.

The default implementation prints and error saying that the left hand side of the array index expression is inappropriate.

Parameters:
rhs The value of the array element to be indexed
Returns:
pointer to an expression node

Reimplemented from expression.

expression::pointer expression_load_indirect::strip_indirection (  )  const [virtual]

The strip_indirection method is used to obtain the address expression of an abstract indirection expression. This is used to pass variables by reference to functions and procedures.

The default implementation returns a NULL pointer, because the error has to be printer by the caller.

Reimplemented from expression.

const symbol* expression_load_indirect::get_symbol_hint (  )  const [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_load_indirect& expression_load_indirect::operator= ( const expression_load_indirect  )  [private]

The assignment operator. Do not use.


Member Data Documentation

translator_compile& expression_load_indirect::code [private]

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

Definition at line 85 of file indirect.h.

expression::pointer expression_load_indirect::operand [private]

The operand instance variable is used to remember the address to be indirected.

Definition at line 91 of file indirect.h.


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