edits
authorPeizhao Ou <peizhaoo@uci.edu>
Thu, 8 Jan 2015 05:45:28 +0000 (21:45 -0800)
committerPeizhao Ou <peizhaoo@uci.edu>
Thu, 8 Jan 2015 05:45:28 +0000 (21:45 -0800)
src/edu/uci/eecs/specCompiler/codeGenerator/CodeVariables.java
src/edu/uci/eecs/specCompiler/codeGenerator/SemanticsChecker.java
src/edu/uci/eecs/specCompiler/specExtraction/Construct.java
src/edu/uci/eecs/specCompiler/specExtraction/ParserUtils.java
src/edu/uci/eecs/specCompiler/specExtraction/SpecExtractor.java

index 4c4fc87..12d0383 100644 (file)
@@ -20,6 +20,11 @@ import edu.uci.eecs.specCompiler.specExtraction.PotentialCPDefineConstruct;
 import edu.uci.eecs.specCompiler.specExtraction.SequentialDefineSubConstruct;
 import edu.uci.eecs.specCompiler.specExtraction.VariableDeclaration;
 
+/**
+ * <p> Defines a list of commonly used constant strings. </p>
+ * @author peizhaoo
+ *
+ */
 public class CodeVariables {
        // C++ code or library
        public static final String HEADER_STDLIB = "<stdlib.h>";
index 23dad2f..ed20aa8 100644 (file)
@@ -22,6 +22,15 @@ import edu.uci.eecs.specCompiler.specExtraction.PotentialCPDefineConstruct;
 import edu.uci.eecs.specCompiler.specExtraction.SourceFileInfo;
 import edu.uci.eecs.specCompiler.specExtraction.SpecExtractor;
 
+/**
+ * <p>
+ * A specificaiton semantics checker that checks the consistency of the
+ * specifications after they are extracted from the source code.
+ * </p>
+ * 
+ * @author peizhaoo
+ * 
+ */
 public class SemanticsChecker {
        public final HashMap<File, SourceFileInfo> srcFilesInfo;
        public final ArrayList<Construct> constructs;
@@ -212,18 +221,18 @@ public class SemanticsChecker {
 
                                for (int j = 0; j < iConstruct.commitPointSet.size(); j++) {
                                        String label = iConstruct.commitPointSet.get(j);
-//                                     if (!CPLabel2InterfaceConstruct.containsKey(label)) {
-//                                             CPLabel2InterfaceConstruct.put(label,
-//                                                             new ArrayList<InterfaceConstruct>());
-//                                     }
-//                                     CPLabel2InterfaceConstruct.get(label).add(iConstruct);
+                                       // if (!CPLabel2InterfaceConstruct.containsKey(label)) {
+                                       // CPLabel2InterfaceConstruct.put(label,
+                                       // new ArrayList<InterfaceConstruct>());
+                                       // }
+                                       // CPLabel2InterfaceConstruct.get(label).add(iConstruct);
                                        if (!CPLabel2InterfaceConstruct.containsKey(label)) {
                                                CPLabel2InterfaceConstruct.put(label, iConstruct);
                                        } else {
                                                throw new SemanticsCheckerException(
                                                                "Commit point has multiple interfaces!");
                                        }
-                                       
+
                                }
                        }
                }
index 0f42b05..7b6e788 100644 (file)
@@ -4,7 +4,7 @@ import java.io.File;
 
 /**
  * <p>
- * This is just an abstract class for all the constructs.
+ * An abstract class for all different specification constructs.
  * </p>
  * 
  * @author peizhaoo
index 201bb8c..b748a82 100644 (file)
@@ -10,6 +10,11 @@ import edu.uci.eecs.specCompiler.codeGenerator.Environment;
 import edu.uci.eecs.specCompiler.grammerParser.utilParser.ParseException;
 import edu.uci.eecs.specCompiler.grammerParser.utilParser.UtilParser;
 
+/**
+ * <p> Utility functions for parsing the specifications </p>
+ * @author peizhaoo
+ *
+ */
 public class ParserUtils {
        public static String trimSpace(String line) {
                int i, j;
index 9d1fa91..439a60f 100644 (file)
@@ -18,8 +18,9 @@ import edu.uci.eecs.specCompiler.grammerParser.TokenMgrError;
  * <p>
  * This class represents the specification extractor of the specification. The
  * main function of this class is to read C/C++11 source files and extract the
- * corresponding specification out, and remember its location, including the
- * file name and the line number, to help the code generation process.
+ * corresponding specifications, and record corresponding information such as
+ * location, e.g., the file name and the line number, to help the code
+ * generation process.
  * </p>
  * 
  * @author peizhaoo
@@ -31,7 +32,7 @@ public class SpecExtractor {
        public SpecExtractor() {
                srcFilesInfo = new HashMap<File, SourceFileInfo>();
        }
-       
+
        public ArrayList<Construct> getConstructs() {
                ArrayList<Construct> constructs = new ArrayList<Construct>();
                for (File f : srcFilesInfo.keySet()) {
@@ -39,7 +40,7 @@ public class SpecExtractor {
                }
                return constructs;
        }
-       
+
        /**
         * <p>
         * Given a list of files, it scans each file and add found SpecConstrcut to
@@ -72,5 +73,4 @@ public class SpecExtractor {
                }
        }
 
-       
 }