Package: PTypeAssistantInterpreter

PTypeAssistantInterpreter

nameinstructionbranchcomplexitylinemethod
PTypeAssistantInterpreter(IInterpreterAssistantFactory)
M: 0 C: 8
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
getAllValues(PType, Context)
M: 0 C: 22
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%

Coverage

1: package org.overture.interpreter.assistant.type;
2:
3: import org.overture.ast.analysis.AnalysisException;
4: import org.overture.ast.assistant.IAstAssistant;
5: import org.overture.ast.types.PType;
6: import org.overture.interpreter.assistant.IInterpreterAssistantFactory;
7: import org.overture.interpreter.runtime.Context;
8: import org.overture.interpreter.runtime.ValueException;
9: import org.overture.interpreter.values.ValueList;
10: import org.overture.typechecker.assistant.type.PTypeAssistantTC;
11:
12: public class PTypeAssistantInterpreter extends PTypeAssistantTC implements IAstAssistant
13: {
14:         protected static IInterpreterAssistantFactory af;
15:
16:         @SuppressWarnings("static-access")
17:         public PTypeAssistantInterpreter(IInterpreterAssistantFactory af)
18:         {
19:                 super(af);
20:                 this.af = af;
21:         }
22:
23:         public ValueList getAllValues(PType type, Context ctxt)
24:                         throws AnalysisException
25:         {
26:                 try
27:                 {
28:                         return type.apply(af.getAllValuesCollector(), ctxt);// FIXME: should we handle exceptions like this
29:                 } catch (AnalysisException e)
30:                 {
31:                         throw new ValueException(4, "Cannot get bind values for type "
32:                                         + type, ctxt);
33:                 }
34:         }
35:
36: }