Package org.eclipse.jdt.internal.compiler

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


  try {
    if (BasicSearchEngine.VERBOSE)
      System.out.println("Parsing " + possibleMatch.openable.toStringWithAncestors()); //$NON-NLS-1$

    this.parser.nodeSet = possibleMatch.nodeSet;
    CompilationResult unitResult = new CompilationResult(possibleMatch, 1, 1, this.options.maxProblemsPerUnit);
    CompilationUnitDeclaration parsedUnit = this.parser.dietParse(possibleMatch, unitResult);
    if (parsedUnit != null) {
      if (!parsedUnit.isEmpty()) {
        if (mustResolve) {
          this.lookupEnvironment.buildTypeBindings(parsedUnit, null /*no access restriction*/);
 
View Full Code Here


      this.typeRoot = root;
     
      this.checkCancel();
     
      // for now until we can change the UI.
      CompilationResult result = new CompilationResult(sourceUnit, 1, 1, this.compilerOptions.maxProblemsPerUnit);
      CompilationUnitDeclaration parsedUnit = this.parser.dietParse(sourceUnit, result, this.actualCompletionPosition);

      //    boolean completionNodeFound = false;
      if (parsedUnit != null) {
        if(DEBUG) {
View Full Code Here

    while(topLevelType.getDeclaringType() != null) {
      topLevelType = topLevelType.getDeclaringType();
    }

    this.fileName = topLevelType.getParent().getElementName().toCharArray();
    CompilationResult compilationResult = new CompilationResult(this.fileName, 1, 1, this.compilerOptions.maxProblemsPerUnit);

    CompilationUnitDeclaration compilationUnit = null;

    try {
      // TypeConverter is used instead of SourceTypeConverter because the type
View Full Code Here

      "FakeType.java", //$NON-NLS-1$
      encoding);

    this.actualCompletionPosition = prefix.length() + position - 1;

    CompilationResult fakeResult = new CompilationResult(fakeUnit, 1, 1, this.compilerOptions.maxProblemsPerUnit);
    CompilationUnitDeclaration fakeAST = this.parser.dietParse(fakeUnit, fakeResult, this.actualCompletionPosition);

    parseBlockStatements(fakeAST, this.actualCompletionPosition);

    return (Initializer)fakeAST.types[0].fields[0];
View Full Code Here

   * it must be done is a subsequent pass.
   */
  private static class BuildTypeMapVisitor extends ASTVisitor {

    private static SourceInfo makeSourceInfo(TypeDeclaration typeDecl) {
      CompilationResult compResult = typeDecl.compilationResult;
      int[] indexes = compResult.lineSeparatorPositions;
      String fileName = String.valueOf(compResult.fileName);
      int startLine = ProblemHandler.searchLineNumber(indexes,
          typeDecl.sourceStart);
      return new SourceInfo(typeDecl.sourceStart, typeDecl.bodyEnd, startLine,
View Full Code Here

   */
  private static class BuildDeclMapVisitor extends ASTVisitor {

    private static SourceInfo makeSourceInfo(
        AbstractMethodDeclaration methodDecl) {
      CompilationResult compResult = methodDecl.compilationResult;
      int[] indexes = compResult.lineSeparatorPositions;
      String fileName = String.valueOf(compResult.fileName);
      int startLine = ProblemHandler.searchLineNumber(indexes,
          methodDecl.sourceStart);
      return new SourceInfo(methodDecl.sourceStart, methodDecl.bodyEnd,
View Full Code Here

     * more straightforward), it makes for fewer kinds of things to worry about
     * when optimizing (more aggressive optimizations), and it's how Java
     * actually implements the stuff under the hood anyway.
     */
    private boolean process(TypeDeclaration typeDeclaration) {
      CompilationResult compResult = typeDeclaration.compilationResult;
      currentSeparatorPositions = compResult.lineSeparatorPositions;
      currentFileName = String.valueOf(compResult.fileName);
      SourceTypeBinding binding = typeDeclaration.binding;
      if (binding.constantPoolName() == null) {
        /*
 
View Full Code Here

    if (goldenCuds.length == 0) {
      compilationFailed = true;
    }
    for (int iCud = 0; iCud < goldenCuds.length; iCud++) {
      CompilationUnitDeclaration cud = goldenCuds[iCud];
      CompilationResult result = cud.compilationResult();
      if (result.hasErrors()) {
        compilationFailed = true;
        // Early out if we don't need to itemize.
        if (!itemizeErrors) {
          break;
        }
        TreeLogger branch = logger.branch(TreeLogger.ERROR, "Errors in "
            + String.valueOf(result.getFileName()), null);
        IProblem[] errors = result.getErrors();
        for (int i = 0; i < errors.length; i++) {
          IProblem problem = errors[i];
          if (problemSet.contains(problem)) {
            continue;
          }
View Full Code Here

    Collections.sort(jprogram.getDeclaredTypes(), new HasNameSort());
  }

  public static void reportJsniError(SourceInfo info,
      AbstractMethodDeclaration methodDeclaration, String message) {
    CompilationResult compResult = methodDeclaration.compilationResult();
    DefaultProblem problem = new DefaultProblem(
        info.getFileName().toCharArray(), message, IProblem.Unclassified, null,
        ProblemSeverities.Error, info.getStartPos(), info.getEndPos(),
        info.getStartLine());
    compResult.record(problem, methodDeclaration);
  }
View Full Code Here

    boolean compilationFailed = false;
    if (goldenCuds.length == 0) {
      compilationFailed = true;
    }
    for (CompilationUnitDeclaration cud : goldenCuds) {
      CompilationResult result = cud.compilationResult();
      if (result.hasErrors()) {
        compilationFailed = true;
        // Early out if we don't need to itemize.
        if (!itemizeErrors) {
          break;
        }
        TreeLogger branch = logger.branch(TreeLogger.ERROR, "Errors in "
            + String.valueOf(result.getFileName()), null);
        IProblem[] errors = result.getErrors();
        for (IProblem problem : errors) {
          if (problemSet.contains(problem)) {
            continue;
          }
View Full Code Here

TOP

Related Classes of 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.