Package: InstanceVariableChecker

InstanceVariableChecker

nameinstructionbranchcomplexitylinemethod
InstanceVariableChecker(ITypeCheckerAssistantFactory)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
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: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseAInstanceVariableDefinition(AInstanceVariableDefinition)
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%
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%
createNewReturnValue(INode)
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)
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%
defaultPDefinition(PDefinition)
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%

Coverage

1: package org.overture.typechecker.utilities;
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.AInstanceVariableDefinition;
8: import org.overture.ast.definitions.ARenamedDefinition;
9: import org.overture.ast.definitions.PDefinition;
10: import org.overture.ast.node.INode;
11: import org.overture.typechecker.assistant.ITypeCheckerAssistantFactory;
12:
13: /***************************************
14: * This method checks if a definition is an instance variable.
15: *
16: * @author gkanos
17: ****************************************/
18: public class InstanceVariableChecker extends AnswerAdaptor<Boolean>
19: {
20:         protected ITypeCheckerAssistantFactory af;
21:
22:         public InstanceVariableChecker(ITypeCheckerAssistantFactory af)
23:         {
24:                 this.af = af;
25:         }
26:
27:         @Override
28:         public Boolean caseAImportedDefinition(AImportedDefinition def)
29:                         throws AnalysisException
30:         {
31:                 return def.getDef().apply(THIS);
32:         }
33:
34:         @Override
35:         public Boolean caseAInheritedDefinition(AInheritedDefinition def)
36:                         throws AnalysisException
37:         {
38:                 return def.getSuperdef().apply(THIS);
39:         }
40:
41:         @Override
42:         public Boolean caseARenamedDefinition(ARenamedDefinition def)
43:                         throws AnalysisException
44:         {
45:                 return def.getDef().apply(THIS);
46:         }
47:
48:         @Override
49:         public Boolean caseAInstanceVariableDefinition(
50:                         AInstanceVariableDefinition def) throws AnalysisException
51:         {
52:                 return true;
53:         }
54:
55:         @Override
56:         public Boolean defaultPDefinition(PDefinition def) throws AnalysisException
57:         {
58:                 return false;
59:         }
60:
61:         @Override
62:         public Boolean createNewReturnValue(INode node) throws AnalysisException
63:         {
64:                 // TODO Auto-generated method stub
65:                 return null;
66:         }
67:
68:         @Override
69:         public Boolean createNewReturnValue(Object node) throws AnalysisException
70:         {
71:                 // TODO Auto-generated method stub
72:                 return null;
73:         }
74:
75: }