The ezr² Project 0.1.1
The codebase for the ezr² programming language.
Loading...
Searching...
No Matches
EzrSquared.Executor.CodeExecutor Class Reference

Utility to execute ezr² code under one static interpreter. More...

Static Public Member Functions

static void CreateRuntimeContext (string filePath)
 Creates the runtime context.
 
static void PopulateRuntimeContext ()
 Populates the runtime context with all built-ins.
 
static void AddToContext (Reference reference, string name)
 Adds the given reference to the runtime context.
 
static ExecutionResult Execute (string script)
 Executes the given script.
 

Static Public Attributes

static readonly Interpreter Interpreter = new()
 The static interpreter.
 

Static Private Attributes

static ? Context s_runtimeContext
 The runtime context, may be null.
 

Detailed Description

Utility to execute ezr² code under one static interpreter.

Member Function Documentation

◆ AddToContext()

static void EzrSquared.Executor.CodeExecutor.AddToContext ( Reference reference,
string name )
static

Adds the given reference to the runtime context.

Exceptions
NullReferenceExceptionThrown if the runtime context is null. Use CreateRuntimeContext(string) to initialize the runtime context.
Parameters
referenceThe reference to add.
nameThe name of the new symbol.

◆ CreateRuntimeContext()

static void EzrSquared.Executor.CodeExecutor.CreateRuntimeContext ( string filePath)
static

Creates the runtime context.

Parameters
filePathThe file path to the code file this context will be used to execute.

◆ Execute()

static ExecutionResult EzrSquared.Executor.CodeExecutor.Execute ( string script)
static

Executes the given script.

Parameters
scriptThe script to execute.
Returns
Exceptions
NullReferenceExceptionThrown if the runtime context is null. Use CreateRuntimeContext(string) to initialize the runtime context.

◆ PopulateRuntimeContext()

static void EzrSquared.Executor.CodeExecutor.PopulateRuntimeContext ( )
static

Populates the runtime context with all built-ins.

Exceptions
NullReferenceExceptionThrown if the runtime context is null. Use CreateRuntimeContext(string) to initialize the runtime context.

The documentation for this class was generated from the following file: