Class BinaryExpressionTransformer

java.lang.Object
org.codehaus.groovy.transform.sc.transformers.BinaryExpressionTransformer

public class BinaryExpressionTransformer extends Object
Rewrites binary expressions into forms that generate better static-compilation bytecode.
  • Constructor Details

    • BinaryExpressionTransformer

      public BinaryExpressionTransformer(StaticCompilationTransformer staticCompilationTransformer)
      Creates a binary-expression transformer backed by the owning static compilation transformer.
      Parameters:
      staticCompilationTransformer - the shared transformer context
  • Method Details

    • transformBinaryExpression

      public Expression transformBinaryExpression(BinaryExpression bin)
      Transforms a binary expression when a static-compilation-specific optimization applies.
      Parameters:
      bin - the binary expression to transform
      Returns:
      the optimized expression, or the regular transformed expression when no optimization applies