Spicy
Public Types | Public Member Functions | Static Public Attributes | List of all members
hilti::detail::visitor::Visitor< Result, Dispatcher, Erased, order > Class Template Reference

#include <visitor.h>

Inheritance diagram for hilti::detail::visitor::Visitor< Result, Dispatcher, Erased, order >:
AssignFieldIndicesVisitor hilti::ConstantFoldingVisitor hilti::FeatureRequirementsVisitor hilti::FunctionVisitor hilti::MemberVisitor hilti::TypeVisitor VisitorCheckCanonicalIDs VisitorClearCanonicalIDs VisitorComputeCanonicalIDs

Public Types

using result_t = Result
 
using erased_t = Erased
 
using base_t = Visitor< Result, Dispatcher, Erased, order >
 
using visitor_t = Dispatcher
 
using iterator_t = Iterator< Erased, order, false >
 
using const_iterator_t = Iterator< Erased, order, true >
 
using position_t = typename iterator_t::Position
 
using const_position_t = typename const_iterator_t::Position
 

Public Member Functions

virtual void preDispatch (const Erased &, int)
 
auto dispatch (position_t &i)
 
auto dispatch (const_position_t &i)
 
auto dispatch (Erased *n)
 
auto dispatch (const Erased &n)
 
auto walk (const Erased &root)
 
auto walk (Erased *root)
 

Static Public Attributes

static const Order order_ = order
 

Detailed Description

template<typename Result, typename Dispatcher, typename Erased, Order order>
class hilti::detail::visitor::Visitor< Result, Dispatcher, Erased, order >

AST visitor.

Template Parameters
Resulttype the dispatch methods (and hence the visitor) returns
Dispatcherclass defining dispatch methods
Erasedtype-erased class to dispatch on
orderorder of iteration

Member Function Documentation

◆ dispatch() [1/4]

template<typename Result, typename Dispatcher, typename Erased, Order order>
auto hilti::detail::visitor::Visitor< Result, Dispatcher, Erased, order >::dispatch ( position_t &  i)
inline

Execute matching dispatch methods for a single node.

◆ dispatch() [2/4]

template<typename Result, typename Dispatcher, typename Erased, Order order>
auto hilti::detail::visitor::Visitor< Result, Dispatcher, Erased, order >::dispatch ( const_position_t &  i)
inline

Execute matching dispatch methods for a single node.

◆ dispatch() [3/4]

template<typename Result, typename Dispatcher, typename Erased, Order order>
auto hilti::detail::visitor::Visitor< Result, Dispatcher, Erased, order >::dispatch ( Erased *  n)
inline

Execute matching dispatch methods for a single node.

This method takes just the node itself and operates as it were the root of an AST.

◆ dispatch() [4/4]

template<typename Result, typename Dispatcher, typename Erased, Order order>
auto hilti::detail::visitor::Visitor< Result, Dispatcher, Erased, order >::dispatch ( const Erased &  n)
inline

Execute matching dispatch methods for a single node.

This method takes just the node itself and operates as it were the root of an AST.

◆ walk() [1/2]

template<typename Result, typename Dispatcher, typename Erased, Order order>
auto hilti::detail::visitor::Visitor< Result, Dispatcher, Erased, order >::walk ( const Erased &  root)
inline

Iterate over AST and Execute matching dispatch methods for each node.

This method operates on a constant AST, and the dispatcher cannot modify any nodes.

Note
The returned view operates on references to the the AST passed in, so make sure that stays around as long as necessary.

◆ walk() [2/2]

template<typename Result, typename Dispatcher, typename Erased, Order order>
auto hilti::detail::visitor::Visitor< Result, Dispatcher, Erased, order >::walk ( Erased *  root)
inline

Iterate over AST and Execute matching dispatch methods for each node.

This method operates on a non-constant AST, and the dispatcher may modify nodes.

Note
The returned view operates on references to the the AST passed in, so make sure that stays around as long as necessary.

The documentation for this class was generated from the following file: