Table of Contents

Class ExecutionResult

Namespace
EzrSquared.Executor
Assembly
ezrSquared-lib.dll

The result of a code execution operation.

public class ExecutionResult
Inheritance
object
ExecutionResult

Constructors

ExecutionResult(Token[], Node, RuntimeResult)

Creates a new execution result.

public ExecutionResult(Token[] tokens, Node ast, RuntimeResult result)

Parameters

tokens Token[]

The tokens returned by the lexer.

ast Node

The executed AST node.

result RuntimeResult

The runtime result carrying the result or error.

ExecutionResult(Token[], EzrSyntaxError)

Creates a new execution result, which failed at lexing.

public ExecutionResult(Token[] tokens, EzrSyntaxError error)

Parameters

tokens Token[]

The tokens returned by the lexer.

error EzrSyntaxError

The error.

ExecutionResult(Token[], ParseResult)

Creates a new execution result, which failed at parsing.

public ExecutionResult(Token[] tokens, ParseResult result)

Parameters

tokens Token[]

The tokens returned by the lexer.

result ParseResult

The parse result carrying the error.

Fields

Ast

The Abstract Syntax Tree of the executed script.

public readonly Node? Ast

Field Value

Node

LexerError

Any error that occurred during lexing.

public readonly EzrSyntaxError? LexerError

Field Value

EzrSyntaxError

ParseError

Any error that occurred during parsing.

public readonly EzrSyntaxError? ParseError

Field Value

EzrSyntaxError

Result

The result of the execution.

public readonly IEzrObject? Result

Field Value

IEzrObject

Success

Was the execution successful?

public readonly bool Success

Field Value

bool

Tokens

The tokens making up the executed script.

public readonly Token[] Tokens

Field Value

Token[]

Methods

GetErrorMessage()

Returns the error message of the execution, be it a lexing, parsing or interpretation error.

public string GetErrorMessage()

Returns

string

The error message.