Package edu.cmu.cs.crystal.annotations

Examples of edu.cmu.cs.crystal.annotations.AnnotationFinder


              num_jobs + " total compilation units.";
          monitor.beginTask(task, num_jobs);
        }

        AnnotationDatabase annoDB = new AnnotationDatabase();
        AnnotationFinder finder = new AnnotationFinder(annoDB);

        // register annotations with database
        registerAnnotationsWithDatabase(annoDB);

        // run the annotation finder on everything
        if (monitor != null)
          monitor.subTask("Scanning annotations of analyzed compilation units");
        if (logger.isLoggable(Level.FINER))
          logger.finer("Scanning annotations of analyzed compilation units");
        for (ICompilationUnit compUnit : command.compilationUnits()) {
          if (compUnit == null)
            continue;
          ASTNode node = WorkspaceUtilities.getASTNodeFromCompilationUnit(compUnit);
          if (monitor != null && monitor.isCanceled())
            // cancel here in case cancellation can produce null or incomplete ASTs
            return;
          if (!(node instanceof CompilationUnit))
            continue;

          // Dummy analysis input
          IAnalysisInput input = new IAnalysisInput() {
            private AnnotationDatabase annoDB = new AnnotationDatabase();

            public AnnotationDatabase getAnnoDB() {
              return annoDB;
            }
           
            public Option<IProgressMonitor> getProgressMonitor() {
              // don't give progress monitor to annotation finder
              return Option.none();
            }

            public Option<CompilationUnitTACs> getComUnitTACs() {
              // don't give 3-address code to annotation finder
              return Option.none();
            }
          };

          // Run annotation finder
          finder.runAnalysis(command.reporter(), input, compUnit, (CompilationUnit) node);
        }

        // tell analyses that the analysis is about to begin!
        for (ICrystalAnalysis analysis : analyses_to_use ) {
          analysis.beforeAllCompilationUnits();
View Full Code Here

TOP

Related Classes of edu.cmu.cs.crystal.annotations.AnnotationFinder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.