OpenVDB  12.0.0
Classes | Namespaces | Functions
Scanners.h File Reference

Retrieve intrinsic information from AX AST by performing various traversal algorithms. More...

#include "AST.h"
#include "Visitor.h"
#include <openvdb/version.h>
#include <string>

Go to the source code of this file.

Classes

struct  VisitNodeType< NodeT, OpT, Derived >
 

Namespaces

 openvdb
 
 openvdb::v12_0
 
 openvdb::v12_0::ax
 
 openvdb::v12_0::ax::ast
 

Functions

OPENVDB_AX_API bool usesAttribute (const ast::Node &node, const std::string &name, const tokens::CoreType type=tokens::UNKNOWN)
 Returns whether or not a given branch of an AST reads from or writes to a given attribute. More...
 
OPENVDB_AX_API bool writesToAttribute (const ast::Node &node, const std::string &name, const tokens::CoreType type=tokens::UNKNOWN)
 Returns whether or not a given branch of an AST writes to a given attribute. More...
 
OPENVDB_AX_API bool callsFunction (const ast::Node &node, const std::string &name)
 Returns whether or not a given branch of an AST calls a function. More...
 
OPENVDB_AX_API void catalogueVariables (const ast::Node &node, std::vector< const ast::Variable * > *readOnly, std::vector< const ast::Variable * > *writeOnly, std::vector< const ast::Variable * > *readWrite, const bool locals=true, const bool attributes=true)
 todo More...
 
OPENVDB_AX_API void catalogueAttributeTokens (const ast::Node &node, std::vector< std::string > *readOnly, std::vector< std::string > *writeOnly, std::vector< std::string > *readWrite)
 Parse all attributes into three unique vectors which represent how they are accessed within the syntax tree. Read only attributes are stored within the 'readOnly' container (for example. More...
 
OPENVDB_AX_API void attributeDependencyTokens (const ast::Tree &tree, const std::string &name, const tokens::CoreType type, std::vector< std::string > &dependencies)
 Populate a list of attribute names which the given attribute depends on. More...
 
template<typename NodeT , typename OpT >
void visitNodeType (const ast::Node &node, const OpT &op)
 For an AST node of a given type, search for and call a custom const operator() which takes a const reference to every occurrence of the specified node type. More...
 
template<typename NodeT , typename ContainerType = std::vector<const NodeT*>>
void collectNodeType (const ast::Node &node, ContainerType &array)
 Visit all nodes of a given type and store pointers to them in a provided compatible container. More...
 
template<typename NodeTypeList , typename ContainerType = std::vector<const Node*>>
void collectNodeTypes (const ast::Node &node, ContainerType &array)
 Visit all nodes of the given types and store pointers to them in a container of base ast::Node pointers. More...
 
OPENVDB_AX_API void linearize (const ast::Node &node, std::vector< const ast::Node * > &list)
 Flatten the provided AST branch into a linear list using post order traversal. More...
 
OPENVDB_AX_API const ast::Variable * firstUse (const ast::Node &node, const std::string &token)
 
OPENVDB_AX_API const ast::Variable * lastUse (const ast::Node &node, const std::string &token)
 

Detailed Description

Retrieve intrinsic information from AX AST by performing various traversal algorithms.

Authors
Nick Avramoussis, Richard Jones