extracting spec & compiling
[cdsspec-compiler.git] / src / edu / uci / eecs / specCompiler / specExtraction / SpecConstruct.java
1 package edu.uci.eecs.specCompiler.specExtraction;
2
3 import java.io.File;
4
5 /**
6  * <p>
7  * This class represents the plain context for each specification construct.
8  * Besides, it also stores some useful information such as interfaceDeclBody,
9  * which is used in @Interface construct to wrap and rename interface calls.
10  * </p>
11  * @author peizhaoo
12  *
13  */
14 public class SpecConstruct {
15         public enum ConstructType {
16                 GLOBAL, INTERFACE, POTENTIAL_CP, CP_DEFINE, CP_DEFINE_CHECK
17         };
18         public ConstructType type;
19         public final String plainText;
20         public final File file;
21         public final int beginLineNum;
22         public final int endLineNum;
23         public final String interfaceDeclBody;
24         
25         public SpecConstruct(ConstructType type, String plainText, File file,
26                         int beginLineNum, int endLineNum) {
27                 this.type = type;
28                 this.plainText = plainText;
29                 this.file = file;
30                 this.beginLineNum = beginLineNum;
31                 this.endLineNum = endLineNum;
32                 this.interfaceDeclBody = ""; 
33         }
34         
35         public SpecConstruct(ConstructType type, String plainText, File file,
36                         int beginLineNum, int endLineNum, String interfaceDeclBody) {
37                 this.type = type;
38                 this.plainText = plainText;
39                 this.file = file;
40                 this.beginLineNum = beginLineNum;
41                 this.endLineNum = endLineNum;
42                 this.interfaceDeclBody = interfaceDeclBody; 
43         }
44 }