Package org.aspectj.org.eclipse.jdt.internal.compiler

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult


    List ret = new ArrayList();
    for (Iterator binIter = binarySourceEntries.keySet().iterator(); binIter.hasNext();) {
      String sourceFileName = (String) binIter.next();
      List unwovenClassFiles = (List) binarySourceEntries.get(sourceFileName);
      // XXX - see bugs 57432,58679 - final parameter on next call should be "compiler.options.maxProblemsPerUnit"
      CompilationResult result = new CompilationResult(sourceFileName.toCharArray(), 0, 0, Integer.MAX_VALUE);
      result.noSourceAvailable();
      InterimCompilationResult binarySource = new InterimCompilationResult(result, unwovenClassFiles);
      ret.add(binarySource);
    }
    return ret;
  }
View Full Code Here


          // throw new RuntimeException("Primary source location must match the file we are currently processing!");
        }
      }
    }

    CompilationResult problemSource = currentlyWeaving;
    if (problemSource == null) {
      // must be a problem found during completeTypeBindings phase of begin to compile
      if (sLoc instanceof EclipseSourceLocation) {
        problemSource = ((EclipseSourceLocation) sLoc).getCompilationResult();
      }
      if (problemSource == null) {
        // XXX this is ok for ajc, will have to do better for AJDT in time...
        return sink.handleMessage(message);
      }
    }
    int startPos = getStartPos(sLoc, problemSource);
    int endPos = getEndPos(sLoc, problemSource);
    int severity = message.isError() ? ProblemSeverities.Error : ProblemSeverities.Warning;
    char[] filename = problemSource.fileName;
    boolean usedBinarySourceFileName = false;
    if (problemSource.isFromBinarySource()) {
      if (sLoc != null) {
        filename = sLoc.getSourceFile().getPath().toCharArray();
        usedBinarySourceFileName = true;
      }
    }
View Full Code Here

    List<InterimCompilationResult> ret = new ArrayList<InterimCompilationResult>();
    for (Iterator<String> binIter = binarySourceEntries.keySet().iterator(); binIter.hasNext();) {
      String sourceFileName = binIter.next();
      List<UnwovenClassFile> unwovenClassFiles = binarySourceEntries.get(sourceFileName);
      // XXX - see bugs 57432,58679 - final parameter on next call should be "compiler.options.maxProblemsPerUnit"
      CompilationResult result = new CompilationResult(sourceFileName.toCharArray(), 0, 0, Integer.MAX_VALUE);
      result.noSourceAvailable();
      InterimCompilationResult binarySource = new InterimCompilationResult(result, unwovenClassFiles);
      ret.add(binarySource);
    }
    return ret;
  }
View Full Code Here

          // ensure dumping problems for enqueued units as well, since may contain primary errors (123476)
          CompilationUnitDeclaration[] queuedUnits = Main.this.batchCompiler.unitsToProcess;
          for (int i = 0, length = Main.this.batchCompiler.totalUnits; i < length; i++) {
            CompilationUnitDeclaration queuedUnit = queuedUnits[i];
            if (queuedUnit == null) continue;
            CompilationResult result = queuedUnit.compilationResult;
            if (result.hasProblems() && !result.hasBeenAccepted) {
              Main.this.logger.logProblems(result.getAllProblems(), result.compilationUnit.getContents(), Main.this);
            }
          }
          Main.this.logger.endLoggingSource();
          Main.this.logger.endLoggingSources();
          Main.this.logger.printStats();
View Full Code Here

    // see bug 47079 for more details
    int[] oldLineEnds = this.scanner.lineEnds;
    int oldLinePtr = this.scanner.linePtr;

    //real parse of the method....
    CompilationResult compilationResult = unit.compilationResult;
    char[] contents = compilationResult.compilationUnit.getContents();
    this.scanner.setSource(contents, compilationResult);
   
    if (this.javadocParser != null && this.javadocParser.checkDocComment) {
      this.javadocParser.scanner.setSource(contents);
View Full Code Here

    // walks the source units
    this.requestedSources = new HashtableOfObject();
    for (int i = 0; i < sourceLength; i++) {
      org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceUnit = sourceUnits[i];
      CompilationUnitDeclaration parsedUnit;
      CompilationResult unitResult =
        new CompilationResult(sourceUnit, index++, maxUnits, this.options.maxProblemsPerUnit);
      try {
        if (options.verbose) {
          this.out.println(
            Messages.bind(Messages.compilation_request,
            new String[] {
              String.valueOf(index++ + 1),
              String.valueOf(maxUnits),
              new String(sourceUnit.getFileName())
            }));
        }
        // diet parsing for large collection of units
        if (this.totalUnits < this.parseThreshold) {
          parsedUnit = this.parser.parse(sourceUnit, unitResult);
        } else {
          parsedUnit = this.parser.dietParse(sourceUnit, unitResult);
        }
        // initial type binding creation
        this.lookupEnvironment.buildTypeBindings(parsedUnit, null /*no access restriction*/);
        addCompilationUnit(sourceUnit, parsedUnit);
        this.requestedSources.put(unitResult.getFileName(), sourceUnit);
        worked(1);
      } finally {
        sourceUnits[i] = null; // no longer hold onto the unit
      }
    }
View Full Code Here

        false);
      int length = compilationUnits.length;
      if (monitor != null) monitor.beginTask("", length); //$NON-NLS-1$
      for (int i = 0; i < length; i++) {
        org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceUnit = (org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit) compilationUnits[i];
        CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, compilerOptions.maxProblemsPerUnit);
        CompilationUnitDeclaration compilationUnitDeclaration = parser.dietParse(sourceUnit, compilationResult);

        if (compilationUnitDeclaration.ignoreMethodBodies) {
          compilationUnitDeclaration.ignoreFurtherInvestigation = true;
          // if initial diet parse did not work, no need to dig into method bodies.
View Full Code Here

      new ProblemReporter(
          DefaultErrorHandlingPolicies.proceedWithAllProblems(),
          compilerOptions,
          new DefaultProblemFactory()),
      false);
    CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, compilerOptions.maxProblemsPerUnit);
    CompilationUnitDeclaration compilationUnitDeclaration = parser.dietParse(sourceUnit, compilationResult);

    if (compilationUnitDeclaration.ignoreMethodBodies) {
      compilationUnitDeclaration.ignoreFurtherInvestigation = true;
      // if initial diet parse did not work, no need to dig into method bodies.
View Full Code Here

          // requested AST
          char[] fileName = unit.compilationResult.getFileName();
          ICompilationUnit source = (ICompilationUnit) this.requestedSources.get(fileName);
          if (source != null) {
            // convert AST
            CompilationResult compilationResult = unit.compilationResult;
            org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceUnit = compilationResult.compilationUnit;
            char[] contents = sourceUnit.getContents();
            // AspectJ Extension start - use the factory
            // old code:
            // AST ast = AST.newAST(apiLevel);
            // new code:
            AST ast = ASTParser.getAST(apiLevel);
            // End AspectJ Extension
            ast.setFlag(flags | AST.RESOLVED_BINDINGS);
            ast.setDefaultNodeFlag(ASTNode.ORIGINAL);
            // AspectJ Extension - use the factory
            // old code:
            // ASTConverter converter = new ASTConverter(compilerOptions, true/*need to resolve bindings*/, this.monitor);
            // new code:
            ASTConverter converter = ASTConverter.getASTConverter(compilerOptions,true,this.monitor);
            // End AspectJ Extension
            BindingResolver resolver = new DefaultBindingResolver(unit.scope, owner, this.bindingTables, (flags & ICompilationUnit.ENABLE_BINDINGS_RECOVERY) != 0);
            ast.setBindingResolver(resolver);
            converter.setAST(ast);
            CompilationUnit compilationUnit = converter.convert(unit, contents);
            compilationUnit.setTypeRoot(source);
            compilationUnit.setLineEndTable(compilationResult.getLineSeparatorPositions());
            ast.setDefaultNodeFlag(0);
            ast.setOriginalModificationCount(ast.modificationCount());

            // pass it to requestor
            astRequestor.acceptAST(source, compilationUnit);
View Full Code Here

  /* recovery */
  recordLastStatementIfNeeded();
}
protected CompilationUnitDeclaration endParse(int act) {
  if (this.hasRecoveredOnExpression) {
    CompilationResult unitResult = this.compilationUnit.compilationResult;
    if (act != ERROR_ACTION) { // expression recovery worked
      // flush previously recorded problems
      for (int i = 0; i < unitResult.problemCount; i++) {
        unitResult.problems[i] = null; // discard problem
      }
View Full Code Here

TOP

Related Classes of org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult

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.