Ast control refactoring
This commit is contained in:
@@ -13,6 +13,7 @@ uses
|
||||
FMX.Controls,
|
||||
FMX.Graphics,
|
||||
FMX.Objects,
|
||||
Myc.Ast,
|
||||
Myc.Ast.Nodes;
|
||||
|
||||
type
|
||||
@@ -42,7 +43,7 @@ type
|
||||
procedure DblClick; override;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
procedure BuildTree(const Root: IAstNode; const Position: TPointF; AMode: TVisualizationMode);
|
||||
procedure BuildTree(const RootNode: IAstNode; const RootScope: IExecutionScope; const Position: TPointF; AMode: TVisualizationMode);
|
||||
function GetChildrenMatrix(var Matrix: TMatrix; var Simple: Boolean): Boolean; override;
|
||||
function Zoom(Factor: Single): Boolean;
|
||||
|
||||
@@ -105,11 +106,21 @@ begin
|
||||
FZoom := 1.0;
|
||||
end;
|
||||
|
||||
procedure TAuraWorkspace.BuildTree(const Root: IAstNode; const Position: TPointF; AMode: TVisualizationMode);
|
||||
procedure TAuraWorkspace.BuildTree(
|
||||
const RootNode: IAstNode;
|
||||
const RootScope: IExecutionScope;
|
||||
const Position: TPointF;
|
||||
AMode: TVisualizationMode
|
||||
);
|
||||
var
|
||||
connections: TList<TPinConnection>;
|
||||
rootDescriptor: IScopeDescriptor;
|
||||
begin
|
||||
var connections := TList<TPinConnection>.Create;
|
||||
connections := TList<TPinConnection>.Create;
|
||||
try
|
||||
Root.Accept(TAstToAuraNodeVisitor.Create(Self, Self, Position, connections, nil, AMode));
|
||||
// Create the scope descriptor from the execution scope provided by the binder.
|
||||
rootDescriptor := TAst.CreateDescriptor(RootScope);
|
||||
RootNode.Accept(TAstToAuraNodeVisitor.Create(Self, Self, Position, connections, nil, AMode, nil, nil, rootDescriptor));
|
||||
FConnections := FConnections + connections.ToArray;
|
||||
finally
|
||||
connections.Free;
|
||||
|
||||
Reference in New Issue
Block a user