#include <dve_expression.hh>
Public Member Functions | |
void | create_gid (int _op, size_int_t _gid) const |
Constructor -- Creates s compacted representation of a unary leaf in the syntax tree. | |
void | create_val (int _op, all_values_t _value) const |
Creates a compacted representation of a unary leaf in the syntax tree. | |
compacted_viewer_t * | first () const |
Returns pointer to the first subexpression. | |
int | get_arity () const |
Returns arity. | |
size_int_t | get_gid () const |
Returns gid of stored in T_ID, T_SQUARE_BRACKET, or T_DOT leaf. | |
int | get_operator () const |
Returns operator. | |
all_values_t | get_value () const |
Returns value of a T_NAT leaf. | |
void | join (int _op, compacted_viewer_t *_left, compacted_viewer_t *_right) const |
Contructor -- Joins to compacted expression into one with given operator. | |
compacted_viewer_t * | last () const |
Returns pointer to the last subexpression. | |
compacted_viewer_t * | left () const |
Returns pointers to left subexpression. | |
compacted_viewer_t * | right () const |
Returns pointers to right subexpression. | |
std::string | to_string () |
To string. | |
Public Attributes | |
compacted_viewer_t * | ptr |
This class is to view compacted expressions. It uses compacted_viewer_t to view the memory block pointed by the member pointer.
void create_gid | ( | int | _op, | |
size_int_t | _gid | |||
) | const |
Constructor -- Creates s compacted representation of a unary leaf in the syntax tree.
Creates memory block that keeps, in a compacted way, a leaf of type different from T_NAT of the tree of subexpressions.
References compacted_viewer_t::arity, compacted_viewer_t::op, compacted_viewer_t::r_offset, and compacted_viewer_t::size.
Referenced by dve_expression_t::compaction().
void create_val | ( | int | _op, | |
all_values_t | _value | |||
) | const |
Creates a compacted representation of a unary leaf in the syntax tree.
Creates memory block that keeps, in a compacted way, a leaf of type T_NAT of the tree of subexpressions.
References compacted_viewer_t::arity, compacted_viewer_t::op, compacted_viewer_t::r_offset, and compacted_viewer_t::size.
Referenced by dve_expression_t::compaction().
compacted_viewer_t* first | ( | ) | const [inline] |
Returns pointer to the first subexpression.
Returns pointer to the first subexpression in a given compacted subexpression.
int get_arity | ( | ) | const [inline] |
Returns arity.
Returns arity of the compacted expression.
size_int_t get_gid | ( | ) | const [inline] |
Returns gid of stored in T_ID, T_SQUARE_BRACKET, or T_DOT leaf.
Returns gid of stored in T_ID, T_SQUARE_BRACKET, or T_DOT leaf in compacted expression.
Referenced by dve_system_t::fast_eval(), and to_string().
int get_operator | ( | ) | const [inline] |
Returns operator.
Returns operator of the compacted expression.
Referenced by dve_system_t::fast_eval().
all_values_t get_value | ( | ) | const [inline] |
Returns value of a T_NAT leaf.
Returns value of a T_NAT leaf in compacted expression.
Referenced by dve_system_t::fast_eval(), and to_string().
void join | ( | int | _op, | |
compacted_viewer_t * | _left, | |||
compacted_viewer_t * | _right | |||
) | const |
Contructor -- Joins to compacted expression into one with given operator.
Creates memory block that keeps, concatenation of given subexpression that is preceded with the connecting connective in a compacted way. of the tree of subexpressions.
References compacted_viewer_t::arity, compacted_viewer_t::op, compacted_viewer_t::r_offset, and compacted_viewer_t::size.
Referenced by dve_expression_t::compaction().
compacted_viewer_t* last | ( | ) | const [inline] |
Returns pointer to the last subexpression.
Returns pointer to the last subexpression in a given compacted subexpression.
compacted_viewer_t* left | ( | ) | const [inline] |
Returns pointers to left subexpression.
Returns pointer to the left subexpression in a given compacted subexpression.
Referenced by dve_system_t::fast_eval(), and to_string().
compacted_viewer_t* right | ( | ) | const [inline] |
Returns pointers to right subexpression.
Returns pointer to the right subexpression in a given compacted subexpression.
Referenced by dve_system_t::fast_eval(), and to_string().
std::string to_string | ( | ) |
To string.
Prints compacted expression to string.
References get_gid(), get_value(), left(), compacted_viewer_t::op, ptr, right(), and to_string().
Referenced by dve_system_t::fast_eval(), and to_string().