Name

SPVM::Native::Env - Execution Native::Environment

Description

SPVM::Native::Env is the Native::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 Native::Env class is build by the get_env method in the Native::Runtime class.

A call stack is build by the new_stack method in this class.

Usage

use Native::Env;

my $env = $runtime->get_env;

my $stack = $env->new_stack;

Pointer

The Native::Env class is a pointer class.

Its insntace has a pointer to an object of the SPVM_ENV type.

Fields

Class Methods

static method new : Native::Env ($compiler : Native::Compiler = undef);

Creates a new Native::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 : Native::Stack ();

Builds a call stack and returns it.

The return type is the Native::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

Native::Runtime

The get_runtime method in the Native::Runtime class builds an executable environement.

Native::Stack

The instance of the Native::Stack class is build by the "new_stack" method in this class.

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License