Loading...
Searching...
No Matches
Visitor< Derived, ConstVisit > Struct Template Reference

The Visitor class uses the Curiously Recursive Template Pattern (CRTP) to provide a customizable interface intended to be used by clients wishing to perform custom operations over an AX Abstract Syntax Tree (AST). By default the Visitor implements simple traversal of all nodes, ensuring that each node on a well formed AST is visited at least once. By deriving from the Visitor, users are able to customize this default behavior and further manually override specific node behavior to their needs. The function options at the top of visitor can be overridden using CRTP to control the prior default behavior, with the ability to override the traverse() and visit() methods for the latter more granular control. More...

`#include <openvdb_ax/ast/Visitor.h>`

## Public Types

template<typename NodeT>
using | NodeType = typename std::conditional<ConstVisit, const NodeT, NodeT>::type
| Templated conditional which resolves to a const NodeT if ConstVisit is true, or a non-const NodeT if ConstVisit is false.

## Public Member Functions

Derived & | derived ()
| Accesses the derived class by static casting the current object. Assumes use of the Curiously Recursive Template Pattern (CRTP).
Options
bool | postOrderNodes () const
| Default behavior option. If true, this results in post-order traversal, where node children are traversed and visited before their parent node. If false, this results in pre-order traversal, where by the current node is visited before the node's children.
bool | reverseChildVisits () const
| Default behavior option. Reverses the traversal order of child nodes. If true, child nodes are accessed from last to first index .i.e. Node::children() -> 0. If false, child nodes are accessed from first to last .i.e. 0 -> Node::children().
bool | visitNodeHierarchies () const
| Default behavior option. Controls whether nodes visit themselves at each stage of their class hierarchy. If true, nodes perform multiple visits on their potentially abstract base classes. If false, only the concrete derived types are visited.
bool | reverseHierarchyVisits () const

Default behavior option. Reverses the traversal order of node hierarchies. If true, hierarchical visits start at the very top of their inheritance structure (always a Node AST node) and visit downwards until the lowest derived concrete node is reached. If false, hierarchical visits start at the lowest derived concrete node and visit upwards until the very top of their inheritance structure (always a Node AST node) is reached.

Traversals
bool | traverse (NodeType< ast::Tree > *tree)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::StatementList > *cond)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::Block > *block)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::CommaOperator > *comma)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::Loop > *loop)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::Keyword > *keyw)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::ConditionalStatement > *cond)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::AssignExpression > *asgn)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::Crement > *crmt)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::UnaryOperator > *unry)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::BinaryOperator > *bin)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::TernaryOperator > *tern)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::Cast > *cast)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::FunctionCall > *call)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::Attribute > *attr)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::ExternalVariable > *ext)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::DeclareLocal > *decl)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::Local > *loc)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::ArrayPack > *pack)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::ArrayUnpack > *pack)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::Value< bool > > *val)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::Value< int16_t > > *val)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::Value< int32_t > > *val)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::Value< int64_t > > *val)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::Value< float > > *val)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::Value< double > > *val)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::Value< std::string > > *val)
| Default traversals for a given concrete AST node type.
bool | traverse (NodeType< ast::Node > *node)
| The default traversal method which is hit for all child traversals. The correct derived traversal scheme is selected by using the node enumerated type.
Visits
bool | visit (NodeType< ast::Node > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::Statement > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::Expression > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::Variable > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::ValueBase > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::Tree > *)
| Visits for concrete Node types.
bool | visit (NodeType< ast::StatementList > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::Block > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::CommaOperator > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::Loop > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::Keyword > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::ConditionalStatement > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::AssignExpression > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::Crement > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::UnaryOperator > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::BinaryOperator > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::TernaryOperator > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::Cast > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::FunctionCall > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::Attribute > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::ExternalVariable > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::DeclareLocal > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::Local > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::ArrayPack > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::ArrayUnpack > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::Value< bool > > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::Value< int16_t > > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::Value< int32_t > > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::Value< int64_t > > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::Value< float > > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::Value< double > > *)
| Visits for abstract (pure-virtual) Node types.
bool | visit (NodeType< ast::Value< std::string > > *)
| Visits for abstract (pure-virtual) Node types.

## Detailed Description

template<typename Derived, bool ConstVisit = true>
struct openvdb::v10_0::ax::ast::Visitor< Derived, ConstVisit >

The Visitor class uses the Curiously Recursive Template Pattern (CRTP) to provide a customizable interface intended to be used by clients wishing to perform custom operations over an AX Abstract Syntax Tree (AST). By default the Visitor implements simple traversal of all nodes, ensuring that each node on a well formed AST is visited at least once. By deriving from the Visitor, users are able to customize this default behavior and further manually override specific node behavior to their needs. The function options at the top of visitor can be overridden using CRTP to control the prior default behavior, with the ability to override the traverse() and visit() methods for the latter more granular control.

To commence a full visit of an AST, begin by calling traverse() on a Node pointer. A visit is defined as one of the visit() methods being called and accepting a Node type. Each node is is guaranteed to be visited exactly once at its lowest concrete derived type. Node inheritance hierarchies can also be visited (disable by default, see Visitor::visitNodeHierarchies) The traverse() methods define how each AST node accesses its children. The default implementation is for each node to traverses its child pointers in the order returned by the derived Node::child() method (see Visitor::reverseChildVisits). You'll typically only require overriding of the visit() methods for achieving most goals, however you can utilize the traverse methods if you find that you require more control over how the node hierarchy is accessed. The default visit order is post order, where by nodes traverse and visit their children first (see Visitor::postOrderNodes). Each visit method returns a boolean value which, if false, allows for early termination of the traversal. In the below example, we show a Visitor capable of visiting every Local node type exactly once, terminating if the Local variable is called "var".

     @par Example:
     @code
     struct LocalVisitor : public Visitor<LocalVisitor>
     {
         // Bring in all base methods to avoid hiding
         using ast::Visitor<LocalVisitor>::traverse;
         using ast::Visitor<LocalVisitor>::visit;

         // override the visit for Local AST nodes
         inline bool visit(const Local* node) {
             if (!node) return true;
             if (node->name() == "var") return false;
             return true;
         }
     };

     LocalVisitor visitor;
     visitor.traverse(&tree);
     @endcode

Note
  The second template argument, ConstVisit, allows you to perform non-const traversals over the AST. In this case, the visit and traversal function signatures change to non-const pointers.
  This design is heavily influenced by Clang's RecursiveVisitor.

Template Parameters

  Derived | The derived visitor to template on the base visitor, using CRTP
  ConstVisit | Whether to visit const or non-const versions of the AST nodes. Note that this value changes the class function signatures.

## Member Typedef Documentation

## NodeType

template<typename Derived, bool ConstVisit = true>
template<typename NodeT>

using NodeType = typename std::conditional<ConstVisit, const NodeT, NodeT>::type

Templated conditional which resolves to a const NodeT if ConstVisit is true, or a non-const NodeT if ConstVisit is false.

## Member Function Documentation

## derived()

template<typename Derived, bool ConstVisit = true>

Derived & derived | ( |  | ) |

inline

Accesses the derived class by static casting the current object. Assumes use of the Curiously Recursive Template Pattern (CRTP).

## postOrderNodes()

template<typename Derived, bool ConstVisit = true>

bool postOrderNodes | ( |  | ) | const

inline

Default behavior option. If true, this results in post-order traversal, where node children are traversed and visited before their parent node. If false, this results in pre-order traversal, where by the current node is visited before the node's children.

Post-order traversal (for each node):

1. Traverse all children.
2. Visit the current node. Pre-order traversal (for each node):

1. Visit the current node.
2. Traverse all children.

## reverseChildVisits()

template<typename Derived, bool ConstVisit = true>

bool reverseChildVisits | ( |  | ) | const

inline

Default behavior option. Reverses the traversal order of child nodes. If true, child nodes are accessed from last to first index .i.e. Node::children() -> 0. If false, child nodes are accessed from first to last .i.e. 0 -> Node::children().

## reverseHierarchyVisits()

template<typename Derived, bool ConstVisit = true>

bool reverseHierarchyVisits | ( |  | ) | const

inline

Default behavior option. Reverses the traversal order of node hierarchies. If true, hierarchical visits start at the very top of their inheritance structure (always a Node AST node) and visit downwards until the lowest derived concrete node is reached. If false, hierarchical visits start at the lowest derived concrete node and visit upwards until the very top of their inheritance structure (always a Node AST node) is reached.

Note
  Has no effect if visitNodeHierarchies() is false

## traverse() [1/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::ArrayPack > * | pack | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [2/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::ArrayUnpack > * | pack | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [3/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::AssignExpression > * | asgn | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [4/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::Attribute > * | attr | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [5/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::BinaryOperator > * | bin | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [6/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::Block > * | block | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [7/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::Cast > * | cast | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [8/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::CommaOperator > * | comma | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [9/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::ConditionalStatement > * | cond | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [10/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::Crement > * | crmt | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [11/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::DeclareLocal > * | decl | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [12/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::ExternalVariable > * | ext | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [13/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::FunctionCall > * | call | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [14/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::Keyword > * | keyw | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [15/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::Local > * | loc | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [16/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::Loop > * | loop | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [17/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::Node > * | node | ) |

inline

The default traversal method which is hit for all child traversals. The correct derived traversal scheme is selected by using the node enumerated type.

Note
  Only handles traversal on concrete node types.

## traverse() [18/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::StatementList > * | cond | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [19/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::TernaryOperator > * | tern | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [20/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::Tree > * | tree | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [21/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::UnaryOperator > * | unry | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [22/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::Value< bool > > * | val | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [23/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::Value< double > > * | val | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [24/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::Value< float > > * | val | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [25/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::Value< int16_t > > * | val | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [26/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::Value< int32_t > > * | val | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [27/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::Value< int64_t > > * | val | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## traverse() [28/28]

template<typename Derived, bool ConstVisit = true>

bool traverse | ( | NodeType< ast::Value< std::string > > * | val | ) |

inline

Default traversals for a given concrete AST node type.

Returns
  True if traversal should continue, false to terminate

## visit() [1/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::ArrayPack > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [2/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::ArrayUnpack > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [3/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::AssignExpression > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [4/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::Attribute > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [5/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::BinaryOperator > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [6/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::Block > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [7/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::Cast > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [8/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::CommaOperator > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [9/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::ConditionalStatement > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [10/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::Crement > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [11/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::DeclareLocal > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [12/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::Expression > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [13/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::ExternalVariable > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [14/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::FunctionCall > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [15/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::Keyword > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [16/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::Local > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [17/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::Loop > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [18/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::Node > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [19/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::Statement > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [20/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::StatementList > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [21/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::TernaryOperator > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [22/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::Tree > * |  | ) |

inline

Visits for concrete Node types.

Returns
  True if traversal should continue, false to terminate

## visit() [23/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::UnaryOperator > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [24/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::Value< bool > > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [25/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::Value< double > > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [26/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::Value< float > > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [27/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::Value< int16_t > > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [28/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::Value< int32_t > > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [29/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::Value< int64_t > > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [30/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::Value< std::string > > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [31/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::ValueBase > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visit() [32/32]

template<typename Derived, bool ConstVisit = true>

bool visit | ( | NodeType< ast::Variable > * |  | ) |

inline

Visits for abstract (pure-virtual) Node types.

Note
  These are only hit through the default behavior if Visitor::visitNodeHierarchies is enabled.

Returns
  True if traversal should continue, false to terminate

## visitNodeHierarchies()

template<typename Derived, bool ConstVisit = true>

bool visitNodeHierarchies | ( |  | ) | const

inline

Default behavior option. Controls whether nodes visit themselves at each stage of their class hierarchy. If true, nodes perform multiple visits on their potentially abstract base classes. If false, only the concrete derived types are visited.

When disabled, abstract node visitor methods are never accessed directly through the default Visitor implementation. These types include Node, Statement, Expression, etc AST nodes. If true, for each linearly inherited AST node, a visit is performed on the entire hierarchy. For example, for a Local AST node which derives from Variable -> Expression -> Statement -> Node, 5 visits will be performed at each level.