private int _beginLineNum, _endLineNum;
private String _beginLine;
- SpecExtractor() {
+ public SpecExtractor() {
_constructs = new ArrayList<SpecConstruct>();
}
continue;
Construct inst = SpecParser.parseSpec(specText
.toString());
- if (inst instanceof InterfaceConstruct) {
+ if (inst instanceof InterfaceConstruct
+ || inst instanceof InterfaceDefineConstruct) {
funcDecl = readFunctionDecl(reader);
specConstruct = new SpecConstruct(
specText.toString(), file,
- _beginLineNum, _endLineNum, inst, funcDecl);
+ _beginLineNum, _endLineNum, inst,
+ funcDecl);
} else {
specConstruct = new SpecConstruct(
specText.toString(), file,
_beginLineNum, _endLineNum, inst);
}
+ _constructs.add(specConstruct);
specText = new StringBuilder();
- System.out.println(specConstruct);
+ // System.out.println(specConstruct);
}
}
} else {
}
Construct inst = SpecParser.parseSpec(specText
.toString());
- if (inst instanceof InterfaceConstruct) {
+ if (inst instanceof InterfaceConstruct
+ || inst instanceof InterfaceDefineConstruct) {
funcDecl = readFunctionDecl(reader);
specConstruct = new SpecConstruct(
- specText.toString(), file,
- _beginLineNum, _endLineNum, inst, funcDecl);
+ specText.toString(), file, _beginLineNum,
+ _endLineNum, inst, funcDecl);
} else {
specConstruct = new SpecConstruct(
- specText.toString(), file,
- _beginLineNum, _endLineNum, inst);
+ specText.toString(), file, _beginLineNum,
+ _endLineNum, inst);
}
- System.out.println(specConstruct);
+ _constructs.add(specConstruct);
specText = new StringBuilder();
+ // System.out.println(specConstruct);
}
}
}
e.printStackTrace();
}
}
-
+
private void printSpecInfo(File file, String text) {
System.out.println("Error in spec!");
System.out.println("File: " + file.getAbsolutePath());
- System.out.println("Begin: "
- + _beginLineNum + " End: " + _endLineNum);
+ System.out.println("Begin: " + _beginLineNum + " End: " + _endLineNum);
System.out.println(text);
}
-
+
private boolean isComment(String specText) {
if (specText.indexOf("@Begin") != -1)
return false;
else
return line.substring(i, j + 1);
}
-
+
public ArrayList<SpecConstruct> getConstructs() {
return this._constructs;
}