souffle  2.0.2-371-g6315b36
Data Structures | Namespaces | Macros | Functions
Visitor.h File Reference
#include "ast/Aggregator.h"
#include "ast/AlgebraicDataType.h"
#include "ast/Argument.h"
#include "ast/Atom.h"
#include "ast/Attribute.h"
#include "ast/BinaryConstraint.h"
#include "ast/BooleanConstraint.h"
#include "ast/BranchInit.h"
#include "ast/Clause.h"
#include "ast/Component.h"
#include "ast/ComponentInit.h"
#include "ast/ComponentType.h"
#include "ast/Constant.h"
#include "ast/Constraint.h"
#include "ast/Counter.h"
#include "ast/Functor.h"
#include "ast/IntrinsicFunctor.h"
#include "ast/Literal.h"
#include "ast/Negation.h"
#include "ast/NilConstant.h"
#include "ast/Node.h"
#include "ast/NumericConstant.h"
#include "ast/Pragma.h"
#include "ast/Program.h"
#include "ast/ProvenanceNegation.h"
#include "ast/RecordInit.h"
#include "ast/RecordType.h"
#include "ast/Relation.h"
#include "ast/StringConstant.h"
#include "ast/SubroutineArgument.h"
#include "ast/SubsetType.h"
#include "ast/Term.h"
#include "ast/Type.h"
#include "ast/TypeCast.h"
#include "ast/UnionType.h"
#include "ast/UnnamedVariable.h"
#include "ast/UserDefinedFunctor.h"
#include "ast/Variable.h"
#include "souffle/utility/FunctionalUtil.h"
#include "souffle/utility/MiscUtil.h"
#include <cstddef>
#include <functional>
#include <memory>
#include <type_traits>
#include <typeinfo>
#include <vector>
Include dependency graph for Visitor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  souffle::ast::ast_visitor_tag
 A tag type required for the is_ast_visitor type trait to identify AstVisitors. More...
 
struct  souffle::ast::detail::is_ast_visitor< T >
 A type trait determining whether a given type is a visitor or not. More...
 
struct  souffle::ast::detail::is_ast_visitor< const T >
 
struct  souffle::ast::detail::is_ast_visitor< T & >
 
struct  souffle::ast::detail::LambdaVisitor< R, N >
 A specialized visitor wrapping a lambda function – an auxiliary type required for visitor convenience functions. More...
 
struct  souffle::ast::Visitor< R, Params >
 The generic base type of all AstVisitors realizing the dispatching of visitor calls. More...
 

Namespaces

 souffle
 
 souffle::ast
 
 souffle::ast::detail
 

Macros

#define FORWARD(Kind)   if (const auto* n = dynamic_cast<const Kind*>(&node)) return visit##Kind(*n, args...);
 
#define LINK(Node, Parent)
 

Functions

template<typename R , typename N >
LambdaVisitor< R, N > souffle::ast::detail::makeLambdaVisitor (const std::function< R(const N &)> &fun)
 A factory function for creating LambdaVisitor instances. More...
 
template<typename Lambda , typename R = typename lambda_traits<Lambda>::result_type, typename N = typename lambda_traits<Lambda>::arg0_type>
std::enable_if<!detail::is_ast_visitor< Lambda >::value, void >::type souffle::ast::visitDepthFirst (const Node &root, const Lambda &fun)
 A utility function visiting all nodes within the ast rooted by the given node recursively in a depth-first pre-order fashion applying the given function to each encountered node. More...
 
template<typename R , typename N >
void souffle::ast::visitDepthFirst (const Node &root, const std::function< R(const N &)> &fun)
 A utility function visiting all nodes within the ast rooted by the given node recursively in a depth-first pre-order fashion applying the given function to each encountered node. More...
 
template<typename R , typename... Ps, typename... Args>
void souffle::ast::visitDepthFirst (const Node &root, Visitor< R, Ps... > &visitor, Args &... args)
 A utility function visiting all nodes within the ast rooted by the given node recursively in a depth-first pre-order fashion applying the given visitor to each encountered node. More...
 
template<typename T , typename Lambda >
void souffle::ast::visitDepthFirst (const std::vector< T * > &list, const Lambda &fun)
 A utility function visiting all nodes within a given list of AST root nodes recursively in a depth-first pre-order fashion applying the given function to each encountered node. More...
 
template<typename T , typename Lambda >
void souffle::ast::visitDepthFirst (const VecOwn< T > &list, const Lambda &fun)
 A utility function visiting all nodes within a given list of AST root nodes recursively in a depth-first pre-order fashion applying the given function to each encountered node. More...
 
template<typename Lambda , typename R = typename lambda_traits<Lambda>::result_type, typename N = typename lambda_traits<Lambda>::arg0_type>
std::enable_if<!detail::is_ast_visitor< Lambda >::value, void >::type souffle::ast::visitDepthFirstPostOrder (const Node &root, const Lambda &fun)
 A utility function visiting all nodes within the ast rooted by the given node recursively in a depth-first post-order fashion applying the given function to each encountered node. More...
 
template<typename R , typename N >
void souffle::ast::visitDepthFirstPostOrder (const Node &root, const std::function< R(const N &)> &fun)
 A utility function visiting all nodes within the ast rooted by the given node recursively in a depth-first post-order fashion applying the given function to each encountered node. More...
 
template<typename R , typename... Ps, typename... Args>
void souffle::ast::visitDepthFirstPostOrder (const Node &root, Visitor< R, Ps... > &visitor, Args &... args)
 A utility function visiting all nodes within the ast rooted by the given node recursively in a depth-first post-order fashion applying the given visitor to each encountered node. More...
 
template<typename R , typename... Ps, typename... Args>
void souffle::ast::visitDepthFirstPreOrder (const Node &root, Visitor< R, Ps... > &visitor, Args &... args)
 A utility function visiting all nodes within the ast rooted by the given node recursively in a depth-first pre-order fashion applying the given visitor to each encountered node. More...
 

Macro Definition Documentation

◆ FORWARD

#define FORWARD (   Kind)    if (const auto* n = dynamic_cast<const Kind*>(&node)) return visit##Kind(*n, args...);

◆ LINK

#define LINK (   Node,
  Parent 
)
Value:
virtual R visit##Node(const Node& n, Params... args) { \
return visit##Parent(n, args...); \
}

Definition at line 158 of file Visitor.h.

n
var n
Definition: htmlJsChartistMin.h:15