Package: NodeAssistantIR

NodeAssistantIR

nameinstructionbranchcomplexitylinemethod
NodeAssistantIR(AssistantManager)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
addMetaData(PIR, List, boolean)
M: 0 C: 11
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
buildData(List, List, boolean)
M: 13 C: 21
62%
M: 3 C: 3
50%
M: 3 C: 1
25%
M: 3 C: 6
67%
M: 0 C: 1
100%

Coverage

1: package org.overture.codegen.assistant;
2:
3: import java.util.LinkedList;
4: import java.util.List;
5:
6: import org.overture.ast.util.ClonableString;
7: import org.overture.codegen.ir.PIR;
8:
9: public class NodeAssistantIR extends AssistantBase
10: {
11:         public NodeAssistantIR(AssistantManager assistantManager)
12:         {
13:                 super(assistantManager);
14:         }
15:
16:         public void addMetaData(PIR node, List<ClonableString> extraMetaData,
17:                         boolean prepend)
18:         {
19:                 List<ClonableString> allMetaData = buildData(node.getMetaData(), extraMetaData, prepend);
20:
21:                 node.setMetaData(allMetaData);
22:         }
23:
24:         public List<ClonableString> buildData(
25:                         List<? extends ClonableString> currentMetaData,
26:                         List<ClonableString> extraMetaData, boolean prepend)
27:         {
28:•                if (extraMetaData == null || extraMetaData.isEmpty())
29:                 {
30:                         return new LinkedList<>();
31:                 }
32:
33:                 List<ClonableString> allMetaData = new LinkedList<ClonableString>();
34:
35:•                if (prepend)
36:                 {
37:                         allMetaData.addAll(extraMetaData);
38:                         allMetaData.addAll(currentMetaData);
39:                 } else
40:                 {
41:                         allMetaData.addAll(currentMetaData);
42:                         allMetaData.addAll(extraMetaData);
43:                 }
44:
45:                 return allMetaData;
46:         }
47: }