]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/m2/gm2-compiler/M2StackAddress.def
Update copyright years.
[thirdparty/gcc.git] / gcc / m2 / gm2-compiler / M2StackAddress.def
CommitLineData
1eee94d3
GM
1(* M2StackAddress.def provides a generic stack for ADDRESS sized objects.
2
83ffe9cd 3Copyright (C) 2001-2023 Free Software Foundation, Inc.
1eee94d3
GM
4Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
5
6This file is part of GNU Modula-2.
7
8GNU Modula-2 is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 3, or (at your option)
11any later version.
12
13GNU Modula-2 is distributed in the hope that it will be useful, but
14WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with GNU Modula-2; see the file COPYING3. If not see
20<http://www.gnu.org/licenses/>. *)
21
22DEFINITION MODULE M2StackAddress ;
23
24(*
25 Title : M2StackAddress
26 Author : Gaius Mulley
27 System : UNIX (GNU Modula-2)
28 Date : Fri Oct 12 17:26:50 2001
29 Revision : $Version$
30 Description: provides a generic stack for ADDRESS sized objects.
31*)
32
33FROM SYSTEM IMPORT ADDRESS ;
34EXPORT QUALIFIED StackOfAddress, InitStackAddress, KillStackAddress,
35 PushAddress, PopAddress, PeepAddress,
36 IsEmptyAddress, NoOfItemsInStackAddress ;
37
38TYPE
39 StackOfAddress ;
40
41
42(*
43 InitStackAddress - creates and returns a new stack.
44*)
45
46PROCEDURE InitStackAddress () : StackOfAddress ;
47
48
49(*
50 KillStackAddress - destroys a stack, returning NIL.
51*)
52
53PROCEDURE KillStackAddress (s: StackOfAddress) : StackOfAddress ;
54
55
56(*
57 PushAddress - pushes a word, w, onto, s.
58*)
59
60PROCEDURE PushAddress (s: StackOfAddress; w: ADDRESS) ;
61
62
63(*
64 PopAddress - pops an element from stack, s.
65*)
66
67PROCEDURE PopAddress (s: StackOfAddress) : ADDRESS ;
68
69
70(*
71 IsEmptyAddress - returns TRUE if stack, s, is empty.
72*)
73
74PROCEDURE IsEmptyAddress (s: StackOfAddress) : BOOLEAN ;
75
76
77(*
78 PeepAddress - returns the element at, n, items below in the stack.
79 Top of stack can be seen via Peep(s, 1)
80*)
81
82PROCEDURE PeepAddress (s: StackOfAddress; n: CARDINAL) : ADDRESS ;
83
84
85(*
86 ReduceAddress - reduce the stack by n elements.
87*)
88
89PROCEDURE ReduceAddress (s: StackOfAddress; n: CARDINAL) ;
90
91
92(*
93 NoOfItemsInStack - returns the number of items held in the stack, s.
94*)
95
96PROCEDURE NoOfItemsInStackAddress (s: StackOfAddress) : CARDINAL ;
97
98
99END M2StackAddress.