]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/m2/gm2-compiler/M2GCCDeclare.def
Update copyright years.
[thirdparty/gcc.git] / gcc / m2 / gm2-compiler / M2GCCDeclare.def
1 (* M2GCCDeclare.def declares Modula-2 types to GCC.
2
3 Copyright (C) 2001-2024 Free Software Foundation, Inc.
4 Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
5
6 This file is part of GNU Modula-2.
7
8 GNU Modula-2 is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
11 any later version.
12
13 GNU Modula-2 is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU Modula-2; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. *)
21
22 DEFINITION MODULE M2GCCDeclare ;
23
24 (*
25 Title : M2GCCDeclare
26 Author : Gaius Mulley
27 System : UNIX (gm2)
28 Date : Sat Jul 17 10:28:43 1999
29 Description: declares Modula-2 types to GCC,
30 only declares a type once all subcomponents are known.
31 *)
32
33 FROM SYSTEM IMPORT WORD ;
34 FROM m2tree IMPORT Tree ;
35
36 TYPE
37 WalkAction = PROCEDURE (WORD) ;
38 IsAction = PROCEDURE (WORD) : BOOLEAN ;
39
40
41 (*
42 FoldConstants - a wrapper for ResolveConstantExpressions.
43 *)
44
45 PROCEDURE FoldConstants (start, end: CARDINAL) ;
46
47
48 (*
49 StartDeclareScope - declares types, variables associated with this scope.
50 *)
51
52 PROCEDURE StartDeclareScope (scope: CARDINAL) ;
53
54
55 (*
56 EndDeclareScope -
57 *)
58
59 PROCEDURE EndDeclareScope ;
60
61
62 (*
63 DeclareParameters -
64 *)
65
66 PROCEDURE DeclareParameters (sym: CARDINAL) ;
67
68
69 (*
70 DeclareConstant - if, sym, is a constant then declare it.
71 The constant must be solvable at this point.
72 *)
73
74 PROCEDURE DeclareConstant (tokenno: CARDINAL; sym: CARDINAL) ;
75
76
77 (*
78 DeclareConstructor - if, sym, is a constructor then declare it.
79 The constructor must be solvable at this point.
80 *)
81
82 PROCEDURE DeclareConstructor (tokenno: CARDINAL; quad: CARDINAL; sym: CARDINAL) ;
83
84
85 (*
86 TryDeclareConstant - try and declare a constant. If, sym, is a
87 constant try and declare it, if we cannot
88 then enter it into the to do list.
89 *)
90
91 PROCEDURE TryDeclareConstant (tokenno: CARDINAL; sym: CARDINAL) ;
92
93
94 (*
95 TryDeclareConstructor - try and declare a constructor. If, sym, is a
96 constructor try and declare it, if we cannot
97 then enter it into the to do list.
98 *)
99
100 PROCEDURE TryDeclareConstructor (tokenno: CARDINAL; sym: CARDINAL) ;
101
102
103 (*
104 DeclareLocalVariables - lists the Local variables for procedure
105 together with their offset.
106 *)
107
108 PROCEDURE DeclareLocalVariables (procedure: CARDINAL) ;
109
110
111 (*
112 DeclareLocalVariable - declare a local variable var.
113 *)
114
115 PROCEDURE DeclareLocalVariable (var: CARDINAL) ;
116
117
118 (*
119 DeclareProcedure - declares procedure, sym, or all procedures inside
120 module sym.
121 *)
122
123 PROCEDURE DeclareProcedure (sym: WORD) ;
124
125
126 (*
127 DeclareModuleVariables - declares Module variables for a module
128 which inside a procedure.
129 *)
130
131 PROCEDURE DeclareModuleVariables (sym: CARDINAL) ;
132
133
134 (*
135 IsProcedureGccNested - returns TRUE if procedure, sym, will be considered
136 as nested by GCC.
137 This will occur if either its outer defining scope
138 is a procedure or is a module which is inside a
139 procedure.
140 *)
141
142 PROCEDURE IsProcedureGccNested (sym: CARDINAL) : BOOLEAN ;
143
144
145 (*
146 PoisonSymbols - poisons all gcc symbols from procedure, sym.
147 A debugging aid.
148 *)
149
150 PROCEDURE PoisonSymbols (sym: CARDINAL) ;
151
152
153 (*
154 PromoteToString - declare, sym, and then promote it to a string.
155 Note that if sym is a single character we do
156 *not* record it as a string
157 but as a char however we always
158 return a string constant.
159 *)
160
161 PROCEDURE PromoteToString (tokenno: CARDINAL; sym: CARDINAL) : Tree ;
162
163
164 (*
165 PromoteToCString - declare, sym, and then promote it to a string.
166 Note that if sym is a single character we do
167 *not* record it as a string
168 but as a char however we always
169 return a string constant.
170 *)
171
172 PROCEDURE PromoteToCString (tokenno: CARDINAL; sym: CARDINAL) : Tree ;
173
174
175 (*
176 CompletelyResolved - returns TRUE if a symbol has been completely resolved
177 and is not partially declared (such as a record,
178 array or procedure type).
179 *)
180
181 PROCEDURE CompletelyResolved (sym: CARDINAL) : BOOLEAN ;
182
183
184 (*
185 ConstantKnownAndUsed -
186 *)
187
188 PROCEDURE ConstantKnownAndUsed (sym: CARDINAL; t: Tree) ;
189
190
191 (*
192 PutToBeSolvedByQuads - places, sym, in this list.
193 *)
194
195 PROCEDURE PutToBeSolvedByQuads (sym: CARDINAL) ;
196
197
198 (*
199 MarkExported - tell GCC to mark all exported procedures in module sym.
200 *)
201
202 PROCEDURE MarkExported (sym: CARDINAL) ;
203
204
205 (*
206 GetTypeMin - returns a symbol corresponding to MIN(type)
207 *)
208
209 PROCEDURE GetTypeMin (type: CARDINAL) : CARDINAL ;
210
211
212 (*
213 GetTypeMax - returns a symbol corresponding to MAX(type)
214 *)
215
216 PROCEDURE GetTypeMax (type: CARDINAL) : CARDINAL ;
217
218
219 (*
220 PrintSym - prints limited information about a symbol.
221 *)
222
223 PROCEDURE PrintSym (sym: CARDINAL) ;
224
225
226 (*
227 InitDeclarations - initializes default types and the source filename.
228 *)
229
230 PROCEDURE InitDeclarations ;
231
232
233 END M2GCCDeclare.