Package: PMultipleBindAssistantInterpreter

PMultipleBindAssistantInterpreter

nameinstructionbranchcomplexitylinemethod
PMultipleBindAssistantInterpreter(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(PMultipleBind, 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(PMultipleBind, ObjectContext)
M: 5 C: 7
58%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 2 C: 1
33%
M: 0 C: 1
100%

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.PMultipleBind;
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.runtime.ValueException;
11: import org.overture.interpreter.values.ValueList;
12: import org.overture.typechecker.assistant.pattern.PMultipleBindAssistantTC;
13:
14: public class PMultipleBindAssistantInterpreter extends PMultipleBindAssistantTC implements IAstAssistant
15: {
16:         protected static IInterpreterAssistantFactory af;
17:
18:         @SuppressWarnings("static-access")
19:         public PMultipleBindAssistantInterpreter(IInterpreterAssistantFactory af)
20:         {
21:                 super(af);
22:                 this.af = af;
23:         }
24:
25:         public ValueList getBindValues(PMultipleBind mb, Context ctxt, boolean permuted)
26:                         throws ValueException, AnalysisException
27:         {
28:                 return mb.apply(af.getBindValuesCollector(), new BindState(ctxt, permuted));
29:         }
30:
31:         public ValueList getValues(PMultipleBind mb, ObjectContext ctxt)
32:         {
33:                 try
34:                 {
35:                         return mb.apply(af.getValueCollector(), ctxt);// FIXME: should we handle exceptions like this
36:                 } catch (AnalysisException e)
37:                 {
38:                         return new ValueList();
39:                 }
40:         }
41:
42: }