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

⟦41369f47f⟧ TextFile

    Length: 4387 (0x1123)
    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

separate (Find_Unit.Build_Ada_Compilation_Unit)
procedure Task_Body (Current_Unit : in out
                        Compilation_Unit.Ada_Compilation_Unit) is
    --==============================================================
    -- This procedure builds the next part of the grammar for an   =
    -- Ada compilation unit. Based on the next token, we will      =
    -- complete different productions. At present, we are parsing  =
    -- a task body or a task body stub. This procedure will first  =
    -- of all look for the keyword 'SEPARATE' to see if this is a  =
    -- task stub. If not, then the task body portion of the        =
    -- grammar will be parsed. The exception Build_Syntax_Error    =
    -- will be raised if the end of file token is found.           =
    -- The grammar :                                               =
    --      <Task_Body> =                                          =
    --         * {<Declaration> *} <Begin_Statement> <End_Unit|    =
    --         'SEPARATE' ';'                                      =
    --                                                             =
    -- written  by  GER  with  help  from  b2  and  JM             =
    -- May 1985  at EVB Software Engineering                       =
    --==============================================================

    Current_Token : Token_Package.Token;
    -- Holds the current token
    Peek_Token : Token_Package.Token;
    -- A token that will be looked at again

begin
    -- Task_Body

    -- Set the peek back to the beginning

    Token_Package.Set_Peek_Back;

    -- Peek at the first keyword to see if it is a task
    -- body stub or just a task body

    Peek_Next_Significant_Token (Significant_Token => Peek_Token);

    -- Parse either a task body stub or a task body

    if Token_Package.Value_Of (Peek_Token) = Token_Package.Separate_Token then
        Get_Next_Significant_Token (Significant_Token => Current_Token,
                                    Current_Unit => Current_Unit);
        Compilation_Unit.Add_Token_To_Compilation_Unit
           (Token_To_Add => Current_Token, Unit_To_Add_To => Current_Unit);

        -- Get the semicolon token

        Get_Next_Significant_Token (Significant_Token => Current_Token,
                                    Current_Unit => Current_Unit);

        if Token_Package.Value_Of (Current_Token) =
           Token_Package.Semicolon_Token then
            Compilation_Unit.Add_Token_To_Compilation_Unit
               (Token_To_Add => Current_Token, Unit_To_Add_To => Current_Unit);
        else
            -- This is not a task body stub. Raise error
            raise Build_Syntax_Error;
        end if;

    else
        -- This must be a task body

        Search_For_Begin:
            while "/=" (Token_Package.Value_Of (Peek_Token),
                        Token_Package.Begin_Token) loop

                -- Is there a nested compilation unit ?

                case Token_Package.Value_Of (Peek_Token) is
                    when Token_Package.Package_Token |
                         Token_Package.Generic_Token |
                         Token_Package.Task_Token |
                         Token_Package.Procedure_Token |
                         Token_Package.Function_Token =>
                        Declaration (Current_Unit => Current_Unit);
                    when others =>
                        -- Not a nested compilation unit

                        Get_Next_Significant_Token
                           (Significant_Token => Current_Token,
                            Current_Unit => Current_Unit);

                        if Token_Package.Class_Of (Current_Token) =
                           Token_Package.End_Of_File then
                            raise Build_Syntax_Error;
                        else
                            Compilation_Unit.Add_Token_To_Compilation_Unit
                               (Token_To_Add => Current_Token,
                                Unit_To_Add_To => Current_Unit);
                        end if;

                end case;

                -- Peek at the next significant token

                Peek_Next_Significant_Token (Significant_Token => Peek_Token);
            end loop Search_For_Begin;

        Begin_Statement (Current_Unit => Current_Unit);
        End_Unit (Current_Unit => Current_Unit);
    end if;

end Task_Body;