Skip navigation links
A B C D E F G H I L M N O P R S T U V W 

A

A - Class in asteroid
Entry point to look up functions and utilities to work with nodes, expressions, statements, node utils...etc
A() - Constructor for class asteroid.A
 
AbstractClassNodeTransformer - Class in asteroid.transformer
This Transformer can be used to transform ClassNode nodes.
AbstractClassNodeTransformer(SourceUnit, Closure<Boolean>) - Constructor for class asteroid.transformer.AbstractClassNodeTransformer
Every instance needs the source unit and the name of the class it's going to transform.
AbstractExpressionTransformer<T extends Expression> - Class in asteroid.transformer
This Transformer could be used as a base for transforming Expression instances.
AbstractExpressionTransformer(Class<T>, SourceUnit, Closure<Boolean>) - Constructor for class asteroid.transformer.AbstractExpressionTransformer
Every instance needs the source unit awareness and the name of the method it's going to transform
AbstractExpressionTransformer(Class<T>, SourceUnit) - Constructor for class asteroid.transformer.AbstractExpressionTransformer
Every instance needs the source unit awareness and the name of the method it's going to transform
AbstractGlobalTransformation - Class in asteroid
This class applies all transformers provided by the method getTransformers in order to all class nodes present in a given source unit instance.
AbstractGlobalTransformation() - Constructor for class asteroid.AbstractGlobalTransformation
 
AbstractLocalTransformation<T extends java.lang.annotation.Annotation,S extends AnnotatedNode> - Class in asteroid
This class is an abstraction to process certain nodes annotated with a specific annotation node type

Types indicate wich nodes are affected:

Lets say we wanted to build a transformation to transform methods annotated by @MyAnnotation:

 class MyCustomTransformation extends AbstractLocalTransformation<MyAnnotation, MethodNode> {
     @Override
     void doVisit(AnnotationNode annotation, final MethodNode annotated){
         // implementation
     }
 }
 
AbstractLocalTransformation() - Constructor for class asteroid.AbstractLocalTransformation
Default constructor
AbstractLocalTransformation(Class<T>) - Constructor for class asteroid.AbstractLocalTransformation
Default constructor
AbstractMethodNodeTransformer - Class in asteroid.transformer
This Transformer can be used to transform MethodNode nodes.
AbstractMethodNodeTransformer(SourceUnit, Closure<Boolean>) - Constructor for class asteroid.transformer.AbstractMethodNodeTransformer
Deprecated. 
AbstractStatementTransformer<T extends Statement> - Class in asteroid.transformer
This Transformer could be used as a base for transforming Statement instances.
AbstractStatementTransformer(SourceUnit, Closure<Boolean>) - Constructor for class asteroid.transformer.AbstractStatementTransformer
Every instance needs the source unit awareness and the name of the method it's going to transform
AbstractTransformer - Class in asteroid.transformer
Most transformers need at some point the source unit in order to fix or apply properly the scope to each variable.
AbstractTransformer(SourceUnit) - Constructor for class asteroid.transformer.AbstractTransformer
This constructor needs a source unit
ACC - Static variable in class asteroid.A
Entry point to access language modifiers
addAfterCodeBlock(MethodNode, Statement) - Method in class asteroid.utils.NodeUtils
Adds the statement passed as argument after the current method code
addAroundCodeBlock(MethodNode, Statement, Statement) - Method in class asteroid.utils.NodeUtils
Adds two different statements to be executed before and after the current method code
addASTAnnotationsFromTo(ClassNode, CompilePhase) - Static method in class asteroid.internal.TransformationUtils
All transformation will be always annotated with: InheritConstructors GroovyASTTransformation To avoid repeating this over and over again this method adds both to the annotated ClassNode passed as first argument
addBeforeCodeBlock(MethodNode, Statement) - Method in class asteroid.utils.NodeUtils
Adds the statement passed as argument before the current method code
addCatchStmt(Class, String, Statement) - Method in class asteroid.statements.TryCatchStatementBuilder
Adds one catch statement to catch a specific exception giving a specific name for the exception variable.
addCatchStmt(ClassNode, String, Statement) - Method in class asteroid.statements.TryCatchStatementBuilder
Adds one catch statement to catch a specific exception giving a specific name for the exception variable.
addCheckTo(MethodNode) - Method in class asteroid.utils.NodeUtils
Adds checks to the method node passed as parameter
addImport(ClassNode, Class) - Method in class asteroid.utils.NodeUtils
Adds an import to the ModuleNode containing the ClassNode passed as first argument.
addImport(ClassNode, String) - Method in class asteroid.utils.NodeUtils
Adds an import to the ModuleNode containing the ClassNode passed as first argument.
addImport(ClassNode, Class, String) - Method in class asteroid.utils.NodeUtils
Adds an import to the ModuleNode containing the ClassNode passed as first argument.
addImport(ClassNode, String, String) - Method in class asteroid.utils.NodeUtils
Adds an import to the ModuleNode containing the ClassNode passed as first argument.
addInterfaces(ClassNode, Class...) - Method in class asteroid.utils.NodeUtils
Makes the ClassNode to implement the interfaces passed as arguments

IMPORTANT: Dont use this method at any CompilePhase before SEMANTIC_ANALYSIS.
addInterfaces(ClassNode, ClassNode...) - Method in class asteroid.utils.NodeUtils
Makes the ClassNode to implement the interfaces passed as arguments.
addMethod(ClassNode, MethodNode) - Method in class asteroid.utils.NodeUtils
Adds the method to the class node passed as first argument
addMethodIfNotPresent(ClassNode, MethodNode) - Method in class asteroid.utils.NodeUtils
Adds a method to the class node passed as first argument only if it wasn't present in the first place
addProperty(ClassNode, PropertyNode) - Method in class asteroid.utils.NodeUtils
Adds the property to the class node passed as first argument
addPropertyIfNotPresent(ClassNode, PropertyNode) - Method in class asteroid.utils.NodeUtils
Adds a property to the class node passed as first argument only if it wasn't present in the first place
and(Closure<Boolean>...) - Static method in class asteroid.Criterias
Combines two Closure expressions returning a boolean.
annotation(Class) - Method in class asteroid.Nodes
Creates an instance of AnnotationNodeBuilder
annotation(Class) - Static method in class asteroid.nodes.AnnotationNodeBuilder
Creates an instance of AnnotationNodeBuilder

AST
ANNOTATION_VALUE - Static variable in class asteroid.utils.NodeUtils
 
AnnotationNodeBuilder - Class in asteroid.nodes
Builder to create instances of type AnnotationNode
applyToStatementsByLabel(List<StatementUtils.Group>, Map<String, Closure<Statement>>) - Method in class asteroid.utils.StatementUtils
If you have a given list of StatementUtils.Group you can apply a set of transformations on certain statements within a given group.
applyToStatementsByLabelFlatten(List<StatementUtils.Group>, Map<String, Closure<Statement>>) - Method in class asteroid.utils.StatementUtils
If you have a given list of StatementUtils.Group you can apply a set of transformations on certain statements within a given group.
asBinaryExpr(Expression, T, Closure<T>) - Method in class asteroid.utils.ExpressionUtils
Executes a given computation if the expression is of type BinaryExpression if not, then a default value is provided
asBinaryExpr(Expression) - Method in class asteroid.utils.ExpressionUtils
Unsafe cast of a given @{link Expression} to a BinaryExpression
assertS(BooleanExpression) - Static method in class asteroid.Statements
Returns an instance of AssertStatement

AST
assertS(BooleanExpression, String) - Static method in class asteroid.Statements
Returns an instance of AssertStatement

AST
asteroid - package asteroid
This package contains:
Classes to implement a local AST transformation Classes to access builder to create: nodes, expressions, statements Classes to make it easier to access AST node values Classes to check AST nodes Most of the times you can access all these functionalities through the A class
asteroid.internal - package asteroid.internal
This package contains internal AST transformations to get rid of boilerplate code when creating a local AST transformation.
asteroid.nodes - package asteroid.nodes
This package contains classes to build ASTNode instances
asteroid.statements - package asteroid.statements
This package contains utility classes to create statements
asteroid.transformer - package asteroid.transformer
This package contains classes to create global AST transformations
asteroid.utils - package asteroid.utils
This package contains utility classes

B

binEqX(Expression, Expression) - Static method in class asteroid.Expressions
Builds an instance of BinaryExpression of type

AST
binX(String, int, String) - Static method in class asteroid.Expressions
Builds a new BinaryExpression with the names of the variables pointing at both left/right terms in the binary expression plus the operator in between.
binX(Expression, int, Expression) - Static method in class asteroid.Expressions
Builds a new BinaryExpression from a left expression and a right expression joined by a given operator.
blockS(List<Statement>) - Static method in class asteroid.Statements
Returns an instance of BlockStatement.
blockS(Statement...) - Static method in class asteroid.Statements
Returns an instance of BlockStatement.
blockS(VariableScope, Statement...) - Static method in class asteroid.Statements
Returns an instance of BlockStatement.
blockS(VariableScope, List<Statement>) - Static method in class asteroid.Statements
Returns an instance of BlockStatement.
blockSFromString(String) - Static method in class asteroid.Statements
Returns an instance of BlockStatement.
boolEqualsNullX(Expression) - Method in class asteroid.Expressions
Builds an instance of BooleanExpression of type:

AST
boolHasSameFieldX(FieldNode, Expression) - Method in class asteroid.Expressions
Builds an instance of BooleanExpression of type:

AST
boolHasSamePropertyX(PropertyNode, Expression) - Method in class asteroid.Expressions
Builds an instance of BooleanExpression of type:

AST
boolIsInstanceOfX(Expression, ClassNode) - Method in class asteroid.Expressions
Use it to create an "instanceof" expression to know whether an instance is of a given type or not.
boolIsInstanceOfX(Expression, Class) - Method in class asteroid.Expressions
Use it to create an "instanceof" expression to know whether an instance is of a given type or not.
boolIsOneX(Expression) - Method in class asteroid.Expressions
Builds an instance of BooleanExpression of type:

AST
boolIsTrueX(Expression) - Method in class asteroid.Expressions
Builds an instance of BooleanExpression of type:

AST
boolIsZeroX(Expression) - Method in class asteroid.Expressions
Builds an instance of BooleanExpression of type:

AST
boolNotNullX(Expression) - Method in class asteroid.Expressions
Builds an instance of BooleanExpression of type:

AST
boolSameX(Expression, Expression) - Method in class asteroid.Expressions
Builds an instance of BooleanExpression of type:

AST
boolX(Expression) - Static method in class asteroid.Expressions
Builds an instance of BooleanExpression from a Expression passed as argument.
boolX(String, int, String) - Static method in class asteroid.Expressions
When creating BooleanExpression in places such as IfStatement you can use this method to create a BooleanExpression out of a binary expression using the names of the compared variables.
boolX(Expression, int, Expression) - Static method in class asteroid.Expressions
When creating BooleanExpression in places such as IfStatement you can use this method to create a BooleanExpression out of a binary expression using constant expressions AST
build() - Method in class asteroid.nodes.AnnotationNodeBuilder
Returns the annotation node configured by this builder
build() - Method in class asteroid.nodes.ClassNodeBuilder
Returns the instance of type ClassNode configured by this builder
build() - Method in class asteroid.nodes.ConstructorNodeBuilder
Returns the configured instance of type ConstructorNode
build() - Method in class asteroid.nodes.GenericsTypeBuilder
 
build() - Method in class asteroid.nodes.MethodNodeBuilder
 
build() - Method in class asteroid.nodes.ParameterNodeBuilder
Returns the Parameter instance
build() - Method in class asteroid.nodes.PropertyNodeBuilder
Returns the initialized PropertyNode
build() - Method in class asteroid.statements.TryCatchStatementBuilder
Returns the created TryCatchStatement instance.
byAnnotation(Class) - Static method in class asteroid.Criterias
Criteria to find those annotated nodes with an annotation with a Class.
byAnnotationSimpleName(String) - Static method in class asteroid.Criterias
Criteria to find those annotated nodes with an annotation with a Class with a name as the passed argument.
byClassNodeNameContains(String) - Static method in class asteroid.Criterias
Criteria to find those classes with a name containing the term passed as parameter
byClassNodeNameEndsWith(String) - Static method in class asteroid.Criterias
Criteria to find those classes with a name containing the term passed as parameter at the end.
byClassNodeNameStartsWith(String) - Static method in class asteroid.Criterias
Criteria to find those classes with a name containing the term passed as parameter at the beginning.
byExprAny() - Static method in class asteroid.Criterias
This criteria will make the transformer to process every Expression
byExprBinaryUsingToken(int) - Static method in class asteroid.Criterias
Checks that a given BinaryExpression uses a specific token type.
byExprMethodCallByArgs(Class...) - Static method in class asteroid.Criterias
This method returns a criteria to look for MethodCallExpression with arguments with the types specified as parameters
byExprMethodCallByName(String) - Static method in class asteroid.Criterias
This method returns a criteria to look for MethodCallExpression with a name equals to the name passed as parameter
byMethodNodeName(String) - Static method in class asteroid.Criterias
Criteria to find those methods with a specific name
byMethodNodeNameContains(String) - Static method in class asteroid.Criterias
Criteria to find those methods with a name containing the term passed as parameter
byMethodNodeNameEndsWith(String) - Static method in class asteroid.Criterias
Criteria to find those methods with a name containing the term passed as parameter at the end.
byMethodNodeNameStartsWith(String) - Static method in class asteroid.Criterias
Criteria to find those methods with a name containing the term passed as parameter at the beginning.
byStmtByType(Class<T>) - Static method in class asteroid.Criterias
This method returns a criteria to look for Statement with a specific type

C

callSuperX(String) - Static method in class asteroid.Expressions
Creates a method call expression

AST
callSuperX(String, Expression...) - Static method in class asteroid.Expressions
Creates a method call expression

AST
callThisX(String, Expression...) - Static method in class asteroid.Expressions
Creates a method call expression using `this` as target instance

AST
callX(Expression, String, Expression...) - Static method in class asteroid.Expressions
Creates a method call expression

AST
CANONICALIZATION - Static variable in class asteroid.Phase.GLOBAL
Complete building the AST
CANONICALIZATION - Static variable in class asteroid.Phase.LOCAL
Complete building the AST
CLASS_GENERATION - Static variable in class asteroid.Phase.GLOBAL
Creates the bytecode of the class in memory
CLASS_GENERATION - Static variable in class asteroid.Phase.LOCAL
Creates the bytecode of the class in memory
ClassNodeBuilder - Class in asteroid.nodes
Builder to create instances of type ClassNode
classX(Class) - Static method in class asteroid.Expressions
Creates an instance of ClassExpression from a Class

AST
classX(ClassNode) - Static method in class asteroid.Expressions
Creates a class expression from a ClassNode

AST
clazz(Class<?>) - Static method in class asteroid.nodes.ClassNodeBuilder
Creates a new instance of ClassNodeBuilder by using the Class type.
clazz(String) - Static method in class asteroid.nodes.ClassNodeBuilder
Creates a new instance of ClassNodeBuilder by using the fully qualified name of a Class

AST
clazz(Class) - Method in class asteroid.Nodes
Creates an instance of ClassNodeBuilder
clazz(String) - Method in class asteroid.Nodes
Creates an instance of ClassNodeBuilder
clazzWithGenerics(Class<?>, GenericsType...) - Static method in class asteroid.nodes.ClassNodeBuilder
Creates a new instance of ClassNodeBuilder by using the fully qualified name of a Class
clazzWithGenerics(Class, GenericsType...) - Method in class asteroid.Nodes
Creates an instance of ClassNodeBuilder
closureX(Statement, Parameter...) - Static method in class asteroid.Expressions
Creates a closure expression.
code(Statement) - Method in class asteroid.nodes.ConstructorNodeBuilder
Sets the constructor body code
code(Statement) - Method in class asteroid.nodes.MethodNodeBuilder
 
constructor(int) - Method in class asteroid.Nodes
Creates an instance of ConstructorNodeBuilder
constructor(int) - Static method in class asteroid.nodes.ConstructorNodeBuilder
Creates a ConstructorNodeBuilder instance initializing constructor with modifiers
ConstructorNodeBuilder - Class in asteroid.nodes
Builder to create instance of type ConstructorNode e.g.
constX(Object) - Static method in class asteroid.Expressions
Builds an instance of ConstantExpression from the constant value passed as argument

AST
CONVERSION - Static variable in class asteroid.Phase.GLOBAL
An abstract syntax tree (AST) is created from token trees
copyWithStatements(List<Statement>) - Method in class asteroid.utils.StatementUtils.Group
Utility method to clone a given StatementUtils.Group changing the statement list
CRITERIA - Static variable in class asteroid.A
Entry point to get criterias
Criterias - Class in asteroid
This class contains out-of-the-box criterias, they are used to help out finding specific nodes.
Criterias() - Constructor for class asteroid.Criterias
 
ctorSuperS(Expression...) - Static method in class asteroid.Statements
Returns an instance of Statement.

D

doVisit(AnnotationNode, S) - Method in class asteroid.AbstractLocalTransformation
This method processes all annotated nodes annotated with a specific annotation node.
doVisit(AnnotationNode, ClassNode) - Method in class asteroid.internal.PhaseTransformation
This method processes all annotated nodes annotated with a specific annotation node.
doWhileS(BooleanExpression, Statement) - Static method in class asteroid.Statements
Represents a do-while statement.
doWhileStatement(BooleanExpression, Statement) - Static method in class asteroid.Statements
Deprecated.
As of release 2.4.7, replaced by Statements.doWhileS(BooleanExpression, Statement)

E

emptyS() - Static method in class asteroid.Statements
Represents an empty statement.
emptyStatement() - Static method in class asteroid.Statements
Deprecated.
As of release 2.4.7, replaced by Statements.emptyS()
everything() - Static method in class asteroid.transformer.AbstractExpressionTransformer
Deprecated.
exceptions(ClassNode...) - Method in class asteroid.nodes.MethodNodeBuilder
 
EXPR - Static variable in class asteroid.A
Entry point to create expressions
EXPR - Static variable in class asteroid.Utils
Access to utility functions to deal with Expression instances
expression - Variable in class asteroid.utils.StatementUtils.Label
 
Expressions - Class in asteroid
This class hides the different implementations to create expressions through the Groovy api to provide a unified an easier way to create expressions when coding an AST transformation.
Expressions() - Constructor for class asteroid.Expressions
 
ExpressionUtils - Class in asteroid.utils
Utility classes to deal with Expression instances
ExpressionUtils() - Constructor for class asteroid.utils.ExpressionUtils
 
extractLabelFrom(Statement) - Method in class asteroid.utils.StatementUtils
If you would like to take the text from a label in your code

F

fieldX(FieldNode) - Static method in class asteroid.Expressions
Creates a method call expression

AST
FINALIZATION - Static variable in class asteroid.Phase.GLOBAL
Perform any last cleanup and closes the file
FINALIZATION - Static variable in class asteroid.Phase.LOCAL
Perform any last cleanup and closes the file
finallyStmt(Statement) - Method in class asteroid.statements.TryCatchStatementBuilder
Adds the statement that will be placed inside the finally block
findAllMethodByName(ClassNode, String) - Method in class asteroid.utils.NodeUtils
Returns all MethodNode found with a given name in a specific ClassNode
findMethodByName(ClassNode, String) - Method in class asteroid.utils.NodeUtils
Returns the first MethodNode found with a given name in a specific ClassNode

G

generics(ClassNode) - Method in class asteroid.Nodes
Creates an instance of GenericsTypeBuilder
generics(ClassNode) - Static method in class asteroid.nodes.GenericsTypeBuilder
 
genericsPlaceHolder(Boolean) - Method in class asteroid.nodes.ClassNodeBuilder
Informs the builder whether to use a generic placeholder in the resulting ClassNode or not.
GenericsTypeBuilder - Class in asteroid.nodes
Builder to create instances of type GenericsType
genericsTypes(GenericsType...) - Method in class asteroid.nodes.ClassNodeBuilder
Sets generic types for the resulting ClassNode
get(AnnotationNode, Class<T>) - Method in class asteroid.utils.NodeUtils
Returns the value of a given annotation member.
get(AnnotationNode, String, Class<T>) - Method in class asteroid.utils.NodeUtils
Returns the value of a member of the AnnotationNode passed as first parameter with the name passed as second parameter.
getAnnotationFrom(ClassNode, ClassNode) - Method in class asteroid.utils.NodeUtils
Gets a given annotation node from the ClassNode passed as first argument.
getAnnotationFrom(ClassNode, String) - Method in class asteroid.utils.NodeUtils
Retrieves an annotation with a specific simple name.
getArgumentByIndexAs(MethodCallExpression, Integer, Class<U>) - Method in class asteroid.utils.ExpressionUtils
Return the element in the specified index from the ArgumentListExpression passed as argument as the expected type.
getArgumentByIndexAs(ArgumentListExpression, Integer, Class<U>) - Method in class asteroid.utils.ExpressionUtils
Return the element in the specified index from the ArgumentListExpression passed as argument as the expected type.
getArgumentList(MethodCallExpression) - Method in class asteroid.utils.ExpressionUtils
Given a MethodCallExpression it returns a list of arguments
getCodeBlock(MethodNode) - Method in class asteroid.utils.NodeUtils
Utility method to make your transformation code more compile static compliant when getting a method node code block.
getCompilePhaseAsPropertyExpression(CompilePhase) - Static method in class asteroid.internal.TransformationUtils
Creates a PropertyExpression containing a CompilePhase.
getFirstArgumentAs(MethodCallExpression, Class<U>) - Method in class asteroid.utils.ExpressionUtils
Return the first element of the ArgumentListExpression passed as parameters as the expected type.
getFirstArgumentAs(ArgumentListExpression, Class<U>) - Method in class asteroid.utils.ExpressionUtils
Return the first element of the ArgumentListExpression passed as parameters as the expected type.
getFirstNodeAs(ASTNode[], Class<T>) - Method in class asteroid.utils.NodeUtils
Returns the first node of the list passed as parameter with the expected type T
getGroovyAnnotation(CompilePhase) - Static method in class asteroid.internal.TransformationUtils
getInheritConstructorsAnnotation() - Static method in class asteroid.internal.TransformationUtils
getInstancePropertyFields(ClassNode) - Method in class asteroid.utils.NodeUtils
Returns all properties from a given ClassNode passed as argument
getLastArgumentAs(MethodCallExpression, Class<U>) - Method in class asteroid.utils.ExpressionUtils
Return the last element of the ArgumentListExpression passed as parameters as the expected type.
getLastArgumentAs(ArgumentListExpression, Class<U>) - Method in class asteroid.utils.ExpressionUtils
Return the last element of the ArgumentListExpression passed as parameters as the expected type.
getLastNodeAs(ASTNode[], Class<T>) - Method in class asteroid.utils.NodeUtils
Returns the last node of the list passed as parameter with the expected type T
getModule() - Method in class asteroid.transformer.AbstractTransformer
This method returns the module of the current SourceUnit instance
getModulePackageName() - Method in class asteroid.transformer.AbstractTransformer
Sometimes could be useful to get the package name of the current module
getSourceUnit() - Method in class asteroid.transformer.AbstractTransformer
This method returns the source unit
getStringValue(AnnotationNode) - Method in class asteroid.utils.NodeUtils
Returns the String representation of the member "value" of the annotation passed as parameter
getText(Expression) - Method in class asteroid.utils.ExpressionUtils
Extracts the String value of a given expression
getTransformers() - Method in class asteroid.AbstractGlobalTransformation
This method should return a list of visitor classes Class instances applied globally by this AST.
getTransformers() - Method in class asteroid.internal.GlobalTransformationTransformation
 
GLOBAL() - Constructor for class asteroid.Phase.GLOBAL
 
GlobalTransformationTransformation - Class in asteroid.internal
This transformation makes easier to declare a given global transformation.
GlobalTransformationTransformation() - Constructor for class asteroid.internal.GlobalTransformationTransformation
 
groupStatementsByLabel(BlockStatement) - Method in class asteroid.utils.StatementUtils
Use this function to group expression statements found within a given block statement.

H

hasArguments(MethodCallExpression) - Method in class asteroid.utils.ExpressionUtils
Given a MethodCallExpression it returns whether it has arguments or not
hasFieldOfType(ClassNode, String) - Method in class asteroid.utils.NodeUtils
Returns whether if the ClassNode passed as first parameter has any field with the type matching the qualified name passed as second parameter.

I

ifElseS(BooleanExpression, Statement, Statement) - Static method in class asteroid.Statements
Builds a if-else statement.
ifS(BooleanExpression, Statement) - Static method in class asteroid.Statements
Builds a if statement, without the else part.
INITIALIZATION - Static variable in class asteroid.Phase.GLOBAL
Source files are opened and environment configured
initialValueExpression(Expression) - Method in class asteroid.nodes.PropertyNodeBuilder
Sets an initial value for the property.
INSTRUCTION_SELECTION - Static variable in class asteroid.Phase.GLOBAL
Instruction set is chosen, for example Java 6 or Java 7 bytecode level
INSTRUCTION_SELECTION - Static variable in class asteroid.Phase.LOCAL
Instruction set is chosen, for example Java 6 or Java 7 bytecode level
isBinaryExpr(Expression) - Method in class asteroid.utils.ExpressionUtils
Checks whether an expression is of type BinaryExpression
isBinaryExpr(Expression, int) - Method in class asteroid.utils.ExpressionUtils
Checks whether an expression is of type BinaryExpression using a specific binary operator
isListExpr(Expression) - Method in class asteroid.utils.ExpressionUtils
Checks whether an expression is of type ListExpression
isMethodCallExpr(Expression) - Method in class asteroid.utils.ExpressionUtils
Checks whether an expression is of type MethodCallExpression
isOrExtends(ClassNode, Class) - Method in class asteroid.utils.NodeUtils
Returns true if the classNode passed as first argument is of type `clazz` or that class extends the other class, false otherwise
isOrExtends(ClassNode, ClassNode) - Method in class asteroid.utils.NodeUtils
Returns true if the classNode passed as first argument is of type `clazz` or that class extends the other class, false otherwise
isOrExtends(ClassNode, String) - Method in class asteroid.utils.NodeUtils
Returns true if the classNode passed as first argument is of type `clazz` or that class extends the other class, false otherwise
isOrExtendsUnsafe(ClassNode, ClassNode) - Method in class asteroid.utils.NodeUtils
Returns true if the classNode passed as first argument is of type `clazz` or that class extends the other class, false otherwise.
isOrImplements(Class, Class) - Method in class asteroid.utils.NodeUtils
Returns true if the classNode passed as first argument is of type `clazz` or that class implements `parent`, false otherwise
isOrImplements(ClassNode, Class) - Method in class asteroid.utils.NodeUtils
Returns true if the classNode passed as first argument is of type `clazz` or that class implements `parent`, false otherwise
isOrImplements(ClassNode, String) - Method in class asteroid.utils.NodeUtils
Returns true if the classNode passed as first argument is of type `clazz` or that class implements `parent`, false otherwise

L

label - Variable in class asteroid.utils.StatementUtils.Group
 
landX(Expression, Expression) - Static method in class asteroid.Expressions
Builds a binary expression using a logical and (&&) AST
leftExprAs(BinaryExpression, Class<T>) - Method in class asteroid.utils.ExpressionUtils
From a BinaryExpression gets the left expression as if it were of a given type
listX(Expression...) - Static method in class asteroid.Expressions
Creates an instance of ListExpression:

AST:
Local - Annotation Type in asteroid
Marks a given annotation as a local AST transformation marker
LOCAL() - Constructor for class asteroid.Phase.LOCAL
 
Local.TO - Enum in asteroid
Targets available to apply a specific transformation
LocalTransformation - Class in asteroid.internal
Reduces the boiler plate code when declaring an annotation as possible target for a given transformation.
LocalTransformation() - Constructor for class asteroid.internal.LocalTransformation
 
lorX(Expression, Expression) - Static method in class asteroid.Expressions
Builds a binary expression using a logical or (||) AST

M

mapEntryX(Expression, Expression) - Static method in class asteroid.Expressions
Creates an instance of type MapEntryExpression
mapX(MapEntryExpression...) - Static method in class asteroid.Expressions
Creates an instance of MapExpression:

AST
mapX(List<MapEntryExpression>) - Static method in class asteroid.Expressions
Creates an instance of MapExpression:

AST
member(String, Expression) - Method in class asteroid.nodes.AnnotationNodeBuilder
Adds a new member to the annotation

AST
method(String) - Method in class asteroid.Nodes
Creates an instance of MethodNodeBuilder
method(String) - Static method in class asteroid.nodes.MethodNodeBuilder
 
MethodNodeBuilder - Class in asteroid.nodes
Builder to create instance of type MethodNode
Modifiers - Class in asteroid
This class acts as a proxy to access modifier codes found at Opcodes.
Modifiers() - Constructor for class asteroid.Modifiers
 
modifiers(int) - Method in class asteroid.nodes.MethodNodeBuilder
 
modifiers(int) - Method in class asteroid.nodes.PropertyNodeBuilder
Sets property modifiers: static/public/...

N

name - Variable in class asteroid.utils.StatementUtils.Label
 
nameAsExpression() - Method in class asteroid.utils.StatementUtils.Label
Returns the label name as a ConstantExpression
newX(Class) - Static method in class asteroid.Expressions
AST
newX(Class, Expression...) - Static method in class asteroid.Expressions
AST
NODE - Static variable in class asteroid.Utils
Access to utility functions to deal with ASTNode instances
NODES - Static variable in class asteroid.A
Entry point to get node builders.
Nodes - Class in asteroid
This class provides access to different builders for creating AST nodes.
Nodes() - Constructor for class asteroid.Nodes
 
NodeUtils - Class in asteroid.utils
General utility methods to deal with ASTNode instances
NodeUtils() - Constructor for class asteroid.utils.NodeUtils
 
notX(Expression) - Static method in class asteroid.Expressions
Negates a given expression AST

O

or(Closure<Boolean>...) - Static method in class asteroid.Criterias
Combines two Closure expressions returning a boolean.
OUTPUT - Static variable in class asteroid.Phase.GLOBAL
Write the binary output to the file system (*.class file)
OUTPUT - Static variable in class asteroid.Phase.LOCAL
Write the binary output to the file system (*.class file)
owner(ClassNode) - Method in class asteroid.nodes.PropertyNodeBuilder
Sets the property owner

P

param(String) - Method in class asteroid.Nodes
Creates an instance of ParameterNodeBuilder.
param(String) - Static method in class asteroid.nodes.ParameterNodeBuilder
Creates a new ParameterNodeBuilder
ParameterNodeBuilder - Class in asteroid.nodes
Creates a new Parameter instance
ParameterNodeBuilder(String) - Constructor for class asteroid.nodes.ParameterNodeBuilder
Default constructor
parameters(Parameter...) - Method in class asteroid.nodes.MethodNodeBuilder
 
PARSING - Static variable in class asteroid.Phase.GLOBAL
The grammar is used to to produce tree of tokens representing the source code
Phase - Annotation Type in asteroid
Compilation is required when declaring any AbstractLocalTransformation or AbstractGlobalTransformation.
Phase.GLOBAL - Class in asteroid
Compilation phases available for global transformations:

SEMANTIC_ANALYSIS CANONICALIZATION INSTRUCTION_SELECTION CLASS_GENERATION OUTPUT FINALIZATION
Phase.LOCAL - Class in asteroid
Compilation phases available for local transformations.
PhaseTransformation - Class in asteroid.internal
This transformation makes easier to declare a given local transformation.
PhaseTransformation() - Constructor for class asteroid.internal.PhaseTransformation
Constructor using abstraction AbstractLocalTransformation
property(String) - Method in class asteroid.Nodes
Creates an instnace of PropertyNodeBuilder.
property(String) - Static method in class asteroid.nodes.PropertyNodeBuilder
Creates a builder from the property name
PropertyNodeBuilder - Class in asteroid.nodes
Creates a new PropertyNode instance
propX(Expression, Expression) - Static method in class asteroid.Expressions
Builds an instance of PropertyExpression:

AST:

R

removeAnnotation(AnnotatedNode, AnnotationNode) - Method in class asteroid.utils.NodeUtils
It removes the AnnotationNode from a given AnnotatedNode
returnS(Expression) - Static method in class asteroid.Statements
Returns an instance of ReturnStatement

AST
returnType(Class) - Method in class asteroid.nodes.MethodNodeBuilder
 
rightExprAs(BinaryExpression, Class<T>) - Method in class asteroid.utils.ExpressionUtils
From a BinaryExpression gets the right expression as if it were of a given type

S

safeCallX(Expression, String, Expression...) - Static method in class asteroid.Expressions
Creates a safe method call expression.
SEMANTIC_ANALYSIS - Static variable in class asteroid.Phase.GLOBAL
Consistency and validity checks
SEMANTIC_ANALYSIS - Static variable in class asteroid.Phase.LOCAL
Consistency and validity checks
Statements - Class in asteroid
This class hides the different implementations to create expressions through the Groovy api to provide a unified an easier way to create statements when coding an AST transformation.
Statements() - Constructor for class asteroid.Statements
 
statements - Variable in class asteroid.utils.StatementUtils.Group
 
StatementUtils - Class in asteroid.utils
General utility methods to deal with Statement instances
StatementUtils() - Constructor for class asteroid.utils.StatementUtils
 
StatementUtils.Group - Class in asteroid.utils
Represent a group of statements grouped by a given label.
StatementUtils.Label - Class in asteroid.utils
This class helps to identify a list of statements.
staticCallX(ClassNode, String, Expression...) - Static method in class asteroid.Expressions
Creates a static method expression

AST
staticCallX(Class, String, Expression...) - Static method in class asteroid.Expressions
Creates a static method expression

AST
STMT - Static variable in class asteroid.A
Entry point to create statements.
stmt(Expression) - Static method in class asteroid.Statements
Returns an instance of Statement.
STMT - Static variable in class asteroid.Utils
Access to utility functions to deal with Statement instances

T

throwS(Expression) - Static method in class asteroid.Statements
Represents how to throw an exception AST
transform(Expression) - Method in class asteroid.transformer.AbstractExpressionTransformer
TransformationUtils - Class in asteroid.internal
A set of utilities to implement base transformation classes
transformClass(ClassNode) - Method in class asteroid.internal.TranslateToGlobalTransform
Within this method developer could modify the ClassNode instance.
transformClass(ClassNode) - Method in class asteroid.transformer.AbstractClassNodeTransformer
Within this method developer could modify the ClassNode instance.
Transformer - Interface in asteroid.transformer
All transformer implementations responsible for modifying an AST node in a AbstractGlobalTransformation should implement this interface
transformExpression(T) - Method in class asteroid.transformer.AbstractExpressionTransformer
This method will transform the expression into its final version.
transformMethod(MethodNode) - Method in class asteroid.transformer.AbstractMethodNodeTransformer
Within this method developer could modify the MethodNode instance.
transformStatement(T) - Method in class asteroid.transformer.AbstractStatementTransformer
This method will transform the statement into its final version.
TranslateToGlobalTransform - Class in asteroid.internal
This AbstractClassNodeTransformer will be applied to all ClassNode instances annotated with Phase.
TranslateToGlobalTransform(SourceUnit) - Constructor for class asteroid.internal.TranslateToGlobalTransform
Constructor receiving the SourceUnit
tryCatchSBuilder() - Static method in class asteroid.Statements
Returns an instance of TryCatchStatementBuilder to build complex try/catch statements the easy way.
TryCatchStatementBuilder - Class in asteroid.statements
This builder tries to make it easier to build a try/catch statement.

AST
TryCatchStatementBuilder() - Constructor for class asteroid.statements.TryCatchStatementBuilder
 
tryStmt(Statement) - Method in class asteroid.statements.TryCatchStatementBuilder
Adds the try statement
type(ClassNode) - Method in class asteroid.nodes.ParameterNodeBuilder
Sets the type of the parameter
type(Class) - Method in class asteroid.nodes.PropertyNodeBuilder
Sets the type of the property

AST

U

usingGenerics(Boolean) - Method in class asteroid.nodes.ClassNodeBuilder
Informs the builder whether to use generics in the resulting ClassNode or not.
UTIL - Static variable in class asteroid.A
Entry point to get util functions
Utils - Class in asteroid
This class gathers together a bunch of util functions to deal with AST transformations.
Utils() - Constructor for class asteroid.Utils
 

V

valueOf(String) - Static method in enum asteroid.Local.TO
Returns the enum constant of this type with the specified name.
values() - Static method in enum asteroid.Local.TO
Returns an array containing the constants of this enum type, in the order they are declared.
varDeclarationX(String, ClassNode, Expression) - Static method in class asteroid.Expressions
Creates a variable definition expression.
varDeclarationX(String, Class, Expression) - Static method in class asteroid.Expressions
Creates a variable definition expression.
varX(String) - Static method in class asteroid.Expressions
Creates a reference to a given variable Creates a method call expression

AST
varX(String, ClassNode) - Static method in class asteroid.Expressions
Creates a reference to a given variable Creates a method call expression

AST
visit(ASTNode[], SourceUnit) - Method in class asteroid.AbstractGlobalTransformation
visit(ASTNode[], SourceUnit) - Method in class asteroid.AbstractLocalTransformation
visit(ASTNode[], SourceUnit) - Method in class asteroid.internal.LocalTransformation
visitClass(ClassNode) - Method in class asteroid.transformer.AbstractClassNodeTransformer
This function has to be implemented in order the transformation to traverse every ClassNode in the AST
visitClass(ClassNode) - Method in interface asteroid.transformer.Transformer
This function has to be implemented in order the transformation to traverse every ClassNode in the AST
visitMethod(MethodNode) - Method in class asteroid.transformer.AbstractMethodNodeTransformer
visitStatement(Statement) - Method in class asteroid.transformer.AbstractStatementTransformer

W

whileS(BooleanExpression, Statement) - Static method in class asteroid.Statements
Represents a while statement.
A B C D E F G H I L M N O P R S T U V W 
Skip navigation links