public char[] getMainTypeName() {

    if (compilationResult.compilationUnit == null) {
      char[] fileName = compilationResult.getFileName();

      int start = CharOperation.lastIndexOf('/', fileName) + 1;
      if (start == 0 || start < CharOperation.lastIndexOf('\\', fileName))
        start = CharOperation.lastIndexOf('\\', fileName) + 1;

      int end = CharOperation.lastIndexOf('.', fileName);
      if (end == -1) end = fileName.length;

      return CharOperation.subarray(fileName, start, end);
    } else {
      return compilationResult.compilationUnit.getMainTypeName();
    }
  }
  /*
   * When unit result is about to be accepted, removed back pointers
   * to compiler structures.
   */
  public void cleanUp() {
    if (this.compilationUnitBinding != null) this.compilationUnitBinding.cleanup();

    if (this.types != null) {
      for (int i = 0, max = this.types.length; i < max; i++) {
        cleanUp(this.types[i]);
      }
      for (int i = 0, max = this.localTypeCount; i < max; i++) {
        LocalTypeBinding localType = localTypes[i];
        // null out the type's scope backpointers
        localType.scope = null; // local members are already in the list
        localType.enclosingCase = null;
      }
    }

    for (int i = 0; i < this.numberInferredTypes; i++) {
      SourceTypeBinding binding = this.inferredTypes[i].binding;
      if (binding != null) binding.cleanup();
    }
    compilationResult.recoveryScannerData = null; // recovery is already done
  }
  public char[] getFileName() {

    return compilationResult.getFileName();
  }