![]() |
Spicy
|
#include <node.h>
Public Member Functions | |
NodeBase (Meta meta) | |
NodeBase (std::vector< Node > children, Meta meta) | |
template<typename T > | |
const T & | child (int i) const |
template<typename T > | |
void | assertChildIsA (int i) |
template<typename T > | |
auto | children (int begin, int end) const |
auto | childRefs (int begin, int end) |
template<typename T > | |
hilti::node::Set< T > | childrenOfType () const |
template<typename T > | |
std::vector< NodeRef > | childRefsOfType () const |
void | addChild (Node n) |
const auto & | children () const |
auto & | children () |
auto & | meta () const |
void | setMeta (Meta m) |
bool | pruneWalk () const |
Common base class for classes implementing the Node
interface. The base implements a number of the interface methods with standard versions shared across all nodes.
|
inline |
Constructor.
meta | meta information to associate with the node |
Constructor registering child nodes.
children | children of this node |
meta | meta information to associate with the node |
|
inline |
Adds a child node. It will be appended to the end of the current list node of children.
|
inline |
Aborts execution if a given child is not an expected type T
.
T | type that the child node is assumed to have |
i | index of the child, in the order they were passed into the constructor and/or added |
|
inline |
Returns a child.
T | type that the child nodes are assumed to (and must) have |
i | index of the child, in the order they were passed into the constructor and/or added |
T
|
inline |
Returns a references to a subrange of children. The indices correspond to the order children were passed into the constructor and/or added.
begin | index of first child to include; a negative index counts Python-style from end of list |
end | index of one beyond last child to include; a negative index counts Python-style from end of list |
start
to end
std::vector< NodeRef > hilti::NodeBase::childRefsOfType | ( | ) | const |
Returns a vector of references to a subset of children selected by their type.
T | type of children to return |
T
|
inline |
Returns a subrange of children. The indices correspond to the order children were passed into the constructor and/or added.
T | type that the child nodes are assumed to (and must) have |
begin | index of first child to include; a negative index counts Python-style from end of list |
end | index of one beyond last child to include; a negative index counts Python-style from end of list |
start
to end
|
inline |
Implements the Node
interface.
|
inline |
Implements the Node
interface.
hilti::node::Set< T > hilti::NodeBase::childrenOfType | ( | ) | const |
Returns a subset of children selected by their type.
T | type of children to return |
T
|
inline |
Implements the Node
interface.
|
inline |
Implements the Node
interface.