|
OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
|
Abstract Syntax Tree. More...
#include <matheval.hpp>
Public Types | |
| using | tree_t |
Public Member Functions | |
| expr_ast () | |
| Default constructor. | |
| template<typename Expr> | |
| expr_ast (Expr other) | |
| Copy constructor. | |
| expr_ast & | operator+= (expr_ast const &rhs) |
| Add a tree. | |
| expr_ast & | operator-= (expr_ast const &rhs) |
| subtract a tree | |
| expr_ast & | operator*= (expr_ast const &rhs) |
| Multiply by a tree. | |
| expr_ast & | operator/= (expr_ast const &rhs) |
| Divide by a tree. | |
Public Attributes | |
| tree_t | tree |
| AST storage. | |
Abstract Syntax Tree.
Stores the abstract syntax tree (AST) of the parsed mathematical expression.
Definition at line 96 of file matheval.hpp.
| using matheval::detail::expr_ast< real_t >::tree_t |
Definition at line 98 of file matheval.hpp.
|
inline |
Default constructor.
Initializes the tree to a nil value to indicate inconsistent state.
Definition at line 121 of file matheval.hpp.
References tree.
Referenced by operator*=(), operator+=(), operator-=(), and operator/=().
|
inline |
Copy constructor.
Deep copies the syntax tree.
Definition at line 128 of file matheval.hpp.
References tree.
| expr_ast< real_t > & matheval::detail::expr_ast< real_t >::operator*= | ( | expr_ast< real_t > const & | rhs | ) |
Multiply by a tree.
Definition at line 191 of file matheval.hpp.
References expr_ast(), and tree.
| expr_ast< real_t > & matheval::detail::expr_ast< real_t >::operator+= | ( | expr_ast< real_t > const & | rhs | ) |
Add a tree.
Definition at line 179 of file matheval.hpp.
References expr_ast(), and tree.
| expr_ast< real_t > & matheval::detail::expr_ast< real_t >::operator-= | ( | expr_ast< real_t > const & | rhs | ) |
subtract a tree
Definition at line 185 of file matheval.hpp.
References expr_ast(), and tree.
| expr_ast< real_t > & matheval::detail::expr_ast< real_t >::operator/= | ( | expr_ast< real_t > const & | rhs | ) |
Divide by a tree.
Definition at line 197 of file matheval.hpp.
References expr_ast(), and tree.
| tree_t matheval::detail::expr_ast< real_t >::tree |
AST storage.
The syntax tree can hold various types. Numbers (real_t), variables (std::string), the recursive tree itself (expr_ast), binary operators (binary_op), and unary operators (unary_op).
Definition at line 114 of file matheval.hpp.
Referenced by expr_ast(), expr_ast(), matheval::detail::ConstantFolder< real_t >::operator()(), matheval::detail::eval_ast< real_t >::operator()(), operator*=(), operator+=(), operator-=(), and operator/=().