Table of Contents

Class EzrRuntimeExecutable

Namespace
EzrSquared.Runtime.Types.Executables
Assembly
ezrSquared-lib.dll

The base root class of all runtime executables.

public abstract class EzrRuntimeExecutable : EzrObject, IEzrObject
Inheritance
object
EzrRuntimeExecutable
Implements
Derived
Inherited Members

Constructors

EzrRuntimeExecutable(string?, Node, (string Name, Node Node)[], (Position StartPosition, Position EndPosition, string Name)?, (Position StartPosition, Position EndPosition, string Name)?, Context, Position, Position, Context?)

Creates a new executable object.

public EzrRuntimeExecutable(string? name, Node body, (string Name, Node Node)[] parameters, (Position StartPosition, Position EndPosition, string Name)? extraKeywordArguments, (Position StartPosition, Position EndPosition, string Name)? extraPositionalArguments, Context parentContext, Position startPosition, Position endPosition, Context? initializationContext = null)

Parameters

name string

The name of the executable.

body Node

The source code body of the executable.

parameters (string Name, Node Node)[]

The source code of the executable's parameters and their default values.

extraKeywordArguments (Position StartPosition, Position EndPosition, string Name)?

The position in source code and name of the variable for the executable's extra keyword arguments.

extraPositionalArguments (Position StartPosition, Position EndPosition, string Name)?

The position in source code and name of the variable for the executable's extra positional arguments.

parentContext Context

The parent context.

startPosition Position

The starting position of the object.

endPosition Position

The ending position of the object.

initializationContext Context

The internal context, if null, creates a new one.

Fields

Body

The source code body of the executable.

public readonly Node Body

Field Value

Node

ExecutableName

The name of the executable.

public readonly string ExecutableName

Field Value

string

IsAnonymous

Is the executable anonymous?

public readonly bool IsAnonymous

Field Value

bool

Properties

ExtraKeywordArguments

The position in source code and name of the variable for the executable's extra keyword arguments.

public (Position StartPosition, Position EndPosition, string Name)? ExtraKeywordArguments { get; protected internal set; }

Property Value

(Position StartPosition, Position EndPosition, string Name)?

ExtraPositionalArguments

The position in source code and name of the variable for the executable's extra positional arguments.

public (Position StartPosition, Position EndPosition, string Name)? ExtraPositionalArguments { get; protected internal set; }

Property Value

(Position StartPosition, Position EndPosition, string Name)?

Parameters

The name and source code of the executable's parameters and their default values.

public (string Name, Node Node)[] Parameters { get; protected internal set; }

Property Value

(string Name, Node Node)[]

Methods

CheckAndPopulateArguments(Reference[], Context, Interpreter, RuntimeResult, bool)

Checks if the given array of arguments conform to the executables parameters, and populates them in the given context.

protected internal void CheckAndPopulateArguments(Reference[] arguments, Context context, Interpreter interpreter, RuntimeResult result, bool ignoreExtraArguments)

Parameters

arguments Reference[]

The arguments to check.

context Context

The context to populate

interpreter Interpreter

The interpreter for executing parameter default values.

result RuntimeResult

Runtime result for carrying any errors.

ignoreExtraArguments bool

Should the checker ignore extra arguments?

ComparisonEqual(IEzrObject, RuntimeResult)

Compares the object to another, checks equality.

public override void ComparisonEqual(IEzrObject other, RuntimeResult result)

Parameters

other IEzrObject

The other object in the operation.

result RuntimeResult

Runtime result for carrying the result and any errors.

ComparisonNotEqual(IEzrObject, RuntimeResult)

Compares the object to another, checks unequality.

public override void ComparisonNotEqual(IEzrObject other, RuntimeResult result)

Parameters

other IEzrObject

The other object in the operation.

result RuntimeResult

Runtime result for carrying the result and any errors.

ComputeHashCode(RuntimeResult)

Evaluates the current object as its hash.

public override int ComputeHashCode(RuntimeResult result)

Parameters

result RuntimeResult

Runtime result for carrying any errors.

Returns

int

The evaluated value.

EvaluateBoolean(RuntimeResult)

Evaluates the current object as a boolean value.

public override bool EvaluateBoolean(RuntimeResult result)

Parameters

result RuntimeResult

Runtime result for carrying any errors.

Returns

bool

The evaluated value.

StrictEquals(IEzrObject, RuntimeResult)

Strictly compares the current object to another, taking into account inheritance.

public override bool StrictEquals(IEzrObject other, RuntimeResult result)

Parameters

other IEzrObject

The other object in the operation.

result RuntimeResult

Runtime result for carrying any errors.

Returns

bool

ToString(RuntimeResult)

Evaluates the current object as a string value.

public override string ToString(RuntimeResult result)

Parameters

result RuntimeResult

Runtime result for carrying any errors.

Returns

string

The evaluated value.