import java.util.HashMap;
import java.util.HashSet;
+import edu.uci.eecs.specCompiler.grammerParser.ParseException;
+import edu.uci.eecs.specCompiler.grammerParser.SpecParser;
import edu.uci.eecs.specCompiler.specExtraction.CPDefineCheckConstruct;
import edu.uci.eecs.specCompiler.specExtraction.CPDefineConstruct;
import edu.uci.eecs.specCompiler.specExtraction.ClassBeginConstruct;
import edu.uci.eecs.specCompiler.specExtraction.GlobalConstruct;
import edu.uci.eecs.specCompiler.specExtraction.InterfaceConstruct;
import edu.uci.eecs.specCompiler.specExtraction.InterfaceDefineConstruct;
+import edu.uci.eecs.specCompiler.specExtraction.ParserUtils;
import edu.uci.eecs.specCompiler.specExtraction.PotentialCPDefineConstruct;
import edu.uci.eecs.specCompiler.specExtraction.SourceFileInfo;
import edu.uci.eecs.specCompiler.specExtraction.SpecExtractor;
public final HashMap<String, Construct> CPLabel2Construct;
public final HashMap<String, PotentialCPDefineConstruct> potentialCPLabel2Construct;
public final HashMap<String, InterfaceConstruct> interfaceName2Construct;
- public final HashMap<String, Construct> interfaceName2DefineConstruct;
+ public final HashMap<String, InterfaceDefineConstruct> interfaceName2DefineConstruct;
public final HashMap<String, ArrayList<InterfaceConstruct>> CPLabel2InterfaceConstruct;
public final HashMap<String, Integer> interface2Num;
private ArrayList<EntryPointConstruct> entryPointConstructs;
private ClassBeginConstruct classBeginConstruct;
private ClassEndConstruct classEndConstruct;
+
+ private String templateStr;
+ private String templateFullStr;
+ private String className;
private int _interfaceNum;
private int _hbLabelNum;
this.CPLabel2Construct = new HashMap<String, Construct>();
this.potentialCPLabel2Construct = new HashMap<String, PotentialCPDefineConstruct>();
this.interfaceName2Construct = new HashMap<String, InterfaceConstruct>();
- this.interfaceName2DefineConstruct = new HashMap<String, Construct>();
+ this.interfaceName2DefineConstruct = new HashMap<String, InterfaceDefineConstruct>();
this.CPLabel2InterfaceConstruct = new HashMap<String, ArrayList<InterfaceConstruct>>();
this.entryPointConstructs = new ArrayList<EntryPointConstruct>();
this.classBeginConstruct = null;
_interfaceNum = 0;
_hbLabelNum = 0;
_commitPointNum = 0;
+
+ templateStr = null;
+ templateFullStr = null;
+ className = null;
+ }
+
+ public ClassBeginConstruct getClassBeginConstruct() {
+ return this.classBeginConstruct;
+ }
+
+ public ClassEndConstruct getClassEndConstruct() {
+ return this.classEndConstruct;
+ }
+
+ public String getTemplateFullStr() {
+ return this.templateFullStr;
+ }
+
+ public String getTemplateStr() {
+ return this.templateStr;
+ }
+
+ public String getClassName() {
+ return this.className;
}
public HashMap<ConditionalInterface, HashSet<ConditionalInterface>> getHBConditions() {
throw new SemanticsCheckerException(
"Interface define label duplicates!");
}
- interfaceName2DefineConstruct.put(name, construct);
+ interfaceName2DefineConstruct.put(name, theConstruct);
} else if (construct instanceof ClassBeginConstruct) {
classBeginConstruct = (ClassBeginConstruct) construct;
+ ArrayList<String> content = srcFilesInfo.get(classBeginConstruct.file).content;
+ String firstLine = content.get(classBeginConstruct.beginLineNum), secondLine;
+ if (firstLine.startsWith("template")) {
+ secondLine = content.get(classBeginConstruct.beginLineNum + 1);
+ templateFullStr = firstLine;
+ templateStr = ParserUtils.getTemplateStr(firstLine);
+ className = ParserUtils.getClassName(secondLine);
+ } else {
+ className = ParserUtils.getClassName(firstLine);
+ }
+
} else if (construct instanceof ClassEndConstruct) {
classEndConstruct = (ClassEndConstruct) construct;
}