net.janino
Class Java.BinaryOperation
java.lang.Object
|
+--net.janino.Java.Located
|
+--net.janino.Java.Atom
|
+--net.janino.Java.Rvalue
|
+--net.janino.Java.BooleanRvalue
|
+--net.janino.Java.BinaryOperation
- All Implemented Interfaces:
- Java.Locatable
- Enclosing class:
- Java
- public static class Java.BinaryOperation
- extends Java.BooleanRvalue
Representation of all non-operand-modifying JavaTM binary
operations.
Operations with boolean result:
|| && == != < > <= >=
Operations with non-boolean result:
| ^ & * / % + - << >> >>>
Methods inherited from class net.janino.Java.Atom |
addConstantFloatInfo, addConstantIntegerInfo, addConstantStringInfo, allocateLocalVariable, compileError, createDummyCodeAttribute, getLocation, isType, newInserter, newOffset, newUnsetOffset, popInserter, pushInserter, restoreLocalVariables, saveLocalVariables, throwParseException, toLvalue, toLvalueOrCE, toLvalueOrPE, toRvalueOrCE, toRvalueOrPE, toType, toTypeOrCE, toTypeOrPE, write, writeBranch, writeByte, writeConstantClassInfo, writeConstantDoubleInfo, writeConstantFieldrefInfo, writeConstantFloatInfo, writeConstantIntegerInfo, writeConstantInterfaceMethodrefInfo, writeConstantLongInfo, writeConstantMethodrefInfo, writeConstantStringInfo, writeInt, writeOffset, writeOpcode, writeShort |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Java.BinaryOperation
public Java.BinaryOperation(Scanner.Location location,
Java.Rvalue lhs,
java.lang.String op,
Java.Rvalue rhs)
getType
public IClass getType()
throws Java.CompileException
- Overrides:
getType
in class Java.Atom
compileGet
public IClass compileGet()
throws Java.CompileException
- Description copied from class:
Java.Rvalue
- Generates code that determines the value of the
Java.Rvalue
and puts it on the operand stack. This method relies on that the
"context" of the Java.Rvalue
is on top of the operand stack
(see Java.Rvalue.compileContext()
).
- Overrides:
compileGet
in class Java.BooleanRvalue
- Following copied from class:
net.janino.Java.Rvalue
- Returns:
- The type of the
Java.Rvalue
compileBoolean
public void compileBoolean(ClassFile.CodeAttribute.Offset dst,
boolean orientation)
throws Java.CompileException
- Description copied from class:
Java.Rvalue
- Some
Java.Rvalue
s compile more efficiently when their value is the
condition for a branch.
Notice that if "this" is a constant, then either "dst" is never
branched to, or it is unconditionally branched to. "Unexamined code"
errors may result during bytecode validation.
- Overrides:
compileBoolean
in class Java.Rvalue
getConstantValue
public java.lang.Object getConstantValue()
throws Java.CompileException
- Description copied from class:
Java.Rvalue
- Attempts to evaluate as a constant expression.
Expression type | Return value type |
String | String |
byte | Byte |
short | Chort |
int | Integer |
boolean | Boolean |
char | Character |
float | Float |
long | Long |
double | Double |
null | Java.Rvalue.CONSTANT_VALUE_NULL |
- Overrides:
getConstantValue
in class Java.Rvalue