|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: B T
Length: 4046 (0xfce)
Types: TextFile
Names: »B«
└─⟦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⟧
separate (Find_Unit.Build_Ada_Compilation_Unit)
procedure Function_Or_Instantiation
(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 function specification, function body, =
-- or a generic function instantiation. This program will =
-- use the peek ahead to determine whether this is an =
-- instantiation or one of the other productions. =
-- Grammar : =
-- <Function_Or_Instantiation> = =
-- <Desig> [<Left_Right_Paren>] =
-- <Function_Spec_Or_Body> | =
-- <Desig> 'IS' 'NEW' * ';' =
-- =
-- 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
Peek_Token : Token_Package.Token;
-- A future token to be used later
begin
-- Function_Or_Instantiation
-- Get the function designator
Get_Next_Significant_Token (Significant_Token => Current_Token,
Current_Unit => Current_Unit);
if Token_Package.Class_Of (Current_Token) = Token_Package.Identifier or
Token_Package.Class_Of (Current_Token) =
Token_Package.Standard_String_Literal or
Token_Package.Class_Of (Current_Token) =
Token_Package.Alternate_String_Literal then
Compilation_Unit.Add_Token_To_Compilation_Unit
(Token_To_Add => Current_Token, Unit_To_Add_To => Current_Unit);
else
-- Not part of the legal grammar
raise Build_Syntax_Error;
end if;
-- Peek ahead twice to see if this is a generic instantiation
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.New_Token =>
-- Must be a generic instantiation so repeatly get
-- tokens until a semiclon is found
Search_For_Semi_Colon:
loop
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
Compilation_Unit.Add_Token_To_Compilation_Unit
(Token_To_Add => Current_Token,
Unit_To_Add_To => Current_Unit);
else
-- Not part of the legal grammar
raise Build_Syntax_Error;
end if;
exit Search_For_Semi_Colon when
Token_Package.Value_Of (Current_Token) =
Token_Package.Semicolon_Token;
end loop Search_For_Semi_Colon;
when others =>
-- Set the peek back to the beginning
Token_Package.Set_Peek_Back;
Peek_Next_Significant_Token (Significant_Token => Peek_Token);
if Token_Package.Value_Of (Peek_Token) =
Token_Package.Left_Parenthesis_Token then
Left_Right_Paren (Current_Unit => Current_Unit);
end if;
Function_Spec_Or_Body (Current_Unit => Current_Unit);
end case;
end Function_Or_Instantiation;