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
-
objectEzrRuntimeExecutable
- 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
stringThe name of the executable.
body
NodeThe 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
ContextThe parent context.
startPosition
PositionThe starting position of the object.
endPosition
PositionThe ending position of the object.
initializationContext
ContextThe internal context, if null, creates a new one.
Fields
Body
The source code body of the executable.
public readonly Node Body
Field Value
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
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
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
ContextThe context to populate
interpreter
InterpreterThe interpreter for executing parameter default values.
result
RuntimeResultRuntime result for carrying any errors.
ignoreExtraArguments
boolShould 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
IEzrObjectThe other object in the operation.
result
RuntimeResultRuntime 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
IEzrObjectThe other object in the operation.
result
RuntimeResultRuntime 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
RuntimeResultRuntime 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
RuntimeResultRuntime 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
IEzrObjectThe other object in the operation.
result
RuntimeResultRuntime 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
RuntimeResultRuntime result for carrying any errors.
Returns
- string
The evaluated value.