Package: TypeDefinitionChecker

TypeDefinitionChecker

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