X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=src%2Fedu%2Fuci%2Feecs%2FspecExtraction%2FSpecExtractor.java;fp=src%2Fedu%2Fuci%2Feecs%2FspecExtraction%2FSpecExtractor.java;h=df0b5f1cb78d5c1928d6d49796e01274a604bf9a;hb=9b8cea33592559e9a8b351fba6ddd05618d7cc80;hp=afa42f78033b5d34475c38c5601fa251950563fc;hpb=103bce9e104bde86e9d2389e852427c8f4e3963a;p=cdsspec-compiler.git diff --git a/src/edu/uci/eecs/specExtraction/SpecExtractor.java b/src/edu/uci/eecs/specExtraction/SpecExtractor.java index afa42f7..df0b5f1 100644 --- a/src/edu/uci/eecs/specExtraction/SpecExtractor.java +++ b/src/edu/uci/eecs/specExtraction/SpecExtractor.java @@ -38,8 +38,8 @@ public class SpecExtractor { public final HashMap entryMap; public final HashSet 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 forwardClass; private GlobalConstruct globalConstruct; @@ -54,10 +54,9 @@ public class SpecExtractor { forwardClass = new HashSet(); globalConstruct = null; } - + private void addDefineConstruct(DefineConstruct construct) { - ArrayList list = defineListMap - .get(construct.file); + ArrayList list = defineListMap.get(construct.file); if (list == null) { list = new ArrayList(); 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; } - + /** *

* 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 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); } - /** *

@@ -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)); }