1 (* ==================================================================== *)
2 (* *)
3 (* Visitor pattern for the Gardens Point Component Pascal Compiler. *)
4 (* This module defines various extensions of type Symbols.SymForAll *)
5 (* Copyright (c) John Gough 1999, 2000. *)
6 (* *)
7 (* ==================================================================== *)
11 IMPORT
12 GPCPcopyright,
13 Console,
14 Symbols,
15 CPascalS,
16 LitValue,
19 NameHash;
21 (* ============================================================ *)
23 TYPE
26 (* -------------------------------------------- *)
28 TYPE
31 (* -------------------------------------------- *)
33 TYPE
36 (* -------------------------------------------- *)
38 TYPE
45 (* ============================================================ *)
48 (** Create a new symbol table and add to it all of the abstract *)
49 (* methods which are not concrete in the target scope space. *)
51 BEGIN
58 (* --------------------------- *)
61 (** Create a new symbol table and add to it all of the abstract *)
62 (* methods which are not concrete in the target scope space. *)
64 BEGIN
71 (* --------------------------- *)
77 BEGIN
79 (*
80 * Lookup the id in the original record name-scope
81 * If id implements some interface method, we must
82 * force it to be virtual by getting rid of newBit.
83 *)
98 (* -------------------------------------------- *)
104 (* --------------------------- *)
112 (* ----------------------------------------- *)
117 BEGIN
124 (* ----------------------------------------- *)
125 BEGIN
134 (*
135 * This is a concrete record extending an abstract record.
136 * By now, all inherited abstract methods must have been
137 * resolved to concrete methods. Traverse up the base
138 * hierarchy accumulating unimplemented methods.
139 *)
141 REPEAT
146 (*
147 * Now we turn the missing table into a list.
148 *)
155 (*
156 * The record rTp claims to implement interfaces.
157 * We must check conformance to the contract.
158 *)
161 (*
162 * Now we turn the missing table into a list.
163 *)
173 (* -------------------------------------------- *)
177 BEGIN
182 (* --------------------------- *)
186 BEGIN
191 (* ------------------------------------------------- *
192 * IF idTp # NIL THEN
193 * WITH idTp : Ty.Array DO
194 * IF idTp.isOpenArrType() THEN id.IdError(67) END;
195 * | idTp : Ty.Record DO
196 * IF id.kind = Id.varId THEN idTp.InstantiateCheck(id.token) END;
197 * ELSE
198 * END;
199 * END;
200 * ------------------------------------------------- *)
206 ELSE
209 (* ------------------------------------------------- *)
215 (* --------------------------- *)
219 BEGIN
224 (* --------------------------- *)
227 (* Erases any compound types found in the symbol table. These
228 * are converted to their implementation types *)
231 BEGIN
237 (* ============================================================ *)
239 (* ============================================================ *)