Top Description Fields Constructors Methods
org.codehaus.groovy.classgen.asm

public abstract Class BinaryExpressionWriter

extends Object
Class Inheritance
Known Direct Subclasses
org.codehaus.groovy.classgen.asm.BinaryFloatExpressionHelper, org.codehaus.groovy.classgen.asm.BinaryIntExpressionHelper, org.codehaus.groovy.classgen.asm.BinaryLongExpressionHelper, org.codehaus.groovy.classgen.asm.BinaryObjectExpressionHelper
Imports
org.codehaus.groovy.ast.ClassHelper, .ClassNode, org.objectweb.asm.Label, .MethodVisitor

Base class for writing primitive typed operations

Field Summary

Modifier and TypeField and Description
private MethodCaller
private MethodCaller
private final WriterController
protected static final int[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
arrayGet(int operation, boolean simulate)

public boolean
arraySet(boolean simulate)

protected abstract void
protected MethodCaller
protected ClassNode
protected MethodCaller
protected abstract int
protected abstract int
public WriterController
getController()

return writer controller

protected abstract ClassNode
protected abstract ClassNode
protected abstract int
protected abstract int
protected abstract void
public void
protected boolean
public boolean
write(int operation, boolean simulate)

protected boolean

Returns:

true if a successful bitwise operation write
writeBitwiseOp
(int
the token type
type
,
boolean simulate)

writes some the bitwise operations.

protected boolean
writeDivision(boolean simulate)

protected abstract void
protected abstract void
public boolean
writePostOrPrefixMethod(int operation, boolean simulate)

protected boolean

Returns:

true on a successful shift operation write
writeShiftOp
(int
the token type
type
,
boolean simulate)

Write shifting operations.

protected boolean
writeSpaceship(int type, boolean simulate)

protected boolean

Returns:

true if a successful std operator write
writeStdCompare
(int
the token type
type
,
boolean simulate)

writes some int standard operations for compares

protected boolean
writeStdOperators(int type, boolean simulate)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

arrayGetback to summary
private MethodCaller arrayGet
arraySetback to summary
private MethodCaller arraySet
controllerback to summary
private final WriterController controller
stdCompareCodesback to summary
protected static final int[] stdCompareCodes

Constructor Detail

BinaryExpressionWriterback to summary
public BinaryExpressionWriter(WriterController controller, MethodCaller arraySet, MethodCaller arrayGet)

Method Detail

arrayGetback to summary
public boolean arrayGet(int operation, boolean simulate)
arraySetback to summary
public boolean arraySet(boolean simulate)
doubleTwoOperandsback to summary
protected abstract void doubleTwoOperands(MethodVisitor mv)
getArrayGetCallerback to summary
protected MethodCaller getArrayGetCaller()
getArrayGetResultTypeback to summary
protected ClassNode getArrayGetResultType()
getArraySetCallerback to summary
protected MethodCaller getArraySetCaller()
getBitwiseOperationBytecodeback to summary
protected abstract int getBitwiseOperationBytecode(int type)
getCompareCodeback to summary
protected abstract int getCompareCode()
getControllerback to summary
public WriterController getController()

return writer controller

Since
2.5.0
getDevisionOpResultTypeback to summary
protected abstract ClassNode getDevisionOpResultType()
getNormalOpResultTypeback to summary
protected abstract ClassNode getNormalOpResultType()
getShiftOperationBytecodeback to summary
protected abstract int getShiftOperationBytecode(int type)
getStandardOperationBytecodeback to summary
protected abstract int getStandardOperationBytecode(int type)
removeTwoOperandsback to summary
protected abstract void removeTwoOperands(MethodVisitor mv)
setArraySetAndGetback to summary
public void setArraySetAndGet(MethodCaller arraySet, MethodCaller arrayGet)
supportsDivisionback to summary
protected boolean supportsDivision()
writeback to summary
public boolean write(int operation, boolean simulate)
writeBitwiseOpback to summary
protected boolean writeBitwiseOp(int type, boolean simulate)

writes some the bitwise operations. type is one of BITWISE_OR, BITWISE_AND, BITWISE_XOR

Parameters
type:int

the token type

Returns:boolean

true if a successful bitwise operation write

writeDivisionback to summary
protected boolean writeDivision(boolean simulate)
writeMinusMinusback to summary
protected abstract void writeMinusMinus(MethodVisitor mv)
writePlusPlusback to summary
protected abstract void writePlusPlus(MethodVisitor mv)
writePostOrPrefixMethodback to summary
public boolean writePostOrPrefixMethod(int operation, boolean simulate)
writeShiftOpback to summary
protected boolean writeShiftOp(int type, boolean simulate)

Write shifting operations. Type is one of LEFT_SHIFT, RIGHT_SHIFT, or RIGHT_SHIFT_UNSIGNED

Parameters
type:int

the token type

Returns:boolean

true on a successful shift operation write

writeSpaceshipback to summary
protected boolean writeSpaceship(int type, boolean simulate)
writeStdCompareback to summary
protected boolean writeStdCompare(int type, boolean simulate)

writes some int standard operations for compares

Parameters
type:int

the token type

Returns:boolean

true if a successful std operator write

writeStdOperatorsback to summary
protected boolean writeStdOperators(int type, boolean simulate)