6105620dfad3810493b73e79ff4484fea15d651f
[cdsspec-compiler.git] / src / edu / uci / eecs / specCompiler / specExtraction / SequentialDefineSubConstruct.java
1 package edu.uci.eecs.specCompiler.specExtraction;
2
3 import java.util.ArrayList;
4
5 public class SequentialDefineSubConstruct {
6         public final ArrayList<String> initVar;
7         public final ArrayList<String> cleanupCode;
8         public final ArrayList<ArrayList<String>> defineFuncs;
9         public final ArrayList<VariableDeclaration> declareVar;
10         public final ArrayList<ArrayList<String>> declareStructs;
11
12         public SequentialDefineSubConstruct(
13                         ArrayList<ArrayList<String>> declareStruct,
14                         ArrayList<VariableDeclaration> declareVar,
15                         ArrayList<String> initVar, ArrayList<String> cleanupCode,
16                         ArrayList<ArrayList<String>> defineFuncs) {
17                 this.declareStructs = declareStruct;
18                 this.declareVar = declareVar;
19                 this.initVar = initVar;
20                 this.cleanupCode = cleanupCode;
21                 this.defineFuncs = defineFuncs;
22         }
23
24         public String toString() {
25                 StringBuffer res = new StringBuffer();
26                 res.append("@Sequential_define:\n");
27                 res.append("@DeclareStruct:\n");
28                 for (int i = 0; i < declareStructs.size(); i++) {
29                         res.append(ParserUtils.array2Str(declareStructs.get(i)) + "\n");
30                 }
31                 res.append("@DeclareVar:\n");
32                 res.append(ParserUtils.array2Str(declareVar));
33                 res.append("@InitVar:\n");
34                 res.append(ParserUtils.array2Str(initVar));
35                 res.append("@DefineFunc:\n");
36                 for (int i = 0; i < defineFuncs.size(); i++) {
37                         res.append(ParserUtils.array2Str(defineFuncs.get(i)) + "\n");
38                 }
39                 return res.toString();
40         }
41 }