]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/m2/mc/wlists.def
Update copyright years.
[thirdparty/gcc.git] / gcc / m2 / mc / wlists.def
CommitLineData
1eee94d3
GM
1(* wlists.def word lists module.
2
83ffe9cd 3Copyright (C) 2015-2023 Free Software Foundation, Inc.
1eee94d3
GM
4Contributed by Gaius Mulley <gaius@glam.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 wlists ;
23
24
25FROM SYSTEM IMPORT WORD ;
26
27TYPE
28 wlist ;
29 performOperation = PROCEDURE (WORD) ;
30
31
32(*
33 initList - creates a new wlist, l.
34*)
35
36PROCEDURE initList () : wlist ;
37
38
39(*
40 killList - deletes the complete wlist, l.
41*)
42
43PROCEDURE killList (VAR l: wlist) ;
44
45
46(*
47 putItemIntoList - places an WORD, c, into wlist, l.
48*)
49
50PROCEDURE putItemIntoList (l: wlist; c: WORD) ;
51
52
53(*
54 getItemFromList - retrieves the nth WORD from wlist, l.
55*)
56
57PROCEDURE getItemFromList (l: wlist; n: CARDINAL) : WORD ;
58
59
60(*
61 getIndexOfList - returns the index for WORD, c, in wlist, l.
62 If more than one CARDINAL, c, exists the index
63 for the first is returned.
64*)
65
66PROCEDURE getIndexOfList (l: wlist; c: WORD) : CARDINAL ;
67
68
69(*
70 noOfItemsInList - returns the number of items in wlist, l.
71*)
72
73PROCEDURE noOfItemsInList (l: wlist) : CARDINAL ;
74
75
76(*
77 includeItemIntoList - adds an WORD, c, into a wlist providing
78 the value does not already exist.
79*)
80
81PROCEDURE includeItemIntoList (l: wlist; c: WORD) ;
82
83
84(*
85 removeItemFromList - removes an WORD, c, from a wlist.
86 It assumes that this value only appears once.
87*)
88
89PROCEDURE removeItemFromList (l: wlist; c: WORD) ;
90
91
92(*
93 replaceItemInList - replace the nth WORD in wlist, l.
94 The first item in a wlists is at index, 1.
95 If the index, n, is out of range nothing is changed.
96*)
97
98PROCEDURE replaceItemInList (l: wlist; n: CARDINAL; w: WORD) ;
99
100
101(*
102 isItemInList - returns true if a WORD, c, was found in wlist, l.
103*)
104
105PROCEDURE isItemInList (l: wlist; c: WORD) : BOOLEAN ;
106
107
108(*
109 foreachItemInListDo - calls procedure, P, foreach item in wlist, l.
110*)
111
112PROCEDURE foreachItemInListDo (l: wlist; p: performOperation) ;
113
114
115(*
116 duplicateList - returns a duplicate wlist derived from, l.
117*)
118
119PROCEDURE duplicateList (l: wlist) : wlist ;
120
121
122END wlists.