Package org.eclipse.jdt.internal.compiler.parser

Examples of org.eclipse.jdt.internal.compiler.parser.Parser


                      null);
                }
              }
            }
          } else {
            Parser basicParser = getParser();
            org.eclipse.jdt.internal.compiler.env.ICompilationUnit unit = (org.eclipse.jdt.internal.compiler.env.ICompilationUnit) workingCopy;
            CompilationResult compilationUnitResult = new CompilationResult(unit, 0, 0, this.compilerOptions.maxProblemsPerUnit);
            CompilationUnitDeclaration parsedUnit = basicParser.dietParse(unit, compilationUnitResult);
            if (parsedUnit != null) {
              final char[] packageDeclaration = parsedUnit.currentPackage == null ? CharOperation.NO_CHAR : CharOperation.concatWith(parsedUnit.currentPackage.getImportName(), '.');
              class AllConstructorDeclarationsVisitor extends ASTVisitor {
                private TypeDeclaration[] declaringTypes = new TypeDeclaration[0];
                private int declaringTypesPtr = -1;
View Full Code Here


                  nameRequestor.acceptType(type.getFlags(), packageDeclaration, simpleName, enclosingTypeNames, path, null);
                }
              }
            }
          } else {
            Parser basicParser = getParser();
            org.eclipse.jdt.internal.compiler.env.ICompilationUnit unit = (org.eclipse.jdt.internal.compiler.env.ICompilationUnit) workingCopy;
            CompilationResult compilationUnitResult = new CompilationResult(unit, 0, 0, this.compilerOptions.maxProblemsPerUnit);
            CompilationUnitDeclaration parsedUnit = basicParser.dietParse(unit, compilationUnitResult);
            if (parsedUnit != null) {
              final char[] packageDeclaration = parsedUnit.currentPackage == null ? CharOperation.NO_CHAR : CharOperation.concatWith(parsedUnit.currentPackage.getImportName(), '.');
              class AllTypeDeclarationsVisitor extends ASTVisitor {
                public boolean visit(TypeDeclaration typeDeclaration, BlockScope blockScope) {
                  return false; // no local/anonymous type
View Full Code Here

              if (pattern.matchesDecodedKey(new QualifiedTypeDeclarationPattern(qualification, simpleName, suffix, matchRule))) {
                nameRequestor.acceptType(type.getFlags(), packageDeclaration, simpleName, enclosingTypeNames, path, null);
              }
            }
          } else {
            Parser basicParser = getParser();
            org.eclipse.jdt.internal.compiler.env.ICompilationUnit unit = (org.eclipse.jdt.internal.compiler.env.ICompilationUnit) workingCopy;
            CompilationResult compilationUnitResult = new CompilationResult(unit, 0, 0, this.compilerOptions.maxProblemsPerUnit);
            CompilationUnitDeclaration parsedUnit = basicParser.dietParse(unit, compilationUnitResult);
            if (parsedUnit != null) {
              final char[] packageDeclaration = parsedUnit.currentPackage == null
                ? CharOperation.NO_CHAR
                : CharOperation.concatWith(parsedUnit.currentPackage.getImportName(), '.');
              class AllTypeDeclarationsVisitor extends ASTVisitor {
View Full Code Here

              DefaultErrorHandlingPolicies.proceedWithAllProblems(),
              this.options,
              new DefaultProblemFactory());

      // Re-parse using normal parser, IndexingParser swallows several nodes, see comment above class.
      this.basicParser = new Parser(problemReporter, false);
      this.basicParser.reportOnlyOneSyntaxError = true;
      this.basicParser.scanner.taskTags = null;
      this.cud = this.basicParser.parse(this.compilationUnit, new CompilationResult(this.compilationUnit, 0, 0, this.options.maxProblemsPerUnit));

      // Use a non model name environment to avoid locks, monitors and such.
View Full Code Here

      ProblemReporter problemReporter =
        new ProblemReporter(
          DefaultErrorHandlingPolicies.proceedWithAllProblems(),
          this.compilerOptions,
          new DefaultProblemFactory());
      this.parser = new Parser(problemReporter, true);
    }
    return this.parser;
  }
View Full Code Here

                      null);
                }
              }
            }
          } else {
            Parser basicParser = getParser();
            org.eclipse.jdt.internal.compiler.env.ICompilationUnit unit = (org.eclipse.jdt.internal.compiler.env.ICompilationUnit) workingCopy;
            CompilationResult compilationUnitResult = new CompilationResult(unit, 0, 0, this.compilerOptions.maxProblemsPerUnit);
            CompilationUnitDeclaration parsedUnit = basicParser.dietParse(unit, compilationUnitResult);
            if (parsedUnit != null) {
              final char[] packageDeclaration = parsedUnit.currentPackage == null ? CharOperation.NO_CHAR : CharOperation.concatWith(parsedUnit.currentPackage.getImportName(), '.');
              class AllConstructorDeclarationsVisitor extends ASTVisitor {
                private TypeDeclaration[] declaringTypes = new TypeDeclaration[0];
                private int declaringTypesPtr = -1;
View Full Code Here

                  nameRequestor.acceptType(type.getFlags(), packageDeclaration, simpleName, enclosingTypeNames, path, null);
                }
              }
            }
          } else {
            Parser basicParser = getParser();
            org.eclipse.jdt.internal.compiler.env.ICompilationUnit unit = (org.eclipse.jdt.internal.compiler.env.ICompilationUnit) workingCopy;
            CompilationResult compilationUnitResult = new CompilationResult(unit, 0, 0, this.compilerOptions.maxProblemsPerUnit);
            CompilationUnitDeclaration parsedUnit = basicParser.dietParse(unit, compilationUnitResult);
            if (parsedUnit != null) {
              final char[] packageDeclaration = parsedUnit.currentPackage == null ? CharOperation.NO_CHAR : CharOperation.concatWith(parsedUnit.currentPackage.getImportName(), '.');
              class AllTypeDeclarationsVisitor extends ASTVisitor {
                public boolean visit(TypeDeclaration typeDeclaration, BlockScope blockScope) {
                  return false; // no local/anonymous type
View Full Code Here

              if (pattern.matchesDecodedKey(new QualifiedTypeDeclarationPattern(qualification, simpleName, suffix, matchRule))) {
                nameRequestor.acceptType(type.getFlags(), packageDeclaration, simpleName, enclosingTypeNames, path, null);
              }
            }
          } else {
            Parser basicParser = getParser();
            org.eclipse.jdt.internal.compiler.env.ICompilationUnit unit = (org.eclipse.jdt.internal.compiler.env.ICompilationUnit) workingCopy;
            CompilationResult compilationUnitResult = new CompilationResult(unit, 0, 0, this.compilerOptions.maxProblemsPerUnit);
            CompilationUnitDeclaration parsedUnit = basicParser.dietParse(unit, compilationUnitResult);
            if (parsedUnit != null) {
              final char[] packageDeclaration = parsedUnit.currentPackage == null
                ? CharOperation.NO_CHAR
                : CharOperation.concatWith(parsedUnit.currentPackage.getImportName(), '.');
              class AllTypeDeclarationsVisitor extends ASTVisitor {
View Full Code Here

    }
    return false;
  }

  LambdaExpression copy() {
    final Parser parser = new Parser(this.enclosingScope.problemReporter(), false);
    final char[] source = this.compilationResult.getCompilationUnit().getContents();
    LambdaExpression copy =  (LambdaExpression) parser.parseLambdaExpression(source, this.sourceStart, this.sourceEnd - this.sourceStart + 1,
                    this.enclosingScope.referenceCompilationUnit(), false /* record line separators */);

    if (copy != null) { // ==> syntax errors == null
      copy.original = this;
    }
View Full Code Here

    this.sourceEnd = sourceEndPosition;
  }
  public void generateImplicitLambda(BlockScope currentScope, CodeStream codeStream, boolean valueRequired) {
   
    final Parser parser = new Parser(this.enclosingScope.problemReporter(), false);
    final char[] source = this.compilationResult.getCompilationUnit().getContents();
    ReferenceExpression copy =  (ReferenceExpression) parser.parseExpression(source, this.sourceStart, this.sourceEnd - this.sourceStart + 1,
                    this.enclosingScope.referenceCompilationUnit(), false /* record line separators */);
   
    int argc = this.descriptor.parameters.length;
   
    LambdaExpression implicitLambda = new LambdaExpression(this.compilationResult, false);
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.parser.Parser

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.