|
|
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: 2337 (0x921)
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 (Token_Package)
procedure Peek (Next_Token : out Token) is
Tail_Of_List : New_List.List;
Location_Of_New_Token : New_List.List;
Current_Token : Token;
begin
-- Peek
-- check if Peek_Token_Location is empty or not
if New_List.Is_Equal (Peek_Token_Location, New_List.Null_List) then
Build (New_Token => Current_Token,
Previous_Token => Peek_Previous_Token);
New_List.Construct (New_Item => Current_Token,
And_The_List => Location_Of_New_Token);
if not New_List.Is_Equal (List_Of_Tokens, New_List.Null_List) then
-- get tail of list
New_List.Share (The_List => New_List.Tail_Of (List_Of_Tokens),
With_The_List => Tail_Of_List);
-- append token at the end of list
New_List.Append (This_List => Tail_Of_List,
And_This_List => Location_Of_New_Token);
else
-- list is EMPTY
New_List.Share (The_List => Location_Of_New_Token,
With_The_List => List_Of_Tokens);
end if;
-- check if Next_Token_Location is null or not
if New_List.Is_Equal (Next_Token_Location, New_List.Null_List) then
-- if it is, assign Next_Token_Location to the
-- head of List_Of_Tokens
New_List.Share (The_List => List_Of_Tokens,
With_The_List => Next_Token_Location);
end if;
else
-- Peek_Token_Location is not empty
Guard_Against_Overflow:
begin
-- get next token from List_Of_Tokens
Current_Token := New_List.Content_Of (Peek_Token_Location);
-- advance Peek_Token_Location
New_List.Share (The_List =>
New_List.Seek (Peek_Token_Location, +1),
With_The_List => Peek_Token_Location);
exception
when New_List.Overflow =>
New_List.Share (The_List => New_List.Null_List,
With_The_List => Peek_Token_Location);
end Guard_Against_Overflow;
end if;
Peek_Previous_Token := Current_Token;
Next_Token := Current_Token;
end Peek;