예제 #1
0
 /** Returns a string representation of the compilation environment. */
 public String toString() {
   StringBuffer sb = new StringBuffer();
   sb.append("==============================" + "==============================\n");
   sb.append("Compilation environment for " + targetFile.getName() + "\n");
   sb.append("==============================" + "==============================\n");
   sb.append("Main directory: " + mainDir.getName() + "\n");
   sb.append("------------------------------" + "------------------------------\n");
   sb.append("Unparsable files: " + getResolveNames(unparsables) + "\n");
   sb.append("Compile stack: " + stack.toString() + "\n");
   Iterator<ModuleID> i = map.keyIterator();
   while (i.hasNext()) {
     ModuleID id = i.next();
     ModuleRecord record = map.get(id);
     // sb.append(getResolveName(record.getFile()) + " ");
     sb.append(id.toString());
     if (record.isComplete()) {
       sb.append(" is complete");
     } else {
       sb.append(" is incomplete");
     }
     if (record.containsErrors()) {
       sb.append(" due to errors");
     }
     sb.append(".\n");
     sb.append("    Theories: " + record.getTheories().toString());
     sb.append("\n");
   }
   sb.append("------------------------------" + "------------------------------\n");
   return sb.toString();
 }
예제 #2
0
  /**
   * Places the symbol table for an associated module into the environment and pops the module from
   * the compilation stack, indicating that compilation has been completed for this module.
   */
  public void completeRecord(ModuleID id, OldSymbolTable table) {
    ModuleRecord record = map.get(id);
    record.setSymbolTable(table);
    ModuleID id2 = stack.pop();
    assert id == id2 : "id != id2";

    if (!debugOff) {
      err.message("Complete record: " + id.toString()); // DEBUG
    }
  }
예제 #3
0
  /**
   * Constructs a record containing the module id, the file, and the module dec, and places it in
   * the module environment. Also places the module into a stack that indicates compilation has
   * begun on this module but has not completed.
   */
  public void constructRecord(ModuleID id, File file, ModuleDec dec) {
    ModuleRecord record = new ModuleRecord(id, file);
    record.setModuleDec(dec);
    assert !map.containsKey(id) : "map already contains key";
    assert !fmap.containsKey(file) : "fmap already contains file";
    map.put(id, record);
    fmap.put(file, id);
    stack.push(id);

    if (!debugOff) {
      err.message("Construct record: " + id.toString()); // DEBUG
    }
  }
예제 #4
0
 /**
  * Associates a list of visible theories with the specified module. This method may only be called
  * once during the life of a module. The visible theories must be accessible to a module before
  * population begins.
  */
 public void setTheories(ModuleID id, List<ModuleID> theories) {
   ModuleRecord record = map.get(id);
   record.setTheories(theories);
 }