aboutsummaryrefslogtreecommitdiff
path: root/src/kompsos.ads
diff options
context:
space:
mode:
Diffstat (limited to 'src/kompsos.ads')
-rw-r--r--src/kompsos.ads32
1 files changed, 23 insertions, 9 deletions
diff --git a/src/kompsos.ads b/src/kompsos.ads
index 66ebfd5..d1e19be 100644
--- a/src/kompsos.ads
+++ b/src/kompsos.ads
@@ -9,7 +9,6 @@
private with
Ada.Containers.Indefinite_Holders,
- Ada.Containers.Vectors,
Ada.Finalization;
@@ -460,26 +459,41 @@ private
- type Binding is record
- Key : Variable;
- Elem : Term;
+ type State_Component is limited record
+ Counter : Natural;
+ Key : Variable;
+ Value : Term;
+ Next : aliased State;
end record;
- package Binding_Vectors is new Ada.Containers.Vectors
- (Index_Type => Long_Positive,
- Element_Type => Binding);
+ type State_Component_Access is access State_Component;
+
+ type State_Control is new Ada.Finalization.Controlled with record
+ Actual : State_Component_Access := null;
+ end record;
+
+ overriding procedure Initialize
+ (This : in out State_Control);
+
+ overriding procedure Adjust
+ (This : in out State_Control);
+
+ overriding procedure Finalize
+ (This : in out State_Control);
type State is record
- Actual : Binding_Vectors.Vector;
+ Ctrl : State_Control := (Ada.Finalization.Controlled with Actual => null);
end record;
+ type State_Access is access State;
+
function Lookup
(This : in State;
Key : in Variable;
Value : out Term'Class)
return Boolean;
- Empty_State : constant State := (Actual => Binding_Vectors.Empty_Vector);
+ Empty_State : constant State := (Ctrl => (Ada.Finalization.Controlled with Actual => null));