Package org.eclipse.jdt.internal.core.util

Examples of org.eclipse.jdt.internal.core.util.CommentRecorderParser


  /* (non-Javadoc)
   * @see org.eclipse.jdt.internal.compiler.Compiler#initializeParser()
   */
  public void initializeParser() {
    this.parser = new CommentRecorderParser(this.problemReporter, false);
  }
View Full Code Here


  public static void parse(ICompilationUnit[] compilationUnits, ASTRequestor astRequestor, int apiLevel, Map options, int flags, IProgressMonitor monitor) {
    try {
      CompilerOptions compilerOptions = new CompilerOptions(options);
      compilerOptions.ignoreMethodBodies = (flags & ICompilationUnit.IGNORE_METHOD_BODIES) != 0;
      Parser parser = new CommentRecorderParser(
        new ProblemReporter(
            DefaultErrorHandlingPolicies.proceedWithAllProblems(),
            compilerOptions,
            new DefaultProblemFactory()),
        false);
      int unitLength = compilationUnits.length;
      if (monitor != null) monitor.beginTask("", unitLength); //$NON-NLS-1$
      for (int i = 0; i < unitLength; i++) {
        org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceUnit = (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.
          continue;
View Full Code Here

      int flags,
      IProgressMonitor monitor) {
    try {
      CompilerOptions compilerOptions = new CompilerOptions(options);
      compilerOptions.ignoreMethodBodies = (flags & ICompilationUnit.IGNORE_METHOD_BODIES) != 0;
      Parser parser = new CommentRecorderParser(
        new ProblemReporter(
            DefaultErrorHandlingPolicies.proceedWithAllProblems(),
            compilerOptions,
            new DefaultProblemFactory()),
        false);
      int unitLength = sourceUnits.length;
      if (monitor != null) monitor.beginTask("", unitLength); //$NON-NLS-1$
      for (int i = 0; i < unitLength; i++) {
        char[] contents = null;
        String encoding = encodings != null ? encodings[i] : null;
        try {
          contents = Util.getFileCharContent(new File(sourceUnits[i]), encoding);
        } catch(IOException e) {
          // go to the next unit
          continue;
        }
        if (contents == null) {
          // go to the next unit
          continue;
        }
        org.eclipse.jdt.internal.compiler.batch.CompilationUnit compilationUnit = new org.eclipse.jdt.internal.compiler.batch.CompilationUnit(contents, sourceUnits[i], encoding);
        org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceUnit = compilationUnit;
        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.
          continue;
View Full Code Here

    CompilerOptions compilerOptions = new CompilerOptions(settings);
    boolean statementsRecovery = (flags & ICompilationUnit.ENABLE_STATEMENTS_RECOVERY) != 0;
    compilerOptions.performMethodsFullRecovery = statementsRecovery;
    compilerOptions.performStatementsRecovery = statementsRecovery;
    compilerOptions.ignoreMethodBodies = (flags & ICompilationUnit.IGNORE_METHOD_BODIES) != 0;
    Parser parser = new CommentRecorderParser(
      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.
      return compilationUnitDeclaration;
View Full Code Here

  /* (non-Javadoc)
   * Fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=60689.
   * @see org.eclipse.jdt.internal.compiler.Compiler#initializeParser()
   */
  public void initializeParser() {
    this.parser = new CommentRecorderParser(this.problemReporter, this.options.parseLiteralExpressionsAsConstants);
  }
View Full Code Here

        return cu;
    }

    private static Parser createCommentRecorderParser(CompilerOptions options) {
        Parser parser =
                new CommentRecorderParser(new ProblemReporter(
                        DefaultErrorHandlingPolicies.proceedWithAllProblems(),
                        options,
                        new DefaultProblemFactory()), false);
        return parser;
    }
View Full Code Here

        options.targetJDK = ClassFileConstants.JDK1_6;
        return options;
    }

    private static Parser createCommentRecorderParser(CompilerOptions options) {
        return new CommentRecorderParser(new ProblemReporter(
                DefaultErrorHandlingPolicies.proceedWithAllProblems(),
                options,
                new DefaultProblemFactory()), false);
    }
View Full Code Here

  /* (non-Javadoc)
   * @see org.eclipse.jdt.internal.compiler.Compiler#initializeParser()
   */
  public void initializeParser() {
    this.parser = new CommentRecorderParser(this.problemReporter, false);
  }
View Full Code Here

  public static void parse(ICompilationUnit[] compilationUnits, ASTRequestor astRequestor, int apiLevel, Map options, int flags, IProgressMonitor monitor) {
    try {
      CompilerOptions compilerOptions = new CompilerOptions(options);
      compilerOptions.ignoreMethodBodies = (flags & ICompilationUnit.IGNORE_METHOD_BODIES) != 0;
      Parser parser = new CommentRecorderParser(
        new ProblemReporter(
            DefaultErrorHandlingPolicies.proceedWithAllProblems(),
            compilerOptions,
            new DefaultProblemFactory()),
        false);
      int unitLength = compilationUnits.length;
      if (monitor != null) monitor.beginTask("", unitLength); //$NON-NLS-1$
      for (int i = 0; i < unitLength; i++) {
        org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceUnit = (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.
          continue;
View Full Code Here

      int flags,
      IProgressMonitor monitor) {
    try {
      CompilerOptions compilerOptions = new CompilerOptions(options);
      compilerOptions.ignoreMethodBodies = (flags & ICompilationUnit.IGNORE_METHOD_BODIES) != 0;
      Parser parser = new CommentRecorderParser(
        new ProblemReporter(
            DefaultErrorHandlingPolicies.proceedWithAllProblems(),
            compilerOptions,
            new DefaultProblemFactory()),
        false);
      int unitLength = sourceUnits.length;
      if (monitor != null) monitor.beginTask("", unitLength); //$NON-NLS-1$
      for (int i = 0; i < unitLength; i++) {
        char[] contents = null;
        String encoding = encodings != null ? encodings[i] : null;
        try {
          contents = Util.getFileCharContent(new File(sourceUnits[i]), encoding);
        } catch(IOException e) {
          // go to the next unit
          continue;
        }
        if (contents == null) {
          // go to the next unit
          continue;
        }
        org.eclipse.jdt.internal.compiler.batch.CompilationUnit compilationUnit = new org.eclipse.jdt.internal.compiler.batch.CompilationUnit(contents, sourceUnits[i], encoding);
        org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceUnit = compilationUnit;
        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.
          continue;
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.core.util.CommentRecorderParser

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.