Package org.eclipse.jdt.internal.compiler.impl

Examples of org.eclipse.jdt.internal.compiler.impl.CompilerOptions


      jdtCompilerEvent.end();
    }
  }

  public static CompilerOptions getCompilerOptions() {
    CompilerOptions options = new CompilerOptions();
    options.complianceLevel = options.sourceLevel = options.targetJDK = ClassFileConstants.JDK1_6;

    // Generate debug info for debugging the output.
    options.produceDebugAttributes = ClassFileConstants.ATTR_VARS
        | ClassFileConstants.ATTR_LINES | ClassFileConstants.ATTR_SOURCE;
View Full Code Here


          cu2.getMainTypeName());
    }
  };

  public static CompilerOptions getCompilerOptions() {
    CompilerOptions options = JdtCompiler.getCompilerOptions();

    // Turn off all debugging for Production Mode.
    options.produceDebugAttributes = 0;
    options.preserveAllLocalVariables = false;
    return options;
View Full Code Here

      INameEnvironment env = new INameEnvironmentImpl();
      IErrorHandlingPolicy pol = DefaultErrorHandlingPolicies.proceedWithAllProblems();
      IProblemFactory probFact = new DefaultProblemFactory(Locale.getDefault());
      ICompilerRequestor req = new ICompilerRequestorImpl();
      CompilerOptions options = getCompilerOptions();

      // This is only needed by TypeOracleBuilder to parse metadata.
      options.docCommentSupport = false;

      compiler = new CompilerImpl(env, pol, options, req, probFact);
View Full Code Here

        settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5);
        settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
        settings.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.GENERATE);
        settings.put(CompilerOptions.OPTION_LineNumberAttribute, CompilerOptions.GENERATE);
        settings.put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.GENERATE);
        compilerOptions = new CompilerOptions(settings);
    }
View Full Code Here

    // and also consider updating org.eclipse.jdt.internal.compiler.batch.Main#initializeWarnings(String)
    // Get options names set
    HashSet optionNames = JavaModelManager.getJavaModelManager().optionNames;

    // Compiler settings
    Map defaultOptionsMap = new CompilerOptions().getMap(); // compiler defaults

    // Override some compiler defaults
    defaultOptionsMap.put(JavaCore.COMPILER_LOCAL_VARIABLE_ATTR, JavaCore.GENERATE);
    defaultOptionsMap.put(JavaCore.COMPILER_CODEGEN_UNUSED_LOCAL, JavaCore.PRESERVE);
    defaultOptionsMap.put(JavaCore.COMPILER_TASK_TAGS, JavaCore.DEFAULT_TASK_TAGS);
View Full Code Here

    this.recoveryScannerData = recoveryScannerData;
  }

  final TokenScanner getScanner() {
    if (this.tokenScanner == null) {
      CompilerOptions compilerOptions = new CompilerOptions(this.options);
      Scanner scanner;
      if (this.recoveryScannerData == null) {
        scanner =
          new Scanner(
              true,/*tokenizeComments*/
 
View Full Code Here

}
/**
* Creates a new parser.
*/
protected DocumentElementParser getParser(Map settings) {
  return new DocumentElementParser(this, new DefaultProblemFactory(), new CompilerOptions(settings));
}
View Full Code Here

    FakeUnit = new CompilationUnitDeclaration(problemReporter, result, 0);
  }

public HierarchyResolver(INameEnvironment nameEnvironment, Map settings, HierarchyBuilder builder, IProblemFactory problemFactory) {
  // create a problem handler with the 'exit after all problems' handling policy
  this.options = new CompilerOptions(settings);
  IErrorHandlingPolicy policy = DefaultErrorHandlingPolicies.exitAfterAllProblems();
  ProblemReporter problemReporter = new ProblemReporter(policy, this.options, problemFactory);

  LookupEnvironment environment = new LookupEnvironment(this, this.options, problemReporter, nameEnvironment);
  environment.mayTolerateMissingType = true;
View Full Code Here

  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(),
View Full Code Here

protected abstract char[] getClassName();
/**
* Creates and returns a compiler for this evaluator.
*/
Compiler getCompiler(ICompilerRequestor compilerRequestor) {
  CompilerOptions compilerOptions = new CompilerOptions(this.options);
  compilerOptions.performMethodsFullRecovery = true;
  compilerOptions.performStatementsRecovery = true;
  return new Compiler(
    this.environment,
    DefaultErrorHandlingPolicies.exitAfterAllProblems(),
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.impl.CompilerOptions

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.