|
|
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: T V
Length: 3337 (0xd09)
Types: TextFile
Names: »V«
└─⟦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.spc,v $
-- $Revision: 4.0 $ -- $Date: 85/02/19 11:33:03 $ -- $Author: carol $
----------------------------------------------------------------------
with Parserdeclarations; -- declarations for the Parser
use Parserdeclarations;
package Parsestack is
--| Elements awaiting parsing
--| Overview
--|
--| The ParseStack used by the parser.
--|
--| This data structure has the following sets of operations:
--|
--| 1) A set that add and delete elements. This set can
--| raise the exceptions: UnderFlow and OverFlow.
--| The set includes:
--|
--| Pop
--| Push
--| Reduce
--|
--| 2) A function that returns the number of elements in the
--| data structure. This set raises no exceptions.
--| The set includes:
--|
--| Length
--|
--| Notes
--|
--| Under some implementations the exception
--| ParserDeclarations.MemoryOverflow could be raised.
--|
package Pd renames Parserdeclarations;
------------------------------------------------------------------
-- Declarations Global to Package ParseStack
------------------------------------------------------------------
Overflow : exception;
--| raised if no more space in stack.
Underflow : exception;
--| raised if no more elements in stack.
------------------------------------------------------------------
procedure Push ( --| Adds new top element to stack
Element : in Pd.Parsestackelement); --| element to add
--| Raises
--|
--| OverFlow - no more space in stack.
--| Effects
--|
--| This subprogram adds an element to the top of the stack.
--|
------------------------------------------------------------------
function Pop --| Removes top element in stack
return Pd.Parsestackelement;
--| Raises
--|
--| UnderFlow - no more elements in stack.
--| Effects
--|
--| This subprogram obtains the element at the top of the stack.
--|
------------------------------------------------------------------
function Length --| Returns the number of
--| elements in the stack
return Pd.Stateparsestacksindex;
--| Effects
--|
--| This subprogram returns the number of elements in the stack.
--|
----------------------------------------------------------------------
procedure Reduce ( --| Pops and discards top n elements on
--| the stack.
Topn : in Pd.Stateparsestacksindex);
--| Number of elements to pop.
--| Raises
--|
--| Underflow - no more elements in stack.
--| Effects
--|
--| Pops and discards top N elements on the stack.
--| If TopN is greater than the number of elements in the stack,
--| Underflow is raised.
--| This subprogram is used by the parser to reduce the stack during
--| a reduce action.
--| This stack reduction could be done with a for loop and
--| the Pop subprogram at a considerable cost in execution time.
--|
----------------------------------------------------------------------
end Parsestack;
----------------------------------------------------------------------