ALib C++ Framework
by
Library Version: 2511 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::expressions::CompilerPlugin::CompilationInfo Struct Reference

Description:

Public inner base struct which provides input and output information for compiling single entities (nodes of the AST) of a parsed expression.

Descendant types

extend this struct with input information, specific to the type of AST-node currently compiled. Special, descendant type

in addition adds specific output members.

Together, these four descendants comprise the parameters of the four overloaded methods TryCompilation.

Definition at line 116 of file compilerplugin.inl.

Inheritance diagram for alib::expressions::CompilerPlugin::CompilationInfo:
alib::expressions::CompilerPlugin::CIAutoCast alib::expressions::CompilerPlugin::CIBinaryOp alib::expressions::CompilerPlugin::CIFunction alib::expressions::CompilerPlugin::CIUnaryOp

Public Field Index:

ArgIterator ArgsBegin
ArgIterator ArgsEnd
CallbackDecl Callback = nullptr
 Output: The native C++ callback function to be set by one of the plug-ins.
MonoAllocatorCompileTimeAllocator
ScopeCompileTimeScope
const ncharDbgCallbackName =nullptr
Box TypeOrValue = nullptr

Public Method Index:

 CompilationInfo (Scope &scope, MonoAllocator &allocator)

Field Details:

◆ ArgsBegin

ArgIterator alib::expressions::CompilerPlugin::CompilationInfo::ArgsBegin

Input: A start iterator to sample boxes that provide the argument types to search a native callback function for.
In case that descendant classes denote that arguments found in this iterator are constant, then the boxes are not just sample boxes, but contain the constant values.

Definition at line 143 of file compilerplugin.inl.

◆ ArgsEnd

ArgIterator alib::expressions::CompilerPlugin::CompilationInfo::ArgsEnd

Input: The end iterator to ArgsBegin. The expression ArgsEnd - ArgsBegin may be used to receive the number of arguments provided.

Definition at line 147 of file compilerplugin.inl.

◆ Callback

CallbackDecl alib::expressions::CompilerPlugin::CompilationInfo::Callback = nullptr

Output: The native C++ callback function to be set by one of the plug-ins.

Definition at line 157 of file compilerplugin.inl.

◆ CompileTimeAllocator

MonoAllocator& alib::expressions::CompilerPlugin::CompilationInfo::CompileTimeAllocator

An allocator to be used exclusively during compile-time. Its memory is cleared (respectively reset to a previous state) after the compilation completed.
(Refers to object MonoAllocator allocator.)

Definition at line 137 of file compilerplugin.inl.

◆ CompileTimeScope

Scope& alib::expressions::CompilerPlugin::CompilationInfo::CompileTimeScope

The scope found here is the same object passed to the method virtual Expression Compile(const String&) , which internally invokes the overloaded methods CompilerPlugin::TryCompilation, that receive an object of this type.

If a compiled expression syntax element evaluates to a constant stored in TypeOrValue it has to be ensured that the boxed data is to available during the life-cycle of the expression.

To allocate custom compilation data, a custom, derived type, might, for example, be extended with simplestd::vector of pointers to the created objects. (Attention: Vectors of value-types must not be used, as with their growth, the objects get moved within the heap memory!).
. Any data allocated, is to be deleted in the virtual destructor of the custom scope type.

Definition at line 131 of file compilerplugin.inl.

◆ DbgCallbackName

const nchar* alib::expressions::CompilerPlugin::CompilationInfo::DbgCallbackName =nullptr

Output: The C++ name of the callback function. This field is available only in debug compilations of the library. Hence, setting it must be performed with preprocessor conditionals.

Definition at line 153 of file compilerplugin.inl.

◆ TypeOrValue

Box alib::expressions::CompilerPlugin::CompilationInfo::TypeOrValue = nullptr

Output: Specifies the return type of Callback, respectively, as the name indicates, the result value in case of constant results.
Note that in case of constant compile-time values, it might be necessary to allocate compile-time memory for the values. For this, field CompileTimeScope is to be used.

Definition at line 163 of file compilerplugin.inl.

Constructor(s) / Destructor Details:

◆ CompilationInfo()

Constructor.

Parameters
scopeThe scope usable for allocation of constant values (compile-time allocations). Assigned to field CompileTimeScope.
allocatorAssigned to field CompileTimeAllocator.

Definition at line 171 of file compilerplugin.inl.


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