Package: PBindAssistantInterpreter

PBindAssistantInterpreter

nameinstructionbranchcomplexitylinemethod
PBindAssistantInterpreter(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%
getBindValues(PBind, Context, boolean)
M: 0 C: 11
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getValues(PBind, ObjectContext)
M: 12 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%

Coverage

1: package org.overture.interpreter.assistant.pattern;
2:
3: import org.overture.ast.analysis.AnalysisException;
4: import org.overture.ast.assistant.IAstAssistant;
5: import org.overture.ast.patterns.PBind;
6: import org.overture.interpreter.assistant.IInterpreterAssistantFactory;
7: import org.overture.interpreter.eval.BindState;
8: import org.overture.interpreter.runtime.Context;
9: import org.overture.interpreter.runtime.ObjectContext;
10: import org.overture.interpreter.values.ValueList;
11: import org.overture.typechecker.assistant.pattern.PBindAssistantTC;
12:
13: public class PBindAssistantInterpreter extends PBindAssistantTC implements IAstAssistant
14: {
15:         protected static IInterpreterAssistantFactory af;
16:
17:         @SuppressWarnings("static-access")
18:         public PBindAssistantInterpreter(IInterpreterAssistantFactory af)
19:         {
20:                 super(af);
21:                 this.af = af;
22:         }
23:
24:         public ValueList getBindValues(PBind bind, Context ctxt, boolean permuted)
25:                         throws AnalysisException
26:         {
27:
28:                 return bind.apply(af.getSingleBindValuesCollector(), new BindState(ctxt, permuted));
29:
30:         }
31:
32:         public ValueList getValues(PBind bind, ObjectContext ctxt)
33:         {
34:
35:                 try
36:                 {
37:                         return bind.apply(af.getBindValueCollector(), ctxt);// FIXME: should we handle exceptions like this
38:                 } catch (AnalysisException e)
39:                 {
40:                         return new ValueList();
41:                 }
42:         }
43:
44: }