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 4c4fc87b9cc04374455745591cde258391af1dc7..12d0383e7965ce81e88038ad7dd9cffae5c13c09 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 23dad2f4f2b296ec576c5820f3b6de91fa58c2b8..ed20aa86ef6ed9a7765572315669e5283fcda979 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 0f42b058b73deb801e0b16167d00075242c15cb8..7b6e788da010c99ebf360b6139b7bb5c0385df3e 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 201bb8c5829bbc43d553cb414c886583d43a15b4..b748a82c4729a5edc745fc5c638e154a85830c2e 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 9d1fa911cdf6624983790922dfb5ed83be4d6544..439a60fa44eebfc280a2e16d22f46dae9dab74bc 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 {
                }
        }
 
-       
 }