Module xl.compiler

Class CompilerOptions

java.lang.Object
de.grogra.xl.compiler.CompilerOptions
All Implemented Interfaces:
Cloneable

public final class CompilerOptions extends Object implements Cloneable
This class contains the set of all compiler options.
Author:
Ole Kniemeyer
  • Field Details

    • DEFAULT_D2F_IS_WIDENING

      public static final boolean DEFAULT_D2F_IS_WIDENING
      See Also:
    • DEFAULT_ALLOW_CONVERSION_WITH_STATIC_VALUEOF

      public static final boolean DEFAULT_ALLOW_CONVERSION_WITH_STATIC_VALUEOF
      See Also:
    • DEFAULT_ALLOW_CONVERSION_WITH_STATIC_TOX

      public static final boolean DEFAULT_ALLOW_CONVERSION_WITH_STATIC_TOX
      See Also:
    • DEFAULT_ALLOW_CONVERSION_WITH_TOX

      public static final boolean DEFAULT_ALLOW_CONVERSION_WITH_TOX
      See Also:
    • DEFAULT_ALLOW_CONVERSION_WITH_CTOR

      public static final boolean DEFAULT_ALLOW_CONVERSION_WITH_CTOR
      See Also:
    • DEFAULT_ENABLE_AUTOCONVERSION_ANNOTATION

      public static final boolean DEFAULT_ENABLE_AUTOCONVERSION_ANNOTATION
      See Also:
    • javaVersion

      public int javaVersion
      Select the target JVM compatibility. A compiler switch allows to select another value for this switch, the default is JDK1.4 compatibility. An example where this switch influences bytecode generation: In java.lang.Integer the conversion of an int to Integer is only possible by creating a new instance of Integer for Java 1.4. Since Java 1.5 the class java.lang.Integer also contains a static method valueOf(int), which is a better choice for that conversion.
    • allowConversionWithStaticValueOf

      public boolean allowConversionWithStaticValueOf
      Compiler option: if true any function of the type 'static B valueOf(A)' in the current scope is used to implicitly perform autoconversion from type A to type B. Note: since the return type is not part of a method's signature, having multiple valueOf-functions may be ambigous.
    • allowConversionWithStaticToX

      public boolean allowConversionWithStaticToX
      Compiler option: if true any function of the type 'static B toB(A)' in the current scope is used to implicitly perform autoconversion from type A to type B.
    • allowConversionWithToX

      public boolean allowConversionWithToX
      Compiler option: if true any function of the type 'B A.valueOf()' in the current scope is used to implicitly perform autoconversion from type A to type B. The function is called on an instance of type A.
    • allowConversionWithCtor

      public boolean allowConversionWithCtor
      Compiler option: if true any function of the type 'B(A)' in the current scope is used to implicitly perform autoconversion from type A to type B. This is equivalent to creating a new instance via 'new B(a)', where a is of type A.
    • enableAutoconversionAnnotation

      public boolean enableAutoconversionAnnotation
      Compiler option: if true any conversion function needs to be annotated with @Autoconversion.
      See Also:
    • sourceInfo

      public boolean sourceInfo
    • lineNumberInfo

      public boolean lineNumberInfo
    • localInfo

      public boolean localInfo
  • Constructor Details

    • CompilerOptions

      public CompilerOptions()
  • Method Details

    • supportsVersion

      public boolean supportsVersion(int ver)
      Returns true if the specified version number designates a version of the JVM that is compatible with the target version currently set. Valid values for the version number are the constants in org.objectweb.asm.Opcodes.V* For instance a call supportsVersion(Opcodes.V1_4) with Opcodes.V1_4 currently set as target would return true. The same call with Opcodes.V1_3 set as target would return false.
      Parameters:
      ver - version to compare
      Returns:
      true iff ver is supported by the currently set version