Simple Virtual Machine A simple but flexible virtual machine

Functions
SVM marker parameters
SVM parameters

This module contains API functions to handle SVM marker parameters. More...

## Functions
SVM_FUNCTION SVM_Boolean | svm_parameter_type_is_marker (const void *svm, const SVM_Parameter parameter)
| This function checks whether a parameter contains a marker. More...
SVM_FUNCTION SVM_String | svm_parameter_marker_get (const void *svm, const SVM_Parameter parameter)
| This function converts a parameter into a marker. More...
SVM_FUNCTION SVM_Parameter | svm_parameter_marker_new (const void *svm, const SVM_String marker)
| This function creates a parameter from a marker string. More...
SVM_FUNCTION SVM_Parameter | svm_parameter_marker_new__raw (const void *svm, const char *marker)
| This function creates a parameter from a marker string. More...
SVM_FUNCTION SVM_Index | svm_parameter_marker_find (const void *svm, const SVM_Size argc, const SVM_Parameter argv[], const SVM_Index start, const SVM_String marker)
| This function looks up for a specific marker in a parameter array. More...
SVM_FUNCTION SVM_Index | svm_parameter_marker_find__raw (const void *svm, const SVM_Size argc, const SVM_Parameter argv[], const SVM_Index start, const char *marker)
| This function looks up for a specific marker in a parameter array. More...
SVM_FUNCTION SVM_Index | svm_parameter_marker_find_separator (const void *svm, const SVM_Size argc, const SVM_Parameter argv[], const SVM_Index start)
| This function looks up the next separator marker in a parameter array. More...
SVM_FUNCTION SVM_Index | svm_parameter_marker_find_closing (const void *svm, const SVM_Size argc, const SVM_Parameter argv[], const SVM_Index opening)
| This function looks up for the closing marker corresponding to an opening separator in a parameter array. More...

## Detailed Description

This module contains API functions to handle SVM marker parameters.

## Function Documentation

## ◆ svm_parameter_marker_find()

SVM_FUNCTION SVM_Index svm_parameter_marker_find | ( | const void * | svm,
|  | const SVM_Size | argc,
|  | const SVM_Parameter | argv[],
|  | const SVM_Index | start,
|  | const SVM_String | marker
| ) |  |

This function looks up for a specific marker in a parameter array.

A marker is a symbol among = < <= << <> >> => > { } , ;

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | argc | The size of the parameter array.
  [in] | argv | The parameter array.
  [in] | start | The first index to search from.
  [in] | marker | The marker to look up.

Returns
  The index of the first found occurence, or argc when not found.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the start is outside parameter array valid indexes.
  FAILURE | interruption when the marker is invalid.

## ◆ svm_parameter_marker_find__raw()

SVM_FUNCTION SVM_Index svm_parameter_marker_find__raw | ( | const void * | svm,
|  | const SVM_Size | argc,
|  | const SVM_Parameter | argv[],
|  | const SVM_Index | start,
|  | const char * | marker
| ) |  |

This function looks up for a specific marker in a parameter array.

A marker is a symbol among = < <= << <> >> => > { } , ;

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | argc | The size of the parameter array.
  [in] | argv | The parameter array.
  [in] | start | The first index to search from.
  [in] | marker | The marker to look up.

Returns
  The index of the first found occurence, or argc when not found.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the start is outside parameter array valid indexes.
  FAILURE | interruption when the marker is invalid.

## ◆ svm_parameter_marker_find_closing()

SVM_FUNCTION SVM_Index svm_parameter_marker_find_closing | ( | const void * | svm,
|  | const SVM_Size | argc,
|  | const SVM_Parameter | argv[],
|  | const SVM_Index | opening
| ) |  |

This function looks up for the closing marker corresponding to an opening separator in a parameter array.

A closing marker is a symbol among:

- > for < as opening marker,
- >> for << as opening marker,
- => for <= as opening marker,
- } for { as opening marker.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | argc | The size of the parameter array.
  [in] | argv | The parameter array.
  [in] | opening | The index of the opening marker.

The function will skip nested opening and closing markers.

Returns
  The index of the closing marker occurence, or argc when not found.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the start is outside parameter array valid indexes.
  FAILURE | interruption when the start is not an opening marker.

## ◆ svm_parameter_marker_find_separator()

SVM_FUNCTION SVM_Index svm_parameter_marker_find_separator | ( | const void * | svm,
|  | const SVM_Size | argc,
|  | const SVM_Parameter | argv[],
|  | const SVM_Index | start
| ) |  |

This function looks up the next separator marker in a parameter array.

A separator marker is a symbol among = <> , ;

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | argc | The size of the parameter array.
  [in] | argv | The parameter array.
  [in] | start | The first index to search from.

Returns
  The index of the first found occurence, or argc when not found.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the start is outside parameter array valid indexes.

## ◆ svm_parameter_marker_get()

SVM_FUNCTION SVM_String svm_parameter_marker_get | ( | const void * | svm,
|  | const SVM_Parameter | parameter
| ) |  |

This function converts a parameter into a marker.

A marker is a symbol among = < <= << <> >> => > { } , ;

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | parameter | The callback parameter to convert.

Returns
  The marker as a SVM_String.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the parameter does not contain a marker.

See also
  svm_parameter_type_is_marker

## ◆ svm_parameter_marker_new()

SVM_FUNCTION SVM_Parameter svm_parameter_marker_new | ( | const void * | svm,
|  | const SVM_String | marker
| ) |  |

This function creates a parameter from a marker string.

A marker is a symbol among = < <= << <> >> => > { } , ;

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | marker | The marker to be passed as a parameter.

Returns
  A parameter containing the marker.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)

## ◆ svm_parameter_marker_new__raw()

SVM_FUNCTION SVM_Parameter svm_parameter_marker_new__raw | ( | const void * | svm,
|  | const char * | marker
| ) |  |

This function creates a parameter from a marker string.

A marker is a symbol among = < <= << <> >> => > { } , ;

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | marker | The marker to be passed as a parameter.

Returns
  A parameter containing the marker.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)

## ◆ svm_parameter_type_is_marker()

SVM_FUNCTION SVM_Boolean svm_parameter_type_is_marker | ( | const void * | svm,
|  | const SVM_Parameter | parameter
| ) |  |

This function checks whether a parameter contains a marker.

A marker is a symbol among = < <= << <> >> => > { } , ;

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | parameter | The callback parameter to check.

Returns
  TRUE if the parameter contains a marker, FALSE otherwise.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)