unit Myc.Ast.Binding.Nodes; interface uses System.SysUtils, System.Classes, System.Generics.Collections, Myc.Data.Scalar, Myc.Data.Value, Myc.Ast.Nodes, Myc.Ast.Visitor, Myc.Ast.Scope, Myc.Ast.Types, Myc.Ast; type TBoundIdentifierNode = class(TIdentifierNode) private FAddress: TResolvedAddress; public constructor Create(const AUnboundNode: IIdentifierNode; const AAddress: TResolvedAddress); property Address: TResolvedAddress read FAddress; end; TBoundVariableDeclarationNode = class(TVariableDeclarationNode) private FIsBoxed: Boolean; public constructor Create(const AIdentifier: IIdentifierNode; AInitializer: IAstNode; AIsBoxed: Boolean); property IsBoxed: Boolean read FIsBoxed; end; TBoundLambdaExpressionNode = class(TLambdaExpressionNode) private FScopeDescriptor: IScopeDescriptor; FUpvalues: TArray; FHasNestedLambdas: Boolean; public constructor Create( const AUnboundNode: ILambdaExpressionNode; const ABody: IAstNode; const AParameters: TArray; const AScopeDescriptor: IScopeDescriptor; const AUpvalues: TArray; AHasNestedLambdas: Boolean ); property ScopeDescriptor: IScopeDescriptor read FScopeDescriptor; property Upvalues: TArray read FUpvalues; property HasNestedLambdas: Boolean read FHasNestedLambdas; end; TBoundFunctionCallNode = class(TFunctionCallNode) private FIsTailCall: Boolean; public constructor Create( const AUnboundNode: IFunctionCallNode; const ACallee: IAstNode; const AArguments: TArray; AIsTailCall: Boolean ); property IsTailCall: Boolean read FIsTailCall; end; TBoundRecordLiteralNode = class(TRecordLiteralNode) private FDefinition: IScalarRecordDefinition; public constructor Create(const AFields: TArray; const ADef: IScalarRecordDefinition); property Definition: IScalarRecordDefinition read FDefinition write FDefinition; end; // Represents a bound record literal that maps to a generic (non-scalar) record TBoundGenericRecordLiteralNode = class(TRecordLiteralNode) private FDefinition: IGenericRecordDefinition; public constructor Create(const AFields: TArray; const ADef: IGenericRecordDefinition); property Definition: IGenericRecordDefinition read FDefinition write FDefinition; end; implementation uses Myc.Data.Keyword; { TBoundIdentifierNode } constructor TBoundIdentifierNode.Create(const AUnboundNode: IIdentifierNode; const AAddress: TResolvedAddress); begin inherited Create(AUnboundNode.Name); FAddress := AAddress; end; { TBoundVariableDeclarationNode } constructor TBoundVariableDeclarationNode.Create(const AIdentifier: IIdentifierNode; AInitializer: IAstNode; AIsBoxed: Boolean); begin inherited Create(AIdentifier, AInitializer); FIsBoxed := AIsBoxed; end; { TBoundLambdaExpressionNode } constructor TBoundLambdaExpressionNode.Create( const AUnboundNode: ILambdaExpressionNode; const ABody: IAstNode; const AParameters: TArray; const AScopeDescriptor: IScopeDescriptor; const AUpvalues: TArray; AHasNestedLambdas: Boolean ); begin inherited Create(AParameters, ABody); FScopeDescriptor := AScopeDescriptor; FUpvalues := AUpvalues; FHasNestedLambdas := AHasNestedLambdas; end; { TBoundFunctionCallNode } constructor TBoundFunctionCallNode.Create( const AUnboundNode: IFunctionCallNode; const ACallee: IAstNode; const AArguments: TArray; AIsTailCall: Boolean ); begin inherited Create(ACallee, AArguments); FIsTailCall := AIsTailCall; end; { TBoundGenericRecordLiteralNode } constructor TBoundGenericRecordLiteralNode.Create(const AFields: TArray; const ADef: IGenericRecordDefinition); begin inherited Create(AFields); FDefinition := ADef; end; { TBoundRecordLiteralNode } constructor TBoundRecordLiteralNode.Create(const AFields: TArray; const ADef: IScalarRecordDefinition); begin inherited Create(AFields); FDefinition := ADef; end; end.