|
|
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: 2336 (0x920)
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⟧
-- $Source: /nosc/work/parser/RCS/ParseStk.bdy,v $
-- $Revision: 4.0 $ -- $Date: 85/02/19 11:34:13 $ -- $Author: carol $
----------------------------------------------------------------------
with Parsetables; -- state tables generated by parser
-- generator
use Parsetables;
with Grammar_Constants;
use Grammar_Constants;
-- to have visibility on operations
-- on type ParserInteger declared there.
package body Parsestack is
--| Overview
--|
--| The data structure is implemented as an array.
--|
------------------------------------------------------------------
-- Declarations Global to Package Body ParseStack
------------------------------------------------------------------
Index : Pd.Stateparsestacksindex := 0;
--| top element in stack.
Space : array (Pd.Stateparsestacksrange) of Pd.Parsestackelement;
--| Storage used to hold stack elements
------------------------------------------------------------------
-- Subprogram Bodies Global to Package ParseStack
-- (declared in package specification).
------------------------------------------------------------------
procedure Push (Element : in Pd.Parsestackelement) is
begin
if (Index >= Pd.Stateparsestacksrange'Last) then
raise Overflow;
end if;
Index := Index + 1;
Space (Index) := Element;
end Push;
------------------------------------------------------------------
function Pop return Pd.Parsestackelement is
begin
if (Index < Pd.Stateparsestacksrange'First) then
raise Underflow;
end if;
Index := Index - 1;
return Space (Index + 1);
end Pop;
------------------------------------------------------------------
function Length return Pd.Stateparsestacksindex is
begin
return Index;
end Length;
------------------------------------------------------------------
procedure Reduce (Topn : in Pd.Stateparsestacksindex) is
begin
if (Topn > Index) then
raise Underflow;
end if;
Index := Index - Topn;
end Reduce; -- procedure
------------------------------------------------------------------
end Parsestack;
----------------------------------------------------------------------