![]() |
Elementa v8.0.0
Minimalistic library for any C++ application (C++11 and up)
|
A class to wrap any expression datum or complete operation as a datum. More...
A class to wrap any expression datum or complete operation as a datum.
It derives from ExprElement to be managed by evaluation methods designed for expressions. Notice that these objects refer to the elements in the original expression through smart pointers. If the original expression is deleted, they remain, and vice versa.
Definition at line 539 of file expressions.h.
#include "expressions.h"


Public Attributes | |
| char | what |
| 'd' -> datum from postfix, 'o' -> scanned operation More... | |
| ExprElement::Ptr | pdatum |
| Datum in original expression if 'd'. More... | |
| struct { | |
| ExprElement::Ptr | poper |
| Operator in original expression. More... | |
| ExprElement::PList | operands |
| Operands (class: TreeNode) More... | |
| } | oper |
| All operation data in original expression if 'o'. | |
Public Member Functions | |
| ExprElement::Kind | kind (void) const |
| Return datum since in a tree everything is dealt with as a datum. More... | |
| std::string | to_string (void) const |
| Return a one-line text representing the node. More... | |
Virtual methods | |
| bool | isDatum (void) const noexcept |
| Return TRUE if the element is a datum (not a grouping). More... | |
| bool | isOperation (void) const noexcept |
| Return TRUE if the element is an operation. More... | |
| bool | isOpeningGrouping (void) const noexcept |
| Return TRUE if the element is an opening grouping. More... | |
| bool | isClosingGrouping (void) const noexcept |
| Return TRUE if the element is a closing grouping. More... | |
| bool | isGrouping (void) const noexcept |
| Return TRUE if the element is a grouping. More... | |
| bool | isOpeningArgs (void) const noexcept |
| Return TRUE if the element is an opening args. More... | |
| bool | isClosingArgs (void) const noexcept |
| Return TRUE if the element is a closing args. More... | |
| bool | isGroupingArgs (void) const noexcept |
| Return TRUE if the element is an args grouping. More... | |
| bool | isSepArgs (void) const noexcept |
| Return TRUE if the element is a sep args. More... | |
| bool | isDatumTypedAs (int ty) const noexcept |
| Return TRUE if the element is a datum of a given type. More... | |
| virtual int | type (void) const |
| Can be overriden to return the type of the element (an int value). More... | |
Types, consts., etc. | |
| ELE_CLASS_ENUM (Kind, kDatum, kGroupOpen, kGroupClose, kArgsOpen, kArgsClose, kArgsSep, kOperation) | |
| Kind ot the elements. | |
| using | Ptr = std::shared_ptr< ExprElement > |
| A safe, polymorphic pointer to an element for container use. More... | |
|
inherited |
A safe, polymorphic pointer to an element for container use.
Definition at line 68 of file expressions.h.
|
inlinevirtual |
Return datum since in a tree everything is dealt with as a datum.
Implements elementa::parsing::ExprElement.
Definition at line 552 of file expressions.h.
|
virtual |
Return a one-line text representing the node.
Reimplemented from elementa::parsing::ExprElement.
|
inlinenoexceptinherited |
Return TRUE if the element is a datum (not a grouping).
Definition at line 114 of file expressions.h.
References elementa::parsing::ExprElement::kind().
Referenced by elementa::parsing::ExprElement::isDatumTypedAs().
|
inlinenoexceptinherited |
Return TRUE if the element is an operation.
Definition at line 117 of file expressions.h.
References elementa::parsing::ExprElement::kind().
|
inlinenoexceptinherited |
Return TRUE if the element is an opening grouping.
Definition at line 120 of file expressions.h.
References elementa::parsing::ExprElement::kind().
Referenced by elementa::parsing::ExprElement::isGrouping().
|
inlinenoexceptinherited |
Return TRUE if the element is a closing grouping.
Definition at line 124 of file expressions.h.
References elementa::parsing::ExprElement::kind().
Referenced by elementa::parsing::ExprElement::isGrouping().
|
inlinenoexceptinherited |
Return TRUE if the element is a grouping.
Definition at line 128 of file expressions.h.
References elementa::parsing::ExprElement::isClosingGrouping(), and elementa::parsing::ExprElement::isOpeningGrouping().
|
inlinenoexceptinherited |
Return TRUE if the element is an opening args.
Definition at line 132 of file expressions.h.
References elementa::parsing::ExprElement::kind().
Referenced by elementa::parsing::ExprElement::isGroupingArgs().
|
inlinenoexceptinherited |
Return TRUE if the element is a closing args.
Definition at line 136 of file expressions.h.
References elementa::parsing::ExprElement::kind().
Referenced by elementa::parsing::ExprElement::isGroupingArgs().
|
inlinenoexceptinherited |
Return TRUE if the element is an args grouping.
Definition at line 140 of file expressions.h.
References elementa::parsing::ExprElement::isClosingArgs(), and elementa::parsing::ExprElement::isOpeningArgs().
|
inlinenoexceptinherited |
Return TRUE if the element is a sep args.
Definition at line 144 of file expressions.h.
References elementa::parsing::ExprElement::kind().
|
inlinenoexceptinherited |
Return TRUE if the element is a datum of a given type.
Definition at line 148 of file expressions.h.
References elementa::parsing::ExprElement::isDatum(), and elementa::parsing::ExprElement::type().
|
inlinevirtualinherited |
Can be overriden to return the type of the element (an int value).
Override it to provide a particular type if you are working with typed expressions. Ignore it otherwise.
Definition at line 157 of file expressions.h.
Referenced by elementa::parsing::ExprElement::isDatumTypedAs().
| char elementa::parsing::Expression::OpDatumWrapper::what |
'd' -> datum from postfix, 'o' -> scanned operation
Definition at line 543 of file expressions.h.
| ExprElement::Ptr elementa::parsing::Expression::OpDatumWrapper::pdatum |
Datum in original expression if 'd'.
Definition at line 544 of file expressions.h.