diff --git a/lib2/h3-compilers.adb b/lib2/h3-compilers.adb index 03cde07..cfe1e8d 100644 --- a/lib2/h3-compilers.adb +++ b/lib2/h3-compilers.adb @@ -632,6 +632,12 @@ ada.text_io.put_line (">>>>>>>>>>> UNBALANCED INCLUSION CONTEXT..." & C.Prs.Top' procedure Initialize (C: in out Compiler) is begin Push_Parse_State (C, PS_START); + + declare + X: H3.Trees.Tree; + begin + H3.Trees.New_Node (X); + end; end Initialize; procedure Finalize (C: in out Compiler) is diff --git a/lib2/h3-trees.adb b/lib2/h3-trees.adb index 35720c0..014eefc 100644 --- a/lib2/h3-trees.adb +++ b/lib2/h3-trees.adb @@ -1,13 +1,20 @@ with Ada.Unchecked_Deallocation; +with ada.text_io; + package body H3.Trees is - procedure New_Node (Tr: in out Tree; Code: Node_Code) is + procedure New_Node (Tr: in out Tree) is N: Node_Pointer; begin - N := new Node(Code); + --N := new Node'(Code => NODE_VOID, Next => null ); + N := new Node; + + N.all := (Code => NODE_VOID, Next => Null); N.Next := Tr.Top; Tr.Top := N; + + ada.text_io.put_line ("new node..."); end New_Node; procedure Free_Node (Tr: in out Tree; N: in out Node) is @@ -20,12 +27,12 @@ package body H3.Trees is -- ------------------------------------------------------------------ - overriding procedure Initialize (C: in out Tree) is + overriding procedure Initialize (Tr: in out Tree) is begin null; end Initialize; - overriding procedure Finalize (C: in out Tree) is + overriding procedure Finalize (Tr: in out Tree) is begin null; end Finalize; diff --git a/lib2/h3-trees.ads b/lib2/h3-trees.ads index 10783e1..96131c4 100644 --- a/lib2/h3-trees.ads +++ b/lib2/h3-trees.ads @@ -38,8 +38,6 @@ package H3.Trees is end case; end record; - - -- parse tree type Tree is new Ada.Finalization.Limited_Controlled with record --Next_Node: System_Index := System_Index'First; @@ -47,6 +45,10 @@ package H3.Trees is Top: Node_Pointer := null; end record; - overriding procedure Initialize (C: in out Tree); - overriding procedure Finalize (C: in out Tree); + -- ------------------------------------------------------------------ + procedure New_Node (Tr: in out Tree); + + + overriding procedure Initialize (Tr: in out Tree); + overriding procedure Finalize (Tr: in out Tree); end H3.Trees;