figasilx.blogg.se

Ada 95 linked list stack display
Ada 95 linked list stack display









ada 95 linked list stack display

Process : not null access procedure (Position : in Cursor ) ) procedure Reverse_Iterate Item : in Element_Type ) return Boolean function Has_Element (Position : in Cursor ) return Boolean procedure Iterate

ada 95 linked list stack display

Position : in Cursor := No_Element ) return Cursor function Contains (Container : in List Position : in Cursor := No_Element ) return Cursor function Reverse_Find (Container : in List Position : in Cursor ) function First (Container : in List ) return Cursor function First_Element (Container : in List ) return Element_Type function Last (Container : in List ) return Cursor function Last_Element (Container : in List ) return Element_Type function Next (Position : in Cursor ) return Cursor function Previous (Position : in Cursor ) return Cursor procedure Next (Position : in out Cursor ) procedure Previous (Position : in out Cursor ) function Find (Container : in List Position : in out Cursor ) procedure Splice (Container : in out List Source : in out List ) procedure Splice (Target : in out List J : in Cursor ) procedure Splice (Target : in out List J : in Cursor ) procedure Swap_Links (Container : in out List Source : in out List ) procedure Insert (Container : in out List Ĭount : in Count_Type := 1 ) procedure Insert (Container : in out List Ĭount : in Count_Type := 1 ) procedure Prepend (Container : in out List Ĭount : in Count_Type := 1 ) procedure Append (Container : in out List Ĭount : in Count_Type := 1 ) procedure Delete (Container : in out List Ĭount : in Count_Type := 1 ) procedure Delete_First (Container : in out List Ĭount : in Count_Type := 1 ) procedure Delete_Last (Container : in out List Ĭount : in Count_Type := 1 ) procedure Reverse_Elements (Container : in out List ) procedure Swap (Container : in out List Process : not null access procedure (Element : in out Element_Type ) ) procedure Move (Target : in out List Process : not null access procedure (Element : in Element_Type ) ) procedure Update_Element New_Item : in Element_Type ) procedure Query_Element Right : in List ) return Boolean function Length (Container : in List ) return Count_Type function Is_Empty (Container : in List ) return Boolean procedure Clear (Container : in out List ) function Element (Position : in Cursor ) return Element_Type procedure Replace_Element (Container : in out List

ada 95 linked list stack display

No_Element : constant Cursor function " =" (Left : in List Doubly_Linked_Lists is pragma Preelaborate (Doubly_Linked_Lists ) type List is tagged private pragma Preelaborable_Initialization (List ) type Cursor is private pragma Preelaborable_Initialization (Cursor ) Right : in Element_Type ) return Boolean is package Ada. SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual - generic type Element_Type is private with function " =" (Left : in Element_Type Specification - Standard Ada library specification - Copyright (c) 2003-2018 Maxim Reznik - Copyright (c) 2004-2016 AXE Consultants - Copyright (c) 2004, 2005, 2006 Ada-Europe - Copyright (c) 2000 The MITRE Corporation, Inc. The worm body is now represented by a doubly linked list, meaning we can loop through each element in either direction, by using the Next and Previous functions.įor those interested, the game can be found at GitHub. This type represents a tile type in a 2-dimensional array. Lvl : in Level_Access ) procedure Turn_Left (Worm : in Worm_Type_Access ) procedure Turn_Right (Worm : in Worm_Type_Access ) procedure Kill (Worm : in Worm_Type_Access ) end Worm Īs you can see, _Linked_Lists is instantiated with a type called “Position”. Doubly_Linked_Lists (Position ) use Worm_Position_Container type Worm_State is (Alive ,Dead ,Observing ) type Worm_Type is recordįull : Boolean := False end record type Worm_Type_Access is access Worm_Type procedure Update_Worm (Worm : in Worm_Type_Access Doubly_Linked_Lists with Wormlevel, Protocol -, Handlers package Worm is use Wormlevel, Protocol -, Handlers package Worm_Position_Container is new Ada. This file represents the specification of a worm. This is example usage is from an existing project. For more information, see doubly linked list. Doubly_Linked_Lists library works.Ī doubly linked list is merely a linked list where each element is not only linked to the next, but also the previous. This library enables the Ada developer to manipulate data structures such as doubly linked lists, maps, sets and vectors. One of the major additions to Ada 2005 is the container library. You can improve the Ada Programming wikibook by reading the contributing guidelines and expanding it.











Ada 95 linked list stack display