DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: ┃ B T ┃
Length: 12917 (0x3275) Types: TextFile Names: »B«
└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13 └─ ⟦124ff5788⟧ »DATA« └─⟦this⟧ └─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11 └─ ⟦129cab021⟧ »DATA« └─⟦this⟧ └─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16 └─ ⟦6f12a12be⟧ »DATA« └─⟦this⟧ └─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04 └─ ⟦d65440be7⟧ »DATA« └─⟦this⟧
------------------------------------------------------------------------------- with Text_Io; with Wild_String; package body Slot is --------------------------------------------------------------------------- function Make (The_Variable : Standard.String; With_Kind : Kind) return Element is The_Element : Element; begin The_Element.The_Name := Umps_Defs.Normalize (The_Variable); The_Element.The_Kind := With_Kind; The_Element.Empty := True; case (With_Kind) is when Integer => The_Element.The_Value := Value'(Is_Kind_Of => Integer, Integer => 0); when String => The_Element.The_Value := Value'(Is_Kind_Of => String, String => (others => Ascii.Nul)); when Character => The_Element.The_Value := Value'(Is_Kind_Of => Character, Character => Ascii.Nul); when Boolean => The_Element.The_Value := Value'(Is_Kind_Of => Boolean, Boolean => False); when Void => The_Element.The_Value := Value'(Is_Kind_Of => Void, Void => Ascii.Nul); end case; return The_Element; end Make; --------------------------------------------------------------------------- function Make (The_Variable : Standard.String; With_Value : Standard.Integer) return Element is The_Element : Element; begin The_Element.The_Name := Umps_Defs.Normalize (The_Variable); The_Element.The_Kind := Integer; The_Element.Empty := False; The_Element.The_Value := Value'(Is_Kind_Of => Integer, Integer => With_Value); return The_Element; end Make; --------------------------------------------------------------------------- function Make (The_Variable : Standard.String; With_Value : Standard.String) return Element is The_Element : Element; A_String : Umps_Defs.String; begin The_Element.The_Name := Umps_Defs.Normalize (The_Variable); A_String := Umps_Defs.Normalize (With_Value); The_Element.The_Kind := String; The_Element.Empty := False; The_Element.The_Value := Value' (Is_Kind_Of => String, String => A_String); return The_Element; end Make; --------------------------------------------------------------------------- function Make (The_Variable : Standard.String; With_Value : Standard.Character) return Element is The_Element : Element; begin The_Element.The_Name := Umps_Defs.Normalize (The_Variable); The_Element.The_Kind := Character; The_Element.Empty := False; The_Element.The_Value := Value'(Is_Kind_Of => Character, Character => With_Value); return The_Element; end Make; --------------------------------------------------------------------------- function Make (The_Variable : Standard.String; With_Value : Standard.Boolean) return Element is The_Element : Element; begin The_Element.The_Name := Umps_Defs.Normalize (The_Variable); The_Element.The_Kind := Boolean; The_Element.Empty := False; The_Element.The_Value := Value'(Is_Kind_Of => Boolean, Boolean => With_Value); return The_Element; end Make; --------------------------------------------------------------------------- function Name_Of (The_Element : Element) return Standard.String is begin return Umps_Defs.Denormalize (The_Element.The_Name); end Name_Of; --------------------------------------------------------------------------- function Kind_Of (The_Element : Element) return Kind is begin return The_Element.The_Kind; end Kind_Of; --------------------------------------------------------------------------- function Is_Empty_Value (The_Element : Element) return Standard.Boolean is begin return The_Element.Empty; end Is_Empty_Value; --------------------------------------------------------------------------- function Value_Of (The_Element : Element) return Standard.String is begin if (Is_Empty_Value (The_Element)) then raise Empty_Value_Error; end if; if (Kind_Of (The_Element) /= String) then raise Illegal_Access_Error; end if; return Umps_Defs.Denormalize (The_Element.The_Value.String); end Value_Of; --------------------------------------------------------------------------- function Value_Of (The_Element : Element) return Standard.Integer is begin if (Is_Empty_Value (The_Element)) then raise Empty_Value_Error; end if; if (Kind_Of (The_Element) /= Integer) then raise Illegal_Access_Error; end if; return The_Element.The_Value.Integer; end Value_Of; --------------------------------------------------------------------------- function Value_Of (The_Element : Element) return Standard.Character is begin if (Is_Empty_Value (The_Element)) then raise Empty_Value_Error; end if; if (Kind_Of (The_Element) /= Character) then raise Illegal_Access_Error; end if; return The_Element.The_Value.Character; end Value_Of; --------------------------------------------------------------------------- function Value_Of (The_Element : Element) return Standard.Boolean is begin if (Is_Empty_Value (The_Element)) then raise Empty_Value_Error; end if; if (Kind_Of (The_Element) /= Boolean) then raise Illegal_Access_Error; end if; return The_Element.The_Value.Boolean; end Value_Of; --------------------------------------------------------------------------- function Value_Part (The_Element : Element) return Value is begin return The_Element.The_Value; end Value_Part; --------------------------------------------------------------------------- function Image (The_Value : Value) return Standard.String is begin case The_Value.Is_Kind_Of is when String => return Umps_Defs.Denormalize (The_Value.String); when Integer => return Standard.Integer'Image (The_Value.Integer); when Character => return "" & The_Value.Character; when Boolean => return Standard.Boolean'Image (The_Value.Boolean); when Void => return ""; end case; end Image; --------------------------------------------------------------------------- function Image (The_Element : Element) return Standard.String is begin if (Is_Empty_Value (The_Element)) then return Name_Of (The_Element) & Umps_Defs.Separator & Kind'Image (Kind_Of (The_Element)) & Umps_Defs.Separator; else return Name_Of (The_Element) & Umps_Defs.Separator & Kind'Image (Kind_Of (The_Element)) & Umps_Defs.Separator & Image (Value_Part (The_Element)); end if; end Image; --------------------------------------------------------------------------- procedure Display (The_Element : Element; String_Before : Standard.String := "") is begin Text_Io.Put_Line (String_Before & "The_Element => " & Name_Of (The_Element)); Text_Io.Put_Line (String_Before & " Kind => " & Kind'Image (Kind_Of (The_Element))); if (Is_Empty_Value (The_Element)) then Text_Io.Put_Line (String_Before & " Value => <empty>"); else Text_Io.Put_Line (String_Before & " Value => " & Image (Value_Part (The_Element))); end if; end Display; --------------------------------------------------------------------------- function Is_Part_Equal (Left, Right : Value) return Standard.Boolean is begin case Left.Is_Kind_Of is when String => return Umps_Defs.Denormalize (Left.String) = Umps_Defs.Denormalize (Right.String); when Integer => return Left.Integer = Right.Integer; when Character => return Left.Character = Right.Character; when Boolean => return Left.Boolean = Right.Boolean; when Void => return True; end case; end Is_Part_Equal; --------------------------------------------------------------------------- function Is_Equal (Left, Right : Element) return Standard.Boolean is begin if (Field = On_None) then return True; end if; if (Umps_Defs.Denormalize (Left.The_Name) /= Umps_Defs.Denormalize (Right.The_Name)) then return False; elsif (Field = On_Name) then return True; end if; if (Kind_Of (Left) /= Kind_Of (Right)) then return False; elsif (Field = On_Kind) then return True; end if; if (Is_Empty_Value (Left) /= Is_Empty_Value (Right)) then return False; elsif (Is_Empty_Value (Left)) then return True; end if; return Is_Part_Equal (Value_Part (Left), Value_Part (Right)); end Is_Equal; --------------------------------------------------------------------------- function Is_Part_Less (Left, Right : Value) return Standard.Boolean is begin case Left.Is_Kind_Of is when String => return Umps_Defs.Denormalize (Left.String) < Umps_Defs.Denormalize (Right.String); when Integer => return Left.Integer < Right.Integer; when Character => return Left.Character < Right.Character; when Boolean => return Left.Boolean < Right.Boolean; when Void => return False; end case; end Is_Part_Less; --------------------------------------------------------------------------- function Is_Less (Left, Right : Element) return Standard.Boolean is begin if (Field = On_None) then return False; end if; if (Umps_Defs.Denormalize (Left.The_Name) > Umps_Defs.Denormalize (Right.The_Name)) then return False; elsif (Field = On_Name) then return True; end if; if (Kind_Of (Left) > Kind_Of (Right)) then return False; elsif (Field = On_Kind) then return True; end if; if (Is_Empty_Value (Left) or else Is_Empty_Value (Right)) then return False; end if; return Is_Part_Less (Value_Part (Left), Value_Part (Right)); end Is_Less; --------------------------------------------------------------------------- function Is_Part_Most (Left, Right : Value) return Standard.Boolean is begin case Left.Is_Kind_Of is when String => return Umps_Defs.Denormalize (Left.String) > Umps_Defs.Denormalize (Right.String); when Integer => return Left.Integer > Right.Integer; when Character => return Left.Character > Right.Character; when Boolean => return Left.Boolean > Right.Boolean; when Void => return False; end case; end Is_Part_Most; --------------------------------------------------------------------------- function Is_Most (Left, Right : Element) return Standard.Boolean is begin if (Field = On_None) then return False; end if; if (Umps_Defs.Denormalize (Left.The_Name) < Umps_Defs.Denormalize (Right.The_Name)) then return False; elsif (Field = On_Name) then return True; end if; if (Kind_Of (Left) < Kind_Of (Right)) then return False; elsif (Field = On_Kind) then return True; end if; if (Is_Empty_Value (Left) or else Is_Empty_Value (Right)) then return False; end if; return Is_Part_Most (Value_Part (Left), Value_Part (Right)); end Is_Most; end Slot;