Package: DefinitionStatementFinder

DefinitionStatementFinder

nameinstructionbranchcomplexitylinemethod
DefinitionStatementFinder(IInterpreterAssistantFactory)
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%
caseAExplicitOperationDefinition(AExplicitOperationDefinition, Integer)
M: 9 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseAImplicitOperationDefinition(AImplicitOperationDefinition, Integer)
M: 14 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
caseAThreadDefinition(AThreadDefinition, Integer)
M: 9 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, Integer)
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, Integer)
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, Integer)
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%
defaultSClassDefinition(SClassDefinition, Integer)
M: 8 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.interpreter.utilities.definition;
2:
3: import org.overture.ast.analysis.AnalysisException;
4: import org.overture.ast.analysis.QuestionAnswerAdaptor;
5: import org.overture.ast.definitions.AExplicitOperationDefinition;
6: import org.overture.ast.definitions.AImplicitOperationDefinition;
7: import org.overture.ast.definitions.AThreadDefinition;
8: import org.overture.ast.definitions.PDefinition;
9: import org.overture.ast.definitions.SClassDefinition;
10: import org.overture.ast.node.INode;
11: import org.overture.ast.statements.PStm;
12: import org.overture.interpreter.assistant.IInterpreterAssistantFactory;
13:
14: /***************************************
15: * This method finds a statement within a definition.
16: *
17: * @author gkanos
18: ****************************************/
19:
20: public class DefinitionStatementFinder extends
21:                 QuestionAnswerAdaptor<Integer, PStm>
22: {
23:         protected IInterpreterAssistantFactory af;
24:
25:         public DefinitionStatementFinder(IInterpreterAssistantFactory af)
26:         {
27:                 this.af = af;
28:         }
29:
30:         @Override
31:         public PStm defaultSClassDefinition(SClassDefinition def, Integer lineno)
32:                         throws AnalysisException
33:         {
34:                 // I don't think this needs to be unfolded. gk
35:                 return af.createSClassDefinitionAssistant().findStatement(def, lineno);
36:
37:         }
38:
39:         @Override
40:         public PStm caseAExplicitOperationDefinition(
41:                         AExplicitOperationDefinition def, Integer lineno)
42:                         throws AnalysisException
43:         {
44:                 return af.createPStmAssistant().findStatement(def.getBody(), lineno);
45:         }
46:
47:         @Override
48:         public PStm caseAImplicitOperationDefinition(
49:                         AImplicitOperationDefinition def, Integer lineno)
50:                         throws AnalysisException
51:         {
52:•                return def.getBody() == null ? null
53:                                 : af.createPStmAssistant().findStatement(def.getBody(), lineno);
54:         }
55:
56:         @Override
57:         public PStm caseAThreadDefinition(AThreadDefinition def, Integer lineno)
58:                         throws AnalysisException
59:         {
60:                 return af.createPStmAssistant().findStatement(def.getStatement(), lineno);
61:         }
62:
63:         @Override
64:         public PStm defaultPDefinition(PDefinition def, Integer lineno)
65:                         throws AnalysisException
66:         {
67:                 return null;
68:         }
69:
70:         @Override
71:         public PStm createNewReturnValue(INode node, Integer question)
72:                         throws AnalysisException
73:         {
74:                 // TODO Auto-generated method stub
75:                 return null;
76:         }
77:
78:         @Override
79:         public PStm createNewReturnValue(Object node, Integer question)
80:                         throws AnalysisException
81:         {
82:                 // TODO Auto-generated method stub
83:                 return null;
84:         }
85:
86: }