-- Trivial_Trie - Provide a trivial trie type for what needs to create but not to destroy them. -- Copyright (C) 2022 Prince Trippy . -- This program is free software: you can redistribute it and/or modify it under the terms of the -- GNU Affero General Public License version 3 as published by the Free Software Foundation. -- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without -- even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- See the GNU Affero General Public License for more details. -- You should have received a copy of the GNU Affero General Public License along with this program. -- If not, see . generic type Index_Type is (<>); type Domain_Type is (<>); type Input_Type is array (Index_Type range <>) of Domain_Type; type Stored_Type is private; package Trivial_Trie is type Trie is limited private; procedure Take (Path : in Input_Type; Tree : in out Trie); procedure Give (Path : in Input_Type; Tree : in out Trie; What : in Stored_Type); procedure Find (Path : in Input_Type; Tree : in Trie; Seen : out Boolean; Unto : out Stored_Type); procedure Sift (Path : in Input_Type; Tree : in Trie; Seen : out Boolean; Unto : out Trie); private type Node; type Trie is access Node; type Step is array (Domain_Type) of Trie; type Node is record Just : Boolean := False; Here : Stored_Type; Past : Step := (others => null); end record; end Trivial_Trie; .