An AST expression tree. It owns and contains multiple dependent expressions. All the expressions are destroyed when the tree is destructed. 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> | |
Expr const & | emplace (Args &&... args) |
Add an expression to the AST tree. More... | |
template<typename Expr > | |
Expr const & | 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 destructed.
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 634 of file expressions.hpp.
|
inline |
get the last expression in the tree
Definition at line 621 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 615 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 641 of file expressions.hpp.
|
inline |
Add an expression to the AST tree.
expr | AST expression to be added |
Definition at line 606 of file expressions.hpp.
|
inline |
get the number of expressions added to the tree
Definition at line 627 of file expressions.hpp.