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

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


    }
  }

  // Compile compilation unit
  CompilerRequestor compilerRequestor = new CompilerRequestor();
  Compiler compiler = getCompiler(compilerRequestor);
  compiler.compile(new ICompilationUnit[] {new ICompilationUnit() {
    public char[] getFileName() {
       // Name of class is name of CU
      return CharOperation.concat(Evaluator.this.getClassName(), Util.defaultJavaExtension().toCharArray());
    }
    public char[] getContents() {
View Full Code Here


*/
Compiler getCompiler(ICompilerRequestor compilerRequestor) {
  CompilerOptions compilerOptions = new CompilerOptions(this.options);
  compilerOptions.performMethodsFullRecovery = true;
  compilerOptions.performStatementsRecovery = true;
  return new Compiler(
    this.environment,
    DefaultErrorHandlingPolicies.exitAfterAllProblems(),
    compilerOptions,
    compilerRequestor,
    this.problemFactory);
View Full Code Here

  FileSystem environment = getLibraryAccess();
  this.compilerOptions = new CompilerOptions(this.options);
  this.compilerOptions.performMethodsFullRecovery = false;
  this.compilerOptions.performStatementsRecovery = false;
  this.batchCompiler =
    new Compiler(
      environment,
      getHandlingPolicy(),
      this.compilerOptions,
      getBatchRequestor(),
      getProblemFactory(),
View Full Code Here

}
/**
* Creates and returns a compiler for this evaluator.
*/
Compiler getCompiler(ICompilerRequestor compilerRequestor) {
  Compiler compiler = super.getCompiler(compilerRequestor);
 
  // Initialize the compiler's lookup environment with the already compiled super class
  IBinaryType binaryType = this.context.getRootCodeSnippetBinary();
  if (binaryType != null) {
    compiler.lookupEnvironment.cacheBinaryType(binaryType, null /*no access restriction*/);
 
View Full Code Here

}
/**
* @see Evaluator
*/
Compiler getCompiler(ICompilerRequestor compilerRequestor) {
  Compiler compiler = null;
  if (!DEVELOPMENT_MODE) {
    // If we are not developping the code snippet support classes,
    // use a regular compiler and feed its lookup environment with
    // the code snippet support classes

    CompilerOptions compilerOptions = new CompilerOptions(this.options);
    compilerOptions.performMethodsFullRecovery = true;
    compilerOptions.performStatementsRecovery = true;
    compiler =
      new CodeSnippetCompiler(
        this.environment,
        DefaultErrorHandlingPolicies.exitAfterAllProblems(),
        compilerOptions,
        compilerRequestor,
        this.problemFactory,
        this.context,
        getMapper().startPosOffset,
        getMapper().startPosOffset + this.codeSnippet.length - 1);
    ((CodeSnippetParser) compiler.parser).lineSeparatorLength = this.context.lineSeparator.length();
    // Initialize the compiler's lookup environment with the already compiled super classes
    IBinaryType binary = this.context.getRootCodeSnippetBinary();
    if (binary != null) {
      compiler.lookupEnvironment.cacheBinaryType(binary, null /*no access restriction*/);
    }
    VariablesInfo installedVars = this.context.installedVars;
    if (installedVars != null) {
      ClassFile[] globalClassFiles = installedVars.classFiles;
      for (int i = 0; i < globalClassFiles.length; i++) {
        ClassFileReader binaryType = null;
        try {
          binaryType = new ClassFileReader(globalClassFiles[i].getBytes(), null);
        } catch (ClassFormatException e) {
          e.printStackTrace(); // Should never happen since we compiled this type
        }
        compiler.lookupEnvironment.cacheBinaryType(binaryType, null /*no access restriction*/);
      }
    }
  } else {
    // If we are developping the code snippet support classes,
    // use a wrapped environment so that if the code snippet classes are not found
    // then a default implementation is provided.

    CompilerOptions compilerOptions = new CompilerOptions(this.options);
    compilerOptions.performMethodsFullRecovery = true;
    compilerOptions.performStatementsRecovery = true;
    compiler = new Compiler(
      getWrapperEnvironment(),
      DefaultErrorHandlingPolicies.exitAfterAllProblems(),
      compilerOptions,
      compilerRequestor,
      this.problemFactory);
View Full Code Here

 
  // called once when the builder is initialized... can override if needed
  CompilerOptions compilerOptions = new CompilerOptions(projectOptions);
  compilerOptions.performMethodsFullRecovery = true;
  compilerOptions.performStatementsRecovery = true;
  Compiler newCompiler = new Compiler(
    nameEnvironment,
    DefaultErrorHandlingPolicies.proceedWithAllProblems(),
    compilerOptions,
    this,
    ProblemFactory.getProblemFactory(Locale.getDefault()));
View Full Code Here

TOP

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

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.