The ezr² Project 0.1.1
The codebase for the ezr² programming language.
Loading...
Searching...
No Matches
EzrSquared.Runtime.Nodes Namespace Reference

Classes

class  InvalidNode
 The dummy invalid Node structure. For returning instead of null if an SyntaxError occurs during parsing. More...
 

Functions

class Node (Position startPosition, Position endPosition)
 The representation of an ezr² source code construct. This is the base class of all nodes. Only for inheritance!
 
class ArrayLikeNode (List< Node > elements, bool createList, Position startPosition, Position endPosition)
 The Node structure for an arraylike (array or list).
 
class DictionaryNode (List<(Node Key, Node Value)> keyValuePairs, Position startPosition, Position endPosition)
 The Node structure for a dictionary.
 
class DefineBlockNode (Node body, AccessMod accessibilityModifiers, Position startPosition, Position endPosition)
 The Node structure for a define block.
 
class VariableAccessNode (Token name, AccessMod accessibilityModifiers, Position startPosition, Position endPosition)
 The Node structure for accesing a variable from the context.
 
class VariableAssignmentNode (Node variable, TokenType assignmentOperator, Node value, AccessMod accessibilityModifiers, Position startPosition, Position endPosition)
 The Node structure for assigning a value to a variable in the context.
 
class CountNode (Node to, Node? from, Node? step, Node? iterationVariable, Node body, Position startPosition, Position endPosition)
 The Node structure for a count expression.
 
class IfNode (List<(Node Condition, Node Body)> cases, Node? elseCase, Position startPosition, Position endPosition)
 The Node structure for an if expression.
 
class TryNode (Node block, List<(Node ErrorType, Node? Variable, Node Body)> cases,(Node? Variable, Node Body)? emptyCase, Position startPosition, Position endPosition)
 The Node structure for a try expression.
 
class WhileNode (Node condition, Node body, Position startPosition, Position endPosition)
 The Node structure for an while expression.
 
class CallNode (Node receiver, List< Node > arguments, Position startPosition, Position endPosition)
 The Node structure for a function call.
 
class ClassDefinitionNode (Node? name, AccessMod accessibilityModifiers, bool @readonly, List< Node > parents, Node body, Position startPosition, Position endPosition)
 The Node structure for a class definition.
 
class FunctionDefinitionNode (Node? name, AccessMod accessibilityModifiers, bool returnLast, List< Node > parameters, Node? keywordArguments, Node body, Position startPosition, Position endPosition)
 The Node structure for a function definition.
 
class IncludeNode (Node script, Node? subStructure, bool isDumped, Node? nickname, Position startPosition, Position endPosition)
 The Node structure for an include expression.
 
class ReturnNode (Node? value, bool returnLast, Position startPosition, Position endPosition)
 The Node structure for a return statement.
 
class BinaryOperationNode (Node left, Node right, TokenType @operator, Position startPosition, Position endPosition)
 The Node structure for a binary operation.
 
class UnaryOperationNode (Node operand, TokenType @operator, Position startPosition, Position endPosition)
 The Node structure for a unary operation.
 
class NoValueNode (TokenType valueType, Position startPosition, Position endPosition)
 The Node structure for a statement or expression without any value (used as skip and stop statement nodes).
 
class ValueNode (Token value, Position startPosition, Position endPosition)
 The Node structure of a simple value like literals and variables.
 

Function Documentation

◆ ArrayLikeNode()

class EzrSquared.Runtime.Nodes.ArrayLikeNode ( List< Node > elements,
bool createList,
Position startPosition,
Position endPosition )

The Node structure for an arraylike (array or list).

Parameters
elementsThe elements of the arraylike.
createListThe check for if the ArrayLikeNode should create a list instead of an array.
startPositionThe starting Position of the ArrayLikeNode.
endPositionThe ending Position of the ArrayLikeNode.

The elements of the arraylike.

The check for if the ArrayLikeNode should create a list instead of an array.

Creates a string representation of the ArrayLikeNode.
All fields excluding the start and end positions are included in the representation, like "ExampleNode(Property1, Property2)".

Returns
The string representation.

◆ BinaryOperationNode()

class EzrSquared.Runtime.Nodes.BinaryOperationNode ( Node left,
Node right,
TokenType @ operator,
Position startPosition,
Position endPosition )

The Node structure for a binary operation.

Parameters
leftThe first operand of the binary operation.
rightThe second operand of the binary operation.
operatorThe operator TokenType of the binary operation.
startPositionThe starting Position of the BinaryOperationNode.
endPositionThe ending Position of the BinaryOperationNode.

The first operand of the binary operation.

The second operand of the binary operation.

The operator TokenType of the binary operation.

Creates a string representation of the BinaryOperationNode.
All fields excluding the start and end positions are included in the representation, like "ExampleNode(Property1, Property2)".

Returns
The string representation.

◆ CallNode()

class EzrSquared.Runtime.Nodes.CallNode ( Node receiver,
List< Node > arguments,
Position startPosition,
Position endPosition )

The Node structure for a function call.

Parameters
receiverThe function/object to be called.
argumentsThe array of arguments.
startPositionThe starting Position of the CallNode.
endPositionThe ending Position of the CallNode.

The function/object to be called.

The array of arguments.

Creates a string representation of the CallNode.
All fields excluding the start and end positions are included in the representation, like "ExampleNode(Property1, Property2)".

Returns
The string representation.

◆ ClassDefinitionNode()

class EzrSquared.Runtime.Nodes.ClassDefinitionNode ( Node? name,
AccessMod accessibilityModifiers,
bool @ readonly,
List< Node > parents,
Node body,
Position startPosition,
Position endPosition )

The Node structure for a class definition.

Parameters
nameThe (optional) name of the class.
accessibilityModifiersThe accessibility modifiers for the class definition.
readonlyThe check for if the class should be declared read-only.
parentsThe parents of the class.
bodyThe body of the class.
startPositionThe starting Position of the ClassDefinitionNode.
endPositionThe ending Position of the ClassDefinitionNode.

The name of the class. May be null.

The accessibility modifiers for the class definition.

The check for if the class should be declared read-only.

The parents of the class.

The body of the class.

Creates a string representation of the ClassDefinitionNode.
All fields excluding the start and end positions are included in the representation, like "ExampleNode(Property1, Property2)".

Returns
The string representation.

◆ CountNode()

class EzrSquared.Runtime.Nodes.CountNode ( Node to,
Node? from,
Node? step,
Node? iterationVariable,
Node body,
Position startPosition,
Position endPosition )

The Node structure for a count expression.

Parameters
toThe amount to count to.
fromThe amount to count from - optional.
stepThe increment of each iteration - optional.
iterationVariableTThe variable to store the iteration number in - optional.
bodyThe body of the count loop.
startPositionThe starting Position of the CountNode.
endPositionThe ending Position of the CountNode.

The amount to count to.

The amount to count from - optional.

The increment of each iteration - optional.

The variable to store the iteration number in - optional.

The body of the count loop.

Creates a string representation of the CountNode.
All fields excluding the start and end positions are included in the representation, like "ExampleNode(Property1, Property2)".

Returns
The string representation.

◆ DefineBlockNode()

class EzrSquared.Runtime.Nodes.DefineBlockNode ( Node body,
AccessMod accessibilityModifiers,
Position startPosition,
Position endPosition )

The Node structure for a define block.

Parameters
bodyThe body of the block.
accessibilityModifiersThe accessibility modifiers for the define block.
startPositionThe starting Position of the DefineBlockNode.
endPositionThe ending Position of the DefineBlockNode.

The body of the block.

The accessibility modifiers of the define block.

Creates a string representation of the DefineBlockNode.
All fields excluding the start and end positions are included in the representation, like "ExampleNode(Property1, Property2)".

Returns
The string representation.

◆ DictionaryNode()

class EzrSquared.Runtime.Nodes.DictionaryNode ( List<(Node Key, Node Value)> keyValuePairs,
Position startPosition,
Position endPosition )

The Node structure for a dictionary.

Parameters
keyValuePairsThe key-value pairs of the dictionary.
startPositionThe starting Position of the DictionaryNode.
endPositionThe ending Position of the DictionaryNode.

The key-value pairs of the dictionary.

Creates a string representation of the DictionaryNode.
All fields excluding the start and end positions are included in the representation, like "ExampleNode(Property1, Property2)".

Returns
The string representation.

◆ FunctionDefinitionNode()

class EzrSquared.Runtime.Nodes.FunctionDefinitionNode ( Node? name,
AccessMod accessibilityModifiers,
bool returnLast,
List< Node > parameters,
Node? keywordArguments,
Node body,
Position startPosition,
Position endPosition )

The Node structure for a function definition.

Parameters
nameThe (optional) name of the function.
accessibilityModifiersThe accessibility modifiers for the function definition.
returnLastThe check for if the last expression of the function should be returned as its result. Only used in oneliners.
parametersThe parameters of the function.
keywordArgumentsThe reference to store the extra keyword arguments in.
bodyThe body of the function.
startPositionThe starting Position of the FunctionDefinitionNode.
endPositionThe ending Position of the FunctionDefinitionNode.

The (optional) name of the function.

The accessibility modifiers for the function definition.

The check for if the last expression of the function should be returned as its result. Only used in oneliners.

The parameters of the function.

The reference to store the extra keyword arguments in.

The body of the function.

Creates a string representation of the FunctionDefinitionNode.
All fields excluding the start and end positions are included in the representation, like "ExampleNode(Property1, Property2)".

Returns
The string representation.

◆ IfNode()

class EzrSquared.Runtime.Nodes.IfNode ( List<(Node Condition, Node Body)> cases,
Node? elseCase,
Position startPosition,
Position endPosition )

The Node structure for an if expression.

Parameters
casesThe cases of the if expression.
elseCaseThe body of the else case.
startPositionThe starting Position of the IfNode.
endPositionThe ending Position of the IfNode.

The cases of the if expression.

The body of the else case.

Creates a string representation of the IfNode.
All fields excluding the start and end positions are included in the representation, like "ExampleNode(Property1, Property2)".

Returns
The string representation.

◆ IncludeNode()

class EzrSquared.Runtime.Nodes.IncludeNode ( Node script,
Node? subStructure,
bool isDumped,
Node? nickname,
Position startPosition,
Position endPosition )

The Node structure for an include expression.

Parameters
scriptThe script to include.
subStructureThe (optional) specific sub-structure or object to be included from the script.
isDumpedSpecifies if all contents of the script need to be dumped into the current context.
nicknameThe (optional) nickname of the object to be included.
startPositionThe starting Position of the IncludeNode.
endPositionThe ending Position of the IncludeNode.

The script to include.

The (optional) specific sub-structure or object to be included from the script.

Specifies if all contents of the script need to be dumped into the current context.

The (optional) nickname of the object to be included.

Creates a string representation of the IncludeNode.
All fields excluding the start and end positions are included in the representation, like "ExampleNode(Property1, Property2)".

Returns
The string representation.

◆ Node()

class EzrSquared.Runtime.Nodes.Node ( Position startPosition,
Position endPosition )
abstract

The representation of an ezr² source code construct. This is the base class of all nodes. Only for inheritance!

Parameters
startPositionThe starting Position of the Node.
endPositionThe ending Position of the Node.

The starting Position of the Node.

The ending Position of the Node.

Creates a string representation of the Node.
All fields excluding the start and end positions are included in the representation, like "ExampleNode(Property1, Property2)".

Returns
The string representation.

◆ NoValueNode()

class EzrSquared.Runtime.Nodes.NoValueNode ( TokenType valueType,
Position startPosition,
Position endPosition )

The Node structure for a statement or expression without any value (used as skip and stop statement nodes).

Parameters
valueTypeThe identifying TokenType of the NoValueNode.
startPositionThe starting Position of the NoValueNode.
endPositionThe ending Position of the NoValueNode.

The identifying TokenType of the NoValueNode.

Creates a string representation of the NoValueNode.
All fields excluding the start and end positions are included in the representation, like "ExampleNode(Property1, Property2)".

Returns
The string representation.

◆ ReturnNode()

class EzrSquared.Runtime.Nodes.ReturnNode ( Node? value,
bool returnLast,
Position startPosition,
Position endPosition )

The Node structure for a return statement.

Parameters
valueThe optional value to be returned.
returnLastReturn the last element of Value, which should be a list or array.
startPositionThe starting Position of the ReturnNode.
endPositionThe ending Position of the ReturnNode.

The optional value to be returned.

Return the last element of Value, which should be a list or array.

Creates a string representation of the ReturnNode.
All fields excluding the start and end positions are included in the representation, like "ExampleNode(Property1, Property2)".

Returns
The string representation.

◆ TryNode()

class EzrSquared.Runtime.Nodes.TryNode ( Node block,
List<(Node ErrorType, Node? Variable, Node Body)> cases,
(Node? Variable, Node Body)? emptyCase,
Position startPosition,
Position endPosition )

The Node structure for a try expression.

Parameters
blockThe try block.
casesThe error cases of the try expression.
emptyCaseThe (optional) Node where the error will be stored and the body of the empty else case.
startPositionThe starting Position of the TryNode.
endPositionThe ending Position of the TryNode.

The try block.

The error cases of the try expression.

The (optional) Node where the error will be stored and the body of the empty else case.

Creates a string representation of the TryNode.
All fields excluding the start and end positions are included in the representation, like "ExampleNode(Property1, Property2)".

Returns
The string representation.

◆ UnaryOperationNode()

class EzrSquared.Runtime.Nodes.UnaryOperationNode ( Node operand,
TokenType @ operator,
Position startPosition,
Position endPosition )

The Node structure for a unary operation.

Parameters
operandThe operand of the unary operation.
operatorThe operator TokenType of the unary operation.
startPositionThe starting Position of the UnaryOperationNode.
endPositionThe ending Position of the UnaryOperationNode.

The operand of the unary operation.

The operator TokenType of the unary operation.

Creates a string representation of the UnaryOperationNode.
All fields excluding the start and end positions are included in the representation, like "ExampleNode(Property1, Property2)".

Returns
The string representation.

◆ ValueNode()

class EzrSquared.Runtime.Nodes.ValueNode ( Token value,
Position startPosition,
Position endPosition )

The Node structure of a simple value like literals and variables.

Parameters
valueThe Token value the ValueNode represents.
startPositionThe starting Position of the ValueNode.
endPositionThe ending Position of the ValueNode.

The value the ValueNode represents.

Creates a string representation of the ValueNode.
All fields excluding the start and end positions are included in the representation, like "ExampleNode(Property1, Property2)".

Returns
The string representation.

◆ VariableAccessNode()

class EzrSquared.Runtime.Nodes.VariableAccessNode ( Token name,
AccessMod accessibilityModifiers,
Position startPosition,
Position endPosition )

The Node structure for accesing a variable from the context.

Parameters
nameThe name of the variable, a Token object of type TokenType.Identifier.
accessibilityModifiersThe accessibility modifiers for the variable access operation.
startPositionThe starting Position of the VariableAccessNode.
endPositionThe ending Position of the VariableAccessNode.

The name of the variable to access.

The accessibility modifiers for the variable access operation.

Creates a string representation of the VariableAccessNode.
All fields excluding the start and end positions are included in the representation, like "ExampleNode(Property1, Property2)".

Returns
The string representation.

◆ VariableAssignmentNode()

class EzrSquared.Runtime.Nodes.VariableAssignmentNode ( Node variable,
TokenType assignmentOperator,
Node value,
AccessMod accessibilityModifiers,
Position startPosition,
Position endPosition )

The Node structure for assigning a value to a variable in the context.

Parameters
variableThe variable to be assigned to.
assignmentOperatorThe operation TokenType, if not TokenType.Colon, between the existing value of variable and value . The result of the operation will be assigned to variable .
valueThe value to be assigned to Variable.
accessibilityModifiersThe accessibility modifiers for the variable assignment operation.
startPositionThe starting Position of the VariableAssignmentNode.
endPositionThe ending Position of the VariableAssignmentNode.

The variable to be assigned to.

The operation TokenType, if not TokenType.Colon, between the existing value of Variable and Value. The result of the operation will be assigned to Variable.

The value to be assigned to Variable.

The accessibility modifiers for the variable assignment operation.

Creates a string representation of the VariableAssignmentNode.
All fields excluding the start and end positions are included in the representation, like "ExampleNode(Property1, Property2)".

Returns
The string representation.

◆ WhileNode()

class EzrSquared.Runtime.Nodes.WhileNode ( Node condition,
Node body,
Position startPosition,
Position endPosition )

The Node structure for an while expression.

Parameters
conditionThe condition of the while loop.
bodyThe body of the while loop.
startPositionThe starting Position of the WhileNode.
endPositionThe ending Position of the WhileNode.

The condition of the while loop.

The body of the while loop.

Creates a string representation of the WhileNode.
All fields excluding the start and end positions are included in the representation, like "ExampleNode(Property1, Property2)".

Returns
The string representation.