Simple Virtual Machine A simple but flexible virtual machine

Loading...
Searching...
No Matches
Functions
SVM codes getters
SVM codes

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.
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.
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.
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.
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.
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.

## 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | name | The code name.
  [in] | source | The 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

  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | name | The code name.
  [in] | source | The 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

  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | name | The code name.
  [in] | source | The 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

  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | name | The code name.
  [in] | source | The code source.

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

Returns
  The executable SVM code.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when a parse error is detected.
  FAILURE | interruption when a label or a symbol is defined twice or not found.
  MEMORY | interruption when a plugin type does not exists or has no constant callback defined.
  PROCESSOR | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | name | The code name.
  [in] | source | The code source.

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

Returns
  The executable SVM code.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when a parse error is detected.
  FAILURE | interruption when a label or a symbol is defined twice or not found.
  MEMORY | interruption when a plugin type does not exists or has no constant callback defined.
  PROCESSOR | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | name | The code name.
  [in] | source | The code source.

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

Returns
  The executable SVM code.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when a parse error is detected.
  FAILURE | interruption when a label or a symbol is defined twice or not found.
  MEMORY | interruption when a plugin type does not exists or has no constant callback defined.
  PROCESSOR | interruption when a plugin instruction or interruption does not exists.