Package: DefinitionRunTimeChecker

DefinitionRunTimeChecker

nameinstructionbranchcomplexitylinemethod
DefinitionRunTimeChecker(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%
caseAImportedDefinition(AImportedDefinition)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseAInheritedDefinition(AInheritedDefinition)
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
caseARenamedDefinition(ARenamedDefinition)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseATypeDefinition(ATypeDefinition)
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
createNewReturnValue(INode)
M: 3 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)
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
defaultPDefinition(PDefinition)
M: 0 C: 3
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.definition;
2:
3: import org.overture.ast.analysis.AnalysisException;
4: import org.overture.ast.analysis.AnswerAdaptor;
5: import org.overture.ast.definitions.AImportedDefinition;
6: import org.overture.ast.definitions.AInheritedDefinition;
7: import org.overture.ast.definitions.ARenamedDefinition;
8: import org.overture.ast.definitions.ATypeDefinition;
9: import org.overture.ast.definitions.PDefinition;
10: import org.overture.ast.node.INode;
11: import org.overture.interpreter.assistant.IInterpreterAssistantFactory;
12:
13: /***************************************
14: * This method checks if a definition can be executed at runtime.
15: *
16: * @author gkanos
17: ****************************************/
18: public class DefinitionRunTimeChecker extends AnswerAdaptor<Boolean>
19: {
20:         protected IInterpreterAssistantFactory af;
21:
22:         public DefinitionRunTimeChecker(IInterpreterAssistantFactory af)
23:         {
24:                 this.af = af;
25:         }
26:
27:         @Override
28:         public Boolean caseAImportedDefinition(AImportedDefinition def)
29:                         throws AnalysisException
30:         {
31:
32:                 return def.getDef().apply(THIS);
33:         }
34:
35:         @Override
36:         public Boolean caseAInheritedDefinition(AInheritedDefinition def)
37:                         throws AnalysisException
38:         {
39:
40:                 return def.getSuperdef().apply(THIS);
41:         }
42:
43:         @Override
44:         public Boolean caseARenamedDefinition(ARenamedDefinition def)
45:                         throws AnalysisException
46:         {
47:
48:                 return def.getDef().apply(THIS);
49:         }
50:
51:         @Override
52:         public Boolean caseATypeDefinition(ATypeDefinition node)
53:                         throws AnalysisException
54:         {
55:                 return false;
56:         }
57:
58:         @Override
59:         public Boolean defaultPDefinition(PDefinition node)
60:                         throws AnalysisException
61:         {
62:                 return true;
63:         }
64:
65:         @Override
66:         public Boolean createNewReturnValue(INode node) throws AnalysisException
67:         {
68:                 // TODO Auto-generated method stub
69:                 return true;
70:         }
71:
72:         @Override
73:         public Boolean createNewReturnValue(Object node) throws AnalysisException
74:         {
75:                 // TODO Auto-generated method stub
76:                 return true;
77:         }
78:
79: }