DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦8c0641bb5⟧ TextFile

    Length: 2836 (0xb14)
    Types: TextFile
    Names: »B«

Derivation

└─⟦5829e5ed5⟧ Bits:30000534 8mm tape, Rational 1000, RCI 2_0_5
    └─ ⟦c9a165082⟧ »DATA« 
        └─⟦2162db02b⟧ 
            └─⟦this⟧ 

TextFile

package body Parameter_Parser_Defs is

    function Deslash (S : String) return String is
        P : Integer := Su.Locate ('\', S);
    begin
        if P in 1 .. S'Last - 1 then
            return S (S'First .. P - 1) & S (P + 1) &
                      Deslash (S (P + 2 .. S'Last));
        else
            return S;
        end if;
    end Deslash;

    function Clean (S : String) return String is
    begin
        if S'Length = 0 then
            return S;
        elsif S (S'First) = '(' then
            if S (S'Last) = ')' then
                return Deslash (S (S'First + 1 .. S'Last - 1));
            else
                return Deslash (S (S'First + 1 .. S'Last));
            end if;
        else
            return Deslash (S);
        end if;
    end Clean;

    function Normal (S : String) return String is
        Ns : String (1 .. S'Length) := Su.Upper_Case (S);
    begin
        return Ns;
    end Normal;
    -- Allow abbreviations within <..>

    function May_Be (Arg, Val : String) return Boolean is

    begin
        return Arg'Length <= Val'Length and then
                  (Val (1 .. Arg'Length) = Arg or else
                   (Arg /= "" and then Arg (Arg'Last) = '>' and then
                    Arg (Arg'First .. Arg'Last - 1) =
                       Val (1 .. Arg'Length - 1)));
    end May_Be;

    procedure Unique_Prefix (S : String;
                             Result : out Enumeration;
                             Prefix : out Boolean;
                             Unique : out Boolean) is
        Already_Matched : Boolean := False;
        Exact : Boolean;
        Match : Boolean;
        Up_S : constant String := String_Utilities.Upper_Case (S);
        -- determines if S is a prefix of Is_In,  Case sensitive
        procedure Check_Prefix (S, Is_In : String;
                                Prefix : in out Boolean;
                                Exact : out Boolean) is
            Bound : constant Integer := Is_In'First + S'Length - 1;
        begin
            Prefix := S'Length <= Is_In'Length and then
                         S = Is_In (Is_In'First .. Bound);
            Exact := Prefix and then (S'Length = Is_In'Length);
        end Check_Prefix;
    begin
        Prefix := False;
        Unique := False;
        Result := Enumeration'Last;
        for Enum in Enumeration loop
            Check_Prefix (Up_S, Enumeration'Image (Enum), Match, Exact);
            if Exact then
                Result := Enum;
                Unique := True;
                Prefix := False;
                return;
            elsif Match then
                Unique := not Already_Matched;
                Already_Matched := True;
                Prefix := True;
                Result := Enum;
            end if;
        end loop;
    end Unique_Prefix;

end Parameter_Parser_Defs;