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 - metrics - download
Index: B T

⟦7ca9df8a1⟧ TextFile

    Length: 6656 (0x1a00)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

with Text_Io; --**
separate (Compilation_Unit.Produce_Metrics)
procedure Task_Specification
             (Current_Compilation_Unit : in out Ada_Compilation_Unit;
              Program_Unit : in Program_Unit_State_Machine;
              Halstead : in Halstead_State_Machine;
              Loc : in Loc_State_Machine;
              Mccabe : in Mccabe_State_Machine) is

    --=============================================================
    -- Task_Specification ::=
    --     "TASK" [ "TYPE" ]
    --     <IDENTIFIER>
    --     [ "IS"  Pragma_Clause
    --            { Entry_Declaration Pragma_Clause }
    --            { Representation_Clause Pragma_Clause }
    --     "END" [ <IDENTIFIER> ] ] ";"
    --=============================================================


    Current_Token : Token_Package.Token;

    Is_Done : Boolean := False;
    Unit_Name : Program_Unit_Name;

begin
    -- Task_Specification

    Get_Next_Token (Out_Token => Current_Token,
                    From => Current_Compilation_Unit,
                    Current_Loc => Loc);

    if "/=" (Token_Package.Value_Of (Current_Token),
             Token_Package.Task_Token) then
        raise Syntax_Error;
    end if;

    Get_Next_Token (Out_Token => Current_Token,
                    From => Current_Compilation_Unit,
                    Current_Loc => Loc);

    if Token_Package.Value_Of (Current_Token) = Token_Package.Type_Token then

        -- increment Halstead TYPE operator count
        Halstead.Store_Operator ((Kind => Halstead_Operator.Type_Halstead));

        -- set program unit kind to TASK_TYPE_SPECIFICATION
        Program_Unit.Store_Kind_Of_Program_Unit
           (The_Kind_Of_Program_Unit => Task_Type_Specification);

        Get_Next_Token (Out_Token => Current_Token,
                        From => Current_Compilation_Unit,
                        Current_Loc => Loc);

    else

        -- set program unit kind to TASK_SPECIFICATION
        Program_Unit.Store_Kind_Of_Program_Unit
           (The_Kind_Of_Program_Unit => Task_Specification);

    end if;

    if "/=" (Token_Package.Class_Of (Current_Token),
             Token_Package.Identifier) then
        raise Syntax_Error;
    end if;

    -- increment Halstead operand count
    Halstead.Store_Operand (Halstead_Operand.Definition
                               (Token_Package.Value_Of
                                   (This_Token => Current_Token)));

    Unit_Name := String_To_Name (Token_Package.Value_Of (Current_Token));

    -- set program unit name
    Program_Unit.Store_Program_Unit_Name (The_Program_Unit_Name => Unit_Name);

    Get_Next_Token (Out_Token => Current_Token,
                    From => Current_Compilation_Unit,
                    Current_Loc => Loc);

    if Token_Package.Value_Of (Current_Token) = Token_Package.Is_Token then

        Pragma_Clause (Current_Compilation_Unit => Current_Compilation_Unit,
                       Program_Unit => Program_Unit,
                       Halstead => Halstead,
                       Loc => Loc,
                       Mccabe => Mccabe);

        Process_Entry_Declarations:
            while Token_Package.Value_Of
                     (Peek (From => Current_Compilation_Unit)) =
                  Token_Package.Entry_Token loop

                -- increment LOC data declaration count
                Loc.Change_Data_Declarations_Count;

                Entry_Declaration
                   (Current_Compilation_Unit => Current_Compilation_Unit,
                    Program_Unit => Program_Unit,
                    Halstead => Halstead,
                    Loc => Loc,
                    Mccabe => Mccabe);

                Pragma_Clause
                   (Current_Compilation_Unit => Current_Compilation_Unit,
                    Program_Unit => Program_Unit,
                    Halstead => Halstead,
                    Loc => Loc,
                    Mccabe => Mccabe);

            end loop Process_Entry_Declarations;

        Process_Representation_Clauses:
            while Token_Package.Value_Of
                     (Peek (From => Current_Compilation_Unit)) =
                  Token_Package.For_Token loop

                Representation_Clause
                   (Current_Compilation_Unit => Current_Compilation_Unit,
                    Program_Unit => Program_Unit,
                    Halstead => Halstead,
                    Loc => Loc,
                    Mccabe => Mccabe);

                Pragma_Clause
                   (Current_Compilation_Unit => Current_Compilation_Unit,
                    Program_Unit => Program_Unit,
                    Halstead => Halstead,
                    Loc => Loc,
                    Mccabe => Mccabe);

            end loop Process_Representation_Clauses;

        Get_Next_Token (Out_Token => Current_Token,
                        From => Current_Compilation_Unit,
                        Current_Loc => Loc);

        if "/=" (Token_Package.Value_Of (Current_Token),
                 Token_Package.End_Token) then
            raise Syntax_Error;
        end if;

        -- increment Halstead TASK_IS_END operator count
        Halstead.Store_Operator ((Kind =>
                                     Halstead_Operator.Task_Is_End_Halstead));

        Get_Next_Token (Out_Token => Current_Token,
                        From => Current_Compilation_Unit,
                        Current_Loc => Loc);

        if Token_Package.Class_Of (Current_Token) =
           Token_Package.Identifier then

            -- increment Halstead operand count
            Halstead.Store_Operand (Halstead_Operand.Definition
                                       (Token_Package.Value_Of
                                           (This_Token => Current_Token)));

            Get_Next_Token (Out_Token => Current_Token,
                            From => Current_Compilation_Unit,
                            Current_Loc => Loc);
        end if;

    else
        -- ACTOR TASK

        -- increment Halstead TASK operator count
        Halstead.Store_Operator ((Kind => Halstead_Operator.Task_Halstead));

        --** removed 11/21/85 by J. Margono
        --** reason: did not need another Get_Next_Token

    end if;

    if "/=" (Token_Package.Value_Of (Current_Token),
             Token_Package.Semicolon_Token) then
        --**
        Text_Io.Put ("TASK SPECIFICATION: Current token is ");
        Text_Io.Put_Line (Token_Package.Value_Of (Current_Token));
        raise Syntax_Error;
    end if;

    -- increment Halstead SEMICOLON operator count
    Halstead.Store_Operator ((Kind => Halstead_Operator.Semicolon_Halstead));

end Task_Specification;