add support for unattached ordering points
[cdsspec-compiler.git] / src / edu / uci / eecs / specExtraction / SpecExtractor.java
index afa42f78033b5d34475c38c5601fa251950563fc..df0b5f1cb78d5c1928d6d49796e01274a604bf9a 100644 (file)
@@ -38,8 +38,8 @@ public class SpecExtractor {
        public final HashMap<File, EntryConstruct> entryMap;
 
        public final HashSet<String> headerFiles;
-       
-       // In the generated header file, we need to forward the user-defined 
+
+       // In the generated header file, we need to forward the user-defined
        public final HashSet<String> forwardClass;
 
        private GlobalConstruct globalConstruct;
@@ -54,10 +54,9 @@ public class SpecExtractor {
                forwardClass = new HashSet<String>();
                globalConstruct = null;
        }
-       
+
        private void addDefineConstruct(DefineConstruct construct) {
-               ArrayList<DefineConstruct> list = defineListMap
-                               .get(construct.file);
+               ArrayList<DefineConstruct> list = defineListMap.get(construct.file);
                if (list == null) {
                        list = new ArrayList<DefineConstruct>();
                        defineListMap.put(construct.file, list);
@@ -385,7 +384,7 @@ public class SpecExtractor {
                // -1 means the curl symbols in the interface do not match
                return -1;
        }
-       
+
        /**
         * <p>
         * A sub-routine to extract the define construct. When called, we have
@@ -408,17 +407,16 @@ public class SpecExtractor {
         * @throws IOException
         * @throws ParseException
         */
-       private void extractDefineConstruct(File file,
-                       LineNumberReader lineReader, String curLine, int beginLineNum)
-                       throws WrongAnnotationException, IOException, ParseException {
+       private void extractDefineConstruct(File file, LineNumberReader lineReader,
+                       String curLine, int beginLineNum) throws WrongAnnotationException,
+                       IOException, ParseException {
                ArrayList<String> annotations = extractTillConstructEnd(file,
                                lineReader, curLine, beginLineNum);
                int endLineNum = lineReader.getLineNumber();
-               DefineConstruct construct = new DefineConstruct(file,
-                               beginLineNum, endLineNum, annotations);
+               DefineConstruct construct = new DefineConstruct(file, beginLineNum,
+                               endLineNum, annotations);
                addDefineConstruct(construct);
        }
-       
 
        /**
         * <p>
@@ -461,7 +459,7 @@ public class SpecExtractor {
                        line = lineReader.readLine();
                        lineNum = lineReader.getLineNumber();
                        construct.processFunctionDeclaration(line);
-                       
+
                        // Record those user-defined struct
                        // RET
                        String returnType = construct.getFunctionHeader().returnType;
@@ -472,7 +470,7 @@ public class SpecExtractor {
                                if (SpecUtils.isUserDefinedStruct(decl.type))
                                        forwardClass.add(SpecUtils.getPlainType(decl.type));
                        }
-                       
+
                } catch (IOException e) {
                        errMsg = "Spec error in file \""
                                        + file.getName()
@@ -590,7 +588,9 @@ public class SpecExtractor {
                                extractEntryConstruct(file, beginLineNum, curLine);
                        else if (name.equals("OPDefine") || name.equals("PotentialOP")
                                        || name.equals("OPCheck") || name.equals("OPClear")
-                                       || name.equals("OPClearDefine"))
+                                       || name.equals("OPClearDefine")
+                                       || name.equals("OPDefineUnattached")
+                                       || name.equals("OPClearDefineUnattached"))
                                extractOPConstruct(file, beginLineNum, curLine,
                                                OPType.valueOf(name));
                }