]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/m2/gm2-compiler/Sets.def
Update copyright years.
[thirdparty/gcc.git] / gcc / m2 / gm2-compiler / Sets.def
CommitLineData
1eee94d3
GM
1(* Sets.def provides a dynamic set module.
2
83ffe9cd 3Copyright (C) 2009-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 Sets ;
23
24(*
25 Title : Sets
26 Author : Gaius Mulley
27 System : GNU Modula-2
28 Date : Wed May 6 22:48:19 2009
29 Revision : $Version$
30 Description: provides a dynamic set module which allows
31 sets to contain the elements in the range:
32 min..SymbolTable.FinalSymbol()
33*)
34
35FROM SymbolKey IMPORT PerformOperation ;
36
37EXPORT QUALIFIED Set,
38 InitSet, KillSet,
39 IncludeElementIntoSet, ExcludeElementFromSet,
40 NoOfElementsInSet, IsElementInSet,
41 ForeachElementInSetDo, DuplicateSet ;
42
43TYPE
44 Set ;
45
46
47(*
48 InitSet - initializes and returns a set. The set will
49 never contain an element less than, low.
50*)
51
52PROCEDURE InitSet (low: CARDINAL) : Set ;
53
54
55(*
56 KillSet - deallocates Set, s.
57*)
58
59PROCEDURE KillSet (s: Set) : Set ;
60
61
62(*
63 DuplicateSet - returns a new duplicated set.
64*)
65
66PROCEDURE DuplicateSet (s: Set) : Set ;
67
68
69(*
70 ForeachElementInSetDo - for each element e in, s, call, p(e).
71*)
72
73PROCEDURE ForeachElementInSetDo (s: Set; p: PerformOperation) ;
74
75
76(*
77 IsElementInSet - returns TRUE if element, i, is in set, s.
78*)
79
80PROCEDURE IsElementInSet (s: Set; i: CARDINAL) : BOOLEAN ;
81
82
83(*
84 NoOfElementsInSet - returns the number of elements in a set, s.
85*)
86
87PROCEDURE NoOfElementsInSet (s: Set) : CARDINAL ;
88
89
90(*
91 ExcludeElementFromSet - excludes element, i, from set, s.
92*)
93
94PROCEDURE ExcludeElementFromSet (s: Set; i: CARDINAL) ;
95
96
97(*
98 IncludeElementIntoSet - includes element, i, into set, s.
99*)
100
101PROCEDURE IncludeElementIntoSet (s: Set; i: CARDINAL) ;
102
103
104END Sets.