Enum CompilePhase

  • All Implemented Interfaces:
    Serializable, Comparable<CompilePhase>

    public enum CompilePhase
    extends Enum<CompilePhase>
    The phases of the GroovyCompiler. This is an enum facade on top of the Phases object. In general, prefer using this object over Phases.
    • Enum Constant Detail


        public static final CompilePhase INITIALIZATION
        source files are opened and environment configured
      • PARSING

        public static final CompilePhase PARSING
        the grammar is used to to produce tree of tokens representing the source code

        public static final CompilePhase CONVERSION
        An abstract syntax tree (AST) is created from token trees

        public static final CompilePhase SEMANTIC_ANALYSIS
        Performs consistency and validity checks that the grammar can't check for, and resolves classes

        public static final CompilePhase CANONICALIZATION
        Complete building the AST

        public static final CompilePhase INSTRUCTION_SELECTION
        instruction set is chosen, for example java5 or pre java5

        public static final CompilePhase CLASS_GENERATION
        creates the binary output in memory
      • OUTPUT

        public static final CompilePhase OUTPUT
        write the binary output to the file system

        public static final CompilePhase FINALIZATION
        Perform any last cleanup
    • Field Detail

      • phases

        public static CompilePhase[] phases
        The phases as an array, with a null entry.
    • Method Detail

      • values

        public static CompilePhase[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (CompilePhase c : CompilePhase.values())
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CompilePhase valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        name - the name of the enum constant to be returned.
        the enum constant with the specified name
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getPhaseNumber

        public int getPhaseNumber()
        Returns the underlieng integer Phase number.
      • fromPhaseNumber

        public static CompilePhase fromPhaseNumber​(int phaseNumber)
        Returns the CompilePhase for the given integer phase number.
        phaseNumber - the phase number
        the CompilePhase or null if not found