|
|
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: 7003 (0x1b5b)
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 Accept_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 an accept statement. We will look at the first =
-- token to see if the end is found (semicolon found) or =
-- whether we must keep search for the 'End'. If the end of =
-- file or a syntax error is found, then the exception =
-- Build_Syntax_Error will be raised. =
-- The grammar : =
-- <Accept_Tail> = =
-- 'DO' * {<Statement> *} <End_Unit> | =
-- ';' =
-- =
-- 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 read at a later time
End_Accept : Boolean := False;
-- Set to true when the end of the accept statement is found
begin
-- Accept_Tail
-- Parse either a semicolon or a do
Get_Next_Significant_Token (Significant_Token => Current_Token,
Current_Unit => Current_Unit);
-- If a do is found, then repeatly get tokens until
-- the end of accept statement is found
case Token_Package.Value_Of (Current_Token) is
when Token_Package.Do_Token =>
Compilation_Unit.Add_Token_To_Compilation_Unit
(Token_To_Add => Current_Token, Unit_To_Add_To => Current_Unit);
-- Repeatly get tokens until the end of accept statement
-- is found
Search_For_End_Of_Accept:
loop
Peek_Next_Significant_Token
(Significant_Token => Peek_Token);
-- Search for the end of the accept or a nested block
-- statement or nested accept statement
case Token_Package.Value_Of (Peek_Token) is
when Token_Package.Begin_Token |
Token_Package.Declare_Token |
Token_Package.Accept_Token =>
Statement (Current_Unit => Current_Unit);
when Token_Package.End_Token =>
-- Peek at the next token to see if this is the end or
-- just 'end if', or 'end case', or 'end select', etc.
Peek_Next_Significant_Token
(Significant_Token => Peek_Token);
if Token_Package.Class_Of (Peek_Token) =
Token_Package.Identifier or
Token_Package.Value_Of (Peek_Token) =
Token_Package.Semicolon_Token then
End_Accept := True;
else
-- Not the end of the accept statement
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);
end if;
when others =>
if Token_Package.Class_Of (Peek_Token) =
Token_Package.Identifier then
-- Search for a named block first, so peek twice
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.Declare_Token |
Token_Package.Begin_Token =>
-- Found a nested named block statement
Statement (Current_Unit =>
Current_Unit);
when others =>
-- Not a nested block statement
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);
end case;
else
-- Not a nested named block statement
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);
end if;
end case;
if Token_Package.Class_Of (Current_Token) =
Token_Package.End_Of_File then
raise Build_Syntax_Error;
end if;
exit Search_For_End_Of_Accept when End_Accept;
end loop Search_For_End_Of_Accept;
End_Unit (Current_Unit => Current_Unit);
when Token_Package.Semicolon_Token =>
-- The end of accept statement has been found
Compilation_Unit.Add_Token_To_Compilation_Unit
(Token_To_Add => Current_Token, Unit_To_Add_To => Current_Unit);
when others =>
-- Not part of an accept statement
raise Build_Syntax_Error;
end case;
end Accept_Tail;