Simple Virtual Machine
A simple but flexible virtual machine
SVM codes getters

This module contains API functions to create SVM codes. More...

Functions

SVM_FUNCTION SVM_Code svm_code_new (const void *svm, const SVM_Value_String name, const SVM_Value_String source)
 This function creates a SVM code from two string values. More...
 
SVM_FUNCTION SVM_Code svm_code_new__string (const void *svm, const SVM_String name, const SVM_String source)
 This function creates a SVM code from two SVM_String. More...
 
SVM_FUNCTION SVM_Code svm_code_new__raw (const void *svm, const char *name, const char *source)
 This function creates a SVM code from two C nul-terminated strings. More...
 
SVM_FUNCTION SVM_Variable svm_code_compile (const void *svm, const SVM_Value_String name, const SVM_Value_String source)
 This function tries to create a SVM code from two string values. More...
 
SVM_FUNCTION SVM_Variable svm_code_compile__string (const void *svm, const SVM_String name, const SVM_String source)
 This function creates a SVM code from two SVM_String. More...
 
SVM_FUNCTION SVM_Variable svm_code_compile__raw (const void *svm, const char *name, const char *source)
 This function creates a SVM code from two C nul-terminated strings. More...
 

Detailed Description

This module contains API functions to create SVM codes.

Function Documentation

◆ svm_code_compile()

SVM_FUNCTION SVM_Variable svm_code_compile ( const void *  svm,
const SVM_Value_String  name,
const SVM_Value_String  source 
)

This function tries to create a SVM code from two string values.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]nameThe code name.
[in]sourceThe code source.

The source code is compiled and linked by the SVM code parser.

Returns
The executable SVM code (a SVM_Code) when the compilation succeed, or a string value (a SVM_Value_String) containing an error when it failed.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_code_compile__raw()

SVM_FUNCTION SVM_Variable svm_code_compile__raw ( const void *  svm,
const char *  name,
const char *  source 
)

This function creates a SVM code from two C nul-terminated strings.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]nameThe code name.
[in]sourceThe code source.

The source code is compiled and linked by the SVM code parser.

Returns
The executable SVM code (a SVM_Code) when the compilation succeed, or a string value (a SVM_Value_String) containing an error when it failed.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_code_compile__string()

SVM_FUNCTION SVM_Variable svm_code_compile__string ( const void *  svm,
const SVM_String  name,
const SVM_String  source 
)

This function creates a SVM code from two SVM_String.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]nameThe code name.
[in]sourceThe code source.

The source code is compiled and linked by the SVM code parser.

Returns
The executable SVM code (a SVM_Code) when the compilation succeed, or a string value (a SVM_Value_String) containing an error when it failed.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_code_new()

SVM_FUNCTION SVM_Code svm_code_new ( const void *  svm,
const SVM_Value_String  name,
const SVM_Value_String  source 
)

This function creates a SVM code from two string values.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]nameThe code name.
[in]sourceThe code source.

The source code is compiled and linked by the SVM code parser.

Returns
The executable SVM code.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when a parse error is detected.
FAILUREinterruption when a label or a symbol is defined twice or not found.
MEMORYinterruption when a plugin type does not exists or has no constant callback defined.
PROCESSORinterruption when a plugin instruction or interruption does not exists.

◆ svm_code_new__raw()

SVM_FUNCTION SVM_Code svm_code_new__raw ( const void *  svm,
const char *  name,
const char *  source 
)

This function creates a SVM code from two C nul-terminated strings.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]nameThe code name.
[in]sourceThe code source.

The source code is compiled and linked by the SVM code parser.

Returns
The executable SVM code.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when a parse error is detected.
FAILUREinterruption when a label or a symbol is defined twice or not found.
MEMORYinterruption when a plugin type does not exists or has no constant callback defined.
PROCESSORinterruption when a plugin instruction or interruption does not exists.

◆ svm_code_new__string()

SVM_FUNCTION SVM_Code svm_code_new__string ( const void *  svm,
const SVM_String  name,
const SVM_String  source 
)

This function creates a SVM code from two SVM_String.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]nameThe code name.
[in]sourceThe code source.

The source code is compiled and linked by the SVM code parser.

Returns
The executable SVM code.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when a parse error is detected.
FAILUREinterruption when a label or a symbol is defined twice or not found.
MEMORYinterruption when a plugin type does not exists or has no constant callback defined.
PROCESSORinterruption when a plugin instruction or interruption does not exists.