Package Stack_ASM

AuthorJulien Burdy & Vincent Decorges
Date10.4.02
DescriptionAn Abstract State Machine of stack
File namestack_asm.ads
 

Generics

Quick access : ClausesGenericsDefinitionsSubprograms


Types
Name Declaration
T_Informationprivate
Type of the information in the stack
 

Basic Objects

Quick access : ClausesGenericsDefinitionsSubprograms


Basic Objects
Name Type Default
Empty_StackT_Stackconstant
An empty stack!
 

Definitions

Quick access : ClausesGenericsDefinitionsSubprograms


Types
Name Declaration
T_Stackprivate
  
Exceptions
Stack_Full_Error
Stack_Empty_Error
 

Subprograms

Quick access : ClausesGenericsDefinitionsSubprograms


  
Push procedure
Add an element at the beginning of the stack
Stack_Full_Error is raise if the stack is full
Parameter name Type Mode Default
ElementT_Informationin
  
Pop procedure
  
Empty procedure
Empty a stack
  
Run_Through procedure
Run through the stack and call treat for each Information
Generic parameters
with procedure Treat (Information : in T_Information)
Treatment to do
  
Empty function
ReturnBoolean
Return true if the stack is empty
  
Length function
ReturnNatural
Return the length of the stack
  
Head function
ReturnT_Information
Return the element at the head of the stack
  
Sub_Head function
ReturnT_Information
Return the element under head of the stack