#include <expr.h>
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_expr & | operator= (const rpt_expr &) |
Private Attributes | |
rpt_position::pointer | pos |
rpt_expr::pointer * | child |
size_t | nchild |
size_t | nchild_max |
Definition at line 34 of file expr.h.
typedef aegis_shared_ptr<rpt_expr> rpt_expr::pointer |
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.
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.
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] |
rpt_position::pointer rpt_expr::get_pos | ( | ) | const [inline] |
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] |
The evaluate method may be used to calculate the value of the expression syntax tree.
Implemented in rpt_expr_assign, rpt_expr_assign_power, rpt_expr_assign_mul, rpt_expr_assign_div, rpt_expr_assign_mod, rpt_expr_assign_plus, rpt_expr_assign_minus, rpt_expr_assign_join, rpt_expr_assign_and_bit, rpt_expr_assign_xor_bit, rpt_expr_assign_or_bit, rpt_expr_assign_shift_left, rpt_expr_assign_shift_right, rpt_expr_not_bit, rpt_expr_xor_bit, rpt_expr_or_bit, rpt_expr_and_bit, rpt_expr_comma, rpt_expr_constant, rpt_expr_func, rpt_expr_in, rpt_expr_inc_pre, rpt_expr_inc_post, rpt_expr_dec_pre, rpt_expr_dec_post, rpt_expr_list, rpt_expr_and_logical, rpt_expr_or_logical, rpt_expr_not_logical, rpt_expr_if, rpt_expr_lookup, rpt_expr_mul, rpt_expr_div, rpt_expr_mod, rpt_expr_neg, rpt_expr_pos, rpt_expr_plus, rpt_expr_minus, rpt_expr_join, rpt_expr_power, rpt_expr_lt, rpt_expr_gt, rpt_expr_le, rpt_expr_ge, rpt_expr_eq, rpt_expr_ne, rpt_expr_match, rpt_expr_nmatch, rpt_expr_shift_left, rpt_expr_shift_right, rpt_expr_struct, and rpt_expr_struct_assign.
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.
n | The index of the child desired, zero based. |
rpt_position::pointer rpt_expr::pos [private] |
rpt_expr::pointer* rpt_expr::child [private] |
size_t rpt_expr::nchild [private] |
size_t rpt_expr::nchild_max [private] |