Name
SPVM::Env - Execution Environment
Description
SPVM::Env
is the Env
class in the SPVM language.
The instance is an execution environemnt. It has the Native APIs and the data of class variables.
An instance of the Env
class is build by the get_env method in the Runtime class.
A call stack is build by the new_stack method in this class.
Usage
use Env;
my $env = $runtime->get_env;
my $stack = $env->new_stack;
Pointer
The Env
class is a pointer class.
Its insntace has a pointer to an object of the SPVM_ENV type.
Fields
runtime
has runtime : ro Runtime;
A runtime. The field type is the Runtime class.
Class Methods
native static method new : Env ($runtime = undef : Runtime);
Creates a new Env ojbect, and returns it.
Instance Methods
set_command_info
method set_command_info : void ($program_name : string, $argv : string[]);
Sets command line information.
call_init_methods
method call_init_methods : void ();
Calls all INIT blocks.
new_stack
method new_stack : Stack ();
Builds a call stack and returns it.
The return type is the Stack class.
get_exception
method get_exception : string ();
Gets the excetpion.
set_exception
method set_exception : void ($exception : string);
Sets an excetpion.
DESTROY
method DESTROY : void ();
The destructor.
See Also
Runtime
The build_runtime method in the Runtime class builds an executable environement.
Stack
The instance of the Stack class is build by the "new_stack" method in this class.
Copyright & License
Copyright (c) 2023 Yuki Kimoto
MIT License