mod_stack Module

(in libkernel) the module to realize a stack with integer elements


Uses


Contents


Derived Types

type, public :: stack

the class of stack with integer elements

Type-Bound Procedures

procedure, public :: push

push an integer into a stack

procedure, public :: pop

pop an integer out of a stack

procedure, public :: top

return the top of a stack

procedure, public :: num

return the number of elements in a stack

procedure, public :: clean

clean a stack

procedure, public :: read

read a stack from a file

procedure, public :: write

save a stack to a file

procedure, public :: consistent

check if a stack is consistent

procedure, public :: items

public only for test, don't use

generic, public :: assignment(=) => copy

assignment of a stack

generic, public :: operator(==) => compare

check if two stacks are equal