10.1. Runtime type information library
The RTTI module exposes runtime type information and program introspection facilities. It allows querying module structure, type declarations, function signatures, annotations, and other compile-time metadata at runtime. Used primarily by macro libraries and code generation tools.
All functions and symbols are in “rtti” module, use require to get access to it.
require daslib/rtti
10.1.1. Type aliases
- bitfield ProgramFlags
Flags which represent state of the Program object, both during and after compilation.
- Fields:
failToCompile (0x1) - indicates that the program failed to compile.
_unsafe (0x2) - indicates that the program contains unsafe code.
isCompiling (0x4) - indicates that the program is currently compiling.
isSimulating (0x8) - indicates that the program is currently simulating.
isCompilingMacros (0x10) - indicates that the program is currently compiling macros.
needMacroModule (0x20) - indicates that the program needs a macro module.
promoteToBuiltin (0x40) - indicates that the program is being promoted to a builtin module.
isDependency (0x80) - indicates that the program is a dependency module.
macroException (0x100) - indicates that a macro exception has occurred.
- bitfield context_category_flags
Flags which specify type of the Context.
- Fields:
dead (0x1) - indicates that the context is dead.
debug_context (0x2) - indicates that the context is a debug context.
thread_clone (0x4) - indicates that the context is a thread clone.
job_clone (0x8) - indicates that the context is a job clone.
opengl (0x10) - indicates that the context is an opengl context.
debugger_tick (0x20) - indicates that the context is a debugger tick.
debugger_attached (0x40) - indicates that the context has a debugger attached.
macro_context (0x80) - indicates that the context is a macro context (i.e. compiled macro module)
folding_context (0x100) - indicates that the context is a folding context (used during compilation or optimization for the purposes of folding constants)
audio (0x200) - indicates that the context is an audio context.
- bitfield TypeInfoFlags
Flags which specify properties of the TypeInfo object (any rtti type). indicates that the type is a reference value.
- Fields:
ref (0x1) - indicates that the type is a reference type.
refType (0x2) - indicates that the type can be copied.
canCopy (0x4) - indicates that the type is a plain old data type.
isPod (0x8) - indicates that the type is a raw plain old data type (without pointers or strings).
isRawPod (0x10) - indicates that the type is a const type.
isConst (0x20) - indicates that the type is a temporary type.
isTemp (0x40) - indicates that the type is an implicit type.
isImplicit (0x80) - indicates that the type is a reference value.
refValue (0x100) - indicates that the type has an initial value.
hasInitValue (0x200) - indicates that the type is a smart pointer.
isSmartPtr (0x400) - indicates that the type is a smart pointer native (smart_ptr_raw)
isSmartPtrNative (0x800) - indicates that the type is a handled type (annotation)
isHandled (0x1000) - indicates that the type needs marking by the garbage collector.
heapGC (0x2000) - indicates that the type needs marking of strings by the garbage collector.
stringHeapGC (0x4000) - indicates that the type needs lock checking.
isPrivate (0x8000) - indicates that the type is private.
- bitfield StructInfoFlags
Flags which represent properties of the StructInfo object (rtti object which represents structure type). This structure is a class.
- Fields:
_class (0x1) - This structure is a lambda.
_lambda (0x2) - This structure needs marking by the garbage collector.
heapGC (0x4) - This structure needs marking of strings by the garbage collector.
stringHeapGC (0x8) - This structure needs lock checking.
- bitfield ModuleFlags
Flags which represent the module’s state. This module is built-in.
- Fields:
builtIn (0x1) - This module is promoted to a builtin module.
promoted (0x2) - This module is public.
isPublic (0x4) - This module is a module.
isModule (0x8) - This module is a solid context (can’t be called from other contexts via pinvoke, global variables are cemented at locations)
isSolidContext (0x10) - This module is from an extra dependency.
fromExtraDependency (0x20) - This module does not allow unsafe code.
doNotAllowUnsafe (0x40) - This module was parsed nameless.
wasParsedNameless (0x80) - This module is visible everywhere.
visibleEverywhere (0x100) - This module skips lock checking.
allowPodInscope (0x200) - This module allows pod inscope.
- bitfield AnnotationDeclarationFlags
Flags which represent properties of the AnnotationDeclaration object.
- Fields:
inherited (0x1) - Indicates that the annotation is inherited.
- bitfield SimFunctionFlags
properties of the SimFunction object.
- Fields:
aot (0x1) - Function is compiled ahead-of-time.
fastcall (0x2) - Function uses fastcall calling convention.
builtin (0x4) - Function is a builtin.
jit (0x8) - Function is JIT-compiled.
unsafe (0x10) - Function is unsafe.
cmres (0x20) - Function returns via caller-managed return space.
pinvoke (0x40) - Function uses platform invoke for external calls.
- bitfield LocalVariableInfoFlags
properties of the LocalVariableInfo object.
- Fields:
cmres (0x1) - Variable is a caller-managed return space variable.
- variant RttiValue
Variant type which represents value of any annotation arguments and variable annotations.
- Variants:
tBool : bool - boolean value
tInt : int - integer value
tUInt : uint - unsigned integer value
tInt64 : int64 - 64-bit integer value
tUInt64 : uint64 - 64-bit unsigned integer value
tFloat : float - floating point value
tDouble : double - double precision floating point value
tString : string - string value
nothing : any - no value
- FileAccessPtr = smart_ptr<FileAccess>
typedef FileAccessPtr = smart_ptr<rtti_core::FileAccess> aka FileAccessPtr
10.1.2. Constants
- FUNCINFO_INIT = 0x1
Bit flag constant on FuncInfo.flags indicating that the function runs during Context initialization ([init] attribute).
- FUNCINFO_BUILTIN = 0x2
Bit flag constant on FuncInfo.flags indicating that the function is a built-in (C++-bound) function rather than a daslang-defined one.
- FUNCINFO_PRIVATE = 0x4
Bit flag constant on FuncInfo.flags indicating that the function has [private] visibility and cannot be called from other modules.
- FUNCINFO_SHUTDOWN = 0x8
Bit flag constant on FuncInfo.flags indicating that the function runs during Context shutdown ([finalize] attribute).
- FUNCINFO_LATE_INIT = 0x20
Bit flag constant on FuncInfo.flags indicating the function uses late initialization with a custom init order ([init(order)] attribute).
10.1.3. Enumerations
- CompilationError
- Values:
unspecified = 0 - Enumeration which represents error type for each of the errors which compiler returns and various stages.
mismatching_parentheses = 10001 - Unspecified error.
mismatching_curly_bracers = 10002 - Mismatching parentheses.
string_constant_exceeds_file = 10003 - Mismatching curly braces.
string_constant_exceeds_line = 10004 - String constant exceeds file.
unexpected_close_comment = 10005 - String constant exceeds line.
integer_constant_out_of_range = 10006 - Unexpected close comment.
comment_contains_eof = 10007 - Integer constant out of range.
invalid_escape_sequence = 10008 - Comment contains EOF (end of file).
invalid_line_directive = 10009 - Invalid escape sequence.
syntax_error = 20000 - Invalid line directive.
malformed_ast = 20001 - Syntax error, usually invalid grammar.
invalid_type = 30101 - Malformed AST.
invalid_return_type = 30102 - Invalid type.
invalid_argument_type = 30103 - Invalid return type.
invalid_structure_field_type = 30104 - Invalid argument type.
invalid_array_type = 30105 - Invalid structure field type.
invalid_table_type = 30106 - Invalid array type.
invalid_argument_count = 30107 - Invalid table type.
invalid_variable_type = 30108 - Invalid argument count.
invalid_new_type = 30109 - Invalid variable type.
invalid_index_type = 30110 - Invalid new type.
invalid_annotation = 30111 - Invalid index type.
invalid_swizzle_mask = 30112 - Invalid annotation.
invalid_initialization_type = 30113 - Invalid swizzle mask.
invalid_with_type = 30114 - Invalid initialization type.
invalid_override = 30115 - Invalid with type.
invalid_name = 30116 - Invalid override.
invalid_array_dimension = 30117 - Invalid name.
invalid_iteration_source = 30118 - Invalid array dimension.
invalid_loop = 30119 - Invalid iteration source.
invalid_label = 30120 - Invalid loop.
invalid_enumeration = 30121 - Invalid label.
invalid_option = 30122 - Invalid enumeration.
invalid_member_function = 30123 - Invalid or unsupported option.
function_already_declared = 30201 - Invalid member function.
argument_already_declared = 30202 - Function already declared.
local_variable_already_declared = 30203 - Argument already declared.
global_variable_already_declared = 30204 - Local variable already declared.
structure_field_already_declared = 30205 - Global variable already declared.
structure_already_declared = 30206 - Structure field already declared.
structure_already_has_initializer = 30207 - Structure already declared.
enumeration_already_declared = 30208 - Structure already has initializer.
enumeration_value_already_declared = 30209 - Enumeration already declared.
type_alias_already_declared = 30210 - Enumeration value already declared.
field_already_initialized = 30211 - Type alias already declared.
type_not_found = 30301 - Field already initialized.
structure_not_found = 30302 - Type not found.
operator_not_found = 30303 - Structure not found.
function_not_found = 30304 - Operator not found.
variable_not_found = 30305 - Function not found.
handle_not_found = 30306 - Variable not found.
annotation_not_found = 30307 - Handle not found.
enumeration_not_found = 30308 - Annotation not found.
enumeration_value_not_found = 30309 - Enumeration not found.
type_alias_not_found = 30310 - Enumeration value not found.
bitfield_not_found = 30311 - Type alias not found.
cant_initialize = 30401 - Bitfield not found.
cant_dereference = 30501 - Can’t initialize.
cant_index = 30502 - Can’t dereference (not a pointer or dereferencable type).
cant_get_field = 30503 - Can’t index (not an array, table, or indexable type).
cant_write_to_const = 30504 - Can’t get field (not a structure or table type).
cant_move_to_const = 30505 - Can’t write to const.
cant_write_to_non_reference = 30506 - Can’t move to const.
cant_copy = 30507 - Can’t write to non-reference.
cant_move = 30508 - Can’t copy.
cant_pass_temporary = 30509 - Can’t move.
condition_must_be_bool = 30601 - Can’t pass temporary value to non-temporary parameter.
condition_must_be_static = 30602 - Condition must be boolean.
cant_pipe = 30701 - Condition must be static (for ‘static_if’ and ‘static_elif’)
invalid_block = 30801 - Can’t pipe (invalid left-hand side or right-hand side).
return_or_break_in_finally = 30802 - Invalid block.
module_not_found = 30901 - Return or break in finally section is not allowed.
module_already_has_a_name = 30902 - Module not found.
cant_new_handle = 31001 - Module already has a name.
bad_delete = 31002 - Can’t new handled type.
cant_infer_generic = 31100 - Bad delete.
cant_infer_missing_initializer = 31101 - Can’t infer generic.
cant_infer_mismatching_restrictions = 31102 - Can’t infer missing initializer.
invalid_cast = 31200 - Can’t infer mismatching restrictions.
incompatible_cast = 31201 - Invalid cast.
unsafe = 31300 - Incompatible cast.
index_out_of_range = 31400 - Unsafe operation.
expecting_return_value = 32101 - Index out of range.
not_expecting_return_value = 32102 - Expecting return value.
invalid_return_semantics = 32103 - Not expecting return value (void function or block).
invalid_yield = 32104 - Invalid return semantics.
typeinfo_reference = 39901 - Invalid yield.
typeinfo_auto = 39902 - ‘typeinfo’ error, the type is a reference.
typeinfo_undefined = 39903 - ‘typeinfo’ error, the type is auto.
typeinfo_dim = 39904 - ‘typeinfo’ error, the type is undefined.
typeinfo_macro_error = 39905 - ‘typeinfo’ error, the type is not a static array.
static_assert_failed = 40100 - Macro returned error.
run_failed = 40101 - Static assert failed.
annotation_failed = 40102 - Run failed (attempt of folding constant function without side-effects failed)
concept_failed = 40103 - Annotation throw panic during compile time.
not_all_paths_return_value = 40200 - Concept throw panic during compile time.
assert_with_side_effects = 40201 - Not all paths return value.
only_fast_aot_no_cpp_name = 40202 - Assert with side effects.
aot_side_effects = 40203 - Only fast AOT no C++ name.
no_global_heap = 40204 - AOT side effects.
no_global_variables = 40205 - No global heap is specified, but program requests it.
unused_function_argument = 40206 - No global variables are allowed in this context.
unsafe_function = 40207 - Unused function argument.
performance_lint = 40217 - Unsafe function.
too_many_infer_passes = 41000 - Too many infer passes.
missing_node = 50100 - Missing simulation node.
- ConstMatters
Yes or no flag which indicates if constant flag of the type matters (during comparison).
- Values:
no = 0 - const does not matter, when comparing types.
yes = 1 - const matters, when comparing types.
- RefMatters
Yes or no flag which indicates if reference flag of the type matters (during comparison).
- Values:
no = 0 - Ref does not matter, when comparing types.
yes = 1 - Ref matters, when comparing types.
- TemporaryMatters
Yes or no flag which indicates if temporary flag of the type matters (during comparison).
- Values:
no = 0 - Temporary does not matter, when comparing types.
yes = 1 - Temporary matters, when comparing types.
- Type
One of the fundamental (base) types of any type object.
- Values:
none = 0 - No type specified (not void, not anything).
autoinfer = 1 - Auto-inferred type (auto)
alias = 2 - Type alias.
option = 3 - Optional type (foo|bar|…)
typeDecl = 4 - Type declaration typedecl(expr…)
typeMacro = 5 - Type macro. $type_macro_name(args…)
fakeContext = 6 - Fake context type (used for internal purposes to pass context as argument to C++ functions)
fakeLineInfo = 7 - Fake line info type (used for internal purposes to pass line info as argument to C++ functions)
anyArgument = 8 - Any argument type (only available for C++ interop functions, TypeInfo is provided)
tVoid = 9 - Void type.
tBool = 10 - Boolean type.
tInt8 = 11 - 8-bit integer type.
tUInt8 = 12 - 8-bit unsigned integer type.
tInt16 = 13 - 16-bit integer type.
tUInt16 = 14 - 16-bit unsigned integer type.
tInt64 = 15 - 64-bit integer type.
tUInt64 = 16 - 64-bit unsigned integer type.
tInt = 17 - 32-bit integer type.
tInt2 = 18 - vector of 2 32-bit integers.
tInt3 = 19 - vector of 3 32-bit integers.
tInt4 = 20 - vector of 4 32-bit integers.
tUInt = 21 - 32-bit unsigned integer type.
tUInt2 = 22 - vector of 2 32-bit unsigned integers.
tUInt3 = 23 - vector of 3 32-bit unsigned integers.
tUInt4 = 24 - vector of 4 32-bit unsigned integers.
tFloat = 25 - 32-bit floating point type.
tFloat2 = 26 - vector of 2 32-bit floating point numbers.
tFloat3 = 27 - vector of 3 32-bit floating point numbers.
tFloat4 = 28 - vector of 4 32-bit floating point numbers.
tDouble = 29 - 64-bit floating point type.
tRange = 30 - 32-bit range type, similar to vector of two 32-bit integers.
tURange = 31 - 32-bit unsigned range type, similar to vector of two 32-bit unsigned integers.
tRange64 = 32 - 64-bit range type, similar to vector of two 64-bit integers.
tURange64 = 33 - 64-bit unsigned range type, similar to vector of two 64-bit unsigned integers.
tString = 34 - String type.
tStructure = 35 - Structure type.
tHandle = 36 - Handle type (C++ type specified via annotation).
tEnumeration = 37 - 32-bit enumeration type.
tEnumeration8 = 38 - 8-bit enumeration type.
tEnumeration16 = 39 - 16-bit enumeration type.
tEnumeration64 = 40 - 64-bit enumeration type.
tBitfield = 41 - 32-bit bitfield type.
tBitfield8 = 42 - 8-bit bitfield type.
tBitfield16 = 43 - 16-bit bitfield type.
tBitfield64 = 44 - 64-bit bitfield type.
tPointer = 45 - Pointer type.
tFunction = 46 - Function type.
tLambda = 47 - Lambda type.
tIterator = 48 - Iterator type.
tArray = 49 - Array type.
tTable = 50 - Table type.
tBlock = 51 - Block type.
tTuple = 52 - Tuple type.
tVariant = 53 - Variant type.
10.1.4. Handled structures
- Program
- Program.getThisModule(): Module?
Property-like accessor that returns the Module pointer for the module currently being inferred in the given Program.
- Program.getDebugger(): bool
Property-like accessor that returns true if the debugger is attached and enabled for the given Program.
- Properties:
getThisModule : Module?
getDebugger : bool
Object representing full information about Daslang program during and after compilation (but not the simulated result of the program).
- Fields:
thisNamespace : das_string - namespace of the program
thisModuleName : das_string - module name
totalFunctions : int - total number of functions in the program
totalVariables : int - total number of variables in the program
errors : vector<Error> - compilation errors and exceptions
globalStringHeapSize : uint - size of the global string heap
initSemanticHashWithDep : uint64 - initial semantic hash with dependencies
flags : ProgramFlags - program flags
_options : AnnotationArgumentList - program options
policies : CodeOfPolicies - code of policies
- BasicStructureAnnotation
- BasicStructureAnnotation.fieldCount(): int
Property-like accessor that returns the number of fields declared in the given BasicStructureAnnotation.
- Properties:
fieldCount : int
Handled type which represents a structure-like annotation for exposing C++ types to daslang.
- Fields:
name : das_string - Name of the annotation
cppName : das_string - C++ class name used in AOT code generation
- EnumValueInfo
Single element of enumeration, its name and value.
- Fields:
name : string - name of the enumeration value
value : int64 - value of the enumeration value
- AstSerializer
Dummy annotation to strengthen type system. Can only be passed to its API functions.
- Module
Collection of types, aliases, functions, classes, macros etc under a single namespace.
- Fields:
name : das_string - Module name.
fileName : das_string - Module file name.
moduleFlags : ModuleFlags - Module flags.
- Annotation
- Annotation.isTypeAnnotation(): bool
Property-like accessor that returns true if the given Annotation is a TypeAnnotation (defines a handled type).
- Annotation.isBasicStructureAnnotation(): bool
Property-like accessor that returns true if the given Annotation is a BasicStructureAnnotation, which exposes C++ struct fields to daslang.
- Annotation.isStructureAnnotation(): bool
Property-like accessor that returns true if the given Annotation is a structure annotation (applied to struct declarations).
- Annotation.isStructureTypeAnnotation(): bool
Property-like accessor that returns true if the given Annotation is a StructureTypeAnnotation, which binds a C++ class as a daslang handled struct.
- Annotation.isFunctionAnnotation(): bool
Property-like accessor that returns true if the given Annotation is a FunctionAnnotation (applied to functions).
- Annotation.isEnumerationAnnotation(): bool
Property-like accessor that returns true if the given Annotation is an EnumerationAnnotation.
- Properties:
isTypeAnnotation : bool
isBasicStructureAnnotation : bool
isStructureAnnotation : bool
isStructureTypeAnnotation : bool
isFunctionAnnotation : bool
isEnumerationAnnotation : bool
Handled type or macro.
- Fields:
name : das_string - name of the annotation
cppName : das_string - name of the associated C++ type or macro
_module : Module? - module where the annotation is defined
- CodeOfPolicies
- Fields:
aot : bool - Object which holds compilation and simulation settings and restrictions.
aot_lib : bool - Whether ahead-of-time compilation is enabled.
standalone_context : bool - AOT library mode.
aot_module : bool - Whether standalone context AOT compilation is enabled.
aot_macros : bool - Specifies to AOT if we are compiling a module, or a final program.
paranoid_validation : bool - Enables AOT of macro code (like ‘qmacro_block’ etc).
validate_ast : bool - Whether paranoid validation is enabled (extra checks, no optimizations).
cross_platform : bool - Whether to validate the AST after compilation (uniqueness checks, etc.). Off by default (slow).
aot_result : das_string - Whether cross-platform AOT is enabled (if not, we generate code for the current platform).
completion : bool - File name for AOT output (if not set, we generate a temporary file).
lint_check : bool - If we are in code completion mode.
export_all : bool - Whether we are in lint-check mode (standalone linters set this so modules can adapt behavior).
serialize_main_module : bool - Export all functions and global variables.
keep_alive : bool - If not set, we recompile main module each time.
very_safe_context : bool - Keep context alive after main function.
always_report_candidates_threshold : int - Whether to use very safe context (delete of data is delayed, to avoid table[foo]=table[bar] lifetime bugs).
max_infer_passes : int - Threshold for reporting candidates for function calls. If less than this number, we always report them.
max_call_depth : int - Maximum number of inference passes.
stack : uint - Stack size.
intern_strings : bool - Whether to intern strings.
persistent_heap : bool - Whether to use persistent heap (or linear heap).
multiple_contexts : bool - Whether multiple contexts are allowed (pinvokes between contexts).
heap_size_hint : uint - Heap size hint.
string_heap_size_hint : uint - String heap size hint.
solid_context : bool - Whether to use solid context (global variables are cemented at locations, can’t be called from other contexts via pinvoke).
macro_context_persistent_heap : bool - Whether macro context uses persistent heap.
macro_context_collect : bool - Whether macro context does garbage collection.
max_static_variables_size : uint64 - Maximum size of static variables.
max_heap_allocated : uint64 - Maximum heap allocated.
max_string_heap_allocated : uint64 - Maximum string heap allocated.
rtti : bool - Whether to enable RTTI.
unsafe_table_lookup : bool - Whether to allow unsafe table lookups (via [] operator).
relaxed_pointer_const : bool - Whether to relax pointer constness rules.
version_2_syntax : bool - Allows use of version 2 syntax.
gen2_make_syntax : bool - Whether to use gen2 make syntax.
relaxed_assign : bool - Allows relaxing of the assignment rules.
no_unsafe : bool - Disables all unsafe operations.
local_ref_is_unsafe : bool - Local references are considered unsafe.
no_global_variables : bool - Disallows global variables in this context (except for generated).
no_global_variables_at_all : bool - Disallows global variables at all in this context.
no_global_heap : bool - Disallows global heap in this context.
only_fast_aot : bool - Only fast AOT, no C++ name generation.
aot_order_side_effects : bool - Whether to consider side effects during AOT ordering.
no_unused_function_arguments : bool - Errors on unused function arguments.
no_unused_block_arguments : bool - Errors on unused block arguments.
allow_block_variable_shadowing : bool - Allows block variable shadowing.
allow_local_variable_shadowing : bool - Allows local variable shadowing.
allow_shared_lambda : bool - Allows shared lambdas.
ignore_shared_modules : bool - Ignore shared modules during compilation.
default_module_public : bool - Default module mode is public.
no_deprecated : bool - Disallows use of deprecated features.
no_aliasing : bool - Disallows aliasing (if aliasing is allowed, temporary lifetimes are extended).
strict_smart_pointers : bool - Enables strict smart pointer checks.
no_init : bool - Disallows use of ‘init’ in structures.
strict_unsafe_delete : bool - Enables strict unsafe delete checks.
no_members_functions_in_struct : bool - Disallows member functions in structures.
no_local_class_members : bool - Disallows local class members.
report_invisible_functions : bool - Report invisible functions.
report_private_functions : bool - Report private functions.
strict_properties : bool - Enables strict property checks.
no_optimizations : bool - Disables all optimizations.
no_infer_time_folding : bool - Disables infer-time constant folding.
fail_on_no_aot : bool - Fails compilation if AOT is not available.
fail_on_lack_of_aot_export : bool - Fails compilation if AOT export is not available.
log_compile_time : bool - Log compile time.
log_total_compile_time : bool - Log total compile time.
no_fast_call : bool - Disables fast call optimization.
scoped_stack_allocator : bool - Reuse stack memory after variables go out of scope.
force_inscope_pod : bool - Force in-scope for POD-like types.
log_inscope_pod : bool - Log in-scope for POD-like types.
debugger : bool - Enables debugger support.
debug_infer_flag : bool - Enables debug inference flag.
profiler : bool - Enables profiler support.
threadlock_context : bool - Enables threadlock context.
jit_enabled : bool - JIT enabled - if enabled, JIT will be used to compile code at runtime.
jit_jit_all_functions : bool - JIT all functions - if enabled, JIT will compile all functions in the module.
jit_debug_info : bool - JIT debug info - if enabled, JIT will generate debug info for JIT compiled code.
jit_dll_mode : bool - JIT dll mode - if enabled, JIT will generate DLL’s into JIT output folder and load them from there.
jit_exe_mode : bool - JIT exe mode - if enabled, JIT will generate standalone executable.
emit_prologue : bool - JIT will always emit function prologues, which allows call-stack in debuggers.
jit_output_path : das_string - JIT output folder (where JIT compiled code will be stored).
jit_opt_level : int - JIT optimization level for compiled code (0-3).
jit_size_level : int - JIT size optimization level for compiled code (0-3).
jit_path_to_shared_lib : das_string - Path to shared library, which is used in JIT.
jit_path_to_linker : das_string - Path to linker, which is used in JIT.
- FileInfo
Information about a single file stored in the FileAccess object.
- Fields:
name : das_string - File name.
tabSize : int - Tab size for this file.
- TypeAnnotation
- TypeAnnotation.is_any_vector(): bool
Property-like accessor that returns true if the given TypeAnnotation wraps any C++ vector-like container (e.g., std::vector).
- TypeAnnotation.canMove(): bool
Property-like accessor that returns true if the given TypeAnnotation supports move semantics.
- TypeAnnotation.canCopy(): bool
Property-like accessor that returns true if the given TypeAnnotation supports copy semantics.
- TypeAnnotation.canClone(): bool
Property-like accessor that returns true if the given TypeAnnotation supports the clone operation.
- TypeAnnotation.isPod(): bool
Property-like accessor that returns true if the given TypeAnnotation is a POD (plain old data) type — no constructor, destructor, or special semantics.
- TypeAnnotation.isRawPod(): bool
Property-like accessor that returns true if the given TypeAnnotation is a raw POD type — a basic value type excluding pointers and strings.
- TypeAnnotation.isRefType(): bool
Property-like accessor that returns true if the given TypeAnnotation is always passed by reference, or is itself a reference type.
- TypeAnnotation.hasNonTrivialCtor(): bool
Property-like accessor that returns true if the given TypeAnnotation has a non-trivial constructor (requires explicit initialization).
- TypeAnnotation.hasNonTrivialDtor(): bool
Property-like accessor that returns true if the given TypeAnnotation has a non-trivial destructor (requires explicit finalization).
- TypeAnnotation.hasNonTrivialCopy(): bool
Property-like accessor that returns true if the given TypeAnnotation has non-trivial copy semantics (i.e., a custom copy constructor).
- TypeAnnotation.canBePlacedInContainer(): bool
Property-like accessor that returns true if values of the given TypeAnnotation can be stored inside arrays, tables, or other containers.
- TypeAnnotation.isLocal(): bool
Property-like accessor that returns true if the given TypeAnnotation can be used as a local variable type within a function.
- TypeAnnotation.canNew(): bool
Property-like accessor that returns true if the given TypeAnnotation supports heap allocation via new.
- TypeAnnotation.canDelete(): bool
Property-like accessor that returns true if values of the given TypeAnnotation can be explicitly deleted.
- TypeAnnotation.needDelete(): bool
Property-like accessor that returns true if values of the given TypeAnnotation require explicit delete to free resources.
- TypeAnnotation.canDeletePtr(): bool
Property-like accessor that returns true if a pointer to the given TypeAnnotation type can be explicitly deleted.
- TypeAnnotation.isIterable(): bool
Property-like accessor that returns true if the given TypeAnnotation supports iteration via for.
Property-like accessor that returns true if the given TypeAnnotation can be shared across multiple Context objects.
- TypeAnnotation.isSmart(): bool
Property-like accessor that returns true if the given TypeAnnotation represents a smart_ptr managed type.
- TypeAnnotation.avoidNullPtr(): bool
Property-like accessor that returns true if the given TypeAnnotation requires pointers to its type to be non-null (i.e., must be initialized on creation).
- TypeAnnotation.sizeOf(): uint64
Property-like accessor that returns the size in bytes of the type described by the given TypeAnnotation.
- TypeAnnotation.alignOf(): uint64
Property-like accessor that returns the memory alignment requirement (in bytes) of the type described by the given TypeAnnotation.
- Properties:
is_any_vector : bool
canMove : bool
canCopy : bool
canClone : bool
isPod : bool
isRawPod : bool
isRefType : bool
hasNonTrivialCtor : bool
hasNonTrivialDtor : bool
hasNonTrivialCopy : bool
canBePlacedInContainer : bool
isLocal : bool
canNew : bool
canDelete : bool
needDelete : bool
canDeletePtr : bool
isIterable : bool
isShareable : bool
isSmart : bool
avoidNullPtr : bool
sizeOf : uint64
alignOf : uint64
Handled type.
- Fields:
name : das_string - name of the type annotation
cppName : das_string - name of the associated C++ type
_module : Module? - module where the annotation is defined
- TypeInfo
- TypeInfo.enumType(): EnumInfo?
Property-like accessor that returns the EnumInfo pointer describing the underlying enumeration for the given enum TypeAnnotation.
- TypeInfo.isRef(): bool
Property-like accessor that returns true if the given TypeInfo describes a reference (&) type.
- TypeInfo.isRefType(): bool
Property-like accessor that returns true if the given TypeAnnotation is always passed by reference, or is itself a reference type.
- TypeInfo.isRefValue(): bool
Property-like accessor that returns true if the given TypeInfo describes a ref-value type (boxed value accessed by reference).
- TypeInfo.canCopy(): bool
Property-like accessor that returns true if the given TypeAnnotation supports copy semantics.
- TypeInfo.isPod(): bool
Property-like accessor that returns true if the given TypeAnnotation is a POD (plain old data) type — no constructor, destructor, or special semantics.
- TypeInfo.isRawPod(): bool
Property-like accessor that returns true if the given TypeAnnotation is a raw POD type — a basic value type excluding pointers and strings.
- TypeInfo.isConst(): bool
Property-like accessor that returns true if the given TypeInfo describes a const-qualified type.
- TypeInfo.isTemp(): bool
Property-like accessor that returns true if the given TypeInfo describes a temporary (#) type that cannot be captured or stored.
- TypeInfo.isImplicit(): bool
Property-like accessor that returns true if the given TypeInfo describes an implicit (compiler-inferred) type.
- TypeInfo.annotation(): TypeAnnotation?
Property-like accessor that returns the Annotation pointer associated with the given TypeInfo.
- TypeInfo.annotation_or_name(): TypeAnnotation?
Property-like accessor that returns the annotation name if one exists, otherwise returns the raw type name from the given TypeInfo.
- TypeInfo.structType(): StructInfo?
Property-like accessor that returns the StructInfo pointer for the struct described by the given TypeInfo, or null if not a struct type.
- Properties:
enumType : EnumInfo?
isRef : bool
isRefType : bool
isRefValue : bool
canCopy : bool
isPod : bool
isRawPod : bool
isConst : bool
isTemp : bool
isImplicit : bool
annotation : TypeAnnotation?
annotation_or_name : TypeAnnotation?
structType : StructInfo?
Object which represents any Daslang type.
- Fields:
firstType : TypeInfo? - first type parameter
secondType : TypeInfo? - second type parameter
argTypes : TypeInfo?? - argument types list
argNames : string? - argument names list
dim : uint? - dimensions list
hash : uint64 - hash of the type
basicType : Type - kind of the type
_type : Type - basic type category
flags : TypeInfoFlags - flags associated with the type
size : uint - size of the type in bytes
argCount : uint - number of arguments in the type
dimSize : uint - number of dimensions in the type
- AnnotationArgument
Single argument of the annotation, typically part of the AnnotationArgumentList.
- Fields:
basicType : Type - type of the argument value
name : das_string - argument name
sValue : das_string - string value
fValue : float - integer value
iValue : int - float value
bValue : bool - boolean value
at : LineInfo - line info where the argument is defined
- VarInfo
Object which represents variable declaration.
- Fields:
firstType : TypeInfo? - first type parameter
secondType : TypeInfo? - second type parameter
argTypes : TypeInfo?? - argument types list
argNames : string? - argument names list
hash : uint64 - hash of the type
basicType : Type - basic type category
flags : TypeInfoFlags - flags associated with the type
size : uint - size of the type in bytes
argCount : uint - number of arguments in the type
dimSize : uint - number of dimensions in the type
value : any - value of the variable
sValue : string - string value of the variable
name : string - name of the variable
annotation_arguments : AnnotationArguments? - annotation arguments
offset : uint - offset of the variable in the structure
nextGcField : uint - next garbage collection field in the structure, which requires garbage collection marking
- LocalVariableInfo
Object which represents local variable declaration.
- Fields:
firstType : TypeInfo? - first type parameter
secondType : TypeInfo? - second type parameter
argTypes : TypeInfo?? - argument types list
argNames : string? - argument names list
hash : uint64 - hash of the type
basicType : Type - basic type category
flags : TypeInfoFlags - flags associated with the type
size : uint - size of the type in bytes
argCount : uint - number of arguments in the type
dimSize : uint - number of dimensions in the type
visibility : LineInfo - visibility information
name : string - name of the variable
stackTop : uint - stack top offset
localFlags : LocalVariableInfoFlags - local variable flags
- EnumInfo
Type object which represents enumeration.
- Fields:
name : string - name of the enumeration
module_name : string - module where the enumeration is defined
fields : EnumValueInfo?? - fields in the enumeration
count : uint - number of fields in the enumeration
hash : uint64 - hash of the enumeration
- SimFunction
- SimFunction.lineInfo(): LineInfo const?
Property-like accessor that returns the LineInfo (source location) associated with the given function’s FuncInfo.
- Properties:
lineInfo : LineInfo?
Object which represents simulated function in the Context.
- Fields:
name : string - original function name
mangledName : string - mangled function name (with arguments and types encoded)
debugInfo : FuncInfo? - pointer to the function debug info, if available
mangledNameHash : uint64 - hash of the mangled function name
stackSize : uint - stack size in bytes
flags : SimFunctionFlags - flags associated with the function
- DebugInfoHelper
Helper object which holds debug information about the simulated program.
- Fields:
rtti : bool - The RTTI context pointer.
- LineInfo
Information about a section of the file stored in the FileAccess object.
- Fields:
fileInfo : FileInfo? - File information object.
column : uint - Column number (1-based).
line : uint - Line number (1-based).
last_column : uint - Last column number (1-based).
last_line : uint - Last line number (1-based).
- Error
Object which holds information about compilation error or exception.
- Fields:
what : das_string - What error is about.
extra : das_string - Extra information about error.
fixme : das_string - Fixme information about error.
at : LineInfo - Line info where error occurred.
cerr : CompilationError - Compilation error.
- StructInfo
Type object which represents structure or class.
- Fields:
name : string - name of the structure
module_name : string - module where the structure is defined
fields : VarInfo?? - fields in the structure
hash : uint64 - hash of the structure
init_mnh : uint64 - hash of the structure initializer
flags : StructInfoFlags - flags associated with the structure
count : uint - number of fields in the structure
size : uint - size of the structure in bytes
firstGcField : uint - index of the first GC field in the structure, i.e. field which requires garbage collection marking
- FileAccess
Object which holds collection of files as well as means to access them (Project).
- Context
- Context.getInitSemanticHash(): uint64
Property-like accessor that returns the uint64 semantic hash of the initialization code for the given Context, useful for detecting code changes.
- Context.totalFunctions(): int
Property-like accessor that returns the total number of registered SimFunction entries in the given Context.
- Context.totalVariables(): int
Property-like accessor that returns the total number of global variables registered in the given Context.
- Context.getCodeAllocatorId(): uint64
Property-like accessor that returns a non-persistent unique integer ID of the code (node) allocator associated with the given Context.
- Properties:
getInitSemanticHash : uint64
totalFunctions : int
totalVariables : int
getCodeAllocatorId : uint64
Object which holds single Daslang Context. Context is the result of the simulation of the Daslang program.
- Fields:
breakOnException : bool - Calls breakpoint when exception is thrown.
alwaysErrorOnException : bool - Always error on exception.
alwaysStackWalkOnException : bool - Always stack walk on exception.
name : das_string - Context name.
category : context_category_flags - Context category flags.
exceptionAt : LineInfo - Exception at line info.
exception : string - Exception message.
last_exception : string - Last exception message.
contextMutex : recursive_mutex? - Context mutex.
- ModuleGroup
Collection of modules.
- FuncInfo
Object which represents function declaration.
- Fields:
name : string - function name
cppName : string - C++ name (for the builtin functions)
fields : VarInfo?? - function parameters
result : TypeInfo? - function result type
locals : LocalVariableInfo?? - local variables (with visibility info)
globals : VarInfo?? - accessed global variables
hash : uint64 - hash of the function
flags : uint - flags associated with the function
count : uint - number of arguments in the function
stackSize : uint - stack size in bytes
localCount : uint - number of local variables
globalCount : uint - number of accessed global variables
- AnnotationDeclaration
Annotation declaration, its location, and arguments.
- Fields:
annotation : Annotation? - pointer to the handled annotation object.
arguments : AnnotationArgumentList - list of annotation arguments.
at : LineInfo - line information where the annotation is defined.
flags : AnnotationDeclarationFlags - flags associated with the annotation.
10.1.5. Typeinfo macros
- rtti_typeinfo
Typeinfo macro that provides compile-time access to RTTI type information structures. Typeinfo macro rtti_typeinfo
10.1.6. Handled types
- recursive_mutex
Handled type wrapping a system std::recursive_mutex, used with lock_mutex for thread-safe access to shared data across contexts.
- AnnotationArgumentList
Handled type representing an ordered list of annotation arguments and properties, providing indexed and named access to argument entries.
- AnnotationArguments
Handled type representing a collection of annotation arguments, typically the raw argument list parsed from an annotation declaration.
- AnnotationList
Handled type representing all annotations attached to a single object (function, structure, or variable), iterable via each.
10.1.7. Initialization and finalization
- CodeOfPolicies(): CodeOfPolicies
Constructs a default-initialized CodeOfPolicies structure, which controls compiler behavior and optimization settings.
10.1.7.1. LineInfo
- LineInfo(): LineInfo
Constructs a default-initialized LineInfo structure representing source file location (file, line, column).
- LineInfo(arg0: FileInfo?; arg1: int; arg2: int; arg3: int; arg4: int): LineInfo
- RttiValue_nothing(): auto
def RttiValue_nothing () : auto
10.1.7.2. using
- using(arg0: block<(CodeOfPolicies):void>)
Creates a temporary RTTI helper object (e.g., Program, DebugInfoHelper) scoped to the given block, automatically finalized on block exit.
- Arguments:
arg0 : block<( CodeOfPolicies):void> implicit
- using(arg0: block<(ModuleGroup):void>)
- using(arg0: block<(recursive_mutex):void>)
10.1.8. Type access
10.1.8.1. arg_names
- arg_names(info: TypeInfo): auto
def arg_names (info: TypeInfo) : auto
- Arguments:
info : TypeInfo
- arg_names(info: VarInfo): auto
10.1.8.2. arg_types
- arg_types(info: VarInfo): auto
def arg_types (info: VarInfo) : auto
- Arguments:
info : VarInfo
- arg_types(info: TypeInfo): auto
- builtin_is_same_type(a: TypeInfo const?; b: TypeInfo const?; refMatters: RefMatters; cosntMatters: ConstMatters; tempMatters: TemporaryMatters; topLevel: bool): bool
Returns true if two TypeInfo pointers describe the same type, with flags controlling whether ref, const, temp, and other qualifiers are included in the comparison.
- Arguments:
a : TypeInfo? implicit
b : TypeInfo? implicit
refMatters : RefMatters
cosntMatters : ConstMatters
tempMatters : TemporaryMatters
topLevel : bool
10.1.8.3. each_dim
- each_dim(info: TypeInfo): auto
def each_dim (info: TypeInfo) : auto
- Arguments:
info : TypeInfo
- each_dim(info: VarInfo): auto
- get_das_type_name(type: Type): string
Returns the canonical string name of the given Type enumeration value (e.g., tInt → "int").
- Arguments:
type : Type
10.1.8.4. get_dim
- get_dim(typeinfo: VarInfo; index: int): int
Returns the dimension size (int) at the specified index for a fixed-size array type described by TypeInfo.
- Arguments:
typeinfo : VarInfo implicit
index : int
- get_dim(typeinfo: TypeInfo; index: int): int
- get_type_align(type: TypeInfo?): int
Returns the memory alignment (int, in bytes) of the type described by the given TypeInfo.
- Arguments:
type : TypeInfo? implicit
- get_type_size(type: TypeInfo?): int
Returns the size (int, in bytes) of the type described by the given TypeInfo.
- Arguments:
type : TypeInfo? implicit
10.1.8.5. is_compatible_cast
- is_compatible_cast(from: StructInfo const?; to: StructInfo const?): bool
Returns true if an object of type from (StructInfo) can be safely cast to type to (StructInfo), following the class hierarchy.
- Arguments:
from : StructInfo? implicit
to : StructInfo? implicit
- is_compatible_cast(a: StructInfo; b: StructInfo): auto
- is_same_type(a: TypeInfo; b: TypeInfo; refMatters: RefMatters = RefMatters.yes; constMatters: ConstMatters = ConstMatters.yes; temporaryMatters: TemporaryMatters = TemporaryMatters.yes; topLevel: bool = true): auto
def is_same_type (a: TypeInfo; b: TypeInfo; refMatters: RefMatters = RefMatters.yes; constMatters: ConstMatters = ConstMatters.yes; temporaryMatters: TemporaryMatters = TemporaryMatters.yes; topLevel: bool = true) : auto
- Arguments:
a : TypeInfo
b : TypeInfo
refMatters : RefMatters
constMatters : ConstMatters
temporaryMatters : TemporaryMatters
topLevel : bool
10.1.9. Rtti context access
- class_info(cl: auto): StructInfo const?
def class_info (cl: auto) : StructInfo const?
- Arguments:
cl : auto
- context_for_each_function(blk: block<(info:FuncInfo):void>): auto
def context_for_each_function (blk: block<(info:FuncInfo):void>) : auto
- Arguments:
blk : block<(info: FuncInfo):void>
- context_for_each_variable(blk: block<(info:VarInfo):void>): auto
def context_for_each_variable (blk: block<(info:VarInfo):void>) : auto
- Arguments:
blk : block<(info: VarInfo):void>
- get_function_by_mnh(context: Context; MNH: uint64) : function<():void>
Returns a SimFunction pointer looked up by mangled name hash — an alternative form of get_function_address.
- Arguments:
context : Context implicit
MNH : uint64
10.1.9.1. get_function_info
- get_function_info(context: any; index: int): FuncInfo
Returns the FuncInfo pointer for a function at the given index in the Context, providing access to its name, arguments, and return type.
- Arguments:
context : any
index : int
- get_function_info(context: Context; function: function<():void>): FuncInfo const?
10.1.9.2. get_line_info
- get_line_info(): LineInfo
Returns a LineInfo structure representing the source location (file, line, column) of the call site where get_line_info is invoked.
- get_line_info(depth: int): LineInfo
- get_total_functions(context: Context): int
Returns the total number of registered functions (int) in the given Context.
- Arguments:
context : Context implicit
- get_total_variables(context: Context): int
Returns the total number of global variables (int) in the given Context.
- Arguments:
context : Context implicit
- get_variable_info(context: any; index: int): VarInfo
Returns the VarInfo pointer for a global variable at the given index in the Context, providing access to its name, type, and offset.
- Arguments:
context : any
index : int
- get_variable_value(varInfo: VarInfo): RttiValue
Returns an RttiValue variant representing the current value of a global variable, looked up by VarInfo in the given Context.
- Arguments:
varInfo : VarInfo implicit
- this_context(): Context&
Returns a pointer to the current Context in which the calling code is executing.
10.1.9.3. type_info
- type_info(cl: auto): TypeInfo const?
def type_info (cl: auto) : TypeInfo const?
- Arguments:
cl : auto
- type_info(vinfo: VarInfo): TypeInfo const?
- type_info(vinfo: LocalVariableInfo): TypeInfo const?
10.1.10. Program access
- get_module(name: string): Module?
Returns a Module pointer looked up by module name string, or null if no such module is registered.
- Arguments:
name : string implicit
- get_this_module(program: smart_ptr<Program>): Module?
Returns the Module pointer for the module currently being compiled or inferred, retrieved from the Program.
- Arguments:
program : smart_ptr< Program> implicit
- has_module(name: string): bool
Returns true if a module with the given name is registered, false otherwise.
- Arguments:
name : string implicit
- program_for_each_module(program: smart_ptr<Program>; block: block<(Module?):void>)
Iterates through all modules referenced by the given Program (including transitive dependencies), yielding a Module pointer for each.
- program_for_each_registered_module(block: block<(Module?):void>)
Iterates through all modules registered in the daslang runtime (globally, not per-program), yielding a Module pointer for each.
- Arguments:
block : block<( Module?):void> implicit
10.1.11. Module access
module_for_each_annotation (module: Module?; block: block<(Annotation):void>)
module_for_each_dependency (module: Module?; block: block<(Module?;bool):void>)
module_for_each_enumeration (module: Module?; block: block<(EnumInfo):void>)
module_for_each_function (module: Module?; block: block<(FuncInfo):void>)
module_for_each_generic (module: Module?; block: block<(FuncInfo):void>)
module_for_each_global (module: Module?; block: block<(VarInfo):void>)
module_for_each_structure (module: Module?; block: block<(StructInfo):void>)
- module_for_each_annotation(module: Module?; block: block<(Annotation):void>)
Iterates through each annotation (handled type) in the given Module, yielding an Annotation pointer for each registered annotation.
- Arguments:
module : Module? implicit
block : block<( Annotation):void> implicit
- module_for_each_dependency(module: Module?; block: block<(Module?;bool):void>)
Iterates through each module dependency of the given Module, yielding the dependent Module pointer for each required module.
- module_for_each_enumeration(module: Module?; block: block<(EnumInfo):void>)
Iterates through each enumeration declared in the given Module, yielding an EnumInfo pointer for each enum.
- module_for_each_function(module: Module?; block: block<(FuncInfo):void>)
Iterates through each function declared in the given Module, yielding a FuncInfo pointer for each function.
- module_for_each_generic(module: Module?; block: block<(FuncInfo):void>)
Iterates through each generic (template) function declared in the given Module, yielding a FuncInfo pointer for each generic.
- module_for_each_global(module: Module?; block: block<(VarInfo):void>)
Iterates through each global variable declared in the given Module, yielding a VarInfo pointer for each variable.
- module_for_each_structure(module: Module?; block: block<(StructInfo):void>)
Iterates through each structure declaration in the given Module, yielding a StructInfo pointer for each struct.
- Arguments:
module : Module? implicit
block : block<( StructInfo):void> implicit
10.1.12. Annotation access
- add_annotation_argument(annotation: AnnotationArgumentList; name: string): int
Appends an annotation argument (name-value pair) to the given AnnotationArgumentList, used when constructing annotations programmatically.
- Arguments:
annotation : AnnotationArgumentList implicit
name : string implicit
- get_annotation_argument_value(info: AnnotationArgument): RttiValue
Returns an RttiValue variant representing the value of a specific named argument from an AnnotationArgumentList.
- Arguments:
info : AnnotationArgument implicit
10.1.13. Compilation and simulation
ast_serializer_get_data (serializer: AstSerializer?; block: block<(array<uint8>#):void>)
create_ast_deserializer (data: array<uint8>) : AstSerializer?
for_each_expected_error (program: smart_ptr<Program>; block: block<(CompilationError;int):void>)
serialize_program (serializer: AstSerializer?; program: smart_ptr<Program> const&) : bool
- ast_serializer_get_data(serializer: AstSerializer?; block: block<(array<uint8>#):void>)
Returns content of serializer.
- Arguments:
serializer : AstSerializer? implicit
block : block<(array<uint8>#):void> implicit
10.1.13.1. compile
- compile(module_name: string; codeText: string; codeOfPolicies: CodeOfPolicies; exportAll: bool; block: block<(bool;smart_ptr<Program>;das_string):void>)
Compiles a daslang program from a source code string using the provided FileAccess and ModuleGroup, returning a ProgramPtr (null on failure).
- Arguments:
module_name : string implicit
codeText : string implicit
codeOfPolicies : CodeOfPolicies implicit
exportAll : bool
block : block<(bool;smart_ptr< Program>; das_string):void> implicit
- compile(module_name: string; codeText: string; codeOfPolicies: CodeOfPolicies; block: block<(bool;smart_ptr<Program>;das_string):void>)
- compile_file(module_name: string; fileAccess: smart_ptr<FileAccess>; moduleGroup: ModuleGroup?; codeOfPolicies: CodeOfPolicies; block: block<(bool;smart_ptr<Program>;das_string):void>)
Compiles a daslang program from a file registered in the given FileAccess object, returning a ProgramPtr (null on failure).
- Arguments:
module_name : string implicit
fileAccess : smart_ptr< FileAccess> implicit
moduleGroup : ModuleGroup? implicit
codeOfPolicies : CodeOfPolicies implicit
block : block<(bool;smart_ptr< Program>; das_string):void> implicit
- create_ast_deserializer(data: array<uint8>): AstSerializer?
Creates deserializer. As an input expects output of ast_serializer_get_data.
- Arguments:
data : array<uint8> implicit
- create_ast_serializer(): AstSerializer?
Creates serializer object.
- delete_ast_serializer(serializer: AstSerializer?)
Frees memory for ast_serializer.
- Arguments:
serializer : AstSerializer? implicit
- deserialize_program(serializer: AstSerializer?; block: block<(bool;smart_ptr<Program>;das_string):void>)
Deserializes all programs from file and calls block on each of them.
- Arguments:
serializer : AstSerializer? implicit
block : block<(bool;smart_ptr< Program>; das_string):void> implicit
- for_each_expected_error(program: smart_ptr<Program>; block: block<(CompilationError;int):void>)
Iterates through each expected compilation error declared in the Program (via expect), yielding the error code for each.
- Arguments:
program : smart_ptr< Program> implicit
block : block<( CompilationError;int):void> implicit
- for_each_require_declaration(program: smart_ptr<Program>; block: block<(Module?;string#;string#;bool;LineInfo):void>)
Iterates through each require declaration of the compiled Program, yielding the module name, public/private flag, and source LineInfo.
- Arguments:
- serialize_program(serializer: AstSerializer?; program: smart_ptr<Program> const&): bool
Serializes program to serializer object.
- Arguments:
serializer : AstSerializer? implicit
program : smart_ptr< Program>& implicit
- simulate(program: smart_ptr<Program> const&; block: block<(bool;smart_ptr<Context>;das_string):void>)
Simulates (links and initializes) a compiled Program, returning a Context pointer ready for function execution, or null on failure.
- Arguments:
program : smart_ptr< Program>& implicit
block : block<(bool;smart_ptr< Context>; das_string):void> implicit
10.1.14. File access
- add_extra_module(access: smart_ptr<FileAccess>; modName: string; modFile: string)
Adds extra module to FileAccess. All files compiled via this FileAccess will include this extra module.
- Arguments:
access : smart_ptr< FileAccess> implicit
modName : string implicit
modFile : string implicit
- add_file_access_root(access: smart_ptr<FileAccess>; mod: string; path: string): bool
Adds an extra root directory (search path) to the given FileAccess object, expanding where require resolves files from.
- Arguments:
access : smart_ptr< FileAccess> implicit
mod : string implicit
path : string implicit
- make_file_access(project: string): smart_ptr<FileAccess>
Creates and returns a new FileAccessPtr (smart_ptr<FileAccess>) initialized as a default file-system-backed project.
- Arguments:
project : string implicit
- set_file_source(access: smart_ptr<FileAccess>; fileName: string; text: string): bool
Registers a source code string for the given file name inside the FileAccess object, allowing in-memory compilation without disk files.
- Arguments:
access : smart_ptr< FileAccess> implicit
fileName : string implicit
text : string implicit
10.1.15. Structure access
- basic_struct_for_each_field(annotation: BasicStructureAnnotation; block: block<(string;string;TypeInfo;uint):void>)
Iterates through each field of a BasicStructureAnnotation, yielding the field name, C++ name, TypeInfo, and byte offset for each field.
- Arguments:
annotation : BasicStructureAnnotation implicit
block : block<(string;string; TypeInfo;uint):void> implicit
- basic_struct_for_each_parent(annotation: BasicStructureAnnotation; block: block<(Annotation?):void>)
Iterates through each parent (base class) of a BasicStructureAnnotation, yielding the parent TypeInfo for each ancestor.
- Arguments:
annotation : BasicStructureAnnotation implicit
block : block<( Annotation?):void> implicit
- rtti_builtin_structure_for_each_annotation(struct: StructInfo; block: block<():void>)
Iterates through each annotation attached to a StructInfo, yielding the annotation name and its AnnotationArgumentList for each.
- Arguments:
struct : StructInfo implicit
block : block<void> implicit
- structure_for_each_annotation(st: StructInfo; subexpr: block<(ann:Annotation;args:AnnotationArguments):void>): auto
def structure_for_each_annotation (st: StructInfo; subexpr: block<(ann:Annotation;args:AnnotationArguments):void>) : auto
- Arguments:
st : StructInfo
subexpr : block<(ann: Annotation;args: AnnotationArguments):void>
10.1.16. Data walking and printing
10.1.16.1. describe
- describe(lineinfo: LineInfo; fully: bool = false): string
Returns a human-readable string description of an RTTI object (TypeInfo, VarInfo, FuncInfo, etc.), useful for logging and debug output.
- Arguments:
lineinfo : LineInfo implicit
fully : bool
- describe(type: TypeInfo const?): string
- get_mangled_name(type: TypeInfo const?): string
Returns the full mangled name string for the given FuncInfo, encoding its module, name, and argument types.
- Arguments:
type : TypeInfo? implicit
10.1.16.2. sprint_data
- sprint_data(data: float4; type: TypeInfo const?; flags: bitfield): string
Returns a string representation of a value given its data pointer and TypeInfo, similar to debug or print but capturing output as a string.
- Arguments:
data : float4
type : TypeInfo? implicit
flags : bitfield<>
- sprint_data(data: void?; type: TypeInfo const?; flags: bitfield): string
10.1.17. Function and mangled name hash
- get_function_address(MNH: uint64; at: Context): uint64
Returns a SimFunction pointer looked up by mangled name hash in the given Context, or null if not found.
- Arguments:
MNH : uint64
at : Context implicit
10.1.17.1. get_function_by_mangled_name_hash
- get_function_by_mangled_name_hash(src: uint64; context: Context) : function<():void>
Returns a function<> lambda value looked up by its mangled name hash in the given Context.
- Arguments:
src : uint64
context : Context implicit
- get_function_by_mangled_name_hash(src: uint64) : function<():void>
- get_function_mangled_name_hash(src: function<():void>): uint64
Returns the uint64 mangled name hash for the given function<> value, which uniquely identifies the function in its Context.
- Arguments:
src : function<void>
10.1.18. Context and mutex locking
- lock_context(lock_context: Context; block: block<():void>)
Acquires a recursive lock on the given Context and executes a block, ensuring thread-safe access to context data within the scope.
- Arguments:
lock_context : Context implicit
block : block<void> implicit
- lock_mutex(mutex: recursive_mutex; block: block<():void>)
Acquires a recursive lock on the given recursive_mutex and executes a block, releasing the lock when the block exits.
- Arguments:
mutex : recursive_mutex implicit
block : block<void> implicit
- lock_this_context(block: block<():void>)
Acquires a recursive lock on the current Context and executes a block, ensuring thread-safe access within the scope.
- Arguments:
block : block<void> implicit
10.1.19. Runtime data access
- get_table_key_index(table: void?; key: any; baseType: Type; valueTypeSize: int): int
Returns the internal slot index (int) for the given key within a table value, or -1 if the key is not present.
- Arguments:
table : void? implicit
key : any
baseType : Type
valueTypeSize : int
10.1.20. Tuple and variant access
- get_tuple_field_offset(type: TypeInfo?; index: int): int
Returns the byte offset (int) of a field at the given index within a tuple type described by TypeInfo.
- Arguments:
type : TypeInfo? implicit
index : int
- get_variant_field_offset(type: TypeInfo?; index: int): int
Returns the byte offset (int) of a field at the given index within a variant type described by TypeInfo.
- Arguments:
type : TypeInfo? implicit
index : int
10.1.21. Iteration
each (info: FuncInfo const implicit ==const) : iterator<VarInfo const&>
each (info: StructInfo const implicit ==const) : iterator<VarInfo const&>
each (info: StructInfo implicit ==const) : iterator<VarInfo&>
each (info: EnumInfo const implicit ==const) : iterator<EnumValueInfo const&>
each (info: EnumInfo implicit ==const) : iterator<EnumValueInfo&>
10.1.21.1. each
- each(info: FuncInfo const implicit ==const): iterator<VarInfo const&>
Iterates through each element of an RTTI container (e.g., AnnotationArguments, AnnotationArgumentList, AnnotationList), yielding individual entries.
- Arguments:
info : FuncInfo implicit!
- each(info: FuncInfo implicit ==const): iterator<VarInfo&>
- each(info: StructInfo const implicit ==const): iterator<VarInfo const&>
- each(info: StructInfo implicit ==const): iterator<VarInfo&>
- each(info: EnumInfo const implicit ==const): iterator<EnumValueInfo const&>
- each(info: EnumInfo implicit ==const): iterator<EnumValueInfo&>