Package org.codehaus.groovy.classgen.asm
Class UnaryExpressionHelper
java.lang.Object
org.codehaus.groovy.classgen.asm.UnaryExpressionHelper
- Direct Known Subclasses:
StaticTypesUnaryExpressionHelper
A helper class used to generate bytecode for unary expressions. AST transformations willing to use
a custom unary expression helper may set the
WriterControllerFactory node metadata on a
class node to provide a custom WriterController which would in turn use a custom expression
helper.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final WriterControllerThe controller coordinating all bytecode writers for the current class. -
Constructor Summary
ConstructorsConstructorDescriptionUnaryExpressionHelper(WriterController controller) Creates an unary expression helper with the given controller. -
Method Summary
Modifier and TypeMethodDescriptionvoidwriteBitwiseNegate(BitwiseNegationExpression expression) Generates bytecode for a bitwise negation expression.voidwriteNotExpression(NotExpression expression) Generates bytecode for a logical not expression.voidwriteUnaryMinus(UnaryMinusExpression expression) Generates bytecode for a unary minus expression.voidwriteUnaryPlus(UnaryPlusExpression expression) Generates bytecode for a unary plus expression.
-
Field Details
-
controller
The controller coordinating all bytecode writers for the current class.
-
-
Constructor Details
-
UnaryExpressionHelper
Creates an unary expression helper with the given controller.- Parameters:
controller- the writer controller
-
-
Method Details
-
writeUnaryPlus
Generates bytecode for a unary plus expression.- Parameters:
expression- the unary plus expression
-
writeUnaryMinus
Generates bytecode for a unary minus expression.- Parameters:
expression- the unary minus expression
-
writeBitwiseNegate
Generates bytecode for a bitwise negation expression.- Parameters:
expression- the bitwise negation expression
-
writeNotExpression
Generates bytecode for a logical not expression.- Parameters:
expression- the not expression
-