with String_Utilities;
package body Line_Utilities is
    package Su renames String_Utilities;

    function Filter (In_Line : String) return String is
        Return_String : String (In_Line'First .. In_Line'Last) := In_Line;
    begin
        for I in Return_String'Range loop
            if Return_String (I) = Ascii.Lf or Return_String (I) = Ascii.Ht then
                Return_String (I) := ' ';
            end if;

        end loop;

        return Su.Strip (Return_String);
    end Filter;

    function Characterize (In_Line : String) return Line_Type is
        Modified_Line : constant String := Filter (In_Line);
    begin

        if Modified_Line'Length = 0 then
            return Blank_Line;
        elsif Modified_Line'Length >= 2 and then
              Modified_Line (Modified_Line'First .. Modified_Line'First + 1) =
                 "--" then
            return Comment_Line;
        else
            for I in Modified_Line'Range loop
                if Modified_Line (I) = ';' then
                    return Contains_Semi;
                end if;
            end loop;
        end if;

        return Other_Type;
    end Characterize;

end Line_Utilities;
