Package Stack_ASM
Author
Julien Burdy & Vincent Decorges
Date
10.4.02
Description
An Abstract State Machine of stack
File name
stack_asm.ads
Generics
Quick access :
Clauses
-
Generics
-
Definitions
-
Subprograms
Types
Name
Declaration
T_Information
private
Type of the information in the stack
Basic Objects
Quick access :
Clauses
-
Generics
-
Definitions
-
Subprograms
Basic Objects
Name
Type
Default
Empty_Stack
T_Stack
constant
An empty stack!
Definitions
Quick access :
Clauses
-
Generics
-
Definitions
-
Subprograms
Types
Name
Declaration
T_Stack
private
Exceptions
Stack_Full_Error
Stack_Empty_Error
Subprograms
Quick access :
Clauses
-
Generics
-
Definitions
-
Subprograms
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
Element
T_Information
in
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
Return
Boolean
Return true if the stack is empty
Length
function
Return
Natural
Return the length of the stack
Head
function
Return
T_Information
Return the element at the head of the stack
Sub_Head
function
Return
T_Information
Return the element under head of the stack