Package: ExpressionValueCollector

ExpressionValueCollector

nameinstructionbranchcomplexitylinemethod
ExpressionValueCollector(IInterpreterAssistantFactory)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
caseAApplyExp(AApplyExp, ObjectContext)
M: 0 C: 20
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
caseACasesExp(ACasesExp, ObjectContext)
M: 44 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 7 C: 0
0%
M: 1 C: 0
0%
caseADefExp(ADefExp, ObjectContext)
M: 20 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
caseAElseIfExp(AElseIfExp, ObjectContext)
M: 20 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
caseAExists1Exp(AExists1Exp, ObjectContext)
M: 20 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
caseAExistsExp(AExistsExp, ObjectContext)
M: 37 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
caseAFieldExp(AFieldExp, ObjectContext)
M: 40 C: 34
46%
M: 6 C: 2
25%
M: 4 C: 1
20%
M: 10 C: 9
47%
M: 0 C: 1
100%
caseAFieldNumberExp(AFieldNumberExp, ObjectContext)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseAForAllExp(AForAllExp, ObjectContext)
M: 0 C: 37
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 6
100%
M: 0 C: 1
100%
caseAFuncInstatiationExp(AFuncInstatiationExp, ObjectContext)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseAIfExp(AIfExp, ObjectContext)
M: 14 C: 40
74%
M: 2 C: 2
50%
M: 2 C: 1
33%
M: 2 C: 6
75%
M: 0 C: 1
100%
caseAIotaExp(AIotaExp, ObjectContext)
M: 20 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
caseAIsExp(AIsExp, ObjectContext)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseAIsOfBaseClassExp(AIsOfBaseClassExp, ObjectContext)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseAIsOfClassExp(AIsOfClassExp, ObjectContext)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseALambdaExp(ALambdaExp, ObjectContext)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseALetBeStExp(ALetBeStExp, ObjectContext)
M: 33 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
caseALetDefExp(ALetDefExp, ObjectContext)
M: 20 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
caseAMapCompMapExp(AMapCompMapExp, ObjectContext)
M: 44 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 7 C: 0
0%
M: 1 C: 0
0%
caseAMapEnumMapExp(AMapEnumMapExp, ObjectContext)
M: 14 C: 13
48%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 2 C: 3
60%
M: 0 C: 1
100%
caseAMapletExp(AMapletExp, ObjectContext)
M: 19 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
caseAMkBasicExp(AMkBasicExp, ObjectContext)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseAMkTypeExp(AMkTypeExp, ObjectContext)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseAMuExp(AMuExp, ObjectContext)
M: 32 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
caseANarrowExp(ANarrowExp, ObjectContext)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseANewExp(ANewExp, ObjectContext)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseASameBaseClassExp(ASameBaseClassExp, ObjectContext)
M: 20 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
caseASameClassExp(ASameClassExp, ObjectContext)
M: 20 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
caseASeqCompSeqExp(ASeqCompSeqExp, ObjectContext)
M: 34 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
caseASeqEnumSeqExp(ASeqEnumSeqExp, ObjectContext)
M: 0 C: 8
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
caseASetCompSetExp(ASetCompSetExp, ObjectContext)
M: 10 C: 34
77%
M: 1 C: 3
75%
M: 1 C: 2
67%
M: 1 C: 6
86%
M: 0 C: 1
100%
caseASetEnumSetExp(ASetEnumSetExp, ObjectContext)
M: 0 C: 8
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
caseASubseqExp(ASubseqExp, ObjectContext)
M: 30 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
caseATupleExp(ATupleExp, ObjectContext)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseAVariableExp(AVariableExp, ObjectContext)
M: 0 C: 19
100%
M: 0 C: 4
100%
M: 0 C: 3
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
createNewReturnValue(INode, ObjectContext)
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
createNewReturnValue(Object, ObjectContext)
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
defaultPExp(PExp, ObjectContext)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
defaultSBinaryExp(SBinaryExp, ObjectContext)
M: 0 C: 20
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
defaultSMapExp(SMapExp, ObjectContext)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
defaultSSeqExp(SSeqExp, ObjectContext)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
defaultSSetExp(SSetExp, ObjectContext)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
defaultSUnaryExp(SUnaryExp, ObjectContext)
M: 0 C: 8
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: package org.overture.interpreter.utilities.expression;
2:
3: import org.overture.ast.analysis.AnalysisException;
4: import org.overture.ast.analysis.QuestionAnswerAdaptor;
5: import org.overture.ast.expressions.AApplyExp;
6: import org.overture.ast.expressions.ACaseAlternative;
7: import org.overture.ast.expressions.ACasesExp;
8: import org.overture.ast.expressions.ADefExp;
9: import org.overture.ast.expressions.AElseIfExp;
10: import org.overture.ast.expressions.AExists1Exp;
11: import org.overture.ast.expressions.AExistsExp;
12: import org.overture.ast.expressions.AFieldExp;
13: import org.overture.ast.expressions.AFieldNumberExp;
14: import org.overture.ast.expressions.AForAllExp;
15: import org.overture.ast.expressions.AFuncInstatiationExp;
16: import org.overture.ast.expressions.AIfExp;
17: import org.overture.ast.expressions.AIotaExp;
18: import org.overture.ast.expressions.AIsExp;
19: import org.overture.ast.expressions.AIsOfBaseClassExp;
20: import org.overture.ast.expressions.AIsOfClassExp;
21: import org.overture.ast.expressions.ALambdaExp;
22: import org.overture.ast.expressions.ALetBeStExp;
23: import org.overture.ast.expressions.ALetDefExp;
24: import org.overture.ast.expressions.AMapCompMapExp;
25: import org.overture.ast.expressions.AMapEnumMapExp;
26: import org.overture.ast.expressions.AMapletExp;
27: import org.overture.ast.expressions.AMkBasicExp;
28: import org.overture.ast.expressions.AMkTypeExp;
29: import org.overture.ast.expressions.AMuExp;
30: import org.overture.ast.expressions.ANarrowExp;
31: import org.overture.ast.expressions.ANewExp;
32: import org.overture.ast.expressions.ARecordModifier;
33: import org.overture.ast.expressions.ASameBaseClassExp;
34: import org.overture.ast.expressions.ASameClassExp;
35: import org.overture.ast.expressions.ASeqCompSeqExp;
36: import org.overture.ast.expressions.ASeqEnumSeqExp;
37: import org.overture.ast.expressions.ASetCompSetExp;
38: import org.overture.ast.expressions.ASetEnumSetExp;
39: import org.overture.ast.expressions.ASubseqExp;
40: import org.overture.ast.expressions.ATupleExp;
41: import org.overture.ast.expressions.AVariableExp;
42: import org.overture.ast.expressions.PExp;
43: import org.overture.ast.expressions.SBinaryExp;
44: import org.overture.ast.expressions.SMapExp;
45: import org.overture.ast.expressions.SSeqExp;
46: import org.overture.ast.expressions.SSetExp;
47: import org.overture.ast.expressions.SUnaryExp;
48: import org.overture.ast.node.INode;
49: import org.overture.ast.patterns.PMultipleBind;
50: import org.overture.interpreter.assistant.IInterpreterAssistantFactory;
51: import org.overture.interpreter.runtime.ContextException;
52: import org.overture.interpreter.runtime.ObjectContext;
53: import org.overture.interpreter.runtime.ValueException;
54: import org.overture.interpreter.runtime.VdmRuntimeError;
55: import org.overture.interpreter.values.UpdatableValue;
56: import org.overture.interpreter.values.Value;
57: import org.overture.interpreter.values.ValueList;
58:
59: /***************************************
60: * This method collects and returns the values of an expression.
61: *
62: * @author gkanos
63: ****************************************/
64: public class ExpressionValueCollector extends
65:                 QuestionAnswerAdaptor<ObjectContext, ValueList>
66: {
67:         protected IInterpreterAssistantFactory af;
68:
69:         public ExpressionValueCollector(IInterpreterAssistantFactory af)
70:         {
71:                 this.af = af;
72:         }
73:
74:         @Override
75:         public ValueList caseAApplyExp(AApplyExp exp, ObjectContext ctxt)
76:                         throws AnalysisException
77:         {
78:                 ValueList list = af.createPExpAssistant().getValues(exp.getArgs(), ctxt);
79:                 list.addAll(exp.getRoot().apply(THIS, ctxt));
80:                 return list;
81:         }
82:
83:         @Override
84:         public ValueList defaultSBinaryExp(SBinaryExp exp, ObjectContext ctxt)
85:                         throws AnalysisException
86:         {
87:                 ValueList list = exp.getLeft().apply(THIS, ctxt);
88:                 list.addAll(exp.getRight().apply(THIS, ctxt));
89:                 return list;
90:         }
91:
92:         @Override
93:         public ValueList caseACasesExp(ACasesExp exp, ObjectContext ctxt)
94:                         throws AnalysisException
95:         {
96:                 ValueList list = exp.getExpression().apply(THIS, ctxt);
97:
98:•                for (ACaseAlternative c : exp.getCases())
99:                 {
100:                         list.addAll(c.apply(THIS, ctxt));
101:                 }
102:
103:•                if (exp.getOthers() != null)
104:                 {
105:                         list.addAll(exp.getOthers().apply(THIS, ctxt));
106:                 }
107:
108:                 return list;
109:         }
110:
111:         @Override
112:         public ValueList caseADefExp(ADefExp exp, ObjectContext ctxt)
113:                         throws AnalysisException
114:         {
115:                 ValueList list = af.createPDefinitionListAssistant().getValues(exp.getLocalDefs(), ctxt);
116:                 list.addAll(exp.getExpression().apply(THIS, ctxt));
117:                 return list;
118:         }
119:
120:         @Override
121:         public ValueList caseAElseIfExp(AElseIfExp exp, ObjectContext ctxt)
122:                         throws AnalysisException
123:         {
124:                 ValueList list = exp.getElseIf().apply(THIS, ctxt);
125:                 list.addAll(exp.getThen().apply(THIS, ctxt));
126:                 return list;
127:         }
128:
129:         @Override
130:         public ValueList caseAExistsExp(AExistsExp exp, ObjectContext ctxt)
131:                         throws AnalysisException
132:         {
133:                 ValueList list = new ValueList();
134:
135:•                for (PMultipleBind mb : exp.getBindList())
136:                 {
137:                         list.addAll(ctxt.assistantFactory.createPMultipleBindAssistant().getValues(mb, ctxt));
138:                 }
139:
140:                 list.addAll(exp.getPredicate().apply(THIS, ctxt));
141:                 return list;
142:         }
143:
144:         @Override
145:         public ValueList caseAExists1Exp(AExists1Exp exp, ObjectContext ctxt)
146:                         throws AnalysisException
147:         {
148:                 ValueList list = af.createPBindAssistant().getValues(exp.getBind(), ctxt);
149:                 list.addAll(exp.getPredicate().apply(THIS, ctxt));
150:                 return list;
151:         }
152:
153:         @Override
154:         public ValueList caseAFieldExp(AFieldExp exp, ObjectContext ctxt)
155:                         throws AnalysisException
156:         {
157:                 ValueList values = exp.getObject().apply(THIS, ctxt);
158:
159:                 try
160:                 {
161:                         // This evaluation should not affect scheduling as we are trying to
162:                         // discover the sync variables to listen to only.
163:
164:                         ctxt.threadState.setAtomic(true);
165:                         Value r = af.createAFieldExpAssistant().evaluate(exp, ctxt);
166:
167:•                        if (r instanceof UpdatableValue)
168:                         {
169:                                 values.add(r);
170:                         }
171:
172:                         return values;
173:                 } catch (ContextException e)
174:                 {
175:•                        if (e.number == 4034)
176:                         {
177:                                 return values; // Non existent variable
178:                         } else
179:                         {
180:                                 throw e;
181:                         }
182:                 } catch (ValueException e)
183:                 {
184:•                        if (e.number == 4097 || e.number == 4105)
185:                         {
186:                                 return values;        // Cannot get record/object value of ...
187:                         }
188:                         VdmRuntimeError.abort(exp.getLocation(), e);
189:                         return null;
190:                 } catch (AnalysisException e)
191:                 {
192:                         e.printStackTrace();
193:                         return null;
194:                 } finally
195:                 {
196:                         ctxt.threadState.setAtomic(false);
197:                 }
198:         }
199:
200:         @Override
201:         public ValueList caseAFieldNumberExp(AFieldNumberExp exp, ObjectContext ctxt)
202:                         throws AnalysisException
203:         {
204:                 return exp.getTuple().apply(THIS, ctxt);
205:         }
206:
207:         @Override
208:         public ValueList caseAForAllExp(AForAllExp exp, ObjectContext ctxt)
209:                         throws AnalysisException
210:         {
211:                 ValueList list = new ValueList();
212:
213:•                for (PMultipleBind mb : exp.getBindList())
214:                 {
215:                         list.addAll(ctxt.assistantFactory.createPMultipleBindAssistant().getValues(mb, ctxt));
216:                 }
217:
218:                 list.addAll(exp.getPredicate().apply(THIS, ctxt));
219:                 return list;
220:         }
221:
222:         @Override
223:         public ValueList caseAFuncInstatiationExp(AFuncInstatiationExp exp,
224:                         ObjectContext ctxt) throws AnalysisException
225:         {
226:                 return exp.getFunction().apply(THIS, ctxt);
227:         }
228:
229:         @Override
230:         public ValueList caseAIfExp(AIfExp exp, ObjectContext ctxt)
231:                         throws AnalysisException
232:         {
233:                 ValueList list = exp.getTest().apply(THIS, ctxt);
234:                 list.addAll(exp.getThen().apply(THIS, ctxt));
235:
236:•                for (AElseIfExp elif : exp.getElseList())
237:                 {
238:                         list.addAll(elif.apply(THIS, ctxt));
239:                 }
240:
241:•                if (exp.getElse() != null)
242:                 {
243:                         list.addAll(exp.getElse().apply(THIS, ctxt));
244:                 }
245:
246:                 return list;
247:         }
248:
249:         @Override
250:         public ValueList caseAIotaExp(AIotaExp exp, ObjectContext ctxt)
251:                         throws AnalysisException
252:         {
253:                 ValueList list = af.createPBindAssistant().getValues(exp.getBind(), ctxt);
254:                 list.addAll(exp.getPredicate().apply(THIS, ctxt));
255:                 return list;
256:         }
257:
258:         @Override
259:         public ValueList caseAIsExp(AIsExp exp, ObjectContext ctxt)
260:                         throws AnalysisException
261:         {
262:                 return exp.getTest().apply(THIS, ctxt);
263:
264:         }
265:
266:         @Override
267:         public ValueList caseAIsOfBaseClassExp(AIsOfBaseClassExp exp,
268:                         ObjectContext ctxt) throws AnalysisException
269:         {
270:
271:                 return exp.getExp().apply(THIS, ctxt);
272:         }
273:
274:         @Override
275:         public ValueList caseAIsOfClassExp(AIsOfClassExp exp, ObjectContext ctxt)
276:                         throws AnalysisException
277:         {
278:
279:                 return exp.getExp().apply(THIS, ctxt);
280:         }
281:
282:         @Override
283:         public ValueList caseALambdaExp(ALambdaExp exp, ObjectContext ctxt)
284:                         throws AnalysisException
285:         {
286:
287:                 return exp.getExpression().apply(THIS, ctxt);
288:         }
289:
290:         @Override
291:         public ValueList caseALetBeStExp(ALetBeStExp exp, ObjectContext ctxt)
292:                         throws AnalysisException
293:         {
294:
295:                 ValueList list = ctxt.assistantFactory.createPMultipleBindAssistant().getValues(exp.getBind(), ctxt);
296:
297:•                if (exp.getSuchThat() != null)
298:                 {
299:                         list.addAll(exp.getSuchThat().apply(THIS, ctxt));
300:                 }
301:
302:                 list.addAll(exp.getValue().apply(THIS, ctxt));
303:                 return list;
304:         }
305:
306:         @Override
307:         public ValueList caseALetDefExp(ALetDefExp exp, ObjectContext ctxt)
308:                         throws AnalysisException
309:         {
310:
311:                 ValueList list = af.createPDefinitionListAssistant().getValues(exp.getLocalDefs(), ctxt);
312:                 list.addAll(exp.getExpression().apply(THIS, ctxt));
313:                 return list;
314:         }
315:
316:         @Override
317:         public ValueList caseAMapCompMapExp(AMapCompMapExp exp, ObjectContext ctxt)
318:                         throws AnalysisException
319:         {
320:
321:                 ValueList list = exp.getFirst().apply(THIS, ctxt);
322:
323:•                for (PMultipleBind mb : exp.getBindings())
324:                 {
325:                         list.addAll(ctxt.assistantFactory.createPMultipleBindAssistant().getValues(mb, ctxt));
326:                 }
327:
328:•                if (exp.getPredicate() != null)
329:                 {
330:                         list.addAll(exp.getPredicate().apply(THIS, ctxt));
331:                 }
332:
333:                 return list;
334:         }
335:
336:         @Override
337:         public ValueList caseAMapEnumMapExp(AMapEnumMapExp exp, ObjectContext ctxt)
338:                         throws AnalysisException
339:         {
340:
341:                 ValueList list = new ValueList();
342:
343:•                for (AMapletExp maplet : exp.getMembers())
344:                 {
345:                         list.addAll(maplet.apply(THIS, ctxt));
346:                 }
347:
348:                 return list;
349:         }
350:
351:         @Override
352:         public ValueList defaultSMapExp(SMapExp exp, ObjectContext ctxt)
353:                         throws AnalysisException
354:         {
355:                 return new ValueList();
356:         }
357:
358:         @Override
359:         public ValueList caseAMapletExp(AMapletExp exp, ObjectContext ctxt)
360:                         throws AnalysisException
361:         {
362:
363:                 ValueList list = exp.apply(THIS, ctxt);
364:                 list.addAll(exp.getRight().apply(THIS, ctxt));
365:                 return list;
366:         }
367:
368:         @Override
369:         public ValueList caseAMkBasicExp(AMkBasicExp exp, ObjectContext ctxt)
370:                         throws AnalysisException
371:         {
372:
373:                 return exp.getArg().apply(THIS, ctxt);
374:         }
375:
376:         @Override
377:         public ValueList caseAMkTypeExp(AMkTypeExp exp, ObjectContext ctxt)
378:                         throws AnalysisException
379:         {
380:
381:                 return af.createPExpAssistant().getValues(exp.getArgs(), ctxt);
382:         }
383:
384:         @Override
385:         public ValueList caseAMuExp(AMuExp exp, ObjectContext ctxt)
386:                         throws AnalysisException
387:         {
388:
389:                 ValueList list = exp.getRecord().apply(THIS, ctxt);
390:
391:•                for (ARecordModifier rm : exp.getModifiers())
392:                 {
393:                         list.addAll(rm.getValue().apply(THIS, ctxt));
394:                 }
395:
396:                 return list;
397:         }
398:
399:         @Override
400:         public ValueList caseANarrowExp(ANarrowExp exp, ObjectContext ctxt)
401:                         throws AnalysisException
402:         {
403:
404:                 return exp.getTest().apply(THIS, ctxt);
405:         }
406:
407:         @Override
408:         public ValueList caseANewExp(ANewExp exp, ObjectContext ctxt)
409:                         throws AnalysisException
410:         {
411:
412:                 return af.createPExpAssistant().getValues(exp.getArgs(), ctxt);
413:         }
414:
415:         @Override
416:         public ValueList caseASameBaseClassExp(ASameBaseClassExp exp,
417:                         ObjectContext ctxt) throws AnalysisException
418:         {
419:
420:                 ValueList list = exp.getLeft().apply(THIS, ctxt);
421:                 list.addAll(exp.getRight().apply(THIS, ctxt));
422:                 return list;
423:         }
424:
425:         @Override
426:         public ValueList caseASameClassExp(ASameClassExp exp, ObjectContext ctxt)
427:                         throws AnalysisException
428:         {
429:
430:                 ValueList list = exp.getLeft().apply(THIS, ctxt);
431:                 list.addAll(exp.getRight().apply(THIS, ctxt));
432:                 return list;
433:         }
434:
435:         @Override
436:         public ValueList caseASeqCompSeqExp(ASeqCompSeqExp exp, ObjectContext ctxt)
437:                         throws AnalysisException
438:         {
439:
440:                 ValueList list = exp.getFirst().apply(THIS, ctxt);
441:                 list.addAll(af.createPBindAssistant().getBindValues(exp.getBind(), ctxt, false));
442:
443:•                if (exp.getPredicate() != null)
444:                 {
445:                         list.addAll(exp.getPredicate().apply(THIS, ctxt));
446:                 }
447:
448:                 return list;
449:         }
450:
451:         @Override
452:         public ValueList caseASeqEnumSeqExp(ASeqEnumSeqExp exp, ObjectContext ctxt)
453:                         throws AnalysisException
454:         {
455:
456:                 return af.createPExpAssistant().getValues(exp.getMembers(), ctxt);
457:         }
458:
459:         @Override
460:         public ValueList defaultSSeqExp(SSeqExp exp, ObjectContext ctxt)
461:                         throws AnalysisException
462:         {
463:                 return new ValueList();
464:         }
465:
466:         @Override
467:         public ValueList caseASetCompSetExp(ASetCompSetExp exp, ObjectContext ctxt)
468:                         throws AnalysisException
469:         {
470:
471:                 ValueList list = exp.getFirst().apply(THIS, ctxt);
472:
473:•                for (PMultipleBind mb : exp.getBindings())
474:                 {
475:                         list.addAll(ctxt.assistantFactory.createPMultipleBindAssistant().getValues(mb, ctxt));
476:                 }
477:
478:•                if (exp.getPredicate() != null)
479:                 {
480:                         list.addAll(exp.getPredicate().apply(THIS, ctxt));
481:                 }
482:
483:                 return list;
484:         }
485:
486:         @Override
487:         public ValueList caseASetEnumSetExp(ASetEnumSetExp exp, ObjectContext ctxt)
488:                         throws AnalysisException
489:         {
490:                 return af.createPExpAssistant().getValues(exp.getMembers(), ctxt);
491:         }
492:
493:         @Override
494:         public ValueList defaultSSetExp(SSetExp exp, ObjectContext ctxt)
495:                         throws AnalysisException
496:         {
497:                 return new ValueList();
498:         }
499:
500:         @Override
501:         public ValueList caseASubseqExp(ASubseqExp exp, ObjectContext ctxt)
502:                         throws AnalysisException
503:         {
504:                 ValueList list = exp.getSeq().apply(THIS, ctxt);
505:                 list.addAll(exp.getFrom().apply(THIS, ctxt));
506:                 list.addAll(exp.getTo().apply(THIS, ctxt));
507:                 return list;
508:         }
509:
510:         @Override
511:         public ValueList caseATupleExp(ATupleExp exp, ObjectContext ctxt)
512:                         throws AnalysisException
513:         {
514:                 return af.createPExpAssistant().getValues(exp.getArgs(), ctxt);
515:         }
516:
517:         @Override
518:         public ValueList defaultSUnaryExp(SUnaryExp exp, ObjectContext ctxt)
519:                         throws AnalysisException
520:         {
521:                 return exp.getExp().apply(THIS, ctxt);
522:         }
523:
524:         @Override
525:         public ValueList caseAVariableExp(AVariableExp exp, ObjectContext ctxt)
526:                         throws AnalysisException
527:         {
528:                 Value v = ctxt.check(exp.getName());
529:
530:•                if (v == null || !(v instanceof UpdatableValue))
531:                 {
532:                         return new ValueList();
533:                 } else
534:                 {
535:                         return new ValueList(v);
536:                 }
537:         }
538:
539:         @Override
540:         public ValueList defaultPExp(PExp exp, ObjectContext ctxt)
541:                         throws AnalysisException
542:         {
543:                 return new ValueList(); // Default, for expressions with no variables
544:         }
545:
546:         @Override
547:         public ValueList createNewReturnValue(INode node, ObjectContext question)
548:                         throws AnalysisException
549:         {
550:                 // TODO Auto-generated method stub
551:                 return null;
552:         }
553:
554:         @Override
555:         public ValueList createNewReturnValue(Object node, ObjectContext question)
556:                         throws AnalysisException
557:         {
558:                 // TODO Auto-generated method stub
559:                 return null;
560:         }
561:
562: }