|
1 |
| package edu.rice.cs.dynamicjava.interpreter; |
|
2 |
| |
|
3 |
| import edu.rice.cs.plt.iter.IterUtil; |
|
4 |
| |
|
5 |
| import edu.rice.cs.dynamicjava.symbol.*; |
|
6 |
| import edu.rice.cs.dynamicjava.symbol.type.Type; |
|
7 |
| import edu.rice.cs.dynamicjava.symbol.type.ClassType; |
|
8 |
| import edu.rice.cs.dynamicjava.symbol.type.VariableType; |
|
9 |
| |
|
10 |
| import static edu.rice.cs.plt.debug.DebugUtil.debug; |
|
11 |
| |
|
12 |
| |
|
13 |
| public abstract class DelegatingContext implements TypeContext { |
|
14 |
| |
|
15 |
| private TypeContext _next; |
|
16 |
| |
|
17 |
2901
| protected DelegatingContext(TypeContext next) {
|
|
18 |
2901
| _next = next;
|
|
19 |
| } |
|
20 |
| |
|
21 |
| |
|
22 |
| protected abstract TypeContext duplicate(TypeContext next); |
|
23 |
| |
|
24 |
| |
|
25 |
| |
|
26 |
| |
|
27 |
| |
|
28 |
0
| public TypeContext setPackage(String name) {
|
|
29 |
0
| return duplicate(_next.setPackage(name));
|
|
30 |
| } |
|
31 |
| |
|
32 |
| |
|
33 |
9
| public TypeContext importTopLevelClasses(String pkg) {
|
|
34 |
9
| return duplicate(_next.importTopLevelClasses(pkg));
|
|
35 |
| } |
|
36 |
| |
|
37 |
| |
|
38 |
0
| public TypeContext importMemberClasses(DJClass outer) {
|
|
39 |
0
| return duplicate(_next.importMemberClasses(outer));
|
|
40 |
| } |
|
41 |
| |
|
42 |
| |
|
43 |
0
| public TypeContext importStaticMembers(DJClass c) {
|
|
44 |
0
| return duplicate(_next.importStaticMembers(c));
|
|
45 |
| } |
|
46 |
| |
|
47 |
| |
|
48 |
0
| public TypeContext importTopLevelClass(DJClass c) {
|
|
49 |
0
| return duplicate(_next.importTopLevelClass(c));
|
|
50 |
| } |
|
51 |
| |
|
52 |
| |
|
53 |
0
| public TypeContext importMemberClass(DJClass outer, String name) {
|
|
54 |
0
| return duplicate(_next.importMemberClass(outer, name));
|
|
55 |
| } |
|
56 |
| |
|
57 |
| |
|
58 |
0
| public TypeContext importField(DJClass c, String name) {
|
|
59 |
0
| return duplicate(_next.importField(c, name));
|
|
60 |
| } |
|
61 |
| |
|
62 |
| |
|
63 |
0
| public TypeContext importMethod(DJClass c, String name) {
|
|
64 |
0
| return duplicate(_next.importMethod(c, name));
|
|
65 |
| } |
|
66 |
| |
|
67 |
| |
|
68 |
| |
|
69 |
| |
|
70 |
| |
|
71 |
131
| public boolean typeExists(String name, TypeSystem ts) {
|
|
72 |
131
| return _next.typeExists(name, ts);
|
|
73 |
| } |
|
74 |
| |
|
75 |
| |
|
76 |
2056
| public boolean topLevelClassExists(String name, TypeSystem ts) {
|
|
77 |
2056
| return _next.topLevelClassExists(name, ts);
|
|
78 |
| } |
|
79 |
| |
|
80 |
| |
|
81 |
11589
| public DJClass getTopLevelClass(String name, TypeSystem ts) throws AmbiguousNameException {
|
|
82 |
11589
| return _next.getTopLevelClass(name, ts);
|
|
83 |
| } |
|
84 |
| |
|
85 |
| |
|
86 |
0
| public boolean memberClassExists(String name, TypeSystem ts) {
|
|
87 |
0
| return _next.memberClassExists(name, ts);
|
|
88 |
| } |
|
89 |
| |
|
90 |
| |
|
91 |
| |
|
92 |
| |
|
93 |
| |
|
94 |
4072
| public ClassType typeContainingMemberClass(String name, TypeSystem ts) throws AmbiguousNameException {
|
|
95 |
4072
| return _next.typeContainingMemberClass(name, ts);
|
|
96 |
| } |
|
97 |
| |
|
98 |
| |
|
99 |
0
| public boolean typeVariableExists(String name, TypeSystem ts) {
|
|
100 |
0
| return _next.typeVariableExists(name, ts);
|
|
101 |
| } |
|
102 |
| |
|
103 |
| |
|
104 |
2137
| public VariableType getTypeVariable(String name, TypeSystem ts) {
|
|
105 |
2137
| return _next.getTypeVariable(name, ts);
|
|
106 |
| } |
|
107 |
| |
|
108 |
| |
|
109 |
| |
|
110 |
| |
|
111 |
| |
|
112 |
265
| public boolean variableExists(String name, TypeSystem ts) {
|
|
113 |
265
| return _next.variableExists(name, ts);
|
|
114 |
| } |
|
115 |
| |
|
116 |
| |
|
117 |
377
| public boolean fieldExists(String name, TypeSystem ts) {
|
|
118 |
377
| return _next.fieldExists(name, ts);
|
|
119 |
| } |
|
120 |
| |
|
121 |
| |
|
122 |
| |
|
123 |
| |
|
124 |
| |
|
125 |
354
| public ClassType typeContainingField(String name, TypeSystem ts) throws AmbiguousNameException {
|
|
126 |
354
| return _next.typeContainingField(name, ts);
|
|
127 |
| } |
|
128 |
| |
|
129 |
| |
|
130 |
1362
| public boolean localVariableExists(String name, TypeSystem ts) {
|
|
131 |
1362
| return _next.localVariableExists(name, ts);
|
|
132 |
| } |
|
133 |
| |
|
134 |
| |
|
135 |
985
| public LocalVariable getLocalVariable(String name, TypeSystem ts) {
|
|
136 |
985
| return _next.getLocalVariable(name, ts);
|
|
137 |
| } |
|
138 |
| |
|
139 |
| |
|
140 |
| |
|
141 |
| |
|
142 |
| |
|
143 |
0
| public boolean functionExists(String name, TypeSystem ts) {
|
|
144 |
0
| return _next.functionExists(name, ts);
|
|
145 |
| } |
|
146 |
| |
|
147 |
| |
|
148 |
0
| public boolean methodExists(String name, TypeSystem ts) {
|
|
149 |
0
| return _next.methodExists(name, ts);
|
|
150 |
| } |
|
151 |
| |
|
152 |
| |
|
153 |
| |
|
154 |
| |
|
155 |
| |
|
156 |
0
| public Type typeContainingMethod(String name, TypeSystem ts) {
|
|
157 |
0
| return _next.typeContainingMethod(name, ts);
|
|
158 |
| } |
|
159 |
| |
|
160 |
| |
|
161 |
274
| public boolean localFunctionExists(String name, TypeSystem ts) {
|
|
162 |
274
| return _next.localFunctionExists(name, ts);
|
|
163 |
| } |
|
164 |
| |
|
165 |
| |
|
166 |
| |
|
167 |
| |
|
168 |
| |
|
169 |
| |
|
170 |
108
| public final Iterable<LocalFunction> getLocalFunctions(String name, TypeSystem ts) {
|
|
171 |
108
| return getLocalFunctions(name, ts, IterUtil.<LocalFunction>empty());
|
|
172 |
| } |
|
173 |
| |
|
174 |
382
| public Iterable<LocalFunction> getLocalFunctions(String name, TypeSystem ts, Iterable<LocalFunction> partial) {
|
|
175 |
382
| return _next.getLocalFunctions(name, ts, partial);
|
|
176 |
| } |
|
177 |
| |
|
178 |
| |
|
179 |
| |
|
180 |
| |
|
181 |
4485
| public Access.Module accessModule() {
|
|
182 |
4485
| return _next.accessModule();
|
|
183 |
| } |
|
184 |
| |
|
185 |
| |
|
186 |
158
| public String makeClassName(String n) {
|
|
187 |
158
| return _next.makeClassName(n);
|
|
188 |
| } |
|
189 |
| |
|
190 |
| |
|
191 |
0
| public String makeAnonymousClassName() {
|
|
192 |
0
| return _next.makeAnonymousClassName();
|
|
193 |
| } |
|
194 |
| |
|
195 |
| |
|
196 |
| |
|
197 |
| |
|
198 |
| |
|
199 |
138
| public DJClass getThis() {
|
|
200 |
138
| return _next.getThis();
|
|
201 |
| } |
|
202 |
| |
|
203 |
| |
|
204 |
| |
|
205 |
| |
|
206 |
| |
|
207 |
0
| public DJClass getThis(String className) {
|
|
208 |
0
| return _next.getThis(className);
|
|
209 |
| } |
|
210 |
| |
|
211 |
520
| public DJClass getThis(Type expected, TypeSystem ts) { return _next.getThis(expected, ts); }
|
|
212 |
| |
|
213 |
0
| public DJClass initializingClass() { return _next.initializingClass(); }
|
|
214 |
| |
|
215 |
| |
|
216 |
| |
|
217 |
| |
|
218 |
| |
|
219 |
109
| public Type getReturnType() {
|
|
220 |
109
| return _next.getReturnType();
|
|
221 |
| } |
|
222 |
| |
|
223 |
| |
|
224 |
| |
|
225 |
| |
|
226 |
| |
|
227 |
1722
| public Iterable<Type> getDeclaredThrownTypes() {
|
|
228 |
1722
| return _next.getDeclaredThrownTypes();
|
|
229 |
| } |
|
230 |
| |
|
231 |
86
| public ClassLoader getClassLoader() {
|
|
232 |
86
| return _next.getClassLoader();
|
|
233 |
| } |
|
234 |
| |
|
235 |
| } |