*
*/
public class SpecConstruct {
- public enum ConstructType {
- GLOBAL, INTERFACE, POTENTIAL_CP, CP_DEFINE, CP_DEFINE_CHECK
- };
- public ConstructType type;
public final String plainText;
public final File file;
public final int beginLineNum;
public final int endLineNum;
public final String interfaceDeclBody;
+ public final Construct construct;
- public SpecConstruct(ConstructType type, String plainText, File file,
- int beginLineNum, int endLineNum) {
- this.type = type;
+ public SpecConstruct(String plainText, File file,
+ int beginLineNum, int endLineNum, Construct construct) {
this.plainText = plainText;
this.file = file;
this.beginLineNum = beginLineNum;
this.endLineNum = endLineNum;
+ this.construct = construct;
this.interfaceDeclBody = "";
}
- public SpecConstruct(ConstructType type, String plainText, File file,
- int beginLineNum, int endLineNum, String interfaceDeclBody) {
- this.type = type;
+ public SpecConstruct(String plainText, File file,
+ int beginLineNum, int endLineNum, Construct construct,
+ String interfaceDeclBody) {
this.plainText = plainText;
this.file = file;
this.beginLineNum = beginLineNum;
this.endLineNum = endLineNum;
+ this.construct = construct;
this.interfaceDeclBody = interfaceDeclBody;
}
+
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("File: " + file.getAbsolutePath() + "\n");
+ sb.append("Begin: "
+ + beginLineNum + " End: " + endLineNum + "\n");
+ sb.append(construct);
+ if (construct instanceof InterfaceConstruct) {
+ sb.append("Function declaration: " + interfaceDeclBody);
+ }
+ boolean a = !false, b = 3 > 0 ? a : !a;
+ return sb.toString();
+
+ }
}