|
OpenVDB 13.0.0
|
The compiler class. This holds a set of compiler options and constructs executable objects (e.g. PointExecutable or VolumeExecutable) from a syntax tree or snippet of code. More...
#include <openvdb_ax/compiler/Compiler.h>
Public Types | |
| using | Ptr = std::shared_ptr<Compiler> |
| using | UniquePtr = std::unique_ptr<Compiler> |
Public Member Functions | |
| Compiler (const CompilerOptions &options=CompilerOptions()) | |
| Construct a compiler object with given settings. | |
| ~Compiler () | |
| Compiler (const Compiler &)=delete | |
| Compiler & | operator= (const Compiler &)=delete |
| Compiler (Compiler &&) | |
| Compiler & | operator= (Compiler &&) |
| template<typename ExecutableT> | |
| ExecutableT::Ptr | compile (const ast::Tree &syntaxTree, Logger &logger, const CustomData::Ptr data=CustomData::Ptr()) |
| Compile a given AST into an executable object of the given type. | |
| template<typename ExecutableT> | |
| ExecutableT::Ptr | compile (const std::string &code, Logger &logger, const CustomData::Ptr data=CustomData::Ptr()) |
| Compile a given snippet of AX code into an executable object of the given type. | |
| template<typename ExecutableT> | |
| ExecutableT::Ptr | compile (const std::string &code, const CustomData::Ptr data=CustomData::Ptr()) |
| Compile a given snippet of AX code into an executable object of the given type. | |
| template<typename ExecutableT> | |
| ExecutableT::Ptr | compile (const ast::Tree &syntaxTree, const CustomData::Ptr data=CustomData::Ptr()) |
| Compile a given AST into an executable object of the given type. | |
| void | setFunctionRegistry (std::unique_ptr< codegen::FunctionRegistry > &&functionRegistry) |
| Sets the compiler's function registry object. | |
Static Public Member Functions | |
| static UniquePtr | create (const CompilerOptions &options=CompilerOptions()) |
| Static method for creating Compiler objects. | |
The compiler class. This holds a set of compiler options and constructs executable objects (e.g. PointExecutable or VolumeExecutable) from a syntax tree or snippet of code.
| Compiler | ( | const CompilerOptions & | options = CompilerOptions() | ) |
Construct a compiler object with given settings.
| options | CompilerOptions object with various settings |
| ~Compiler | ( | ) |
|
delete |
| Compiler | ( | Compiler && | ) |
|
inline |
Compile a given AST into an executable object of the given type.
| syntaxTree | An abstract syntax tree to compile |
| data | Optional external/custom data which is to be referenced by the executable object. It allows one to reference data held elsewhere, such as inside of a DCC, from inside the AX code |
| ExecutableT::Ptr compile | ( | const ast::Tree & | syntaxTree, |
| Logger & | logger, | ||
| const CustomData::Ptr | data = CustomData::Ptr() ) |
Compile a given AST into an executable object of the given type.
| syntaxTree | An abstract syntax tree to compile |
| logger | Logger for errors and warnings during compilation, this should be linked to an ast::Tree and populated with AST node + line number mappings for this Tree, e.g. during ast::parse(). This Tree can be different from the syntaxTree argument. |
| data | Optional external/custom data which is to be referenced by the executable object. It allows one to reference data held elsewhere, such as inside of a DCC, from inside the AX code |
|
inline |
Compile a given snippet of AX code into an executable object of the given type.
| code | A string of AX code |
| data | Optional external/custom data which is to be referenced by the executable object. It allows one to reference data held elsewhere, such as inside of a DCC, from inside the AX code |
|
inline |
Compile a given snippet of AX code into an executable object of the given type.
| code | A string of AX code |
| logger | Logger for errors and warnings during compilation, will be cleared of existing data |
| data | Optional external/custom data which is to be referenced by the executable object. It allows one to reference data held elsewhere, such as inside of a DCC, from inside the AX code |
|
static |
Static method for creating Compiler objects.
| void setFunctionRegistry | ( | std::unique_ptr< codegen::FunctionRegistry > && | functionRegistry | ) |
Sets the compiler's function registry object.
| functionRegistry | A unique pointer to a FunctionRegistry object. The compiler will take ownership of the registry that was passed in. |