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

⟦10011380b⟧ TextFile

    Length: 3755 (0xeab)
    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 Package_Or_Renames (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 either a package compilation unit or just a package =
    -- renames. If it is a nested compilaiton unit, then we will   =
    -- recurse on Get_Compilation_Unit. If it is renames,          =
    -- then we will keep getting tokens until the end of the       =
    -- declaration.                                                =
    -- Grammar :                                                   =
    --         <Package_Or_Renames> =                              =
    --            'PACKAGE' * 'RENAMES' * ';' |                    =
    --            <Package_Unit>                                   =
    --                                                             =
    -- Written  by  GER  with  help  from  b2  and  JM             =
    -- May 1985  EVB Software Engineering Inc.                     =
    --==============================================================

    Current_Token : Token_Package.Token;
    -- The current token read from the source file

    Nested_Unit : Compilation_Unit.Ada_Compilation_Unit;
    -- A compilation unit that is nested

    Peek_Token : Token_Package.Token;
    -- A future token to be used later

begin
    -- Package_Or_Renames

    -- Set the peek token back to the beginning

    Token_Package.Set_Peek_Back;

    -- Peek at the third token to see if it is a 'renames'. If it is
    -- 'renames' then parse a package renames, else recurse on
    -- Build_Ada_Compilation_Unit

    Peek_Next_Significant_Token (Significant_Token => Peek_Token);
    Peek_Next_Significant_Token (Significant_Token => Peek_Token);
    Peek_Next_Significant_Token (Significant_Token => Peek_Token);

    case Token_Package.Value_Of (Peek_Token) is
        when Token_Package.Renames_Token =>

            Search_For_Semicolon:
                loop

                    -- Get the next token and make sure it is not end of file
                    -- before adding it to the Compilation_Unit

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

                    if "/=" (Token_Package.Class_Of (Peek_Token),
                             Token_Package.End_Of_File) then
                        Compilation_Unit.Add_Token_To_Compilation_Unit
                           (Token_To_Add => Current_Token,
                            Unit_To_Add_To => Current_Unit);
                    else
                        -- Not a block statement
                        raise Build_Syntax_Error;
                    end if;

                    exit Search_For_Semicolon when
                       Token_Package.Value_Of (Current_Token) =
                          Token_Package.Semicolon_Token;
                end loop Search_For_Semicolon;

        when others =>

            -- Add on any comments, new lines, and blank lines to
            -- the present compilation unit

            Add_On_Insignificant_Tokens (Current_Unit => Current_Unit);

            -- Must be a nested package compilation unit so recurse

            Get_Compilation_Unit (Current_Unit => Nested_Unit);
            Compilation_Unit.Add_Compilation_Units
               (Added_Unit => Nested_Unit, Unit_To_Add_To => Current_Unit);
    end case;
end Package_Or_Renames;