@Override
 public String resolve(TemplateContext context) {
   ITranslationUnit unit = ((TranslationUnitContext) context).getTranslationUnit();
   return (unit == null)
       ? null
       : new Path(unit.getElementName()).removeFileExtension().lastSegment();
 }
  public ScanReturn analyse(IProgressMonitor monitor, ITranslationUnit tu, List<String> includes) {
    if (traceOn) {
      println("RunAnalyseBase.analyse()..."); // $NON-NLS-1$
    }
    // ScanReturn nr = null;
    String errMsg = null;

    monitor.subTask(Messages.RunAnalyseHandlerBase_42);

    String rawPath = tu.getLocationURI().toString();
    if (traceOn) {
      println("RunAnalyseBase:              file = " + rawPath); // $NON-NLS-1$
    }

    monitor.subTask(Messages.RunAnalyseHandlerBase_on + rawPath);

    ScanReturn scanReturn = doArtifactAnalysis(tu, includes);
    monitor.worked(1);
    if (traceOn) {
      println("Artifact analysis complete..."); // $NON-NLS-1$
    }
    int numArtifacts = scanReturn.getArtifactList().size();
    cumulativeArtifacts = cumulativeArtifacts + numArtifacts;

    if (traceOn) {
      System.out.println(
          "Artifacts found for " //$NON-NLS-1$
              + tu.getResource().getProjectRelativePath()
              + ": "
              + numArtifacts); //$NON-NLS-1$
    }
    if (traceOn) {
      System.out.println("   Total # found: " + cumulativeArtifacts); // $NON-NLS-1$
    }

    if (scanReturn == null) {
      System.out.println(
          "ScanReturn result is NULL.  No results for " //$NON-NLS-1$
              + tu.getResource().getProjectRelativePath());
      errMsg =
          "Error: No results were returned from analysis of " //$NON-NLS-1$
              + tu.getResource().getProjectRelativePath();
      MessageDialog.openError(shell, "Error in Analysis", errMsg); // $NON-NLS-1$
    } else {
      if (traceOn) {
        System.out.println(
            "RunAnalyzeBase: ScanReturn received for " //$NON-NLS-1$
                + tu.getElementName());
      }
    }

    if (scanReturn != null) {
      boolean wasError = scanReturn.wasError();
      if (traceOn) {
        System.out.println("error occurred =" + wasError); // $NON-NLS-1$
      }
      if (wasError) {
        System.out.println("RunAnalyseBase.analyse...Error..."); // $NON-NLS-1$
      }
    }
    return scanReturn;
  }
 @Override
 public String resolve(TemplateContext context) {
   ITranslationUnit unit = ((TranslationUnitContext) context).getTranslationUnit();
   return (unit == null) ? null : unit.getElementName();
 }