diff --git a/ASTPlayground/ASTPlayground.delphilsp.json b/ASTPlayground/ASTPlayground.delphilsp.json
index 4c43439..455951b 100644
--- a/ASTPlayground/ASTPlayground.delphilsp.json
+++ b/ASTPlayground/ASTPlayground.delphilsp.json
@@ -1 +1 @@
-{ "settings": { "project": "file:///T%3A/Myc/ASTPlayground/ASTPlayground.dpr", "dllname": "dcc64370.dll", "dccOptions": "-$D0 -$L- -$Y- --no-config -Q -TX.exe -AGenerics.Collections=System.Generics.Collections;Generics.Defaults=System.Generics.Defaults;WinTypes=Winapi.Windows;WinProcs=Winapi.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE -DRELEASE;;FRAMEWORK_FMX -E.\\Win64\\Release -I\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\lib\\Win64\\release\\DE\";T:\\Myc\\Src\\Data;T:\\Myc\\Src\\AST;T:\\Myc\\Src;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\lib\\Win64\\release\";C:\\Users\\Brummel\\Documents\\Embarcadero\\Studio\\37.0\\Imports\\Win64;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\Imports\";C:\\Users\\Public\\Documents\\Embarcadero\\Studio\\37.0\\Dcp\\Win64;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\include\";S:\\sc_famos_src\\svn_vcl\\Virtual-TreeView\\Source;S:\\sc_famos_src\\svn_vcl\\cpxedits;S:\\sc_famos_src\\svn_vcl\\dzChart;S:\\sc_famos_src\\svn_vcl\\eaeditor;S:\\sc_famos_src\\svn_vcl\\FamosEvents;S:\\sc_famos_src\\svn_vcl\\HTML_Viewer\\source;S:\\sc_famos_src\\svn_vcl\\Myc_ChartEdit;S:\\sc_famos_src\\svn_vcl\\Myc_HemiDrag;S:\\sc_famos_src\\svn_vcl\\Myc_SplitControl;S:\\sc_famos_src\\svn_vcl\\plotter;S:\\sc_famos_src\\svn_vcl\\SimpleIPC;S:\\sc_famos_src\\svn_vcl\\SynEdit-master\\Source;S:\\sc_famos_src\\svn_vcl\\ValEdits;S:\\sc_famos_src\\svn_vcl\\ZipMaster;S:\\sc_famos_src\\svn_common\\Myc_VecMath;\"C:\\Program Files (x86)\\DevExpress VCL\\Library\\RS28\\Win64\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressCore Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressCommon Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressGDI+ Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressLibrary\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\XP Theme Manager\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressLayout Control\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressPageControl\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressEditors Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressDocking Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressBars\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressOfficeCore Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressMemData\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressDataController\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressNavBar\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressSkins Library\\Sources\";S:\\3rdParty\\FastMM5;C:\\Users\\Brummel\\AppData\\Local\\Programs\\TestInsight\\Source;T:\\Myc\\Src;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\source\\DUnitX\" -LEC:\\Users\\Public\\Documents\\Embarcadero\\Studio\\37.0\\Bpl\\Win64 -LNC:\\Users\\Public\\Documents\\Embarcadero\\Studio\\37.0\\Dcp\\Win64 -NU.\\Win64\\Release -NSWinapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;System;Xml;Data;Datasnap;Web;Soap; -OT:\\Myc\\Src\\Data;T:\\Myc\\Src\\AST;T:\\Myc\\Src;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\lib\\Win64\\release\";C:\\Users\\Brummel\\Documents\\Embarcadero\\Studio\\37.0\\Imports\\Win64;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\Imports\";C:\\Users\\Public\\Documents\\Embarcadero\\Studio\\37.0\\Dcp\\Win64;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\include\";S:\\sc_famos_src\\svn_vcl\\Virtual-TreeView\\Source;S:\\sc_famos_src\\svn_vcl\\cpxedits;S:\\sc_famos_src\\svn_vcl\\dzChart;S:\\sc_famos_src\\svn_vcl\\eaeditor;S:\\sc_famos_src\\svn_vcl\\FamosEvents;S:\\sc_famos_src\\svn_vcl\\HTML_Viewer\\source;S:\\sc_famos_src\\svn_vcl\\Myc_ChartEdit;S:\\sc_famos_src\\svn_vcl\\Myc_HemiDrag;S:\\sc_famos_src\\svn_vcl\\Myc_SplitControl;S:\\sc_famos_src\\svn_vcl\\plotter;S:\\sc_famos_src\\svn_vcl\\SimpleIPC;S:\\sc_famos_src\\svn_vcl\\SynEdit-master\\Source;S:\\sc_famos_src\\svn_vcl\\ValEdits;S:\\sc_famos_src\\svn_vcl\\ZipMaster;S:\\sc_famos_src\\svn_common\\Myc_VecMath;\"C:\\Program Files (x86)\\DevExpress VCL\\Library\\RS28\\Win64\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressCore Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressCommon Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressGDI+ Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressLibrary\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\XP Theme Manager\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressLayout Control\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressPageControl\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressEditors Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressDocking Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressBars\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressOfficeCore Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressMemData\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressDataController\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressNavBar\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressSkins Library\\Sources\";S:\\3rdParty\\FastMM5;C:\\Users\\Brummel\\AppData\\Local\\Programs\\TestInsight\\Source;T:\\Myc\\Src;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\source\\DUnitX\" -R\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\lib\\Win64\\release\\DE\";T:\\Myc\\Src\\Data;T:\\Myc\\Src\\AST;T:\\Myc\\Src;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\lib\\Win64\\release\";C:\\Users\\Brummel\\Documents\\Embarcadero\\Studio\\37.0\\Imports\\Win64;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\Imports\";C:\\Users\\Public\\Documents\\Embarcadero\\Studio\\37.0\\Dcp\\Win64;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\include\";S:\\sc_famos_src\\svn_vcl\\Virtual-TreeView\\Source;S:\\sc_famos_src\\svn_vcl\\cpxedits;S:\\sc_famos_src\\svn_vcl\\dzChart;S:\\sc_famos_src\\svn_vcl\\eaeditor;S:\\sc_famos_src\\svn_vcl\\FamosEvents;S:\\sc_famos_src\\svn_vcl\\HTML_Viewer\\source;S:\\sc_famos_src\\svn_vcl\\Myc_ChartEdit;S:\\sc_famos_src\\svn_vcl\\Myc_HemiDrag;S:\\sc_famos_src\\svn_vcl\\Myc_SplitControl;S:\\sc_famos_src\\svn_vcl\\plotter;S:\\sc_famos_src\\svn_vcl\\SimpleIPC;S:\\sc_famos_src\\svn_vcl\\SynEdit-master\\Source;S:\\sc_famos_src\\svn_vcl\\ValEdits;S:\\sc_famos_src\\svn_vcl\\ZipMaster;S:\\sc_famos_src\\svn_common\\Myc_VecMath;\"C:\\Program Files (x86)\\DevExpress VCL\\Library\\RS28\\Win64\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressCore Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressCommon Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressGDI+ Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressLibrary\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\XP Theme Manager\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressLayout Control\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressPageControl\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressEditors Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressDocking Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressBars\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressOfficeCore Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressMemData\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressDataController\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressNavBar\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressSkins Library\\Sources\";S:\\3rdParty\\FastMM5;C:\\Users\\Brummel\\AppData\\Local\\Programs\\TestInsight\\Source;T:\\Myc\\Src;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\source\\DUnitX\" -U\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\lib\\Win64\\release\\DE\";T:\\Myc\\Src\\Data;T:\\Myc\\Src\\AST;T:\\Myc\\Src;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\lib\\Win64\\release\";C:\\Users\\Brummel\\Documents\\Embarcadero\\Studio\\37.0\\Imports\\Win64;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\Imports\";C:\\Users\\Public\\Documents\\Embarcadero\\Studio\\37.0\\Dcp\\Win64;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\include\";S:\\sc_famos_src\\svn_vcl\\Virtual-TreeView\\Source;S:\\sc_famos_src\\svn_vcl\\cpxedits;S:\\sc_famos_src\\svn_vcl\\dzChart;S:\\sc_famos_src\\svn_vcl\\eaeditor;S:\\sc_famos_src\\svn_vcl\\FamosEvents;S:\\sc_famos_src\\svn_vcl\\HTML_Viewer\\source;S:\\sc_famos_src\\svn_vcl\\Myc_ChartEdit;S:\\sc_famos_src\\svn_vcl\\Myc_HemiDrag;S:\\sc_famos_src\\svn_vcl\\Myc_SplitControl;S:\\sc_famos_src\\svn_vcl\\plotter;S:\\sc_famos_src\\svn_vcl\\SimpleIPC;S:\\sc_famos_src\\svn_vcl\\SynEdit-master\\Source;S:\\sc_famos_src\\svn_vcl\\ValEdits;S:\\sc_famos_src\\svn_vcl\\ZipMaster;S:\\sc_famos_src\\svn_common\\Myc_VecMath;\"C:\\Program Files (x86)\\DevExpress VCL\\Library\\RS28\\Win64\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressCore Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressCommon Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressGDI+ Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressLibrary\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\XP Theme Manager\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressLayout Control\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressPageControl\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressEditors Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressDocking Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressBars\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressOfficeCore Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressMemData\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressDataController\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressNavBar\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressSkins Library\\Sources\";S:\\3rdParty\\FastMM5;C:\\Users\\Brummel\\AppData\\Local\\Programs\\TestInsight\\Source;T:\\Myc\\Src;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\source\\DUnitX\" -NBC:\\Users\\Public\\Documents\\Embarcadero\\Studio\\37.0\\Dcp\\Win64 -NHC:\\Users\\Public\\Documents\\Embarcadero\\Studio\\37.0\\hpp\\Win64 -NO.\\Win64\\Release -LU" , "projectFiles":[ { "name": "MainForm", "file": "file:///T%3A/Myc/ASTPlayground/MainForm.pas" }, { "name": "Myc.Ast.Evaluator", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.Evaluator.pas" }, { "name": "Myc.Ast.Nodes", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.Nodes.pas" }, { "name": "Myc.Ast.Scope", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.Scope.pas" }, { "name": "Myc.Data.Value", "file": "file:///T%3A/Myc/ASTPlayground/Myc.Data.Value.pas" }, { "name": "Myc.Ast.Debugger", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.Debugger.pas" }, { "name": "Myc.Ast.Visitor", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.Visitor.pas" }, { "name": "Myc.Ast.Binding", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.Binding.pas" }, { "name": "Myc.Ast.RTL", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.RTL.pas" }, { "name": "Myc.Ast.Dumper", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.Dumper.pas" }, { "name": "Myc.Ast.RTL.Core", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.RTL.Core.pas" }, { "name": "Myc.Fmx.AstEditor.Node", "file": "file:///T%3A/Myc/ASTPlayground/Myc.Fmx.AstEditor.Node.pas" }, { "name": "Myc.Fmx.AstEditor.Workspace", "file": "file:///T%3A/Myc/ASTPlayground/Myc.Fmx.AstEditor.Workspace.pas" }, { "name": "Myc.Fmx.AstEditor.Text", "file": "file:///T%3A/Myc/ASTPlayground/Myc.Fmx.AstEditor.Text.pas" }, { "name": "Myc.Utils", "file": "file:///T%3A/Myc/Src/Myc.Utils.pas" }, { "name": "Myc.Ast.Script", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.Script.pas" }, { "name": "Myc.Ast.Types", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.Types.pas" }, { "name": "Myc.Data.Keyword", "file": "file:///T%3A/Myc/Src/Data/Myc.Data.Keyword.pas" }, { "name": "Myc.Ast.MacroExpander", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.MacroExpander.pas" }, { "name": "Myc.Ast.TypeChecker", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.TypeChecker.pas" }, { "name": "Myc.Ast.Lowering", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.Lowering.pas" }, { "name": "Myc.Ast.Compiler.TCO", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.Compiler.TCO.pas" } ] , "includeDCUsInUsesCompletion": true, "enableKeyWordCompletion": false, "browsingPaths": [ "file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/OCX/Servers","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/SOURCE/VCL","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/rtl/common","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/SOURCE/RTL/SYS","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/rtl/win","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/rtl/win/winrt","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/ToolsAPI","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/SOURCE/IBX","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/Internet","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/SOURCE/PROPERTY%20EDITORS","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/soap","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/SOURCE/XML","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/Indy10/Core","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/Indy10/System","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/Indy10/Protocols","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/fmx","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/databinding/components","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/databinding/engine","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/databinding/graph","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data/ado","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data/cloud","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data/datasnap","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data/dbx","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data/dsnap","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data/vclctrls","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data/datasnap/connectors","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data/datasnap/proxygen","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/DataExplorer","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/DUnit/Contrib/DUnitWizard/Source/Common","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/DUnit/Contrib/DUnitWizard/Source/Common/dunit","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/DUnit/Contrib/DUnitWizard/Source/DelphiExperts/Common","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/DUnit/Contrib/DUnitWizard/Source/DelphiExperts/DUnitProject","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/DUnit/Contrib/DUnitWizard/Source/DelphiExperts/DUnitProject/dunit","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/DUnit/src","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/DUnit/tests","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/Experts","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/indy/abstraction","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/indy/implementation","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/indyimpl","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/Property%20Editors/Indy10","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/soap/wsdlimporter","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/Visualizers","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/DUnit/Contrib/XMLReporting","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/DUnit/Contrib/XPGen","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data/rest","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data/firedac","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/tethering","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/DUnitX","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data/ems","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/rtl/net","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/FlatBox2D","file:///C%3A/Users/Public/Documents/Embarcadero/Studio/37.0/Dcp/%25PLATFORM%25","file:///%25TP%25/runtime/vcl","file:///S%3A/sc_famos_src/svn_vcl/cpxedits","file:///S%3A/sc_famos_src/svn_vcl/dzChart","file:///S%3A/sc_famos_src/svn_vcl/eaeditor","file:///S%3A/sc_famos_src/svn_vcl/FamosEvents","file:///S%3A/sc_famos_src/svn_vcl/HTML_Viewer/source","file:///S%3A/sc_famos_src/svn_vcl/Myc_ChartEdit","file:///S%3A/sc_famos_src/svn_vcl/Myc_HemiDrag","file:///S%3A/sc_famos_src/svn_vcl/Myc_SplitControl","file:///S%3A/sc_famos_src/svn_vcl/NiceChart","file:///S%3A/sc_famos_src/svn_vcl/plotter","file:///S%3A/sc_famos_src/svn_vcl/SimpleIPC","file:///S%3A/sc_famos_src/svn_vcl/SynEdit-master/Source","file:///S%3A/sc_famos_src/svn_vcl/ValEdits","file:///S%3A/sc_famos_src/svn_vcl/ZipMaster","file:///S%3A/sc_famos_src/svn_vcl/ZipMaster/zlib","file:///S%3A/sc_famos_src/svn_vcl/ZipMaster/zlib/win32","file:///S%3A/sc_famos_src/svn_vcl/Virtual-TreeView/Source","file:///S%3A/sc_famos_src/svn_common/caHelpSys","file:///S%3A/sc_famos_src/svn_common/Misc","file:///S%3A/sc_famos_src/svn_common/Myc_VecMath","file:///S%3A/sc_famos_src/svn_common/PascalScript/source","file:///S%3A/sc_famos_src/svn_common/TreeBase","file:///S%3A/sc_famos_src/svn_common/TreeBase/Medien","file:///S%3A/3rdParty/spring4d/Source","file:///S%3A/3rdParty/spring4d/Source/Base","file:///S%3A/3rdParty/spring4d/Source/Base/Collections","file:///S%3A/3rdParty/spring4d/Source/Base/Logging","file:///S%3A/3rdParty/spring4d/Source/Base/Patches","file:///S%3A/3rdParty/spring4d/Source/Core/Container","file:///S%3A/3rdParty/spring4d/Source/Core/Interception","file:///S%3A/3rdParty/spring4d/Source/Core/Logging","file:///S%3A/3rdParty/spring4d/Source/Core/Mocking","file:///S%3A/3rdParty/spring4d/Source/Core/Services","file:///S%3A/3rdParty/spring4d/Source/Extensions/Cryptography","file:///S%3A/3rdParty/spring4d/Source/Extensions/Utils","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressCore%20Library/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressCommon%20Library/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressGDI%2B%20Library/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressLibrary/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/XP%20Theme%20Manager/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressLayout%20Control/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressPageControl/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressEditors%20Library/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressDocking%20Library/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressBars/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressOfficeCore%20Library/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressMemData/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressDataController/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressNavBar/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressSkins%20Library/Sources","file:///T%3A/Myc/Src","file:///T%3A/Myc/Src/Data","file:///T%3A/Myc/Src/AST" ] , "CommonAppData": "file:///C%3A/Users/Brummel/AppData/Roaming/Embarcadero/BDS/37.0/" , "Templates": "file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/ObjRepos/" } }
\ No newline at end of file
+{ "settings": { "project": "file:///T%3A/Myc/ASTPlayground/ASTPlayground.dpr", "dllname": "dcc64370.dll", "dccOptions": "-$O- -$W+ --inline:off -$R+ -$Q+ --no-config -Q -TX.exe -AGenerics.Collections=System.Generics.Collections;Generics.Defaults=System.Generics.Defaults;WinTypes=Winapi.Windows;WinProcs=Winapi.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE -DDEBUG;;FRAMEWORK_FMX -E.\\Win64\\Debug -I\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\lib\\Win64\\debug\\DE\";\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\lib\\Win64\\debug\";\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\lib\\Win64\\release\\DE\";T:\\Myc\\Src\\Data;T:\\Myc\\Src\\AST;T:\\Myc\\Src;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\lib\\Win64\\release\";C:\\Users\\Brummel\\Documents\\Embarcadero\\Studio\\37.0\\Imports\\Win64;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\Imports\";C:\\Users\\Public\\Documents\\Embarcadero\\Studio\\37.0\\Dcp\\Win64;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\include\";S:\\sc_famos_src\\svn_vcl\\Virtual-TreeView\\Source;S:\\sc_famos_src\\svn_vcl\\cpxedits;S:\\sc_famos_src\\svn_vcl\\dzChart;S:\\sc_famos_src\\svn_vcl\\eaeditor;S:\\sc_famos_src\\svn_vcl\\FamosEvents;S:\\sc_famos_src\\svn_vcl\\HTML_Viewer\\source;S:\\sc_famos_src\\svn_vcl\\Myc_ChartEdit;S:\\sc_famos_src\\svn_vcl\\Myc_HemiDrag;S:\\sc_famos_src\\svn_vcl\\Myc_SplitControl;S:\\sc_famos_src\\svn_vcl\\plotter;S:\\sc_famos_src\\svn_vcl\\SimpleIPC;S:\\sc_famos_src\\svn_vcl\\SynEdit-master\\Source;S:\\sc_famos_src\\svn_vcl\\ValEdits;S:\\sc_famos_src\\svn_vcl\\ZipMaster;S:\\sc_famos_src\\svn_common\\Myc_VecMath;\"C:\\Program Files (x86)\\DevExpress VCL\\Library\\RS28\\Win64\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressCore Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressCommon Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressGDI+ Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressLibrary\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\XP Theme Manager\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressLayout Control\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressPageControl\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressEditors Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressDocking Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressBars\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressOfficeCore Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressMemData\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressDataController\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressNavBar\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressSkins Library\\Sources\";S:\\3rdParty\\FastMM5;C:\\Users\\Brummel\\AppData\\Local\\Programs\\TestInsight\\Source;T:\\Myc\\Src;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\source\\DUnitX\" -LEC:\\Users\\Public\\Documents\\Embarcadero\\Studio\\37.0\\Bpl\\Win64 -LNC:\\Users\\Public\\Documents\\Embarcadero\\Studio\\37.0\\Dcp\\Win64 -NU.\\Win64\\Debug -NSWinapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;System;Xml;Data;Datasnap;Web;Soap; -OT:\\Myc\\Src\\Data;T:\\Myc\\Src\\AST;T:\\Myc\\Src;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\lib\\Win64\\release\";C:\\Users\\Brummel\\Documents\\Embarcadero\\Studio\\37.0\\Imports\\Win64;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\Imports\";C:\\Users\\Public\\Documents\\Embarcadero\\Studio\\37.0\\Dcp\\Win64;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\include\";S:\\sc_famos_src\\svn_vcl\\Virtual-TreeView\\Source;S:\\sc_famos_src\\svn_vcl\\cpxedits;S:\\sc_famos_src\\svn_vcl\\dzChart;S:\\sc_famos_src\\svn_vcl\\eaeditor;S:\\sc_famos_src\\svn_vcl\\FamosEvents;S:\\sc_famos_src\\svn_vcl\\HTML_Viewer\\source;S:\\sc_famos_src\\svn_vcl\\Myc_ChartEdit;S:\\sc_famos_src\\svn_vcl\\Myc_HemiDrag;S:\\sc_famos_src\\svn_vcl\\Myc_SplitControl;S:\\sc_famos_src\\svn_vcl\\plotter;S:\\sc_famos_src\\svn_vcl\\SimpleIPC;S:\\sc_famos_src\\svn_vcl\\SynEdit-master\\Source;S:\\sc_famos_src\\svn_vcl\\ValEdits;S:\\sc_famos_src\\svn_vcl\\ZipMaster;S:\\sc_famos_src\\svn_common\\Myc_VecMath;\"C:\\Program Files (x86)\\DevExpress VCL\\Library\\RS28\\Win64\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressCore Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressCommon Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressGDI+ Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressLibrary\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\XP Theme Manager\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressLayout Control\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressPageControl\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressEditors Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressDocking Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressBars\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressOfficeCore Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressMemData\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressDataController\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressNavBar\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressSkins Library\\Sources\";S:\\3rdParty\\FastMM5;C:\\Users\\Brummel\\AppData\\Local\\Programs\\TestInsight\\Source;T:\\Myc\\Src;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\source\\DUnitX\" -R\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\lib\\Win64\\release\\DE\";T:\\Myc\\Src\\Data;T:\\Myc\\Src\\AST;T:\\Myc\\Src;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\lib\\Win64\\release\";C:\\Users\\Brummel\\Documents\\Embarcadero\\Studio\\37.0\\Imports\\Win64;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\Imports\";C:\\Users\\Public\\Documents\\Embarcadero\\Studio\\37.0\\Dcp\\Win64;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\include\";S:\\sc_famos_src\\svn_vcl\\Virtual-TreeView\\Source;S:\\sc_famos_src\\svn_vcl\\cpxedits;S:\\sc_famos_src\\svn_vcl\\dzChart;S:\\sc_famos_src\\svn_vcl\\eaeditor;S:\\sc_famos_src\\svn_vcl\\FamosEvents;S:\\sc_famos_src\\svn_vcl\\HTML_Viewer\\source;S:\\sc_famos_src\\svn_vcl\\Myc_ChartEdit;S:\\sc_famos_src\\svn_vcl\\Myc_HemiDrag;S:\\sc_famos_src\\svn_vcl\\Myc_SplitControl;S:\\sc_famos_src\\svn_vcl\\plotter;S:\\sc_famos_src\\svn_vcl\\SimpleIPC;S:\\sc_famos_src\\svn_vcl\\SynEdit-master\\Source;S:\\sc_famos_src\\svn_vcl\\ValEdits;S:\\sc_famos_src\\svn_vcl\\ZipMaster;S:\\sc_famos_src\\svn_common\\Myc_VecMath;\"C:\\Program Files (x86)\\DevExpress VCL\\Library\\RS28\\Win64\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressCore Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressCommon Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressGDI+ Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressLibrary\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\XP Theme Manager\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressLayout Control\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressPageControl\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressEditors Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressDocking Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressBars\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressOfficeCore Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressMemData\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressDataController\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressNavBar\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressSkins Library\\Sources\";S:\\3rdParty\\FastMM5;C:\\Users\\Brummel\\AppData\\Local\\Programs\\TestInsight\\Source;T:\\Myc\\Src;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\source\\DUnitX\" -U\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\lib\\Win64\\debug\\DE\";\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\lib\\Win64\\debug\";\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\lib\\Win64\\release\\DE\";T:\\Myc\\Src\\Data;T:\\Myc\\Src\\AST;T:\\Myc\\Src;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\lib\\Win64\\release\";C:\\Users\\Brummel\\Documents\\Embarcadero\\Studio\\37.0\\Imports\\Win64;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\Imports\";C:\\Users\\Public\\Documents\\Embarcadero\\Studio\\37.0\\Dcp\\Win64;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\include\";S:\\sc_famos_src\\svn_vcl\\Virtual-TreeView\\Source;S:\\sc_famos_src\\svn_vcl\\cpxedits;S:\\sc_famos_src\\svn_vcl\\dzChart;S:\\sc_famos_src\\svn_vcl\\eaeditor;S:\\sc_famos_src\\svn_vcl\\FamosEvents;S:\\sc_famos_src\\svn_vcl\\HTML_Viewer\\source;S:\\sc_famos_src\\svn_vcl\\Myc_ChartEdit;S:\\sc_famos_src\\svn_vcl\\Myc_HemiDrag;S:\\sc_famos_src\\svn_vcl\\Myc_SplitControl;S:\\sc_famos_src\\svn_vcl\\plotter;S:\\sc_famos_src\\svn_vcl\\SimpleIPC;S:\\sc_famos_src\\svn_vcl\\SynEdit-master\\Source;S:\\sc_famos_src\\svn_vcl\\ValEdits;S:\\sc_famos_src\\svn_vcl\\ZipMaster;S:\\sc_famos_src\\svn_common\\Myc_VecMath;\"C:\\Program Files (x86)\\DevExpress VCL\\Library\\RS28\\Win64\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressCore Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressCommon Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressGDI+ Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressLibrary\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\XP Theme Manager\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressLayout Control\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressPageControl\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressEditors Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressDocking Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressBars\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressOfficeCore Library\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressMemData\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressDataController\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressNavBar\\Sources\";\"C:\\Program Files (x86)\\DevExpress VCL\\ExpressSkins Library\\Sources\";S:\\3rdParty\\FastMM5;C:\\Users\\Brummel\\AppData\\Local\\Programs\\TestInsight\\Source;T:\\Myc\\Src;\"c:\\program files (x86)\\embarcadero\\studio\\37.0\\source\\DUnitX\" -V -VN -VR -NBC:\\Users\\Public\\Documents\\Embarcadero\\Studio\\37.0\\Dcp\\Win64 -NHC:\\Users\\Public\\Documents\\Embarcadero\\Studio\\37.0\\hpp\\Win64 -NO.\\Win64\\Debug -LU" , "projectFiles":[ { "name": "MainForm", "file": "file:///T%3A/Myc/ASTPlayground/MainForm.pas" }, { "name": "Myc.Ast.Evaluator", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.Evaluator.pas" }, { "name": "Myc.Ast.Nodes", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.Nodes.pas" }, { "name": "Myc.Ast.Scope", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.Scope.pas" }, { "name": "Myc.Data.Value", "file": "file:///T%3A/Myc/ASTPlayground/Myc.Data.Value.pas" }, { "name": "Myc.Ast.Debugger", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.Debugger.pas" }, { "name": "Myc.Ast.Visitor", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.Visitor.pas" }, { "name": "Myc.Ast.Binding", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.Binding.pas" }, { "name": "Myc.Ast.RTL", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.RTL.pas" }, { "name": "Myc.Ast.Dumper", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.Dumper.pas" }, { "name": "Myc.Ast.RTL.Core", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.RTL.Core.pas" }, { "name": "Myc.Fmx.AstEditor.Node", "file": "file:///T%3A/Myc/ASTPlayground/Myc.Fmx.AstEditor.Node.pas" }, { "name": "Myc.Fmx.AstEditor.Workspace", "file": "file:///T%3A/Myc/ASTPlayground/Myc.Fmx.AstEditor.Workspace.pas" }, { "name": "Myc.Fmx.AstEditor.Text", "file": "file:///T%3A/Myc/ASTPlayground/Myc.Fmx.AstEditor.Text.pas" }, { "name": "Myc.Utils", "file": "file:///T%3A/Myc/Src/Myc.Utils.pas" }, { "name": "Myc.Ast.Script", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.Script.pas" }, { "name": "Myc.Ast.Types", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.Types.pas" }, { "name": "Myc.Data.Keyword", "file": "file:///T%3A/Myc/Src/Data/Myc.Data.Keyword.pas" }, { "name": "Myc.Ast.MacroExpander", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.MacroExpander.pas" }, { "name": "Myc.Ast.TypeChecker", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.TypeChecker.pas" }, { "name": "Myc.Ast.Lowering", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.Lowering.pas" }, { "name": "Myc.Ast.Compiler.TCO", "file": "file:///T%3A/Myc/Src/AST/Myc.Ast.Compiler.TCO.pas" } ] , "includeDCUsInUsesCompletion": true, "enableKeyWordCompletion": false, "browsingPaths": [ "file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/OCX/Servers","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/SOURCE/VCL","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/rtl/common","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/SOURCE/RTL/SYS","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/rtl/win","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/rtl/win/winrt","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/ToolsAPI","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/SOURCE/IBX","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/Internet","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/SOURCE/PROPERTY%20EDITORS","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/soap","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/SOURCE/XML","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/Indy10/Core","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/Indy10/System","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/Indy10/Protocols","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/fmx","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/databinding/components","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/databinding/engine","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/databinding/graph","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data/ado","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data/cloud","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data/datasnap","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data/dbx","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data/dsnap","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data/vclctrls","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data/datasnap/connectors","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data/datasnap/proxygen","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/DataExplorer","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/DUnit/Contrib/DUnitWizard/Source/Common","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/DUnit/Contrib/DUnitWizard/Source/Common/dunit","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/DUnit/Contrib/DUnitWizard/Source/DelphiExperts/Common","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/DUnit/Contrib/DUnitWizard/Source/DelphiExperts/DUnitProject","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/DUnit/Contrib/DUnitWizard/Source/DelphiExperts/DUnitProject/dunit","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/DUnit/src","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/DUnit/tests","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/Experts","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/indy/abstraction","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/indy/implementation","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/indyimpl","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/Property%20Editors/Indy10","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/soap/wsdlimporter","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/Visualizers","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/DUnit/Contrib/XMLReporting","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/DUnit/Contrib/XPGen","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data/rest","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data/firedac","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/tethering","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/DUnitX","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/data/ems","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/rtl/net","file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/source/FlatBox2D","file:///C%3A/Users/Public/Documents/Embarcadero/Studio/37.0/Dcp/%25PLATFORM%25","file:///%25TP%25/runtime/vcl","file:///S%3A/sc_famos_src/svn_vcl/cpxedits","file:///S%3A/sc_famos_src/svn_vcl/dzChart","file:///S%3A/sc_famos_src/svn_vcl/eaeditor","file:///S%3A/sc_famos_src/svn_vcl/FamosEvents","file:///S%3A/sc_famos_src/svn_vcl/HTML_Viewer/source","file:///S%3A/sc_famos_src/svn_vcl/Myc_ChartEdit","file:///S%3A/sc_famos_src/svn_vcl/Myc_HemiDrag","file:///S%3A/sc_famos_src/svn_vcl/Myc_SplitControl","file:///S%3A/sc_famos_src/svn_vcl/NiceChart","file:///S%3A/sc_famos_src/svn_vcl/plotter","file:///S%3A/sc_famos_src/svn_vcl/SimpleIPC","file:///S%3A/sc_famos_src/svn_vcl/SynEdit-master/Source","file:///S%3A/sc_famos_src/svn_vcl/ValEdits","file:///S%3A/sc_famos_src/svn_vcl/ZipMaster","file:///S%3A/sc_famos_src/svn_vcl/ZipMaster/zlib","file:///S%3A/sc_famos_src/svn_vcl/ZipMaster/zlib/win32","file:///S%3A/sc_famos_src/svn_vcl/Virtual-TreeView/Source","file:///S%3A/sc_famos_src/svn_common/caHelpSys","file:///S%3A/sc_famos_src/svn_common/Misc","file:///S%3A/sc_famos_src/svn_common/Myc_VecMath","file:///S%3A/sc_famos_src/svn_common/PascalScript/source","file:///S%3A/sc_famos_src/svn_common/TreeBase","file:///S%3A/sc_famos_src/svn_common/TreeBase/Medien","file:///S%3A/3rdParty/spring4d/Source","file:///S%3A/3rdParty/spring4d/Source/Base","file:///S%3A/3rdParty/spring4d/Source/Base/Collections","file:///S%3A/3rdParty/spring4d/Source/Base/Logging","file:///S%3A/3rdParty/spring4d/Source/Base/Patches","file:///S%3A/3rdParty/spring4d/Source/Core/Container","file:///S%3A/3rdParty/spring4d/Source/Core/Interception","file:///S%3A/3rdParty/spring4d/Source/Core/Logging","file:///S%3A/3rdParty/spring4d/Source/Core/Mocking","file:///S%3A/3rdParty/spring4d/Source/Core/Services","file:///S%3A/3rdParty/spring4d/Source/Extensions/Cryptography","file:///S%3A/3rdParty/spring4d/Source/Extensions/Utils","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressCore%20Library/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressCommon%20Library/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressGDI%2B%20Library/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressLibrary/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/XP%20Theme%20Manager/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressLayout%20Control/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressPageControl/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressEditors%20Library/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressDocking%20Library/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressBars/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressOfficeCore%20Library/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressMemData/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressDataController/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressNavBar/Sources","file:///C%3A/Program%20Files%20%28x86%29/DevExpress%20VCL/ExpressSkins%20Library/Sources","file:///T%3A/Myc/Src","file:///T%3A/Myc/Src/Data","file:///T%3A/Myc/Src/AST" ] , "CommonAppData": "file:///C%3A/Users/Brummel/AppData/Roaming/Embarcadero/BDS/37.0/" , "Templates": "file:///c%3A/program%20files%20%28x86%29/embarcadero/studio/37.0/ObjRepos/" } }
\ No newline at end of file
diff --git a/ASTPlayground/ASTPlayground.dproj b/ASTPlayground/ASTPlayground.dproj
index 0c4b837..811aca7 100644
--- a/ASTPlayground/ASTPlayground.dproj
+++ b/ASTPlayground/ASTPlayground.dproj
@@ -4,7 +4,7 @@
20.3
FMX
True
- Release
+ Debug
Win64
ASTPlayground
2
diff --git a/ASTPlayground/MainForm.fmx b/ASTPlayground/MainForm.fmx
index 5d3eec7..2b14982 100644
--- a/ASTPlayground/MainForm.fmx
+++ b/ASTPlayground/MainForm.fmx
@@ -234,8 +234,29 @@ object Form1: TForm1
object ScriptMemo: TMemo
Touch.InteractiveGestures = [Pan, LongTap, DoubleTap]
DataDetectorTypes = []
+ Lines.Strings = (
+ '(do'
+ '(defmacro repeat [n body]'
+ ' `(do'
+ ' (def loop (fn [counter]'
+ ' (if (> counter 0)'
+ ' (do'
+ ' ~body'
+ ' (recur (- counter 1))'
+ ' )'
+ ' (do'
+ ' )'
+ ' )'
+ ' ))'
+ ' (loop ~n)'
+ ' )'
+ ')'
+ ''
+ '(repeat 5 "hi")'
+ ')')
StyledSettings = [Size, Style, FontColor]
TextSettings.Font.Family = 'Consolas'
+ OnChange = ScriptMemoChange
OnChangeTracking = ScriptMemoChange
Align = Right
Position.X = 920.000000000000000000
diff --git a/ASTPlayground/MainForm.pas b/ASTPlayground/MainForm.pas
index d39ff95..fac5f0b 100644
--- a/ASTPlayground/MainForm.pas
+++ b/ASTPlayground/MainForm.pas
@@ -1348,14 +1348,16 @@ procedure TForm1.ShowVizualization(X, Y: Single);
begin
FWorkspace.DeleteChildren;
- if FCurrAst <> nil then
- begin
- FWorkspace.Build(FCurrAst, TPointF.Create(X, Y));
- end
- else if FCurrUnboundAst <> nil then
- begin
- FWorkspace.Build(FCurrUnboundAst, TPointF.Create(X, Y));
- end;
+ FWorkspace.Build(FCurrUnboundAst, TPointF.Create(X, Y));
+ //
+ // if FCurrAst <> nil then
+ // begin
+ // FWorkspace.Build(FCurrAst, TPointF.Create(X, Y));
+ // end
+ // else if FCurrUnboundAst <> nil then
+ // begin
+ // FWorkspace.Build(FCurrUnboundAst, TPointF.Create(X, Y));
+ // end;
end;
end.
diff --git a/ASTPlayground/Myc.Fmx.AstEditor.Node.pas b/ASTPlayground/Myc.Fmx.AstEditor.Node.pas
index f922fff..428fb25 100644
--- a/ASTPlayground/Myc.Fmx.AstEditor.Node.pas
+++ b/ASTPlayground/Myc.Fmx.AstEditor.Node.pas
@@ -32,7 +32,20 @@ const
cMinNodeHeight = 10;
type
- TAuraNode = class;
+ TAuraNode = class; // Forward declaration
+
+ // This aggregate interface encapsulates all node-specific logic.
+ IAuraNodeHandler = interface
+ ['{B66291B7-14A1-4638-927A-05B1623C83A6}']
+ // Gets the original logical AST node
+ function GetAstNode: IAstNode;
+ // Creates the specific FMX UI for this node
+ procedure BuildUI(OwnerNode: TAuraNode);
+ // Reconstructs the logical AST node from the FMX UI state
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
+ // The original logical AST node
+ property Node: IAstNode read GetAstNode;
+ end;
IAstVisualizer = interface
{$region 'private'}
@@ -154,31 +167,36 @@ type
// If true, the node is drawn without a border and with a transparent background.
FFrameless: Boolean;
FVisualizer: IAstVisualizer;
+ FHandler: IAuraNodeHandler; // *** NEW: Strategy/Aggregate ***
procedure SetBackgroundColor(const Value: TAlphaColor);
procedure SetBorderColor(const Value: TAlphaColor);
procedure SetBorderWidth(const Value: Single);
procedure SetBorderRadius(const Value: Single);
procedure SetFrameless(const Value: Boolean);
+ function GetNode: IAstNode;
protected
procedure Paint; override;
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Single); override;
procedure MouseMove(Shift: TShiftState; X, Y: Single); override;
procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Single); override;
- property Visualizer: IAstVisualizer read FVisualizer;
- procedure SetupNode; virtual;
+ procedure SetupNode;
function AddLabel(Parent: TControl; const Txt: String): TLabel;
function AddContainer(Parent: TControl; Orientation: TLayoutOrientation; Alignment: TLayoutAlignment): TAutoFitControl;
function AddExpr(Parent: TControl; const Title: String; const Node: IAstNode): TAuraNode;
public
- constructor Create(const AVisualizer: IAstVisualizer); reintroduce;
+ constructor Create(const AVisualizer: IAstVisualizer; const AHandler: IAuraNodeHandler); reintroduce;
destructor Destroy; override;
procedure AfterConstruction; override;
- // Creates an AST from the visualization
- function CreateAst: IAstNode; virtual;
+ // *** CHANGED: Now non-virtual, delegates to handler ***
+ function CreateAst: IAstNode;
+
+ property Visualizer: IAstVisualizer read FVisualizer;
+ // *** NEW: Access to the original logical node via the handler ***
+ property Node: IAstNode read GetNode;
published
// Custom border properties
@@ -222,323 +240,320 @@ type
property OnMouseLeave;
end;
- TAuraConstantNode = class(TAuraNode)
+implementation
+
+// We declare the handler classes here in the implementation
+// as they are private details of the visualizer.
+
+type
+ { TConstantNodeHandler }
+ TConstantNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: IConstantNode;
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: IConstantNode);
-
- function CreateAst: IAstNode; override;
-
- property Node: IConstantNode read FNode;
+ constructor Create(const ANode: IConstantNode);
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraIdentifierNode = class(TAuraNode)
+ { TAuraIdentifierNode }
+ TIdentifierNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: IIdentifierNode;
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: IIdentifierNode);
- function CreateAst: IAstNode; override;
-
- property Node: IIdentifierNode read FNode;
+ constructor Create(const ANode: IIdentifierNode);
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraKeywordNode = class(TAuraNode)
+ { TAuraKeywordNode }
+ TKeywordNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: IKeywordNode;
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: IKeywordNode);
- function CreateAst: IAstNode; override;
- property Node: IKeywordNode read FNode;
+ constructor Create(const ANode: IKeywordNode);
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraBinaryExpressionNode = class(TAuraNode)
+ { TAuraBinaryExpressionNode }
+ TBinaryExpressionNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: IBinaryExpressionNode;
- function GetLeftNode: TAuraNode;
- function GetRightNode: TAuraNode;
- protected
- procedure SetupNode; override;
+ FLeftNode: TAuraNode; // Stores the visual child
+ FRightNode: TAuraNode; // Stores the visual child
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: IBinaryExpressionNode);
- function CreateAst: IAstNode; override;
-
- property LeftNode: TAuraNode read GetLeftNode;
- property RightNode: TAuraNode read GetRightNode;
-
- property Node: IBinaryExpressionNode read FNode;
+ constructor Create(const ANode: IBinaryExpressionNode);
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraBlockExpressionNode = class(TAuraNode)
+ { TAuraBlockExpressionNode }
+ TBlockExpressionNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: IBlockExpressionNode;
FChildNodes: TList; // To store children for CreateAst
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: IBlockExpressionNode);
+ constructor Create(const ANode: IBlockExpressionNode);
destructor Destroy; override;
- function CreateAst: IAstNode; override;
- property Node: IBlockExpressionNode read FNode;
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraUnaryExpressionNode = class(TAuraNode)
+ { TAuraUnaryExpressionNode }
+ TUnaryExpressionNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: IUnaryExpressionNode;
FChildNode: TAuraNode; // Stores the single child
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: IUnaryExpressionNode);
- function CreateAst: IAstNode; override;
- property Node: IUnaryExpressionNode read FNode;
+ constructor Create(const ANode: IUnaryExpressionNode);
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraIfExpressionNode = class(TAuraNode)
+ { TAuraIfExpressionNode }
+ TIfExpressionNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: IIfExpressionNode;
FConditionNode: TAuraNode;
FThenNode: TAuraNode;
FElseNode: TAuraNode; // Can be nil
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: IIfExpressionNode);
- function CreateAst: IAstNode; override;
- property Node: IIfExpressionNode read FNode;
+ constructor Create(const ANode: IIfExpressionNode);
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraTernaryExpressionNode = class(TAuraNode)
+ { TAuraTernaryExpressionNode }
+ TTernaryExpressionNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: ITernaryExpressionNode;
FConditionNode: TAuraNode;
FThenNode: TAuraNode;
FElseNode: TAuraNode;
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: ITernaryExpressionNode);
- function CreateAst: IAstNode; override;
- property Node: ITernaryExpressionNode read FNode;
+ constructor Create(const ANode: ITernaryExpressionNode);
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraLambdaExpressionNode = class(TAuraNode)
+ { TAuraLambdaExpressionNode }
+ TLambdaExpressionNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: ILambdaExpressionNode;
FBodyNode: TAuraNode;
FParamLabels: TList; // To store param labels
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: ILambdaExpressionNode);
+ constructor Create(const ANode: ILambdaExpressionNode);
destructor Destroy; override;
- function CreateAst: IAstNode; override;
- property Node: ILambdaExpressionNode read FNode;
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraFunctionCallNode = class(TAuraNode)
+ { TAuraFunctionCallNode }
+ TFunctionCallNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: IFunctionCallNode;
FCalleeNode: TAuraNode;
FArgumentNodes: TList;
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: IFunctionCallNode);
+ constructor Create(const ANode: IFunctionCallNode);
destructor Destroy; override;
- function CreateAst: IAstNode; override;
- property Node: IFunctionCallNode read FNode;
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraMacroExpansionNode = class(TAuraNode)
+ { TAuraMacroExpansionNode }
+ TMacroExpansionNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: IMacroExpansionNode;
FExpandedBodyNode: TAuraNode;
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: IMacroExpansionNode);
- function CreateAst: IAstNode; override;
- property Node: IMacroExpansionNode read FNode;
+ constructor Create(const ANode: IMacroExpansionNode);
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraRecurNode = class(TAuraNode)
+ { TAuraRecurNode }
+ TRecurNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: IRecurNode;
FArgumentNodes: TList;
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: IRecurNode);
+ constructor Create(const ANode: IRecurNode);
destructor Destroy; override;
- function CreateAst: IAstNode; override;
- property Node: IRecurNode read FNode;
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraVariableDeclarationNode = class(TAuraNode)
+ { TAuraVariableDeclarationNode }
+ TVariableDeclarationNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: IVariableDeclarationNode;
FInitializerNode: TAuraNode; // Can be nil
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: IVariableDeclarationNode);
- function CreateAst: IAstNode; override;
- property Node: IVariableDeclarationNode read FNode;
+ constructor Create(const ANode: IVariableDeclarationNode);
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraAssignmentNode = class(TAuraNode)
+ { TAuraAssignmentNode }
+ TAssignmentNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: IAssignmentNode;
FValueNode: TAuraNode;
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: IAssignmentNode);
- function CreateAst: IAstNode; override;
- property Node: IAssignmentNode read FNode;
+ constructor Create(const ANode: IAssignmentNode);
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraMacroDefinitionNode = class(TAuraNode)
+ { TAuraMacroDefinitionNode }
+ TMacroDefinitionNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: IMacroDefinitionNode;
FBodyNode: TAuraNode;
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: IMacroDefinitionNode);
- function CreateAst: IAstNode; override;
- property Node: IMacroDefinitionNode read FNode;
+ constructor Create(const ANode: IMacroDefinitionNode);
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraQuasiquoteNode = class(TAuraNode)
+ { TAuraQuasiquoteNode }
+ TQuasiquoteNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: IQuasiquoteNode;
FExpressionNode: TAuraNode;
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: IQuasiquoteNode);
- function CreateAst: IAstNode; override;
- property Node: IQuasiquoteNode read FNode;
+ constructor Create(const ANode: IQuasiquoteNode);
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraUnquoteNode = class(TAuraNode)
+ { TAuraUnquoteNode }
+ TUnquoteNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: IUnquoteNode;
FExpressionNode: TAuraNode;
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: IUnquoteNode);
- function CreateAst: IAstNode; override;
- property Node: IUnquoteNode read FNode;
+ constructor Create(const ANode: IUnquoteNode);
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraUnquoteSplicingNode = class(TAuraNode)
+ { TAuraUnquoteSplicingNode }
+ TUnquoteSplicingNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: IUnquoteSplicingNode;
FExpressionNode: TAuraNode;
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: IUnquoteSplicingNode);
- function CreateAst: IAstNode; override;
- property Node: IUnquoteSplicingNode read FNode;
+ constructor Create(const ANode: IUnquoteSplicingNode);
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraIndexerNode = class(TAuraNode)
+ { TAuraIndexerNode }
+ TIndexerNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: IIndexerNode;
FBaseNode: TAuraNode;
FIndexNode: TAuraNode;
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: IIndexerNode);
- function CreateAst: IAstNode; override;
- property Node: IIndexerNode read FNode;
+ constructor Create(const ANode: IIndexerNode);
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraMemberAccessNode = class(TAuraNode)
+ { TAuraMemberAccessNode }
+ TMemberAccessNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: IMemberAccessNode;
FBaseNode: TAuraNode;
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: IMemberAccessNode);
- function CreateAst: IAstNode; override;
- property Node: IMemberAccessNode read FNode;
+ constructor Create(const ANode: IMemberAccessNode);
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraRecordLiteralNode = class(TAuraNode)
+ { TAuraRecordLiteralNode }
+ TRecordLiteralNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: IRecordLiteralNode;
FFieldNodes: TDictionary; // Map KeyName -> ValueNode
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: IRecordLiteralNode);
+ constructor Create(const ANode: IRecordLiteralNode);
destructor Destroy; override;
- function CreateAst: IAstNode; override;
- property Node: IRecordLiteralNode read FNode;
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraCreateSeriesNode = class(TAuraNode)
+ { TAuraCreateSeriesNode }
+ TCreateSeriesNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: ICreateSeriesNode;
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: ICreateSeriesNode);
- function CreateAst: IAstNode; override;
- property Node: ICreateSeriesNode read FNode;
+ constructor Create(const ANode: ICreateSeriesNode);
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraAddSeriesItemNode = class(TAuraNode)
+ { TAuraAddSeriesItemNode }
+ TAddSeriesItemNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: IAddSeriesItemNode;
FValueNode: TAuraNode;
FLookbackNode: TAuraNode; // Can be nil
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: IAddSeriesItemNode);
- function CreateAst: IAstNode; override;
- property Node: IAddSeriesItemNode read FNode;
+ constructor Create(const ANode: IAddSeriesItemNode);
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraSeriesLengthNode = class(TAuraNode)
+ { TAuraSeriesLengthNode }
+ TSeriesLengthNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: ISeriesLengthNode;
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: ISeriesLengthNode);
- function CreateAst: IAstNode; override;
- property Node: ISeriesLengthNode read FNode;
+ constructor Create(const ANode: ISeriesLengthNode);
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
- TAuraNopNode = class(TAuraNode)
+ { TAuraNopNode }
+ TNopNodeHandler = class(TInterfacedObject, IAuraNodeHandler)
private
FNode: INopNode;
- protected
- procedure SetupNode; override;
+ function GetAstNode: IAstNode;
public
- constructor Create(const AVisualizer: IAstVisualizer; const ANode: INopNode);
- function CreateAst: IAstNode; override;
- property Node: INopNode read FNode;
+ constructor Create(const ANode: INopNode);
+ procedure BuildUI(OwnerNode: TAuraNode);
+ function ReconstructAst(OwnerNode: TAuraNode): IAstNode;
end;
-implementation
-
{ TAstVisualizer }
constructor TAstVisualizer.Create(AWorkspace: TAuraWorkspace; AParentControl: TControl; AExprDepth: Integer);
@@ -606,131 +621,207 @@ begin
FParentControl := Value;
end;
-function TAstVisualizer.VisitAddSeriesItem(const Node: IAddSeriesItemNode): TAuraNode;
-begin
- Result := TAuraAddSeriesItemNode.Create(Self, Node);
-end;
-
-function TAstVisualizer.VisitAssignment(const Node: IAssignmentNode): TAuraNode;
-begin
- Result := TAuraAssignmentNode.Create(Self, Node);
-end;
-
// --- Visitor Implementations ---
+// *** CHANGED: All visitor methods now create a Handler and inject it into a generic TAuraNode ***
function TAstVisualizer.VisitConstant(const Node: IConstantNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
begin
- Result := TAuraConstantNode.Create(Self, Node);
+ Handler := TConstantNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
end;
function TAstVisualizer.VisitIdentifier(const Node: IIdentifierNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
begin
- Result := TAuraIdentifierNode.Create(Self, Node);
+ Handler := TIdentifierNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
end;
function TAstVisualizer.VisitKeyword(const Node: IKeywordNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
begin
- Result := TAuraKeywordNode.Create(Self, Node);
+ Handler := TKeywordNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
end;
function TAstVisualizer.VisitBinaryExpression(const Node: IBinaryExpressionNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
begin
- Result := TAuraBinaryExpressionNode.Create(Self, Node);
+ Handler := TBinaryExpressionNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
end;
function TAstVisualizer.VisitBlockExpression(const Node: IBlockExpressionNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
begin
- Result := TAuraBlockExpressionNode.Create(Self, Node);
-end;
-
-function TAstVisualizer.VisitCreateSeries(const Node: ICreateSeriesNode): TAuraNode;
-begin
- Result := TAuraCreateSeriesNode.Create(Self, Node);
-end;
-
-function TAstVisualizer.VisitFunctionCall(const Node: IFunctionCallNode): TAuraNode;
-begin
- Result := TAuraFunctionCallNode.Create(Self, Node);
+ Handler := TBlockExpressionNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
end;
function TAstVisualizer.VisitUnaryExpression(const Node: IUnaryExpressionNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
begin
- Result := TAuraUnaryExpressionNode.Create(Self, Node);
+ Handler := TUnaryExpressionNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
end;
function TAstVisualizer.VisitIfExpression(const Node: IIfExpressionNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
begin
- Result := TAuraIfExpressionNode.Create(Self, Node);
-end;
-
-function TAstVisualizer.VisitIndexer(const Node: IIndexerNode): TAuraNode;
-begin
- Result := TAuraIndexerNode.Create(Self, Node);
-end;
-
-function TAstVisualizer.VisitLambdaExpression(const Node: ILambdaExpressionNode): TAuraNode;
-begin
- Result := TAuraLambdaExpressionNode.Create(Self, Node);
-end;
-
-function TAstVisualizer.VisitMacroDefinition(const Node: IMacroDefinitionNode): TAuraNode;
-begin
- Result := TAuraMacroDefinitionNode.Create(Self, Node);
-end;
-
-function TAstVisualizer.VisitMacroExpansionNode(const Node: IMacroExpansionNode): TAuraNode;
-begin
- Result := TAuraMacroExpansionNode.Create(Self, Node);
-end;
-
-function TAstVisualizer.VisitMemberAccess(const Node: IMemberAccessNode): TAuraNode;
-begin
- Result := TAuraMemberAccessNode.Create(Self, Node);
-end;
-
-function TAstVisualizer.VisitRecordLiteral(const Node: IRecordLiteralNode): TAuraNode;
-begin
- Result := TAuraRecordLiteralNode.Create(Self, Node);
-end;
-
-function TAstVisualizer.VisitQuasiquote(const Node: IQuasiquoteNode): TAuraNode;
-begin
- Result := TAuraQuasiquoteNode.Create(Self, Node);
-end;
-
-function TAstVisualizer.VisitRecurNode(const Node: IRecurNode): TAuraNode;
-begin
- Result := TAuraRecurNode.Create(Self, Node);
-end;
-
-function TAstVisualizer.VisitSeriesLength(const Node: ISeriesLengthNode): TAuraNode;
-begin
- Result := TAuraSeriesLengthNode.Create(Self, Node);
+ Handler := TIfExpressionNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
end;
function TAstVisualizer.VisitTernaryExpression(const Node: ITernaryExpressionNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
begin
- Result := TAuraTernaryExpressionNode.Create(Self, Node);
+ Handler := TTernaryExpressionNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
end;
-function TAstVisualizer.VisitUnquote(const Node: IUnquoteNode): TAuraNode;
+function TAstVisualizer.VisitLambdaExpression(const Node: ILambdaExpressionNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
begin
- Result := TAuraUnquoteNode.Create(Self, Node);
+ Handler := TLambdaExpressionNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
end;
-function TAstVisualizer.VisitUnquoteSplicing(const Node: IUnquoteSplicingNode): TAuraNode;
+function TAstVisualizer.VisitFunctionCall(const Node: IFunctionCallNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
begin
- Result := TAuraUnquoteSplicingNode.Create(Self, Node);
+ Handler := TFunctionCallNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
+end;
+
+function TAstVisualizer.VisitMacroExpansionNode(const Node: IMacroExpansionNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
+begin
+ Handler := TMacroExpansionNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
end;
function TAstVisualizer.VisitVariableDeclaration(const Node: IVariableDeclarationNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
begin
- Result := TAuraVariableDeclarationNode.Create(Self, Node);
+ Handler := TVariableDeclarationNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
+end;
+
+function TAstVisualizer.VisitAssignment(const Node: IAssignmentNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
+begin
+ Handler := TAssignmentNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
+end;
+
+function TAstVisualizer.VisitMacroDefinition(const Node: IMacroDefinitionNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
+begin
+ Handler := TMacroDefinitionNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
+end;
+
+function TAstVisualizer.VisitQuasiquote(const Node: IQuasiquoteNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
+begin
+ Handler := TQuasiquoteNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
+end;
+
+function TAstVisualizer.VisitUnquote(const Node: IUnquoteNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
+begin
+ Handler := TUnquoteNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
+end;
+
+function TAstVisualizer.VisitUnquoteSplicing(const Node: IUnquoteSplicingNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
+begin
+ Handler := TUnquoteSplicingNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
+end;
+
+function TAstVisualizer.VisitIndexer(const Node: IIndexerNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
+begin
+ Handler := TIndexerNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
+end;
+
+function TAstVisualizer.VisitMemberAccess(const Node: IMemberAccessNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
+begin
+ Handler := TMemberAccessNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
+end;
+
+function TAstVisualizer.VisitRecordLiteral(const Node: IRecordLiteralNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
+begin
+ Handler := TRecordLiteralNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
+end;
+
+function TAstVisualizer.VisitCreateSeries(const Node: ICreateSeriesNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
+begin
+ Handler := TCreateSeriesNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
+end;
+
+function TAstVisualizer.VisitAddSeriesItem(const Node: IAddSeriesItemNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
+begin
+ Handler := TAddSeriesItemNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
+end;
+
+function TAstVisualizer.VisitSeriesLength(const Node: ISeriesLengthNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
+begin
+ Handler := TSeriesLengthNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
+end;
+
+function TAstVisualizer.VisitRecurNode(const Node: IRecurNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
+begin
+ Handler := TRecurNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
end;
function TAstVisualizer.VisitNop(const Node: INopNode): TAuraNode;
+var
+ Handler: IAuraNodeHandler;
begin
- Result := TAuraNopNode.Create(Self, Node);
+ Handler := TNopNodeHandler.Create(Node);
+ Result := TAuraNode.Create(Self, Handler);
end;
{ TAutoFitControl }
@@ -941,13 +1032,14 @@ end;
{ TAuraNode }
-constructor TAuraNode.Create(const AVisualizer: IAstVisualizer);
+constructor TAuraNode.Create(const AVisualizer: IAstVisualizer; const AHandler: IAuraNodeHandler);
begin
inherited Create(AVisualizer.Workspace);
Parent := AVisualizer.ParentControl;
FVisualizer := AVisualizer.Clone(Self, AVisualizer.ExprDepth);
+ FHandler := AHandler; // *** Store the injected handler ***
FIsDragging := False;
@@ -985,6 +1077,7 @@ end;
destructor TAuraNode.Destroy;
begin
+ FHandler := nil; // Release the handler interface
inherited;
end;
@@ -1035,7 +1128,20 @@ end;
function TAuraNode.CreateAst: IAstNode;
begin
- Result := TAst.Block([]);
+ // *** CHANGED: Delegate AST reconstruction to the handler ***
+ if Assigned(FHandler) then
+ Result := FHandler.ReconstructAst(Self)
+ else
+ Result := TAst.Nop; // Fallback if handler is missing
+end;
+
+function TAuraNode.GetNode: IAstNode;
+begin
+ // *** NEW: Get the logical node from the handler ***
+ if Assigned(FHandler) then
+ Result := FHandler.Node
+ else
+ Result := nil;
end;
procedure TAuraNode.Paint;
@@ -1046,7 +1152,6 @@ begin
// Clear background before drawing custom border/fill
Canvas.Fill.Kind := TBrushKind.None; // Make sure default fill is cleared if needed
- //Canvas.ClearRect(TRectF.Create(0,0, Width, Height)); // Optional: Explicit clear
if FFrameless then
begin
@@ -1085,7 +1190,6 @@ begin
Canvas.DrawRect(rect, FBorderRadius, FBorderRadius, AllCorners, 1.0, TCornerType.Round);
end;
end;
- // Title drawing removed, handled by external labels now.
end;
procedure TAuraNode.SetBorderColor(const Value: TAlphaColor);
@@ -1180,28 +1284,29 @@ end;
procedure TAuraNode.SetupNode;
begin
-
+ if Assigned(FHandler) then
+ FHandler.BuildUI(Self);
end;
-{ TAuraConstantNode }
+{ TConstantNodeHandler }
-constructor TAuraConstantNode.Create(const AVisualizer: IAstVisualizer; const ANode: IConstantNode);
+constructor TConstantNodeHandler.Create(const ANode: IConstantNode);
begin
- inherited Create(AVisualizer);
+ inherited Create;
FNode := ANode;
end;
-function TAuraConstantNode.CreateAst: IAstNode;
+function TConstantNodeHandler.GetAstNode: IAstNode;
begin
Result := FNode;
end;
-procedure TAuraConstantNode.SetupNode;
+procedure TConstantNodeHandler.BuildUI(OwnerNode: TAuraNode);
var
valueStr: string;
isConcise: Boolean;
begin
- BeginUpdate;
+ OwnerNode.BeginUpdate;
try
valueStr := FNode.Value.ToString;
// Check if it's a number or a single-line text and not excessively long
@@ -1210,138 +1315,195 @@ begin
if isConcise then
begin
// Display value directly in a centered label, frameless node
- Frameless := true;
- AddLabel(Self, valueStr);
+ OwnerNode.Frameless := true;
+ OwnerNode.AddLabel(OwnerNode, valueStr);
end
else
begin
// Use standard framed node with Title label + Value label
- Frameless := False;
- Orientation := loVertical;
+ OwnerNode.Frameless := False;
+ OwnerNode.Orientation := loVertical;
- var titleLabel := AddLabel(Self, 'Const');
+ var titleLabel := OwnerNode.AddLabel(OwnerNode, 'Const');
titleLabel.Font.Style := titleLabel.Font.Style + [TFontStyle.fsBold];
// Value Label
- var valueLabel := AddLabel(Self, valueStr);
- valueLabel.AutoSize := False; // ***Important: Disable AutoSize when Align=Client***
- valueLabel.WordWrap := True; // Allow wrapping for long text
+ var valueLabel := OwnerNode.AddLabel(OwnerNode, valueStr);
+ valueLabel.AutoSize := False;
+ valueLabel.WordWrap := True;
end;
finally
- EndUpdate;
+ OwnerNode.EndUpdate;
end;
end;
-{ TAuraIdentifierNode }
-
-constructor TAuraIdentifierNode.Create(const AVisualizer: IAstVisualizer; const ANode: IIdentifierNode);
+function TConstantNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
begin
- inherited Create(AVisualizer);
+ Result := FNode; // Literals are immutable
+end;
+
+{ TIdentifierNodeHandler }
+
+constructor TIdentifierNodeHandler.Create(const ANode: IIdentifierNode);
+begin
+ inherited Create;
FNode := ANode;
end;
-function TAuraIdentifierNode.CreateAst: IAstNode;
+function TIdentifierNodeHandler.GetAstNode: IAstNode;
begin
+ Result := FNode;
+end;
+
+procedure TIdentifierNodeHandler.BuildUI(OwnerNode: TAuraNode);
+begin
+ OwnerNode.BeginUpdate;
+ try
+ OwnerNode.Frameless := true; // Identifiers are frameless
+ OwnerNode.AddLabel(OwnerNode, FNode.Name); // Add label with the identifier name
+ finally
+ OwnerNode.EndUpdate;
+ end;
+end;
+
+function TIdentifierNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
+begin
+ // Find the label text if needed, but for now, re-use FNode's data
+ // In a real editor, you'd fetch text from the TEdit/TLabel
Result := TAst.Identifier(FNode.Name);
end;
-procedure TAuraIdentifierNode.SetupNode;
-begin
- BeginUpdate;
- try
- Frameless := true; // Identifiers are frameless
- AddLabel(Self, FNode.Name); // Add label with the identifier name
- finally
- EndUpdate;
- end;
-end;
+{ TKeywordNodeHandler }
-{ TAuraKeywordNode }
-
-constructor TAuraKeywordNode.Create(const AVisualizer: IAstVisualizer; const ANode: IKeywordNode);
+constructor TKeywordNodeHandler.Create(const ANode: IKeywordNode);
begin
- inherited Create(AVisualizer);
+ inherited Create;
FNode := ANode;
end;
-function TAuraKeywordNode.CreateAst: IAstNode;
+function TKeywordNodeHandler.GetAstNode: IAstNode;
begin
- Result := FNode; // Keywords are literals, return original node
+ Result := FNode;
end;
-procedure TAuraKeywordNode.SetupNode;
+procedure TKeywordNodeHandler.BuildUI(OwnerNode: TAuraNode);
begin
- BeginUpdate;
+ OwnerNode.BeginUpdate;
try
- Frameless := true;
- var lbl := AddLabel(Self, ':' + FNode.Value.Name);
+ OwnerNode.Frameless := true;
+ var lbl := OwnerNode.AddLabel(OwnerNode, ':' + FNode.Value.Name);
lbl.StyledSettings := lbl.StyledSettings - [TStyledSetting.FontColor];
lbl.FontColor := TAlphaColors.Mediumvioletred;
finally
- EndUpdate;
+ OwnerNode.EndUpdate;
end;
end;
-{ TAuraBinaryExpressionNode }
-
-constructor TAuraBinaryExpressionNode.Create(const AVisualizer: IAstVisualizer; const ANode: IBinaryExpressionNode);
+function TKeywordNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
begin
- inherited Create(AVisualizer);
+ Result := FNode; // Keywords are literals
+end;
+
+{ TBinaryExpressionNodeHandler }
+
+constructor TBinaryExpressionNodeHandler.Create(const ANode: IBinaryExpressionNode);
+begin
+ inherited Create;
FNode := ANode;
end;
-function TAuraBinaryExpressionNode.CreateAst: IAstNode;
+function TBinaryExpressionNodeHandler.GetAstNode: IAstNode;
begin
- Result := TAst.BinaryExpr(LeftNode.CreateAst, FNode.Operator, RightNode.CreateAst);
+ Result := FNode;
end;
-function TAuraBinaryExpressionNode.GetLeftNode: TAuraNode;
+procedure TBinaryExpressionNodeHandler.BuildUI(OwnerNode: TAuraNode);
+var
+ visu: IAstVisualizer;
begin
- Result := Children[0] as TAuraNode;
-end;
-
-function TAuraBinaryExpressionNode.GetRightNode: TAuraNode;
-begin
- Result := Children[2] as TAuraNode;
-end;
-
-procedure TAuraBinaryExpressionNode.SetupNode;
-begin
- var visu := FVisualizer.Clone(Self, FVisualizer.ExprDepth + 1);
-
- BeginUpdate;
+ visu := OwnerNode.Visualizer.Clone(OwnerNode, OwnerNode.Visualizer.ExprDepth + 1);
+ OwnerNode.BeginUpdate;
try
- Frameless := true; // Generally make binary expressions frameless containers
- Orientation := loHorizontal;
+ OwnerNode.Frameless := true;
+ OwnerNode.Orientation := loHorizontal;
- visu.CallAccept(FNode.Left);
-
- // 2. Operator Label
- AddLabel(Self, FNode.Operator.ToString);
-
- // 3. RightNode Expression Node (Visited Recursively)
- visu.CallAccept(FNode.Right);
+ // Create and store visual children
+ FLeftNode := visu.CallAccept(FNode.Left);
+ OwnerNode.AddLabel(OwnerNode, FNode.Operator.ToString);
+ FRightNode := visu.CallAccept(FNode.Right);
finally
- EndUpdate;
+ OwnerNode.EndUpdate;
end;
end;
-{ TAuraBlockExpressionNode }
-
-constructor TAuraBlockExpressionNode.Create(const AVisualizer: IAstVisualizer; const ANode: IBlockExpressionNode);
+function TBinaryExpressionNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
begin
- inherited Create(AVisualizer);
+ // Use the stored visual children to reconstruct the AST
+ Result := TAst.BinaryExpr(FLeftNode.CreateAst, FNode.Operator, FRightNode.CreateAst);
+end;
+
+{ TBlockExpressionNodeHandler }
+
+constructor TBlockExpressionNodeHandler.Create(const ANode: IBlockExpressionNode);
+begin
+ inherited Create;
FNode := ANode;
FChildNodes := TList.Create;
end;
-destructor TAuraBlockExpressionNode.Destroy;
+destructor TBlockExpressionNodeHandler.Destroy;
begin
FChildNodes.Free;
inherited Destroy;
end;
-function TAuraBlockExpressionNode.CreateAst: IAstNode;
+function TBlockExpressionNodeHandler.GetAstNode: IAstNode;
+begin
+ Result := FNode;
+end;
+
+procedure TBlockExpressionNodeHandler.BuildUI(OwnerNode: TAuraNode);
+var
+ visu: IAstVisualizer;
+ childNode: TAuraNode;
+ expr: IAstNode;
+ titleLabel: TLabel;
+ i: Integer;
+ returnContainer: TAutoFitControl;
+ visuReturn: IAstVisualizer;
+begin
+ visu := OwnerNode.Visualizer.Clone(OwnerNode, OwnerNode.Visualizer.ExprDepth + 1);
+ OwnerNode.BeginUpdate;
+ try
+ OwnerNode.Frameless := true;
+ OwnerNode.Orientation := loVertical;
+ OwnerNode.Alignment := laFlush;
+
+ for i := 0 to High(FNode.Expressions) do
+ begin
+ expr := FNode.Expressions[i];
+
+ if i = High(FNode.Expressions) then
+ begin
+ returnContainer := OwnerNode.AddContainer(OwnerNode, loHorizontal, laCenter);
+ titleLabel := OwnerNode.AddLabel(returnContainer, 'return');
+ titleLabel.Font.Style := titleLabel.Font.Style + [TFontStyle.fsBold];
+ visuReturn := OwnerNode.Visualizer.Clone(returnContainer, OwnerNode.Visualizer.ExprDepth + 1);
+ childNode := visuReturn.CallAccept(expr);
+ FChildNodes.Add(childNode);
+ end
+ else
+ begin
+ childNode := visu.CallAccept(expr);
+ FChildNodes.Add(childNode);
+ end;
+ end;
+ finally
+ OwnerNode.EndUpdate;
+ end;
+end;
+
+function TBlockExpressionNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
var
exprs: TArray;
childNode: TAuraNode;
@@ -1354,109 +1516,79 @@ begin
if Assigned(childNode) then
exprs[i] := childNode.CreateAst
else
- exprs[i] := TAst.Constant(TDataValue.Void); // Or handle error
+ exprs[i] := TAst.Nop; // Use Nop as placeholder
end;
Result := TAst.Block(exprs);
end;
-procedure TAuraBlockExpressionNode.SetupNode;
-var
- visu: IAstVisualizer;
- childNode: TAuraNode;
- expr: IAstNode;
- titleLabel: TLabel;
- i: Integer;
- returnContainer: TAutoFitControl;
- visuReturn: IAstVisualizer;
+{ TUnaryExpressionNodeHandler }
+
+constructor TUnaryExpressionNodeHandler.Create(const ANode: IUnaryExpressionNode);
begin
- // This visualizer parents children directly to Self
- visu := FVisualizer.Clone(Self, FVisualizer.ExprDepth + 1);
-
- BeginUpdate;
- try
- Frameless := true;
- Orientation := loVertical;
- Alignment := laFlush; // Align all child rows to the left
-
- for i := 0 to High(FNode.Expressions) do
- begin
- expr := FNode.Expressions[i];
-
- if i = High(FNode.Expressions) then
- begin
- // Last expression: create a horizontal container for "return [expr]"
- returnContainer := AddContainer(Self, loHorizontal, laCenter);
-
- // Add "return" label to the container
- titleLabel := AddLabel(returnContainer, 'return'); // Use AddLabel from TAuraNode (Self)
- titleLabel.Font.Style := titleLabel.Font.Style + [TFontStyle.fsBold];
-
- // Create a new visualizer targeting this container
- visuReturn := FVisualizer.Clone(returnContainer, FVisualizer.ExprDepth + 1);
-
- // Add the expression node to the container
- childNode := visuReturn.CallAccept(expr);
- FChildNodes.Add(childNode); // Store for CreateAst
- end
- else
- begin
- // Not the last expression, add directly to Self
- childNode := visu.CallAccept(expr);
- FChildNodes.Add(childNode); // Store for CreateAst
- end;
- end;
- finally
- EndUpdate;
- end;
-end;
-
-{ TAuraUnaryExpressionNode }
-
-constructor TAuraUnaryExpressionNode.Create(const AVisualizer: IAstVisualizer; const ANode: IUnaryExpressionNode);
-begin
- inherited Create(AVisualizer);
+ inherited Create;
FNode := ANode;
end;
-function TAuraUnaryExpressionNode.CreateAst: IAstNode;
+function TUnaryExpressionNodeHandler.GetAstNode: IAstNode;
+begin
+ Result := FNode;
+end;
+
+procedure TUnaryExpressionNodeHandler.BuildUI(OwnerNode: TAuraNode);
+var
+ visu: IAstVisualizer;
+ titleLabel: TLabel;
+begin
+ visu := OwnerNode.Visualizer.Clone(OwnerNode, OwnerNode.Visualizer.ExprDepth + 1);
+ OwnerNode.BeginUpdate;
+ try
+ OwnerNode.Frameless := False;
+ OwnerNode.Orientation := loVertical;
+ titleLabel := OwnerNode.AddLabel(OwnerNode, 'Unary Op: ' + FNode.Operator.ToString);
+ titleLabel.Font.Style := titleLabel.Font.Style + [TFontStyle.fsBold];
+ FChildNode := visu.CallAccept(FNode.Right);
+ finally
+ OwnerNode.EndUpdate;
+ end;
+end;
+
+function TUnaryExpressionNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
begin
Result := TAst.UnaryExpr(FNode.Operator, FChildNode.CreateAst);
end;
-procedure TAuraUnaryExpressionNode.SetupNode;
-var
- visu: IAstVisualizer;
- titleLabel: TLabel;
+{ TIfExpressionNodeHandler }
+
+constructor TIfExpressionNodeHandler.Create(const ANode: IIfExpressionNode);
begin
- visu := FVisualizer.Clone(Self, FVisualizer.ExprDepth + 1);
-
- BeginUpdate;
- try
- // Vertical layout, framed
- Frameless := False;
- Orientation := loVertical;
-
- // Title
- titleLabel := AddLabel(Self, 'Unary Op: ' + FNode.Operator.ToString);
- titleLabel.Font.Style := titleLabel.Font.Style + [TFontStyle.fsBold];
-
- // Child
- FChildNode := visu.CallAccept(FNode.Right);
- finally
- EndUpdate;
- end;
-end;
-
-{ TAuraIfExpressionNode }
-
-constructor TAuraIfExpressionNode.Create(const AVisualizer: IAstVisualizer; const ANode: IIfExpressionNode);
-begin
- inherited Create(AVisualizer);
+ inherited Create;
FNode := ANode;
FElseNode := nil;
end;
-function TAuraIfExpressionNode.CreateAst: IAstNode;
+function TIfExpressionNodeHandler.GetAstNode: IAstNode;
+begin
+ Result := FNode;
+end;
+
+procedure TIfExpressionNodeHandler.BuildUI(OwnerNode: TAuraNode);
+begin
+ OwnerNode.BeginUpdate;
+ try
+ OwnerNode.Frameless := False;
+ OwnerNode.Orientation := loVertical;
+ OwnerNode.Alignment := laFlush;
+
+ FConditionNode := OwnerNode.AddExpr(OwnerNode, 'if', FNode.Condition);
+ FThenNode := OwnerNode.AddExpr(OwnerNode, 'then', FNode.ThenBranch);
+ if Assigned(FNode.ElseBranch) then
+ FElseNode := OwnerNode.AddExpr(OwnerNode, 'else', FNode.ElseBranch);
+ finally
+ OwnerNode.EndUpdate;
+ end;
+end;
+
+function TIfExpressionNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
var
elseAst: IAstNode;
begin
@@ -1468,149 +1600,171 @@ begin
Result := TAst.IfExpr(FConditionNode.CreateAst, FThenNode.CreateAst, elseAst);
end;
-procedure TAuraIfExpressionNode.SetupNode;
+{ TTernaryExpressionNodeHandler }
+
+constructor TTernaryExpressionNodeHandler.Create(const ANode: ITernaryExpressionNode);
begin
- BeginUpdate;
- try
- Frameless := False;
- Orientation := loVertical;
- Alignment := laFlush;
-
- FConditionNode := AddExpr(Self, 'if', FNode.Condition);
- FThenNode := AddExpr(Self, 'then', FNode.ThenBranch);
- if Assigned(FNode.ElseBranch) then
- FElseNode := AddExpr(Self, 'else', FNode.ElseBranch);
- finally
- EndUpdate;
- end;
-end;
-
-{ TAuraTernaryExpressionNode }
-
-constructor TAuraTernaryExpressionNode.Create(const AVisualizer: IAstVisualizer; const ANode: ITernaryExpressionNode);
-begin
- inherited Create(AVisualizer);
+ inherited Create;
FNode := ANode;
end;
-function TAuraTernaryExpressionNode.CreateAst: IAstNode;
+function TTernaryExpressionNodeHandler.GetAstNode: IAstNode;
+begin
+ Result := FNode;
+end;
+
+procedure TTernaryExpressionNodeHandler.BuildUI(OwnerNode: TAuraNode);
+var
+ visu: IAstVisualizer;
+begin
+ visu := OwnerNode.Visualizer.Clone(OwnerNode, OwnerNode.Visualizer.ExprDepth + 1);
+ OwnerNode.BeginUpdate;
+ try
+ OwnerNode.Frameless := True;
+ OwnerNode.Orientation := loHorizontal;
+ FConditionNode := visu.CallAccept(FNode.Condition);
+ OwnerNode.AddLabel(OwnerNode, '?');
+ FThenNode := visu.CallAccept(FNode.ThenBranch);
+ OwnerNode.AddLabel(OwnerNode, ':');
+ FElseNode := visu.CallAccept(FNode.ElseBranch);
+ finally
+ OwnerNode.EndUpdate;
+ end;
+end;
+
+function TTernaryExpressionNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
begin
Result := TAst.TernaryExpr(FConditionNode.CreateAst, FThenNode.CreateAst, FElseNode.CreateAst);
end;
-procedure TAuraTernaryExpressionNode.SetupNode;
-var
- visu: IAstVisualizer;
+{ TLambdaExpressionNodeHandler }
+
+constructor TLambdaExpressionNodeHandler.Create(const ANode: ILambdaExpressionNode);
begin
- visu := FVisualizer.Clone(Self, FVisualizer.ExprDepth + 1);
-
- BeginUpdate;
- try
- Frameless := True; // Horizontal layout
- Orientation := loHorizontal;
-
- FConditionNode := visu.CallAccept(FNode.Condition);
- AddLabel(Self, '?');
- FThenNode := visu.CallAccept(FNode.ThenBranch);
- AddLabel(Self, ':');
- FElseNode := visu.CallAccept(FNode.ElseBranch);
- finally
- EndUpdate;
- end;
-end;
-
-{ TAuraLambdaExpressionNode }
-
-constructor TAuraLambdaExpressionNode.Create(const AVisualizer: IAstVisualizer; const ANode: ILambdaExpressionNode);
-begin
- inherited Create(AVisualizer);
+ inherited Create;
FNode := ANode;
FParamLabels := TList.Create;
end;
-destructor TAuraLambdaExpressionNode.Destroy;
+destructor TLambdaExpressionNodeHandler.Destroy;
begin
FParamLabels.Free;
inherited Destroy;
end;
-function TAuraLambdaExpressionNode.CreateAst: IAstNode;
+function TLambdaExpressionNodeHandler.GetAstNode: IAstNode;
begin
- Result := TAst.LambdaExpr(FNode.Parameters, FBodyNode.CreateAst);
+ Result := FNode;
end;
-procedure TAuraLambdaExpressionNode.SetupNode;
+procedure TLambdaExpressionNodeHandler.BuildUI(OwnerNode: TAuraNode);
var
visu: IAstVisualizer;
titleContainer: TAutoFitControl;
paramLabel: TLabel;
i: Integer;
begin
- visu := FVisualizer.Clone(Self, 0);
-
- BeginUpdate;
+ visu := OwnerNode.Visualizer.Clone(OwnerNode, 0); // Reset depth for body
+ OwnerNode.BeginUpdate;
try
- Frameless := False;
- Orientation := loVertical; // Main node is vertical
- Alignment := laFlush;
- BackgroundColor := $090000ff;
+ OwnerNode.Frameless := False;
+ OwnerNode.Orientation := loVertical;
+ OwnerNode.Alignment := laFlush;
+ OwnerNode.BackgroundColor := $090000ff;
- // Create a horizontal container for the title/params
- titleContainer := AddContainer(Self, loHorizontal, laCenter);
+ titleContainer := OwnerNode.AddContainer(OwnerNode, loHorizontal, laCenter);
- // 1. Lambda Symbol Label (Title)
- paramLabel := AddLabel(Self, WideChar($03BB)); // Lambda
- paramLabel.Parent := titleContainer; // Add to title container
+ paramLabel := OwnerNode.AddLabel(titleContainer, 'fn'); // ASCII replacement for Lambda
paramLabel.Font.Style := paramLabel.Font.Style + [TFontStyle.fsBold];
+ FParamLabels.Add(paramLabel); // Add to list (though not really needed for CreateAst)
- // 2. Add Parameters
- paramLabel := AddLabel(Self, '(');
- paramLabel.Parent := titleContainer;
+ paramLabel := OwnerNode.AddLabel(titleContainer, '(');
FParamLabels.Add(paramLabel);
for i := 0 to High(FNode.Parameters) do
begin
- paramLabel := AddLabel(Self, FNode.Parameters[i].Name);
- paramLabel.Parent := titleContainer;
+ paramLabel := OwnerNode.AddLabel(titleContainer, FNode.Parameters[i].Name);
FParamLabels.Add(paramLabel);
if i < High(FNode.Parameters) then
begin
- paramLabel := AddLabel(Self, ',');
- paramLabel.Parent := titleContainer;
+ paramLabel := OwnerNode.AddLabel(titleContainer, ',');
FParamLabels.Add(paramLabel);
end;
end;
- paramLabel := AddLabel(Self, ')');
- paramLabel.Parent := titleContainer;
+ paramLabel := OwnerNode.AddLabel(titleContainer, ')');
FParamLabels.Add(paramLabel);
- // 3. Body
FBodyNode := visu.CallAccept(FNode.Body);
FBodyNode.Frameless := false;
finally
- EndUpdate;
+ OwnerNode.EndUpdate;
end;
end;
-{ TAuraFunctionCallNode }
-
-constructor TAuraFunctionCallNode.Create(const AVisualizer: IAstVisualizer; const ANode: IFunctionCallNode);
+function TLambdaExpressionNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
begin
- inherited Create(AVisualizer);
+ // Params are read from FNode (assuming they are not editable via UI labels for now)
+ Result := TAst.LambdaExpr(FNode.Parameters, FBodyNode.CreateAst);
+end;
+
+{ TFunctionCallNodeHandler }
+
+constructor TFunctionCallNodeHandler.Create(const ANode: IFunctionCallNode);
+begin
+ inherited Create;
FNode := ANode;
FArgumentNodes := TList.Create;
end;
-destructor TAuraFunctionCallNode.Destroy;
+destructor TFunctionCallNodeHandler.Destroy;
begin
FArgumentNodes.Free;
inherited Destroy;
end;
-function TAuraFunctionCallNode.CreateAst: IAstNode;
+function TFunctionCallNodeHandler.GetAstNode: IAstNode;
+begin
+ Result := FNode;
+end;
+
+procedure TFunctionCallNodeHandler.BuildUI(OwnerNode: TAuraNode);
+var
+ visu: IAstVisualizer;
+ i: Integer;
+ argNode: TAuraNode;
+begin
+ visu := OwnerNode.Visualizer.Clone(OwnerNode, OwnerNode.Visualizer.ExprDepth + 1);
+ OwnerNode.BeginUpdate;
+ try
+ OwnerNode.Frameless := True;
+ OwnerNode.Orientation := loHorizontal;
+
+ var callLabel := OwnerNode.AddLabel(OwnerNode, 'call ');
+ callLabel.Font.Style := callLabel.Font.Style + [TFontStyle.fsBold];
+
+ FCalleeNode := visu.CallAccept(FNode.Callee);
+
+ if Length(FNode.Arguments) > 0 then
+ begin
+ OwnerNode.AddLabel(OwnerNode, '(');
+ for i := 0 to High(FNode.Arguments) do
+ begin
+ argNode := visu.CallAccept(FNode.Arguments[i]);
+ FArgumentNodes.Add(argNode);
+ if i < High(FNode.Arguments) then
+ OwnerNode.AddLabel(OwnerNode, ',');
+ end;
+ OwnerNode.AddLabel(OwnerNode, ')');
+ end;
+ finally
+ OwnerNode.EndUpdate;
+ end;
+end;
+
+function TFunctionCallNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
var
args: TArray;
i: Integer;
@@ -1622,98 +1776,93 @@ begin
Result := TAst.FunctionCall(FCalleeNode.CreateAst, args);
end;
-procedure TAuraFunctionCallNode.SetupNode;
-var
- visu: IAstVisualizer;
- i: Integer;
- argNode: TAuraNode;
+{ TMacroExpansionNodeHandler }
+
+constructor TMacroExpansionNodeHandler.Create(const ANode: IMacroExpansionNode);
begin
- visu := FVisualizer.Clone(Self, FVisualizer.ExprDepth + 1);
-
- BeginUpdate;
- try
- Frameless := True; // Horizontal layout
- Orientation := loHorizontal;
-
- var callLabel := AddLabel(Self, 'call ');
- callLabel.Font.Style := callLabel.Font.Style + [TFontStyle.fsBold];
-
- // Callee
- FCalleeNode := visu.CallAccept(FNode.Callee);
-
- // Arguments
- if Length(FNode.Arguments) > 0 then
- begin
- AddLabel(Self, '(');
-
- for i := 0 to High(FNode.Arguments) do
- begin
- argNode := visu.CallAccept(FNode.Arguments[i]);
- FArgumentNodes.Add(argNode);
-
- if i < High(FNode.Arguments) then
- AddLabel(Self, ',');
- end;
-
- AddLabel(Self, ')');
- end;
- finally
- EndUpdate;
- end;
-end;
-
-{ TAuraMacroExpansionNode }
-
-constructor TAuraMacroExpansionNode.Create(const AVisualizer: IAstVisualizer; const ANode: IMacroExpansionNode);
-begin
- inherited Create(AVisualizer);
+ inherited Create;
FNode := ANode;
end;
-function TAuraMacroExpansionNode.CreateAst: IAstNode;
+function TMacroExpansionNodeHandler.GetAstNode: IAstNode;
begin
- // Re-create the node using the original FNode (which is an IFunctionCallNode)
- // and the CreateAst of the expanded body.
- Result := TAst.MacroExpansionNode(FNode, FExpandedBodyNode.CreateAst);
+ Result := FNode;
end;
-procedure TAuraMacroExpansionNode.SetupNode;
+procedure TMacroExpansionNodeHandler.BuildUI(OwnerNode: TAuraNode);
var
visu: IAstVisualizer;
titleLabel: TLabel;
begin
- visu := FVisualizer.Clone(Self, FVisualizer.ExprDepth + 1);
-
- BeginUpdate;
+ visu := OwnerNode.Visualizer.Clone(OwnerNode, OwnerNode.Visualizer.ExprDepth + 1);
+ OwnerNode.BeginUpdate;
try
- Frameless := False;
- Orientation := loVertical;
-
- titleLabel := AddLabel(Self, 'Macro Expansion');
+ OwnerNode.Frameless := False;
+ OwnerNode.Orientation := loVertical;
+ titleLabel := OwnerNode.AddLabel(OwnerNode, 'Macro Expansion');
titleLabel.Font.Style := titleLabel.Font.Style + [TFontStyle.fsBold];
-
FExpandedBodyNode := visu.CallAccept(FNode.ExpandedBody);
finally
- EndUpdate;
+ OwnerNode.EndUpdate;
end;
end;
-{ TAuraRecurNode }
-
-constructor TAuraRecurNode.Create(const AVisualizer: IAstVisualizer; const ANode: IRecurNode);
+function TMacroExpansionNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
begin
- inherited Create(AVisualizer);
+ Result := TAst.MacroExpansionNode(FNode, FExpandedBodyNode.CreateAst);
+end;
+
+{ TRecurNodeHandler }
+
+constructor TRecurNodeHandler.Create(const ANode: IRecurNode);
+begin
+ inherited Create;
FNode := ANode;
FArgumentNodes := TList.Create;
end;
-destructor TAuraRecurNode.Destroy;
+destructor TRecurNodeHandler.Destroy;
begin
FArgumentNodes.Free;
inherited Destroy;
end;
-function TAuraRecurNode.CreateAst: IAstNode;
+function TRecurNodeHandler.GetAstNode: IAstNode;
+begin
+ Result := FNode;
+end;
+
+procedure TRecurNodeHandler.BuildUI(OwnerNode: TAuraNode);
+var
+ visu: IAstVisualizer;
+ i: Integer;
+ argNode: TAuraNode;
+ titleLabel: TLabel;
+begin
+ visu := OwnerNode.Visualizer.Clone(OwnerNode, OwnerNode.Visualizer.ExprDepth + 1);
+ OwnerNode.BeginUpdate;
+ try
+ OwnerNode.Frameless := True;
+ OwnerNode.Orientation := loHorizontal;
+
+ titleLabel := OwnerNode.AddLabel(OwnerNode, 'recur'); // ASCII text
+ titleLabel.Font.Style := titleLabel.Font.Style + [TFontStyle.fsBold];
+
+ OwnerNode.AddLabel(OwnerNode, '(');
+ for i := 0 to High(FNode.Arguments) do
+ begin
+ argNode := visu.CallAccept(FNode.Arguments[i]);
+ FArgumentNodes.Add(argNode);
+ if i < High(FNode.Arguments) then
+ OwnerNode.AddLabel(OwnerNode, ',');
+ end;
+ OwnerNode.AddLabel(OwnerNode, ')');
+ finally
+ OwnerNode.EndUpdate;
+ end;
+end;
+
+function TRecurNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
var
args: TArray;
i: Integer;
@@ -1721,56 +1870,50 @@ begin
SetLength(args, FArgumentNodes.Count);
for i := 0 to FArgumentNodes.Count - 1 do
args[i] := FArgumentNodes[i].CreateAst;
-
Result := TAst.Recur(args);
end;
-procedure TAuraRecurNode.SetupNode;
-var
- visu: IAstVisualizer;
- i: Integer;
- argNode: TAuraNode;
- titleLabel: TLabel;
+{ TVariableDeclarationNodeHandler }
+
+constructor TVariableDeclarationNodeHandler.Create(const ANode: IVariableDeclarationNode);
begin
- visu := FVisualizer.Clone(Self, FVisualizer.ExprDepth + 1);
-
- BeginUpdate;
- try
- Frameless := True; // Horizontal layout
- Orientation := loHorizontal;
-
- // 1. 'recur' keyword
- titleLabel := AddLabel(Self, WideChar($03BB));
- titleLabel.Font.Style := titleLabel.Font.Style + [TFontStyle.fsBold];
-
- // 2. Arguments
- AddLabel(Self, '(');
-
- for i := 0 to High(FNode.Arguments) do
- begin
- argNode := visu.CallAccept(FNode.Arguments[i]);
- FArgumentNodes.Add(argNode);
-
- if i < High(FNode.Arguments) then
- AddLabel(Self, ',');
- end;
-
- AddLabel(Self, ')');
- finally
- EndUpdate;
- end;
-end;
-
-{ TAuraVariableDeclarationNode }
-
-constructor TAuraVariableDeclarationNode.Create(const AVisualizer: IAstVisualizer; const ANode: IVariableDeclarationNode);
-begin
- inherited Create(AVisualizer);
+ inherited Create;
FNode := ANode;
FInitializerNode := nil;
end;
-function TAuraVariableDeclarationNode.CreateAst: IAstNode;
+function TVariableDeclarationNodeHandler.GetAstNode: IAstNode;
+begin
+ Result := FNode;
+end;
+
+procedure TVariableDeclarationNodeHandler.BuildUI(OwnerNode: TAuraNode);
+var
+ visu: IAstVisualizer;
+ varLabel: TLabel;
+begin
+ visu := OwnerNode.Visualizer.Clone(OwnerNode, OwnerNode.Visualizer.ExprDepth + 1);
+ OwnerNode.BeginUpdate;
+ try
+ OwnerNode.Frameless := True;
+ OwnerNode.Orientation := loHorizontal;
+
+ varLabel := OwnerNode.AddLabel(OwnerNode, 'var');
+ varLabel.Font.Style := varLabel.Font.Style + [TFontStyle.fsBold];
+
+ OwnerNode.AddLabel(OwnerNode, FNode.Identifier.Name);
+
+ if Assigned(FNode.Initializer) then
+ begin
+ OwnerNode.AddLabel(OwnerNode, ':=');
+ FInitializerNode := visu.CallAccept(FNode.Initializer);
+ end;
+ finally
+ OwnerNode.EndUpdate;
+ end;
+end;
+
+function TVariableDeclarationNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
var
initAst: IAstNode;
begin
@@ -1778,109 +1921,70 @@ begin
initAst := FInitializerNode.CreateAst
else
initAst := nil;
-
- // Re-create the identifier node from the original FNode
Result := TAst.VarDecl(TAst.Identifier(FNode.Identifier.Name), initAst);
end;
-procedure TAuraVariableDeclarationNode.SetupNode;
-var
- visu: IAstVisualizer;
- varLabel: TLabel;
+{ TAssignmentNodeHandler }
+
+constructor TAssignmentNodeHandler.Create(const ANode: IAssignmentNode);
begin
- visu := FVisualizer.Clone(Self, FVisualizer.ExprDepth + 1);
-
- BeginUpdate;
- try
- Frameless := True; // Horizontal layout
- Orientation := loHorizontal;
-
- varLabel := AddLabel(Self, 'var');
- varLabel.Font.Style := varLabel.Font.Style + [TFontStyle.fsBold];
-
- // Add identifier name as a label
- AddLabel(Self, FNode.Identifier.Name);
-
- if Assigned(FNode.Initializer) then
- begin
- AddLabel(Self, ':=');
- FInitializerNode := visu.CallAccept(FNode.Initializer);
- end;
- finally
- EndUpdate;
- end;
-end;
-
-{ TAuraAssignmentNode }
-
-constructor TAuraAssignmentNode.Create(const AVisualizer: IAstVisualizer; const ANode: IAssignmentNode);
-begin
- inherited Create(AVisualizer);
+ inherited Create;
FNode := ANode;
end;
-function TAuraAssignmentNode.CreateAst: IAstNode;
+function TAssignmentNodeHandler.GetAstNode: IAstNode;
+begin
+ Result := FNode;
+end;
+
+procedure TAssignmentNodeHandler.BuildUI(OwnerNode: TAuraNode);
+var
+ visu: IAstVisualizer;
+begin
+ visu := OwnerNode.Visualizer.Clone(OwnerNode, OwnerNode.Visualizer.ExprDepth + 1);
+ OwnerNode.BeginUpdate;
+ try
+ OwnerNode.Frameless := True;
+ OwnerNode.Orientation := loHorizontal;
+ OwnerNode.AddLabel(OwnerNode, FNode.Identifier.Name);
+ OwnerNode.AddLabel(OwnerNode, ':=');
+ FValueNode := visu.CallAccept(FNode.Value);
+ finally
+ OwnerNode.EndUpdate;
+ end;
+end;
+
+function TAssignmentNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
begin
- // Re-create identifier from FNode
Result := TAst.Assign(TAst.Identifier(FNode.Identifier.Name), FValueNode.CreateAst);
end;
-procedure TAuraAssignmentNode.SetupNode;
-var
- visu: IAstVisualizer;
+{ TMacroDefinitionNodeHandler }
+
+constructor TMacroDefinitionNodeHandler.Create(const ANode: IMacroDefinitionNode);
begin
- visu := FVisualizer.Clone(Self, FVisualizer.ExprDepth + 1);
-
- BeginUpdate;
- try
- Frameless := True; // Horizontal layout
- Orientation := loHorizontal;
-
- // Add identifier name as a label
- AddLabel(Self, FNode.Identifier.Name);
-
- AddLabel(Self, ':=');
-
- FValueNode := visu.CallAccept(FNode.Value);
- finally
- EndUpdate;
- end;
-end;
-
-{ TAuraMacroDefinitionNode }
-
-constructor TAuraMacroDefinitionNode.Create(const AVisualizer: IAstVisualizer; const ANode: IMacroDefinitionNode);
-begin
- inherited Create(AVisualizer);
+ inherited Create;
FNode := ANode;
end;
-function TAuraMacroDefinitionNode.CreateAst: IAstNode;
+function TMacroDefinitionNodeHandler.GetAstNode: IAstNode;
begin
- // This assumes FBodyNode will create a valid IQuasiquoteNode.
- Result :=
- TAst.MacroDef(
- TAst.Identifier(FNode.Name.Name),
- FNode.Parameters, // Re-use original parameters
- IQuasiquoteNode(FBodyNode.CreateAst)
- );
+ Result := FNode;
end;
-procedure TAuraMacroDefinitionNode.SetupNode;
+procedure TMacroDefinitionNodeHandler.BuildUI(OwnerNode: TAuraNode);
var
visu: IAstVisualizer;
titleLabel: TLabel;
paramStr: string;
i: Integer;
begin
- visu := FVisualizer.Clone(Self, FVisualizer.ExprDepth + 1);
-
- BeginUpdate;
+ visu := OwnerNode.Visualizer.Clone(OwnerNode, OwnerNode.Visualizer.ExprDepth + 1);
+ OwnerNode.BeginUpdate;
try
- Frameless := False;
- Orientation := loVertical;
+ OwnerNode.Frameless := False;
+ OwnerNode.Orientation := loVertical;
- // Build parameter string
paramStr := '';
for i := 0 to High(FNode.Parameters) do
begin
@@ -1889,196 +1993,262 @@ begin
paramStr := paramStr + FNode.Parameters[i].Name;
end;
- titleLabel := AddLabel(Self, 'Macro Def: ' + FNode.Name.Name + ' (' + paramStr + ')');
+ titleLabel := OwnerNode.AddLabel(OwnerNode, 'Macro Def: ' + FNode.Name.Name + ' (' + paramStr + ')');
titleLabel.Font.Style := titleLabel.Font.Style + [TFontStyle.fsBold];
FBodyNode := visu.CallAccept(FNode.Body);
finally
- EndUpdate;
+ OwnerNode.EndUpdate;
end;
end;
-{ TAuraQuasiquoteNode }
-
-constructor TAuraQuasiquoteNode.Create(const AVisualizer: IAstVisualizer; const ANode: IQuasiquoteNode);
+function TMacroDefinitionNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
begin
- inherited Create(AVisualizer);
+ Result := TAst.MacroDef(TAst.Identifier(FNode.Name.Name), FNode.Parameters, FBodyNode.CreateAst);
+end;
+
+{ TQuasiquoteNodeHandler }
+
+constructor TQuasiquoteNodeHandler.Create(const ANode: IQuasiquoteNode);
+begin
+ inherited Create;
FNode := ANode;
end;
-function TAuraQuasiquoteNode.CreateAst: IAstNode;
+function TQuasiquoteNodeHandler.GetAstNode: IAstNode;
begin
- Result := TAst.Quasiquote(FExpressionNode.CreateAst);
+ Result := FNode;
end;
-procedure TAuraQuasiquoteNode.SetupNode;
+procedure TQuasiquoteNodeHandler.BuildUI(OwnerNode: TAuraNode);
var
visu: IAstVisualizer;
titleLabel: TLabel;
begin
- visu := FVisualizer.Clone(Self, FVisualizer.ExprDepth + 1);
- BeginUpdate;
+ visu := OwnerNode.Visualizer.Clone(OwnerNode, OwnerNode.Visualizer.ExprDepth + 1);
+ OwnerNode.BeginUpdate;
try
- Frameless := False;
- Orientation := loVertical;
- titleLabel := AddLabel(Self, 'Quasiquote');
+ OwnerNode.Frameless := False;
+ OwnerNode.Orientation := loVertical;
+ titleLabel := OwnerNode.AddLabel(OwnerNode, 'Quasiquote');
titleLabel.Font.Style := titleLabel.Font.Style + [TFontStyle.fsBold];
FExpressionNode := visu.CallAccept(FNode.Expression);
finally
- EndUpdate;
+ OwnerNode.EndUpdate;
end;
end;
-{ TAuraUnquoteNode }
-
-constructor TAuraUnquoteNode.Create(const AVisualizer: IAstVisualizer; const ANode: IUnquoteNode);
+function TQuasiquoteNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
begin
- inherited Create(AVisualizer);
+ Result := TAst.Quasiquote(FExpressionNode.CreateAst);
+end;
+
+{ TUnquoteNodeHandler }
+
+constructor TUnquoteNodeHandler.Create(const ANode: IUnquoteNode);
+begin
+ inherited Create;
FNode := ANode;
end;
-function TAuraUnquoteNode.CreateAst: IAstNode;
+function TUnquoteNodeHandler.GetAstNode: IAstNode;
begin
- Result := TAst.Unquote(FExpressionNode.CreateAst);
+ Result := FNode;
end;
-procedure TAuraUnquoteNode.SetupNode;
+procedure TUnquoteNodeHandler.BuildUI(OwnerNode: TAuraNode);
var
visu: IAstVisualizer;
begin
- visu := FVisualizer.Clone(Self, FVisualizer.ExprDepth + 1);
- BeginUpdate;
+ visu := OwnerNode.Visualizer.Clone(OwnerNode, OwnerNode.Visualizer.ExprDepth + 1);
+ OwnerNode.BeginUpdate;
try
- Frameless := True; // Horizontal layout
- Orientation := loHorizontal;
+ OwnerNode.Frameless := True;
+ OwnerNode.Orientation := loHorizontal;
- var leftBracket := AddLabel(Self, '<');
+ var leftBracket := OwnerNode.AddLabel(OwnerNode, '<');
leftBracket.Padding.Right := 0;
leftBracket.Margins.Right := 0;
FExpressionNode := visu.CallAccept(FNode.Expression);
- var rightBracket := AddLabel(Self, '>');
+ var rightBracket := OwnerNode.AddLabel(OwnerNode, '>');
rightBracket.Padding.Left := 0;
rightBracket.Margins.Left := 0;
finally
- EndUpdate;
+ OwnerNode.EndUpdate;
end;
end;
-{ TAuraUnquoteSplicingNode }
-
-constructor TAuraUnquoteSplicingNode.Create(const AVisualizer: IAstVisualizer; const ANode: IUnquoteSplicingNode);
+function TUnquoteNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
begin
- inherited Create(AVisualizer);
+ Result := TAst.Unquote(FExpressionNode.CreateAst);
+end;
+
+{ TUnquoteSplicingNodeHandler }
+
+constructor TUnquoteSplicingNodeHandler.Create(const ANode: IUnquoteSplicingNode);
+begin
+ inherited Create;
FNode := ANode;
end;
-function TAuraUnquoteSplicingNode.CreateAst: IAstNode;
+function TUnquoteSplicingNodeHandler.GetAstNode: IAstNode;
begin
- Result := TAst.UnquoteSplicing(FExpressionNode.CreateAst.AsQuasiquote);
+ Result := FNode;
end;
-procedure TAuraUnquoteSplicingNode.SetupNode;
+procedure TUnquoteSplicingNodeHandler.BuildUI(OwnerNode: TAuraNode);
var
visu: IAstVisualizer;
titleLabel: TLabel;
begin
- visu := FVisualizer.Clone(Self, FVisualizer.ExprDepth + 1);
- BeginUpdate;
+ visu := OwnerNode.Visualizer.Clone(OwnerNode, OwnerNode.Visualizer.ExprDepth + 1);
+ OwnerNode.BeginUpdate;
try
- Frameless := False;
- Orientation := loVertical;
- titleLabel := AddLabel(Self, 'Unquote-Splicing');
+ OwnerNode.Frameless := False;
+ OwnerNode.Orientation := loVertical;
+ titleLabel := OwnerNode.AddLabel(OwnerNode, 'Unquote-Splicing');
titleLabel.Font.Style := titleLabel.Font.Style + [TFontStyle.fsBold];
FExpressionNode := visu.CallAccept(FNode.Expression);
finally
- EndUpdate;
+ OwnerNode.EndUpdate;
end;
end;
-{ TAuraIndexerNode }
-
-constructor TAuraIndexerNode.Create(const AVisualizer: IAstVisualizer; const ANode: IIndexerNode);
+function TUnquoteSplicingNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
begin
- inherited Create(AVisualizer);
+ Result := TAst.UnquoteSplicing(FExpressionNode.CreateAst.AsQuasiquote);
+end;
+
+{ TIndexerNodeHandler }
+
+constructor TIndexerNodeHandler.Create(const ANode: IIndexerNode);
+begin
+ inherited Create;
FNode := ANode;
end;
-function TAuraIndexerNode.CreateAst: IAstNode;
+function TIndexerNodeHandler.GetAstNode: IAstNode;
+begin
+ Result := FNode;
+end;
+
+procedure TIndexerNodeHandler.BuildUI(OwnerNode: TAuraNode);
+var
+ visu: IAstVisualizer;
+begin
+ visu := OwnerNode.Visualizer.Clone(OwnerNode, OwnerNode.Visualizer.ExprDepth + 1);
+ OwnerNode.BeginUpdate;
+ try
+ OwnerNode.Frameless := True;
+ OwnerNode.Orientation := loHorizontal;
+ FBaseNode := visu.CallAccept(FNode.Base);
+ OwnerNode.AddLabel(OwnerNode, '[');
+ FIndexNode := visu.CallAccept(FNode.Index);
+ OwnerNode.AddLabel(OwnerNode, ']');
+ finally
+ OwnerNode.EndUpdate;
+ end;
+end;
+
+function TIndexerNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
begin
Result := TAst.Indexer(FBaseNode.CreateAst, FIndexNode.CreateAst);
end;
-procedure TAuraIndexerNode.SetupNode;
-var
- visu: IAstVisualizer;
+{ TMemberAccessNodeHandler }
+
+constructor TMemberAccessNodeHandler.Create(const ANode: IMemberAccessNode);
begin
- visu := FVisualizer.Clone(Self, FVisualizer.ExprDepth + 1);
- BeginUpdate;
- try
- Frameless := True; // Horizontal layout: Base[Index]
- Orientation := loHorizontal;
-
- FBaseNode := visu.CallAccept(FNode.Base);
- AddLabel(Self, '[');
- FIndexNode := visu.CallAccept(FNode.Index);
- AddLabel(Self, ']');
- finally
- EndUpdate;
- end;
-end;
-
-{ TAuraMemberAccessNode }
-
-constructor TAuraMemberAccessNode.Create(const AVisualizer: IAstVisualizer; const ANode: IMemberAccessNode);
-begin
- inherited Create(AVisualizer);
+ inherited Create;
FNode := ANode;
end;
-function TAuraMemberAccessNode.CreateAst: IAstNode;
+function TMemberAccessNodeHandler.GetAstNode: IAstNode;
begin
- // Re-create identifier from FNode
- Result := TAst.MemberAccess(FBaseNode.CreateAst, TAst.Keyword(FNode.Member.Value.Name));
+ Result := FNode;
end;
-procedure TAuraMemberAccessNode.SetupNode;
+procedure TMemberAccessNodeHandler.BuildUI(OwnerNode: TAuraNode);
var
visu: IAstVisualizer;
begin
- visu := FVisualizer.Clone(Self, FVisualizer.ExprDepth + 1);
- BeginUpdate;
+ visu := OwnerNode.Visualizer.Clone(OwnerNode, OwnerNode.Visualizer.ExprDepth + 1);
+ OwnerNode.BeginUpdate;
try
- Frameless := True; // Horizontal layout: Base.Member
- Orientation := loHorizontal;
-
+ OwnerNode.Frameless := True;
+ OwnerNode.Orientation := loHorizontal;
FBaseNode := visu.CallAccept(FNode.Base);
- AddLabel(Self, '.');
-
- // Add member name as a label
- AddLabel(Self, FNode.Member.Value.Name);
+ OwnerNode.AddLabel(OwnerNode, '.');
+ OwnerNode.AddLabel(OwnerNode, FNode.Member.Value.Name);
finally
- EndUpdate;
+ OwnerNode.EndUpdate;
end;
end;
-{ TAuraRecordLiteralNode }
-
-constructor TAuraRecordLiteralNode.Create(const AVisualizer: IAstVisualizer; const ANode: IRecordLiteralNode);
+function TMemberAccessNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
begin
- inherited Create(AVisualizer);
+ Result := TAst.MemberAccess(FBaseNode.CreateAst, TAst.Keyword(FNode.Member.Value.Name));
+end;
+
+{ TRecordLiteralNodeHandler }
+
+constructor TRecordLiteralNodeHandler.Create(const ANode: IRecordLiteralNode);
+begin
+ inherited Create;
FNode := ANode;
FFieldNodes := TDictionary.Create;
end;
-destructor TAuraRecordLiteralNode.Destroy;
+destructor TRecordLiteralNodeHandler.Destroy;
begin
FFieldNodes.Free;
inherited Destroy;
end;
-function TAuraRecordLiteralNode.CreateAst: IAstNode;
+function TRecordLiteralNodeHandler.GetAstNode: IAstNode;
+begin
+ Result := FNode;
+end;
+
+procedure TRecordLiteralNodeHandler.BuildUI(OwnerNode: TAuraNode);
+var
+ field: TRecordFieldLiteral;
+ fieldContainer: TAutoFitControl;
+ valueNode: TAuraNode;
+ keyLabel: TLabel;
+begin
+ OwnerNode.BeginUpdate;
+ try
+ OwnerNode.Frameless := False;
+ OwnerNode.Orientation := loVertical;
+ OwnerNode.Alignment := laFlush;
+
+ if Length(FNode.Fields) = 0 then
+ begin
+ OwnerNode.AddLabel(OwnerNode, '{}');
+ end
+ else
+ begin
+ for field in FNode.Fields do
+ begin
+ fieldContainer := OwnerNode.AddContainer(OwnerNode, loHorizontal, laCenter);
+ keyLabel := OwnerNode.AddLabel(fieldContainer, ':' + field.Key.Value.Name);
+ keyLabel.Font.Style := keyLabel.Font.Style + [TFontStyle.fsBold];
+ keyLabel.StyledSettings := keyLabel.StyledSettings - [TStyledSetting.FontColor];
+ keyLabel.FontColor := TAlphaColors.Mediumvioletred;
+
+ valueNode := OwnerNode.Visualizer.Clone(fieldContainer, OwnerNode.Visualizer.ExprDepth + 1).CallAccept(field.Value);
+ FFieldNodes.Add(field.Key.Value, valueNode);
+ end;
+ end;
+ finally
+ OwnerNode.EndUpdate;
+ end;
+end;
+
+function TRecordLiteralNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
var
fields: TArray;
i: Integer;
@@ -2087,97 +2257,85 @@ var
begin
SetLength(fields, FFieldNodes.Count);
i := 0;
- // Note: TDictionary iteration order is not guaranteed,
- // but TScalarRecordDefinition is looked up by name, so order doesn't matter.
for pair in FFieldNodes do
begin
valueNode := pair.Value;
- fields[i] := TRecordFieldLiteral.Create(TKeywordNode.Create(pair.Key), valueNode.CreateAst);
+ fields[i] := TRecordFieldLiteral.Create(TAst.Keyword(pair.Key.Name), valueNode.CreateAst);
inc(i);
end;
Result := TAst.RecordLiteral(fields);
end;
-procedure TAuraRecordLiteralNode.SetupNode;
-var
- field: TRecordFieldLiteral;
- fieldContainer: TAutoFitControl;
- valueNode: TAuraNode;
- keyLabel: TLabel;
+{ TCreateSeriesNodeHandler }
+
+constructor TCreateSeriesNodeHandler.Create(const ANode: ICreateSeriesNode);
begin
- BeginUpdate;
- try
- Frameless := False;
- Orientation := loVertical;
- Alignment := laFlush; // Align fields to the left
-
- if Length(FNode.Fields) = 0 then
- begin
- AddLabel(Self, '{}');
- end
- else
- begin
- for field in FNode.Fields do
- begin
- // Create a horizontal container for the key-value pair
- fieldContainer := AddContainer(Self, loHorizontal, laCenter);
-
- // Key label
- keyLabel := AddLabel(fieldContainer, ':' + field.Key.Value.Name);
- keyLabel.Font.Style := keyLabel.Font.Style + [TFontStyle.fsBold];
- keyLabel.StyledSettings := keyLabel.StyledSettings - [TStyledSetting.FontColor];
- keyLabel.FontColor := TAlphaColors.Mediumvioletred;
-
- // Value node
- valueNode := FVisualizer.Clone(fieldContainer, FVisualizer.ExprDepth + 1).CallAccept(field.Value);
-
- // Store for CreateAst
- FFieldNodes.Add(field.Key.Value, valueNode);
- end;
- end;
- finally
- EndUpdate;
- end;
-end;
-
-{ TAuraCreateSeriesNode }
-
-constructor TAuraCreateSeriesNode.Create(const AVisualizer: IAstVisualizer; const ANode: ICreateSeriesNode);
-begin
- inherited Create(AVisualizer);
+ inherited Create;
FNode := ANode;
end;
-function TAuraCreateSeriesNode.CreateAst: IAstNode;
+function TCreateSeriesNodeHandler.GetAstNode: IAstNode;
+begin
+ Result := FNode;
+end;
+
+procedure TCreateSeriesNodeHandler.BuildUI(OwnerNode: TAuraNode);
+var
+ titleLabel: TLabel;
+begin
+ OwnerNode.BeginUpdate;
+ try
+ OwnerNode.Frameless := False;
+ OwnerNode.Orientation := loVertical;
+ titleLabel := OwnerNode.AddLabel(OwnerNode, 'Create Series: ' + FNode.Definition);
+ titleLabel.Font.Style := titleLabel.Font.Style + [TFontStyle.fsBold];
+ finally
+ OwnerNode.EndUpdate;
+ end;
+end;
+
+function TCreateSeriesNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
begin
Result := TAst.CreateSeries(FNode.Definition);
end;
-procedure TAuraCreateSeriesNode.SetupNode;
-var
- titleLabel: TLabel;
-begin
- BeginUpdate;
- try
- Frameless := False; // Leaf node, but framed
- Orientation := loVertical;
- titleLabel := AddLabel(Self, 'Create Series: ' + FNode.Definition);
- titleLabel.Font.Style := titleLabel.Font.Style + [TFontStyle.fsBold];
- finally
- EndUpdate;
- end;
-end;
+{ TAddSeriesItemNodeHandler }
-{ TAuraAddSeriesItemNode }
-
-constructor TAuraAddSeriesItemNode.Create(const AVisualizer: IAstVisualizer; const ANode: IAddSeriesItemNode);
+constructor TAddSeriesItemNodeHandler.Create(const ANode: IAddSeriesItemNode);
begin
- inherited Create(AVisualizer);
+ inherited Create;
FNode := ANode;
FLookbackNode := nil;
end;
-function TAuraAddSeriesItemNode.CreateAst: IAstNode;
+function TAddSeriesItemNodeHandler.GetAstNode: IAstNode;
+begin
+ Result := FNode;
+end;
+
+procedure TAddSeriesItemNodeHandler.BuildUI(OwnerNode: TAuraNode);
+var
+ visu: IAstVisualizer;
+ titleLabel: TLabel;
+begin
+ visu := OwnerNode.Visualizer.Clone(OwnerNode, OwnerNode.Visualizer.ExprDepth + 1);
+ OwnerNode.BeginUpdate;
+ try
+ OwnerNode.Frameless := False;
+ OwnerNode.Orientation := loVertical;
+
+ titleLabel := OwnerNode.AddLabel(OwnerNode, 'Add Item to: ' + FNode.Series.Name);
+ titleLabel.Font.Style := titleLabel.Font.Style + [TFontStyle.fsBold];
+
+ FValueNode := visu.CallAccept(FNode.Value);
+ if Assigned(FNode.Lookback) then
+ FLookbackNode := visu.CallAccept(FNode.Lookback);
+ finally
+ OwnerNode.EndUpdate;
+ end;
+end;
+
+function TAddSeriesItemNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
var
lookbackAst: IAstNode;
begin
@@ -2189,88 +2347,72 @@ begin
Result := TAst.AddSeriesItem(TAst.Identifier(FNode.Series.Name), FValueNode.CreateAst, lookbackAst);
end;
-procedure TAuraAddSeriesItemNode.SetupNode;
-var
- visu: IAstVisualizer;
- titleLabel: TLabel;
+{ TSeriesLengthNodeHandler }
+
+constructor TSeriesLengthNodeHandler.Create(const ANode: ISeriesLengthNode);
begin
- visu := FVisualizer.Clone(Self, FVisualizer.ExprDepth + 1);
- BeginUpdate;
- try
- Frameless := False;
- Orientation := loVertical;
-
- titleLabel := AddLabel(Self, 'Add Item to: ' + FNode.Series.Name);
- titleLabel.Font.Style := titleLabel.Font.Style + [TFontStyle.fsBold];
-
- FValueNode := visu.CallAccept(FNode.Value);
- if Assigned(FNode.Lookback) then
- FLookbackNode := visu.CallAccept(FNode.Lookback);
- finally
- EndUpdate;
- end;
-end;
-
-{ TAuraSeriesLengthNode }
-
-constructor TAuraSeriesLengthNode.Create(const AVisualizer: IAstVisualizer; const ANode: ISeriesLengthNode);
-begin
- inherited Create(AVisualizer);
+ inherited Create;
FNode := ANode;
end;
-function TAuraSeriesLengthNode.CreateAst: IAstNode;
+function TSeriesLengthNodeHandler.GetAstNode: IAstNode;
+begin
+ Result := FNode;
+end;
+
+procedure TSeriesLengthNodeHandler.BuildUI(OwnerNode: TAuraNode);
+var
+ titleLabel: TLabel;
+begin
+ OwnerNode.BeginUpdate;
+ try
+ OwnerNode.Frameless := False;
+ OwnerNode.Orientation := loVertical;
+ titleLabel := OwnerNode.AddLabel(OwnerNode, 'Length of: ' + FNode.Series.Name);
+ titleLabel.Font.Style := titleLabel.Font.Style + [TFontStyle.fsBold];
+ finally
+ OwnerNode.EndUpdate;
+ end;
+end;
+
+function TSeriesLengthNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
begin
Result := TAst.SeriesLength(TAst.Identifier(FNode.Series.Name));
end;
-procedure TAuraSeriesLengthNode.SetupNode;
-var
- titleLabel: TLabel;
-begin
- BeginUpdate;
- try
- Frameless := False; // Leaf node, but framed
- Orientation := loVertical;
- titleLabel := AddLabel(Self, 'Length of: ' + FNode.Series.Name);
- titleLabel.Font.Style := titleLabel.Font.Style + [TFontStyle.fsBold];
- finally
- EndUpdate;
- end;
-end;
+{ TNopNodeHandler }
-{ TAuraNopNode }
-
-constructor TAuraNopNode.Create(const AVisualizer: IAstVisualizer; const ANode: INopNode);
+constructor TNopNodeHandler.Create(const ANode: INopNode);
begin
- inherited Create(AVisualizer);
+ inherited Create;
FNode := ANode;
-
- // Visual style for Nop: Dotted border, minimal size, clear color.
- Frameless := true;
- Alignment := TLayoutAlignment.laCenter;
- Orientation := TLayoutOrientation.loHorizontal;
end;
-function TAuraNopNode.CreateAst: IAstNode;
+function TNopNodeHandler.GetAstNode: IAstNode;
begin
- // The visual node returns the original Nop node, which the compiler pipeline must reject.
Result := FNode;
end;
-procedure TAuraNopNode.SetupNode;
+procedure TNopNodeHandler.BuildUI(OwnerNode: TAuraNode);
var
lbl: TLabel;
begin
- BeginUpdate;
+ OwnerNode.BeginUpdate;
try
- // Add a placeholder text
- lbl := AddLabel(Self, '...');
+ OwnerNode.Frameless := true;
+ OwnerNode.Alignment := TLayoutAlignment.laCenter;
+ OwnerNode.Orientation := TLayoutOrientation.loHorizontal;
+ lbl := OwnerNode.AddLabel(OwnerNode, '...');
lbl.Font.Style := lbl.Font.Style + [TFontStyle.fsBold];
lbl.Margins.Rect := TRectF.Create(8, 4, 8, 4);
finally
- EndUpdate;
+ OwnerNode.EndUpdate;
end;
end;
+function TNopNodeHandler.ReconstructAst(OwnerNode: TAuraNode): IAstNode;
+begin
+ Result := FNode;
+end;
+
end.
diff --git a/Src/AST/Myc.Ast.Binding.pas b/Src/AST/Myc.Ast.Binding.pas
index b052954..a2b39f0 100644
--- a/Src/AST/Myc.Ast.Binding.pas
+++ b/Src/AST/Myc.Ast.Binding.pas
@@ -181,9 +181,11 @@ end;
function TAstBinder.VisitMacroExpansionNode(const Node: IMacroExpansionNode): IAstNode;
begin
- // The MacroExpander (Phase 1) should have unwrapped this.
- // We only visit the *expanded* body.
- Result := Accept(Node.ExpandedBody);
+ // The MacroExpander (Phase 1) created this node.
+ // We must bind the ExpandedBody, but keep the MacroExpansionNode wrapper.
+ // The base TAstTransformer implementation already does exactly this
+ // by visiting Callee, Arguments, and ExpandedBody.
+ Result := inherited VisitMacroExpansionNode(Node);
end;
function TAstBinder.VisitFunctionCall(const Node: IFunctionCallNode): IAstNode;
diff --git a/Src/AST/Myc.Ast.MacroExpander.pas b/Src/AST/Myc.Ast.MacroExpander.pas
index 8e075f1..94c455e 100644
--- a/Src/AST/Myc.Ast.MacroExpander.pas
+++ b/Src/AST/Myc.Ast.MacroExpander.pas
@@ -1,3 +1,6 @@
+//==================================================================================================
+//== FULL UNIT START: Myc.Ast.MacroExpander (from Myc.Ast.MacroExpander.pas)
+//==================================================================================================
unit Myc.Ast.MacroExpander;
interface
@@ -280,7 +283,8 @@ begin
// --- It is a macro, expand it ---
// 1. Create the temporary scope for the macro parameters
- var expansionScope := TAst.CreateScope(nil);
+ // It must be parented to the *initial* scope to find other macros/globals.
+ var expansionScope := TAst.CreateScope(FInitialScope);
var params := macroDef.Parameters;
if Length(Node.Arguments) <> Length(params) then
raise Exception
@@ -301,14 +305,11 @@ begin
boundSubAst: IAstNode;
begin
// This is the compile-time evaluation (Binder + Evaluator)
- // It runs in the *current* context (FInitialScope + FCurrentDescriptor)
- var tempInitScope := TScope.CreateScope(FInitialScope.Parent, FCurrentDescriptor, nil);
+ // [FIX] It must run in the 'expansionScope' which contains the parameters.
+ boundSubAst := TAstBinder.Bind(expansionScope, ANodeToEvaluate, subDescriptor);
- // Bind (mutates ANodeToEvaluate) and get its descriptor
- boundSubAst := TAstBinder.Bind(tempInitScope, ANodeToEvaluate, subDescriptor);
-
- // Create eval scope from the new descriptor
- evalScope := subDescriptor.CreateScope(tempInitScope);
+ // Create eval scope from the new descriptor, parented to the expansion scope
+ evalScope := subDescriptor.CreateScope(expansionScope);
evaluator := FEvaluatorFactory(evalScope);
Result := evaluator.Execute(boundSubAst);
diff --git a/Src/AST/Myc.Ast.Nodes.pas b/Src/AST/Myc.Ast.Nodes.pas
index 858272c..946d716 100644
--- a/Src/AST/Myc.Ast.Nodes.pas
+++ b/Src/AST/Myc.Ast.Nodes.pas
@@ -68,6 +68,12 @@ type
akNop // Added Nop
);
+ // Helper for TAstNodeKind providing a string representation
+ TAstNodeKindHelper = record helper for TAstNodeKind
+ public
+ function ToString: string;
+ end;
+
// --- Concrete Type Definitions ---
// Defines how an identifier's address was resolved.
@@ -377,7 +383,18 @@ type
implementation
uses
- System.Classes;
+ System.Classes,
+ System.Rtti,
+ System.StrUtils;
+
+{ TAstNodeKindHelper }
+
+function TAstNodeKindHelper.ToString: string;
+begin
+ Result := TRttiEnumerationType.GetName(Self);
+ Assert(StartsText('ak', Result));
+ Result := Result.Substring(2);
+end;
{ TResolvedAddress }