package Singly_Linked_Lists is
------------------------------------------------------------------
--| specification for simple linked lists with a single pointer
--| Author: Michael B. Feldman, The George Washington University
--| Last Modified: September 1995
------------------------------------------------------------------
subtype WordType is String(1..3);
type List is private;
procedure AddToFront (L: in out List; Word: in WordType);
-- Pre: Word is defined; L may be empty
-- Post: Word is inserted at the beginning of L
procedure AddToEnd (L: in out List; Word: in WordType);
-- Pre: Word is defined; L may be empty
-- Post: Word is appended to the end of L
function Copy(L: in List) return List;
-- Pre: L may be empty
-- Post: returns a complete copy of the list L
procedure Traverse(L: in List);
-- Pre: L may be empty
-- Post: displays the contents of L's Word fields, in the
-- order in which they appear in L
private
type ListNode;
type List is access ListNode;
type ListNode is record
Word: WordType := "###";
Next: List;
end record;
end Singly_Linked_Lists;