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
-
objectEzrClass
- 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
stringThe name of the executable.
body
NodeThe source code body of the executable.
parents
EzrClass[]The parents of the class.
isReadOnly
boolIs this a read-only class?
isStatic
boolIs this a static class?
interpreter
InterpreterInterpreter for executing the static body of the class.
result
RuntimeResultRuntime result for carrying errors.
parentContext
ContextThe parent context.
startPosition
PositionThe starting position of the object.
endPosition
PositionThe 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
stringThe name of the executable.
body
NodeThe 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
boolIs this a read-only class?
isStatic
boolIs this a static class?
staticContext
ContextThe internal static context.
parentContext
ContextThe parent context.
startPosition
PositionThe starting position of the object.
endPosition
PositionThe 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
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
Contextinterpreter
Interpreterresult
RuntimeResult
Returns
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
RuntimeResultRuntime 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
InterpreterThe interpreter to be used in execution.
result
RuntimeResultRuntime 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
InterpreterThe interpreter to be used in execution.
result
RuntimeResultRuntime result for carrying the result and any errors.
ignoreExtraArguments
boolShould the arguments checker ignore extra parameters?