Package: CallObjStmTrans

CallObjStmTrans

nameinstructionbranchcomplexitylinemethod
CallObjStmTrans(IRInfo)
M: 0 C: 15
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
caseACallObjectStmIR(ACallObjectStmIR)
M: 11 C: 42
79%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 10
91%
M: 0 C: 1
100%

Coverage

1: package org.overture.codegen.trans;
2:
3: import org.apache.log4j.Logger;
4: import org.overture.codegen.ir.IRInfo;
5: import org.overture.codegen.ir.analysis.AnalysisException;
6: import org.overture.codegen.ir.analysis.DepthFirstAnalysisAdaptor;
7: import org.overture.codegen.ir.statements.ACallObjectExpStmIR;
8: import org.overture.codegen.ir.statements.ACallObjectStmIR;
9: import org.overture.codegen.trans.conv.ObjectDesignatorToExpIR;
10:
11: public class CallObjStmTrans extends DepthFirstAnalysisAdaptor
12: {
13:         private ObjectDesignatorToExpIR converter;
14:
15:         private Logger log = Logger.getLogger(this.getClass().getName());
16:
17:         public CallObjStmTrans(IRInfo info)
18:         {
19:                 this.converter = new ObjectDesignatorToExpIR(info);
20:         }
21:
22:         @Override
23:         public void caseACallObjectStmIR(ACallObjectStmIR node)
24:                         throws AnalysisException
25:         {
26:                 ACallObjectExpStmIR callObjExpStm = new ACallObjectExpStmIR();
27:                 callObjExpStm.setArgs(node.getArgs());
28:                 callObjExpStm.setObj(node.getDesignator().apply(converter));
29:                 callObjExpStm.setFieldName(node.getFieldName());
30:                 callObjExpStm.setSourceNode(node.getSourceNode());
31:                 callObjExpStm.setTag(node.getTag());
32:                 callObjExpStm.setType(node.getType());
33:
34:•                if (node.parent() != null)
35:                 {
36:                         node.parent().replaceChild(node, callObjExpStm);
37:                 } else
38:                 {
39:                         log.error("Could not find parent of " + node);
40:                 }
41:         }
42: }