![]() |
Spicy
|
Classes | |
| class | Location |
| struct | Position |
Typedefs | |
| template<typename N > | |
| using | Path = std::vector< std::reference_wrapper< N > > |
| template<typename Result = void, typename Dispatcher = detail::visitor::NoDispatcher, typename Erased = Node> | |
| using | PreOrder = detail::visitor::Visitor< Result, Dispatcher, Erased, detail::visitor::Order::Pre > |
| template<typename Result = void, typename Dispatcher = detail::visitor::NoDispatcher, typename Erased = Node> | |
| using | PostOrder = detail::visitor::Visitor< Result, Dispatcher, Erased, detail::visitor::Order::Post > |
Functions | |
| template<typename N > | |
| N & | current (const Path< N > &path) |
| const Node & | parent (const Path< const Node > &path, int parent_nr=1) |
| Node & | parent (const Path< Node > &path, int parent_nr=1) |
| template<typename T , IF_NOT_SAME(T, Node) > | |
| std::optional< const T > | findParent (const Path< Node > &path) |
| template<typename T , IF_NOT_SAME(T, Node) > | |
| std::optional< const T > | findParent (const Path< const Node > &path) |
Visitor performing a pre-order iteration over an AST.
| using hilti::visitor::Path = typedef std::vector<std::reference_wrapper<N> > |
Represents a path inside an AST from the root node to a node reached during iteration.
| using hilti::visitor::PostOrder = typedef detail::visitor::Visitor<Result, Dispatcher, Erased, detail::visitor::Order::Post> |
Visitor performing a post-order iteration over an AST.
| N& hilti::visitor::current | ( | const Path< N > & | path | ) |
Given an AST path, returns the current node.
| std::optional<const T> hilti::visitor::findParent | ( | const Path< Node > & | path | ) |
Given an AST path, return the first parent of the current node that has a given type.
| std::optional<const T> hilti::visitor::findParent | ( | const Path< const Node > & | path | ) |
Given an AST path, return the first parent of the current node that has a given type.
Given an AST path, returns a parent to the current node.
| path | AST path |
| parent_nr | number of the parent to return; 1 returns immediate parent, 2 the 2nd, etc. |
| <tt>std::out_of_range</tt> | if the requested parent does not exist |
Given an AST path, returns a parent to the current node.
| path | AST path |
| parent_nr | number of the parent to return; 1 returns immediate parent, 2 the 2nd, etc. |
| <tt>std::out_of_range</tt> | if the requested parent does not exist |
1.8.13