Table of Contents

Class EzrClass

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

The "type" type object? You know.

public class EzrClass : EzrRuntimeExecutable, IEzrMutableObject, IMutable<IEzrMutableObject>, IEzrObject
Inheritance
object
EzrClass
Implements
Inherited Members

Constructors

EzrClass(string?, Node, EzrClass[], bool, bool, Interpreter, RuntimeResult, Context, Position, Position)

Creates a new class.

public EzrClass(string? name, Node body, EzrClass[] parents, bool isReadOnly, bool isStatic, Interpreter interpreter, RuntimeResult result, Context parentContext, Position startPosition, Position endPosition)

Parameters

name string

The name of the executable.

body Node

The source code body of the executable.

parents EzrClass[]

The parents of the class.

isReadOnly bool

Is this a read-only class?

isStatic bool

Is this a static class?

interpreter Interpreter

Interpreter for executing the static body of the class.

result RuntimeResult

Runtime result for carrying errors.

parentContext Context

The parent context.

startPosition Position

The starting position of the object.

endPosition Position

The ending position of the object.

EzrClass(string?, Node, (string Name, Node Node)[], (Position StartPosition, Position EndPosition, string Name)?, (Position StartPosition, Position EndPosition, string Name)?, EzrClass[], Reference[], bool, bool, Context, Context, Position, Position)

Creates a new class from the innards of an existing one.

public EzrClass(string? name, Node body, (string Name, Node Node)[] parameters, (Position StartPosition, Position EndPosition, string Name)? extraKeywordArguments, (Position StartPosition, Position EndPosition, string Name)? extraPositionalArguments, EzrClass[] parents, Reference[] staticParentReferences, bool isReadOnly, bool isStatic, Context staticContext, Context parentContext, Position startPosition, Position endPosition)

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 class'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 class's extra keyword arguments.

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

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

parents EzrClass[]

The parents of the class.

staticParentReferences Reference[]

The references to the class's static parents.

isReadOnly bool

Is this a read-only class?

isStatic bool

Is this a static class?

staticContext Context

The internal static context.

parentContext Context

The parent context.

startPosition Position

The starting position of the object.

endPosition Position

The ending position of the object.

Fields

IsStatic

Is the class static?

public readonly bool IsStatic

Field Value

bool

Parents

The parents of the class.

public readonly EzrClass[] Parents

Field Value

EzrClass[]

StaticParentReferences

The references to the class's static parents.

public readonly Reference[] StaticParentReferences

Field Value

Reference[]

Properties

Tag

The tag of the type of this object, similar to C# namespace naming conventions.

public override string Tag { get; protected internal set; }

Property Value

string

TypeName

The name of the type of this object, in plain text, all lowercase. Spaces are allowed.

public override string TypeName { get; protected internal set; }

Property Value

string

Methods

AddParents(Reference[], Context, Interpreter, RuntimeResult)

private Reference[] AddParents(Reference[] arguments, Context context, Interpreter interpreter, RuntimeResult result)

Parameters

arguments Reference[]
context Context
interpreter Interpreter
result RuntimeResult

Returns

Reference[]

Remarks

Important

BUG: The name given to the parents is problematic, as two parents could have the same executable name.

AddStaticParents(RuntimeResult)

private void AddStaticParents(RuntimeResult result)

Parameters

result RuntimeResult

Remarks

Important

BUG: The name given to the parents is problematic, as two parents could have the same executable name.

DeepCopy(RuntimeResult)

Creates a deep copy of the IMutable<T>.

public IMutable<IEzrMutableObject>? DeepCopy(RuntimeResult result)

Parameters

result RuntimeResult

Runtime result for raising errors./

Returns

IMutable<IEzrMutableObject>

The copy, or, null if failed.

Remarks

The deep copy here means that all IMutable<T> properties and fields in the object are also copied.

Execute(Reference[], Interpreter, RuntimeResult)

Creates a new instance of the class.

public override void Execute(Reference[] arguments, Interpreter interpreter, RuntimeResult result)

Parameters

arguments Reference[]

The arguments of the execution.

interpreter Interpreter

The interpreter to be used in execution.

result RuntimeResult

Runtime result for carrying the result and any errors.

Execute(Reference[], Interpreter, RuntimeResult, bool)

Creates a new instance of the class.

private void Execute(Reference[] arguments, Interpreter interpreter, RuntimeResult result, bool ignoreExtraArguments)

Parameters

arguments Reference[]

The arguments of the execution.

interpreter Interpreter

The interpreter to be used in execution.

result RuntimeResult

Runtime result for carrying the result and any errors.

ignoreExtraArguments bool

Should the arguments checker ignore extra parameters?