An AST expression tree. It owns and contains multiple dependent expressions. All the expressions are destroyed when the tree is destroyed. More...
#include <expressions.hpp>
Public Member Functions | |
tree ()=default | |
construct an empty ast tree | |
tree (tree &&)=default | |
Moves the ast tree. | |
tree & | operator= (tree &&)=default |
move-assigns the AST tree More... | |
tree (tree const &)=delete | |
tree & | operator= (tree const &)=delete |
template<typename Expr , typename... Args> | |
std::enable_if_t< std::is_base_of_v< expression, Expr >, Expr const & > | emplace (Args &&... args) |
Add an expression to the AST tree. More... | |
template<typename Expr > | |
decltype(auto) | push (Expr expr) |
Add an expression to the AST tree. More... | |
expression const & | front () const |
get the first expression in the tree More... | |
expression const & | back () const |
get the last expression in the tree More... | |
size_t | size () const |
get the number of expressions added to the tree More... | |
expression const & | at (size_t index) |
get the expression at an index in the tree. Index is checked. More... | |
expression const & | operator[] (size_t index) const |
get the expression at an index in the tree. Index is unchecked. More... | |
An AST expression tree. It owns and contains multiple dependent expressions. All the expressions are destroyed when the tree is destroyed.
Definition at line 561 of file expressions.hpp.
|
inline |
get the expression at an index in the tree. Index is checked.
index | index of expression in the ast tree |
Definition at line 633 of file expressions.hpp.
|
inline |
get the last expression in the tree
Definition at line 620 of file expressions.hpp.
|
inline |
Add an expression to the AST tree.
args | Arguments to use to construct the ast expression |
Definition at line 591 of file expressions.hpp.
|
inline |
get the first expression in the tree
Definition at line 614 of file expressions.hpp.
move-assigns the AST tree
|
inline |
get the expression at an index in the tree. Index is unchecked.
index | index of expression in the ast tree |
Definition at line 640 of file expressions.hpp.
|
inline |
Add an expression to the AST tree.
expr | AST expression to be added |
Definition at line 605 of file expressions.hpp.
|
inline |
get the number of expressions added to the tree
Definition at line 626 of file expressions.hpp.