rpt_expr Class Reference

#include <expr.h>

Inheritance diagram for rpt_expr:

rpt_expr_and_bit rpt_expr_and_logical rpt_expr_assign rpt_expr_assign_and_bit rpt_expr_assign_div rpt_expr_assign_join rpt_expr_assign_minus rpt_expr_assign_mod rpt_expr_assign_mul rpt_expr_assign_or_bit rpt_expr_assign_plus rpt_expr_assign_power rpt_expr_assign_shift_left rpt_expr_assign_shift_right rpt_expr_assign_xor_bit rpt_expr_comma rpt_expr_constant rpt_expr_dec_post rpt_expr_dec_pre rpt_expr_div rpt_expr_eq rpt_expr_func rpt_expr_ge rpt_expr_gt rpt_expr_if rpt_expr_in rpt_expr_inc_post rpt_expr_inc_pre rpt_expr_join rpt_expr_le rpt_expr_list rpt_expr_lookup rpt_expr_lt rpt_expr_match rpt_expr_minus rpt_expr_mod rpt_expr_mul rpt_expr_ne rpt_expr_neg rpt_expr_nmatch rpt_expr_not_bit rpt_expr_not_logical rpt_expr_or_bit rpt_expr_or_logical rpt_expr_plus rpt_expr_pos rpt_expr_power rpt_expr_shift_left rpt_expr_shift_right rpt_expr_struct rpt_expr_struct_assign rpt_expr_xor_bit

Public Types

typedef aegis_shared_ptr
< rpt_expr
pointer

Public Member Functions

virtual ~rpt_expr ()
void parse_error (const char *fmt) const
void append (const rpt_expr::pointer &child)
void prepend (const rpt_expr::pointer &child)
rpt_value::pointer evaluate (bool undefer, bool dereference) const
size_t get_nchildren () const
rpt_position::pointer get_pos () const
void pos_from_lex ()
void pos_from (const rpt_expr::pointer &other)
virtual bool lvalue () const
rpt_expr::pointer nth_child (size_t n) const

Protected Member Functions

 rpt_expr ()
virtual rpt_value::pointer evaluate () const =0

Private Member Functions

 rpt_expr (const rpt_expr &)
rpt_exproperator= (const rpt_expr &)

Private Attributes

rpt_position::pointer pos
rpt_expr::pointerchild
size_t nchild
size_t nchild_max

Detailed Description

The rpt_expr abstract base class is used to represent a generic expressson node in the report generator.

Definition at line 34 of file expr.h.


Member Typedef Documentation

Definition at line 37 of file expr.h.


Constructor & Destructor Documentation

virtual rpt_expr::~rpt_expr (  )  [virtual]

The destructor.

rpt_expr::rpt_expr (  )  [protected]

The default constructor.

rpt_expr::rpt_expr ( const rpt_expr  )  [private]

The copy constructor. Do not use.


Member Function Documentation

void rpt_expr::parse_error ( const char *  fmt  )  const

The parse_error method is used to report parse errors, reported against the location of this expression node.

void rpt_expr::append ( const rpt_expr::pointer child  ) 

The append method is used to append a sub-mode to the end of the list of child nodes of this expression node.

void rpt_expr::prepend ( const rpt_expr::pointer child  ) 

The prepend method is used to prepend a sub-mode to the front of the list of child nodes of this expression node.

rpt_value::pointer rpt_expr::evaluate ( bool  undefer,
bool  dereference 
) const

The evaluate method may be used to calculate the value of the expression syntax tree.

Parameters:
undefer True if deferred values should be evaluated.
dereference True if reference values should be replaced with the referenced value.

size_t rpt_expr::get_nchildren (  )  const [inline]

The get_nchildren method is used to obtain the number of child nodes associated with this node.

Definition at line 85 of file expr.h.

rpt_position::pointer rpt_expr::get_pos (  )  const [inline]

The get_pos method is used to obtain the source file location associated with this node.

Definition at line 91 of file expr.h.

void rpt_expr::pos_from_lex (  ) 

The pos_from_lex method is used to set the exproession node's source code position from the lexer's current position.

void rpt_expr::pos_from ( const rpt_expr::pointer other  ) 

The pos_from method is used to set the exproession node's source code position from the source code location of another expression node.

virtual rpt_value::pointer rpt_expr::evaluate (  )  const [protected, pure virtual]

virtual bool rpt_expr::lvalue (  )  const [virtual]

The lvalue method may be used to determine whether or not this expression node is an L-value (something which may appear on the left hand side of an assigment, a variable).

The default implementation, which is true for the vast majority of expression nodes, returns false.

Reimplemented in rpt_expr_constant, and rpt_expr_lookup.

rpt_expr::pointer rpt_expr::nth_child ( size_t  n  )  const

The nth_child method may be used to obtain the specified child node of this node.

Parameters:
n The index of the child desired, zero based.
Returns:
pointer to child, or NULL if index out of range

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

The assignment operator. Do not use.


Field Documentation

The pos instance variable is used to remember the location of this expression in the source code.

Definition at line 140 of file expr.h.

The child instance variable is used to remember the base address of a dynamically allocated array of pointer to child expression nodes.

Definition at line 147 of file expr.h.

size_t rpt_expr::nchild [private]

The nchild instance variable is used to remember the number of elements used to date in the "child" array.

Definition at line 153 of file expr.h.

size_t rpt_expr::nchild_max [private]

The nchild_max instance variable is used to remember the allocated size of the "child" array.

Definition at line 159 of file expr.h.


The documentation for this class was generated from the following file:

Generated on Wed Mar 12 23:37:42 2008 for Aegis by  doxygen 1.5.5