Struct endbasic_core::exec::Machine [−][src]
pub struct Machine { /* fields omitted */ }
Expand description
Executes an EndBASIC program and tracks its state.
Implementations
Registers the given clearable.
In the common case, functions and commands hold a reference to the out-of-machine state
they interact with. This state is invisible from here, but we may need to have access
to it to reset it as part of the clear
operation. In those cases, such state must be
registered via this hook.
Registers the given builtin command, which must not yet be registered.
Registers the given builtin function, which must not yet be registered.
Tells the machine to stop execution at the next statement boundary.
The exec()
call that’s stopped by this invocation will return the code
given to this
call.
Obtains immutable access to the state of the symbols.
Obtains mutable access to the state of the symbols.
Retrieves the variable name
as a boolean. Fails if it is some other type or if it’s not
defined.
Retrieves the variable name
as an integer. Fails if it is some other type or if it’s not
defined.
Retrieves the variable name
as a string. Fails if it is some other type or if it’s not
defined.
Defines a new array name
of type subtype
with dimensions
. The array must not yet
exist, and the name may not overlap function or variable names.
Executes a program extracted from the input
readable.
Note that this does not consume self
. As a result, it is possible to execute multiple
different programs on the same machine, all sharing state.