code: public void setCompilePhase(CompilePhase phase) {
      if (phase.getPhaseNumber() < CompilePhase.CONVERSION.getPhaseNumber())
        throw new IllegalArgumentException("AST is only available from phase CONVERSION onwards");
      compilePhase = phase;
    }
docs: Sets the compile phase up to which compilation should proceed. Defaults to
  CompilePhase.CONVERSION (the phase in which the AST is first constructed).
  
  @param phase the compile phase up to which compilation should proceed
  @throws IllegalArgumentException if a compile phase before
  CompilePhase.CONVERSION is specified