]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/m2/gm2-compiler/PCSymBuild.def
Update copyright years.
[thirdparty/gcc.git] / gcc / m2 / gm2-compiler / PCSymBuild.def
CommitLineData
1eee94d3
GM
1(* PCSymBuild.def pass C symbol creation.
2
a945c346 3Copyright (C) 2001-2024 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 PCSymBuild ;
23
24(*
25 Title : PCSymBuild
26 Author : Gaius Mulley
27 System : UNIX (GNU Modula-2)
28 Description: provides scope mainstance for Pass C it also resolves
29 the import/export symbols and assigns types to constructors.
30*)
31
32EXPORT QUALIFIED PCStartBuildDefModule,
33 PCEndBuildDefModule,
34 PCStartBuildImpModule,
35 PCEndBuildImpModule,
36 PCStartBuildProgModule,
37 PCEndBuildProgModule,
38 PCStartBuildInnerModule,
39 PCEndBuildInnerModule,
40 PCBuildProcedureHeading,
41 PCStartBuildProcedure,
42 PCEndBuildProcedure,
43 BuildNulName,
44 BuildConst,
45 PCBuildImportOuterModule,
46 PCBuildImportInnerModule,
47 StartDesConst,
48 EndDesConst,
49 BuildRelationConst,
50 BuildUnaryConst,
51 BuildBinaryConst,
52 PushInConstructor,
53 PopInConstructor,
54 SkipConst,
55 PushConstType,
56 PushConstAttributeType,
57 PushConstAttributePairType,
58 PushConstructorCastType,
59 PushRType,
60 PushConstFunctionType,
61 PushIntegerType,
62 PushStringType,
63 ResolveConstTypes ;
64
65
66(*
67 StartBuildDefinitionModule - Creates a definition module and starts
68 a new scope.
69
70 The Stack is expected:
71
72 Entry Exit
73
74 Ptr -> <- Ptr
75 +------------+ +-----------+
76 | NameStart | | NameStart |
77 |------------| |-----------|
78
79*)
80
81PROCEDURE PCStartBuildDefModule ;
82
83
84(*
85 EndBuildDefinitionModule - Destroys the definition module scope and
86 checks for correct name.
87
88 The Stack is expected:
89
90 Entry Exit
91
92 Ptr ->
93 +------------+ +-----------+
94 | NameEnd | | |
95 |------------| |-----------|
96 | NameStart | | | <- Ptr
97 |------------| |-----------|
98*)
99
100PROCEDURE PCEndBuildDefModule ;
101
102
103(*
104 StartBuildImplementationModule - Creates an implementation module and starts
105 a new scope.
106
107 The Stack is expected:
108
109 Entry Exit
110
111 Ptr -> <- Ptr
112 +------------+ +-----------+
113 | NameStart | | NameStart |
114 |------------| |-----------|
115
116*)
117
118PROCEDURE PCStartBuildImpModule ;
119
120
121(*
122 EndBuildImplementationModule - Destroys the implementation module scope and
123 checks for correct name.
124
125 The Stack is expected:
126
127 Entry Exit
128
129 Ptr ->
130 +------------+ +-----------+
131 | NameEnd | | |
132 |------------| |-----------|
133 | NameStart | | | <- Ptr
134 |------------| |-----------|
135*)
136
137PROCEDURE PCEndBuildImpModule ;
138
139
140(*
141 StartBuildProgramModule - Creates a program module and starts
142 a new scope.
143
144 The Stack is expected:
145
146 Entry Exit
147
148 Ptr -> <- Ptr
149 +------------+ +-----------+
150 | NameStart | | NameStart |
151 |------------| |-----------|
152
153*)
154
155PROCEDURE PCStartBuildProgModule ;
156
157
158(*
159 EndBuildProgramModule - Destroys the program module scope and
160 checks for correct name.
161
162 The Stack is expected:
163
164 Entry Exit
165
166 Ptr ->
167 +------------+ +-----------+
168 | NameEnd | | |
169 |------------| |-----------|
170 | NameStart | | | <- Ptr
171 |------------| |-----------|
172*)
173
174PROCEDURE PCEndBuildProgModule ;
175
176
177(*
178 StartBuildInnerModule - Creates an Inner module and starts
179 a new scope.
180
181 The Stack is expected:
182
183 Entry Exit
184
185 Ptr -> <- Ptr
186 +------------+ +-----------+
187 | NameStart | | NameStart |
188 |------------| |-----------|
189
190*)
191
192PROCEDURE PCStartBuildInnerModule ;
193
194
195(*
196 EndBuildInnermModule - Destroys the Inner module scope and
197 checks for correct name.
198
199 The Stack is expected:
200
201 Entry Exit
202
203 Ptr ->
204 +------------+ +-----------+
205 | NameEnd | | |
206 |------------| |-----------|
207 | NameStart | | | <- Ptr
208 |------------| |-----------|
209*)
210
211PROCEDURE PCEndBuildInnerModule ;
212
213
214(*
215 BuildProcedureHeading - Builds a procedure heading for the definition
216 module procedures.
217
218 Operation only performed if compiling a
219 definition module.
220
221 The Stack:
222
223 Entry Exit
224
225 Ptr ->
226 +------------+
227 | ProcSym | Empty
228 |------------|
229
230*)
231
232PROCEDURE PCBuildProcedureHeading ;
233
234
235(*
236 StartBuildProcedure - Builds a Procedure.
237
238 The Stack:
239
240 Entry Exit
241
242 <- Ptr
243 +------------+
244 Ptr -> | ProcSym |
245 +------------+ |------------|
246 | Name | | Name |
247 |------------| |------------|
248*)
249
250PROCEDURE PCStartBuildProcedure ;
251
252
253(*
254 EndBuildProcedure - Ends building a Procedure.
255 It checks the start procedure name matches the end
256 procedure name.
257
258 The Stack:
259
260
261 Entry Exit
262
263 Ptr ->
264 +------------+
265 | NameEnd |
266 |------------|
267 | ProcSym |
268 |------------|
269 | NameStart |
270 |------------|
271 Empty
272*)
273
274PROCEDURE PCEndBuildProcedure ;
275
276
277(*
278 BuildImportOuterModule - Builds imported identifiers into an outer module
279 from a definition module.
280
281 The Stack is expected:
282
283 Entry OR Entry
284
285 Ptr -> Ptr ->
286 +------------+ +-----------+
287 | # | | # |
288 |------------| |-----------|
289 | Id1 | | Id1 |
290 |------------| |-----------|
291 . . . .
292 . . . .
293 . . . .
294 |------------| |-----------|
295 | Id# | | Id# |
296 |------------| |-----------|
297 | ImportTok | | Ident |
298 |------------| |-----------|
299
300 IMPORT Id1, .. Id# ; FROM Ident IMPORT Id1 .. Id# ;
301
302
303 Exit
304
305 All above stack discarded
306*)
307
308PROCEDURE PCBuildImportOuterModule ;
309
310
311(*
312 BuildImportInnerModule - Builds imported identifiers into an inner module
313 from the last level of module.
314
315 The Stack is expected:
316
317 Entry OR Entry
318
319 Ptr -> Ptr ->
320 +------------+ +-----------+
321 | # | | # |
322 |------------| |-----------|
323 | Id1 | | Id1 |
324 |------------| |-----------|
325 . . . .
326 . . . .
327 . . . .
328 |------------| |-----------|
329 | Id# | | Id# |
330 |------------| |-----------|
331 | ImportTok | | Ident |
332 |------------| |-----------|
333
334 IMPORT Id1, .. Id# ; FROM Ident IMPORT Id1 .. Id# ;
335
336
337 Error Condition
338 Exit
339
340 All above stack discarded
341*)
342
343PROCEDURE PCBuildImportInnerModule ;
344
345
346(*
347 BuildNulName - Pushes a NulKey onto the top of the stack.
348 The Stack:
349
350
351 Entry Exit
352
353 <- Ptr
354 Empty +------------+
355 | NulKey |
356 |------------|
357*)
358
359PROCEDURE BuildNulName ;
360
361
362(*
363 BuildConst - builds a constant.
364 Stack
365
366 Entry Exit
367
368 Ptr -> <- Ptr
369 +------------+ +------------+
370 | Name | | Sym |
371 |------------+ |------------|
372*)
373
374PROCEDURE BuildConst ;
375
376
377(*
378 StartDesConst -
379*)
380
381PROCEDURE StartDesConst ;
382
383
384(*
385 EndDesConst -
386*)
387
388PROCEDURE EndDesConst ;
389
390
391(*
392 BuildRelationConst - builds a relationship binary operation.
393*)
394
395PROCEDURE BuildRelationConst ;
396
397
398(*
399 BuildUnaryConst - builds a unary operator node.
400*)
401
402PROCEDURE BuildUnaryConst ;
403
404
405(*
406 BuildBinaryConst - builds a binary operator node.
407*)
408
409PROCEDURE BuildBinaryConst ;
410
411
412(*
413 PushConstFunctionType -
414*)
415
416PROCEDURE PushConstFunctionType ;
417
418
419(*
420 PushIntegerType - pushes a ztype or char leaf.
421*)
422
423PROCEDURE PushIntegerType ;
424
425
426(*
427 PushRType -
428*)
429
430PROCEDURE PushRType ;
431
432
433(*
434 PushStringType -
435*)
436
437PROCEDURE PushStringType ;
438
439
440(*
441 SkipConst - returns an alias to constant, sym, if one exists.
442 Otherwise sym is returned.
443*)
444
445PROCEDURE SkipConst (sym: CARDINAL) : CARDINAL ;
446
447
448(*
449 PushConstType - pushes a constant to the expression stack.
450*)
451
452PROCEDURE PushConstType ;
453
454
455(*
456 PushConstAttributeType -
457*)
458
459PROCEDURE PushConstAttributeType ;
460
461
462(*
463 PushConstAttributePairType -
464*)
465
466PROCEDURE PushConstAttributePairType ;
467
468
469(*
470 PushConstructorCastType -
471*)
472
473PROCEDURE PushConstructorCastType ;
474
475
476(*
477 PushInConstructor -
478*)
479
480PROCEDURE PushInConstructor ;
481
482
483(*
484 PopInConstructor -
485*)
486
487PROCEDURE PopInConstructor ;
488
489
490(*
491 ResolveConstTypes - resolves the types of all designator declared constants.
492*)
493
494PROCEDURE ResolveConstTypes ;
495
496
497END PCSymBuild.