Xmlb.Opcode¶
Fields¶
None
Methods¶
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Xmlb.Opcode¶
- classmethod kind_from_string(str)¶
- Parameters:
str (
str
) – a string, e.g.FUNC
- Returns:
a
Xmlb.OpcodeKind
, e.g.Xmlb.OpcodeKind.TEXT
- Return type:
Converts a string to an opcode kind.
New in version 0.1.1.
- classmethod kind_to_string(kind)¶
- Parameters:
kind (
Xmlb.OpcodeKind
) – aXmlb.OpcodeKind
, e.g.Xmlb.OpcodeKind.FUNCTION
- Returns:
opcode kind, e.g.
FUNC
- Return type:
Converts the opcode kind to a string.
New in version 0.1.1.
- cmp_str()¶
- Returns:
#:obj:True if this opcode can be compared as an string
- Return type:
Checks if the opcode can be compared using the string value.
New in version 0.1.1.
- cmp_val()¶
- Returns:
#:obj:True if this opcode can be compared as an integer
- Return type:
Checks if the opcode can be compared using the integer value.
New in version 0.1.1.
- func_init(func)¶
- Parameters:
func (
int
) – a function index
Initialises a stack allocated
Xmlb.Opcode
to contain a specific function. Custom functions can be registered using xb_machine_add_func() and retrieved using xb_machine_opcode_func_new().New in version 0.2.0.
- get_kind()¶
- Returns:
- Return type:
Gets the opcode kind.
New in version 0.1.1.
- get_str()¶
-
Gets the string value stored on the opcode.
New in version 0.1.1.
- get_val()¶
- Returns:
value, or 0 for unset.
- Return type:
Gets the integer value stored in the opcode. This may be a function ID, a index into the string table or a literal integer.
New in version 0.1.1.
- integer_init(val)¶
- Parameters:
val (
int
) – a integer value
Initialises a stack allocated
Xmlb.Opcode
to contain an integer literal.New in version 0.2.0.
- text_init(str)¶
- Parameters:
str (
str
) – a string
Initialises a stack allocated
Xmlb.Opcode
to contain a text literal. The str argument is copied internally and is not tied to the lifecycle of theXmlb.Opcode
.New in version 0.2.0.
- text_init_static(str)¶
- Parameters:
str (
str
) – a string
Initialises a stack allocated
Xmlb.Opcode
to contain a text literal, where str is either static text or will outlive theXmlb.Opcode
lifecycle.New in version 0.2.0.
- text_init_steal(str)¶
- Parameters:
str (
str
) – a string
Initialises a stack allocated
Xmlb.Opcode
to contain a text literal, stealing the str. Once the opcode is finalizedGLib.free
() will be called on str.New in version 0.2.0.