tvm
Loading...
Searching...
No Matches
Public Attributes | List of all members
tvm::script::printer::DocTranslatorVTable Struct Reference

Engine callbacks borrowed for the translator's lifetime. More...

#include <doc_translator.h>

Collaboration diagram for tvm::script::printer::DocTranslatorVTable:

Public Attributes

TVMFFIAny(* translate )(DocTranslatorObj *translator, ffi::AnyView value, const ffi::Object *destination) noexcept
 Translate a value with an optional pre-mapped destination.
 
TVMFFIAny(* alloc_id )(DocTranslatorObj *translator, ffi::AnyView hint) noexcept
 Reserve an identifier without mapping a variable.
 
TVMFFIAny(* var_get_or_alloc_id )(DocTranslatorObj *translator, ffi::AnyView var, bool explicit_def) noexcept
 Find or allocate a variable's identifier.
 
TVMFFIAny(* get_implicit_defs )(DocTranslatorObj *translator) noexcept
 Get the current variable scope's pending definitions.
 
TVMFFIAny(* begin_var_scope )(DocTranslatorObj *translator) noexcept
 Begin a lexical variable scope.
 
TVMFFIAny(* end_var_scope )(DocTranslatorObj *translator) noexcept
 End the current lexical variable scope.
 

Detailed Description

Engine callbacks borrowed for the translator's lifetime.

Member Data Documentation

◆ alloc_id

TVMFFIAny(* tvm::script::printer::DocTranslatorVTable::alloc_id) (DocTranslatorObj *translator, ffi::AnyView hint) noexcept
noexcept

Reserve an identifier without mapping a variable.

Parameters
translatorThe borrowed translation context.
hintThe borrowed string name hint.
Returns
An owning Expected<IdDoc> encoded as TVMFFIAny, including errors.

◆ begin_var_scope

TVMFFIAny(* tvm::script::printer::DocTranslatorVTable::begin_var_scope) (DocTranslatorObj *translator) noexcept
noexcept

Begin a lexical variable scope.

Parameters
translatorThe borrowed translation context.
Returns
Expected<void> encoded as TVMFFIAny, including errors.

◆ end_var_scope

TVMFFIAny(* tvm::script::printer::DocTranslatorVTable::end_var_scope) (DocTranslatorObj *translator) noexcept
noexcept

End the current lexical variable scope.

Parameters
translatorThe borrowed translation context.
Returns
Expected<void> encoded as TVMFFIAny, including errors.

◆ get_implicit_defs

TVMFFIAny(* tvm::script::printer::DocTranslatorVTable::get_implicit_defs) (DocTranslatorObj *translator) noexcept
noexcept

Get the current variable scope's pending definitions.

Parameters
translatorThe borrowed translation context.
Returns
An owning Expected<Dict<Var, IdDoc>> encoded as TVMFFIAny, including errors.

◆ translate

TVMFFIAny(* tvm::script::printer::DocTranslatorVTable::translate) (DocTranslatorObj *translator, ffi::AnyView value, const ffi::Object *destination) noexcept
noexcept

Translate a value with an optional pre-mapped destination.

Parameters
translatorThe borrowed translation context.
valueThe borrowed input value.
destinationA borrowed Var, or nullptr when no binding is requested.
Returns
An owning Expected<Optional<ExprDoc>> encoded as TVMFFIAny. None means emission completed the request; errors use Expected's error encoding.

◆ var_get_or_alloc_id

TVMFFIAny(* tvm::script::printer::DocTranslatorVTable::var_get_or_alloc_id) (DocTranslatorObj *translator, ffi::AnyView var, bool explicit_def) noexcept
noexcept

Find or allocate a variable's identifier.

Parameters
translatorThe borrowed translation context.
varThe borrowed variable.
explicit_defWhether to remove the binding from pending definitions.
Returns
An owning Expected<IdDoc> encoded as TVMFFIAny, including errors.

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