Index: src/natools-s_expressions-atom_buffers.ads ================================================================== --- src/natools-s_expressions-atom_buffers.ads +++ src/natools-s_expressions-atom_buffers.ads @@ -20,21 +20,15 @@ -- single Atom object. -- -- It also provides an individual Octet accessor, used in parser internal -- -- recursive buffer. -- ------------------------------------------------------------------------------ -with Natools.References; -with Natools.Storage_Pools; +with Natools.S_Expressions.Atom_Refs; package Natools.S_Expressions.Atom_Buffers is pragma Preelaborate (Atom_Buffers); - package Atom_Refs is new Natools.References - (Atom, - Storage_Pools.Access_In_Default_Pool'Storage_Pool, - Storage_Pools.Access_In_Default_Pool'Storage_Pool); - type Atom_Buffer is tagged private; procedure Preallocate (Buffer : in out Atom_Buffer; Length : in Count); -- Preallocate enough memory to append Length octets without -- any further allocation. ADDED src/natools-s_expressions-atom_refs.ads Index: src/natools-s_expressions-atom_refs.ads ================================================================== --- src/natools-s_expressions-atom_refs.ads +++ src/natools-s_expressions-atom_refs.ads @@ -0,0 +1,29 @@ +------------------------------------------------------------------------------ +-- Copyright (c) 2014, Natacha Porté -- +-- -- +-- Permission to use, copy, modify, and distribute this software for any -- +-- purpose with or without fee is hereby granted, provided that the above -- +-- copyright notice and this permission notice appear in all copies. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -- +-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -- +-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -- +-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -- +-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -- +-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -- +-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -- +------------------------------------------------------------------------------ + +------------------------------------------------------------------------------ +-- Natools.S_Expressions.Atom_Refs provides a common instance of default -- +-- reference-counted atoms. -- +------------------------------------------------------------------------------ + +with Natools.References; +with Natools.Storage_Pools; + +package Natools.S_Expressions.Atom_Refs is new Natools.References + (Natools.S_Expressions.Atom, + Natools.Storage_Pools.Access_In_Default_Pool'Storage_Pool, + Natools.Storage_Pools.Access_In_Default_Pool'Storage_Pool); +pragma Preelaborate (Natools.S_Expressions.Atom_Refs); Index: src/natools-s_expressions-interpreters.ads ================================================================== --- src/natools-s_expressions-interpreters.ads +++ src/natools-s_expressions-interpreters.ads @@ -26,11 +26,11 @@ ------------------------------------------------------------------------------ with Natools.S_Expressions.Lockable; private with Ada.Containers.Indefinite_Ordered_Maps; -private with Natools.S_Expressions.Atom_Buffers; +private with Natools.S_Expressions.Atom_Refs; generic type Shared_State (<>) is limited private; type Shared_Context (<>) is limited private; @@ -119,9 +119,9 @@ (Atom, Command'Class, Less_Than); type Interpreter is new Command with record Commands : Command_Maps.Map; Max_Length : Count := 0; - Fallback_Name : Atom_Buffers.Atom_Refs.Reference; + Fallback_Name : Atom_Refs.Reference; end record; end Natools.S_Expressions.Interpreters;