// Path: asteroid-core/src/main/java/asteroid/A.java
// @SuppressWarnings("PMD.ShortClassName")
// public final class A {
// 
//     /**
//      * Entry point to get node builders.
//      *
//      * @since 0.1.0
//      */
//     public static final Nodes NODES = new Nodes();
// 
//     /**
//      * Entry point to access language modifiers
//      *
//      * @since 0.1.0
//      */
//     public static final Modifiers ACC = new Modifiers();
// 
//     /**
//      * Entry point to create statements.
//      *
//      * @since 0.1.0
//      */
//     public static final Statements STMT = new Statements();
// 
//     /**
//      * Entry point to create expressions
//      *
//      * @since 0.1.0
//      */
//     public static final Expressions EXPR = new Expressions();
// 
//     /**
//      * Entry point to get util functions
//      *
//      * @since 0.1.0
//      */
//     public static final Utils UTIL = new Utils();
// 
//     /**
//      * Entry point to get criterias
//      *
//      * @since 0.2.4
//      */
//     public static final Criterias CRITERIA = new Criterias();
// }


import asteroid.A;
import org.codehaus.groovy.ast.ClassNode;
import org.codehaus.groovy.ast.AnnotationNode;
import org.codehaus.groovy.ast.expr.PropertyExpression;
import org.codehaus.groovy.control.CompilePhase;
import org.codehaus.groovy.transform.GroovyASTTransformation;
import groovy.transform.InheritConstructors;
package asteroid.internal;



/**
 * A set of utilities to implement base transformation classes
 *
 * @since 0.2.0
 */
public final class TransformationUtils {

    private TransformationUtils() { }

    /**
     * All transformation will be always annotated with:
     *
     * <ul>
     *    <li>{@link InheritConstructors}</li>
     *    <li>{@link GroovyASTTransformation}</li>
     * </ul>
     *
     * To avoid repeating this over and over again this method adds
     * both to the annotated {@link ClassNode} passed as first
     * argument
     *
     * @param annotated The {@link ClassNode} we want to add both
     * annotations to
     * @param compilePhase The {@link CompilePhase} used as argument for
     * the {@link GroovyASTTransformation} annotation.
     * @since 0.2.0
     */
    public static void addASTAnnotationsFromTo(final ClassNode annotated, final CompilePhase compilePhase) {
        final AnnotationNode groovyAnn = getGroovyAnnotation(compilePhase);
        final AnnotationNode inheritConsAnn = getInheritConstructorsAnnotation();

        annotated.addAnnotation(inheritConsAnn);
        annotated.addAnnotation(groovyAnn);
    }

    /**
     * Creates an {@link AnnotationNode} of type {@link GroovyASTTransformation}.
     *
     * @param compilePhase the target {@link CompilePhase} used as value of the
     * {@link GroovyASTTransformation} annotation
     * @return an instance of {@link GroovyASTTransformation} annotation
     * @since 0.2.0
     */
    public static AnnotationNode getGroovyAnnotation(final CompilePhase compilePhase) {
        final PropertyExpression valueExpr = getCompilePhaseAsPropertyExpression(compilePhase);

// Path: asteroid-core/src/main/java/asteroid/A.java
// @SuppressWarnings("PMD.ShortClassName")
// public final class A {
// 
//     /**
//      * Entry point to get node builders.
//      *
//      * @since 0.1.0
//      */
//     public static final Nodes NODES = new Nodes();
// 
//     /**
//      * Entry point to access language modifiers
//      *
//      * @since 0.1.0
//      */
//     public static final Modifiers ACC = new Modifiers();
// 
//     /**
//      * Entry point to create statements.
//      *
//      * @since 0.1.0
//      */
//     public static final Statements STMT = new Statements();
// 
//     /**
//      * Entry point to create expressions
//      *
//      * @since 0.1.0
//      */
//     public static final Expressions EXPR = new Expressions();
// 
//     /**
//      * Entry point to get util functions
//      *
//      * @since 0.1.0
//      */
//     public static final Utils UTIL = new Utils();
// 
//     /**
//      * Entry point to get criterias
//      *
//      * @since 0.2.4
//      */
//     public static final Criterias CRITERIA = new Criterias();
// }


// Path: asteroid-core/src/main/java/asteroid/internal/TransformationUtils.java
import asteroid.A;
import org.codehaus.groovy.ast.ClassNode;
import org.codehaus.groovy.ast.AnnotationNode;
import org.codehaus.groovy.ast.expr.PropertyExpression;
import org.codehaus.groovy.control.CompilePhase;
import org.codehaus.groovy.transform.GroovyASTTransformation;
import groovy.transform.InheritConstructors;

package asteroid.internal;



/**
 * A set of utilities to implement base transformation classes
 *
 * @since 0.2.0
 */
public final class TransformationUtils {

    private TransformationUtils() { }

    /**
     * All transformation will be always annotated with:
     *
     * <ul>
     *    <li>{@link InheritConstructors}</li>
     *    <li>{@link GroovyASTTransformation}</li>
     * </ul>
     *
     * To avoid repeating this over and over again this method adds
     * both to the annotated {@link ClassNode} passed as first
     * argument
     *
     * @param annotated The {@link ClassNode} we want to add both
     * annotations to
     * @param compilePhase The {@link CompilePhase} used as argument for
     * the {@link GroovyASTTransformation} annotation.
     * @since 0.2.0
     */
    public static void addASTAnnotationsFromTo(final ClassNode annotated, final CompilePhase compilePhase) {
        final AnnotationNode groovyAnn = getGroovyAnnotation(compilePhase);
        final AnnotationNode inheritConsAnn = getInheritConstructorsAnnotation();

        annotated.addAnnotation(inheritConsAnn);
        annotated.addAnnotation(groovyAnn);
    }

    /**
     * Creates an {@link AnnotationNode} of type {@link GroovyASTTransformation}.
     *
     * @param compilePhase the target {@link CompilePhase} used as value of the
     * {@link GroovyASTTransformation} annotation
     * @return an instance of {@link GroovyASTTransformation} annotation
     * @since 0.2.0
     */
    public static AnnotationNode getGroovyAnnotation(final CompilePhase compilePhase) {
        final PropertyExpression valueExpr = getCompilePhaseAsPropertyExpression(compilePhase);

        return A.NODES.annotation(GroovyASTTransformation.class)