|
|
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: 3384 (0xd38)
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 Subprogram_Spec_Tail (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 =
-- the end of a subprogram specification. This subprogram will =
-- search for the ending semicolon. If a left parenthesis is =
-- found first, then search for the right parenthesis before =
-- finding the left parenthesis. Any syntax errors will cause =
-- the exception Build_Syntax_Error to be raised. =
-- The grammar : =
-- <Subprogram_Spec_Tail> = =
-- <id> [<Left_Right_Paren>] * ';' =
-- =
-- 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;
-- This token will be gotten later by Get_Next_Significant
begin
-- Subprogram_Spec_Tail
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
-- This was not the procedure identifier
raise Build_Syntax_Error;
end if;
Peek_Next_Significant_Token (Significant_Token => Peek_Token);
if Token_Package.Value_Of (Peek_Token) =
Token_Package.Left_Parenthesis_Token then
-- Found a left parenthesis before semicolon
Left_Right_Paren (Current_Unit => Current_Unit);
else
-- Not the end of subprogram yet
null;
end if;
-- Search for the semicolon which ends the subprogram
-- specification
Search_For_Semicolon:
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
raise Build_Syntax_Error;
else
-- Not the end of file yet or end of procedure
Compilation_Unit.Add_Token_To_Compilation_Unit
(Token_To_Add => Current_Token,
Unit_To_Add_To => Current_Unit);
end if;
exit Search_For_Semicolon when
Token_Package.Value_Of (Current_Token) =
Token_Package.Semicolon_Token;
end loop Search_For_Semicolon;
end Subprogram_Spec_Tail;