Package: IrToStringUtil

IrToStringUtil

nameinstructionbranchcomplexitylinemethod
IrToStringUtil()
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%
getBlockSimpleBlockString(ABlockStmIR)
M: 0 C: 44
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 10
100%
M: 0 C: 1
100%
getSimpleBlockString(ABlockStmIR)
M: 0 C: 36
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 9
100%
M: 0 C: 1
100%

Coverage

1: package org.overture.codegen.ir;
2:
3: import org.overture.codegen.ir.declarations.AVarDeclIR;
4: import org.overture.codegen.ir.statements.ABlockStmIR;
5:
6: public class IrToStringUtil
7: {
8:         public static String getSimpleBlockString(ABlockStmIR node)
9:         {
10:                 StringBuilder sb = new StringBuilder();
11:                 String sep = "";
12:
13:•                for (SStmIR s : node.getStatements())
14:                 {
15:                         sb.append(sep);
16:                         sb.append(s.toString());
17:                         sep = ";\n";
18:                 }
19:
20:                 sb.append("\n");
21:                 return sb.toString();
22:         }
23:
24:         public static String getBlockSimpleBlockString(ABlockStmIR node)
25:         {
26:                 StringBuilder sb = new StringBuilder();
27:                 sb.append("{\n");
28:
29:•                for (AVarDeclIR d : node.getLocalDefs())
30:                 {
31:                         sb.append(d);
32:                         sb.append("\n");
33:                 }
34:
35:                 sb.append("\n");
36:                 sb.append(getSimpleBlockString(node));
37:                 sb.append("}");
38:                 return sb.toString();
39:         }
40: }