Groovy 2.2.1

org.codehaus.groovy.transform.sc.transformers
[Java] Class StaticCompilationTransformer

java.lang.Object
  org.codehaus.groovy.ast.CodeVisitorSupport
      org.codehaus.groovy.ast.ClassCodeVisitorSupport
          org.codehaus.groovy.ast.ClassCodeExpressionTransformer
              org.codehaus.groovy.transform.sc.transformers.StaticCompilationTransformer

public class StaticCompilationTransformer
extends ClassCodeExpressionTransformer

Some expressions use symbols as aliases to method calls (<<, +=, ...). In static compilation, if such a method call is found, we transform the original binary expression into a method call expression so that the call gets statically compiled.

Authors:
Cedric Champeau


Field Summary
protected static ClassNode BYTECODE_ADAPTER_CLASS

protected static Map BYTECODE_BINARY_ADAPTERS

 
Constructor Summary
StaticCompilationTransformer(SourceUnit unit)

 
Method Summary
ClassNode getClassNode()

protected SourceUnit getSourceUnit()

StaticTypesTypeChooser getTypeChooser()

Expression transform(Expression expr)

void visitClass(ClassNode node)

void visitClassCodeContainer(Statement code)

 
Methods inherited from class ClassCodeExpressionTransformer
visitField, visitReturnStatement, visitProperty, visitDoWhileLoop, visitExpressionStatement, visitForLoop, visitSwitch, visitWhileLoop, visitAnnotations, visitIfElse, visitAssertStatement, visitCaseStatement, visitSynchronizedStatement, visitThrowStatement, transform, visitMethod, visitConstructor, visitClass, visitPackage, visitBlockStatement, visitDeclarationExpression, visitImports, visitBreakStatement, visitContinueStatement, visitTryCatchFinally, visitCatchStatement, visitClassExpression, visitPropertyExpression, visitListExpression, visitConstantExpression, visitMethodCallExpression, visitStaticMethodCallExpression, visitConstructorCallExpression, visitBinaryExpression, visitTernaryExpression, visitShortTernaryExpression, visitPostfixExpression, visitPrefixExpression, visitBooleanExpression, visitNotExpression, visitClosureExpression, visitTupleExpression, visitArrayExpression, visitMapExpression, visitMapEntryExpression, visitRangeExpression, visitSpreadExpression, visitSpreadMapExpression, visitMethodPointerExpression, visitUnaryMinusExpression, visitUnaryPlusExpression, visitBitwiseNegationExpression, visitCastExpression, visitVariableExpression, visitAttributeExpression, visitFieldExpression, visitGStringExpression, visitArgumentlistExpression, visitClosureListExpression, visitBytecodeExpression, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 
Methods inherited from class ClassCodeVisitorSupport
visitMethod, visitField, visitReturnStatement, visitProperty, visitConstructor, visitClass, visitPackage, visitBlockStatement, visitDoWhileLoop, visitExpressionStatement, visitForLoop, visitSwitch, visitWhileLoop, visitDeclarationExpression, visitImports, visitBreakStatement, visitContinueStatement, visitTryCatchFinally, visitAnnotations, visitCatchStatement, visitIfElse, visitAssertStatement, visitCaseStatement, visitSynchronizedStatement, visitThrowStatement, visitClassExpression, visitPropertyExpression, visitListExpression, visitConstantExpression, visitMethodCallExpression, visitStaticMethodCallExpression, visitConstructorCallExpression, visitBinaryExpression, visitTernaryExpression, visitShortTernaryExpression, visitPostfixExpression, visitPrefixExpression, visitBooleanExpression, visitNotExpression, visitClosureExpression, visitTupleExpression, visitArrayExpression, visitMapExpression, visitMapEntryExpression, visitRangeExpression, visitSpreadExpression, visitSpreadMapExpression, visitMethodPointerExpression, visitUnaryMinusExpression, visitUnaryPlusExpression, visitBitwiseNegationExpression, visitCastExpression, visitVariableExpression, visitAttributeExpression, visitFieldExpression, visitGStringExpression, visitArgumentlistExpression, visitClosureListExpression, visitBytecodeExpression, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Field Detail

BYTECODE_ADAPTER_CLASS

protected static final ClassNode BYTECODE_ADAPTER_CLASS


BYTECODE_BINARY_ADAPTERS

protected static final Map BYTECODE_BINARY_ADAPTERS


 
Constructor Detail

StaticCompilationTransformer

public StaticCompilationTransformer(SourceUnit unit)


 
Method Detail

getClassNode

public ClassNode getClassNode()


getSourceUnit

@Overrideprotected SourceUnit getSourceUnit() {
protected SourceUnit getSourceUnit()


getTypeChooser

public StaticTypesTypeChooser getTypeChooser()


transform

@Overridepublic Expression transform(Expression expr) {
public Expression transform(Expression expr)


visitClass

@Overridepublic void visitClass(final ClassNode node) {
public void visitClass(ClassNode node)


visitClassCodeContainer

@Overridepublic void visitClassCodeContainer(final Statement code) {
public void visitClassCodeContainer(Statement code)


 

Copyright &copy; 2003-2013 The Codehaus. All rights reserved.