|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.transjvm.Expression
net.sf.transjvm.Variable
public abstract class Variable
Variables represents storage locations in the JVM: locals, fields and array members.
They can be read, so extend Expression, but can be written to as well, using the
store and assign methods.
FieldID.variable(Expression owner),
FieldID.staticVariable(),
Frame.variable(TypeID type),
Frame.parameter(int index),
Frame._this(),
Expression.index(Expression index)| Field Summary |
|---|
| Fields inherited from class net.sf.transjvm.Expression |
|---|
FALSE, NULL, ONE, TRUE, ZERO |
| Method Summary | |
|---|---|
Expression |
assign(Expression value)
Returns the assignment expression this = value. |
abstract void |
assign(Expression value,
InstructionStream stream,
int depth)
Store value to this Variable and leave value on top of stack, returning stack height |
Statement |
increment(int incr)
Returns a statement which increments this by incr. |
Expression |
postIncrement()
Returns an expression which increments the variable by one as a side effect, and evaluates to the value of the variable after it has incremented. |
Expression |
preIncrement()
Returns an expression which evaluates to the same as this Variable, while incrementing the variable by one as a side effect. |
Statement |
store(Expression value)
Returns the assignment statement this = value. |
abstract void |
store(Expression value,
InstructionStream stream)
Store value to this Variable |
| Methods inherited from class net.sf.transjvm.Expression |
|---|
accept, bitwise, bitwiseNot, branch, branch, branch, cast, compare, conditional, constant, constant, constant, constant, constant, convert, emptyArray, eval, filledArray, getType, index, isInstanceOf, length, logicalNot, math, negate, not, shortCut, toStm |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public abstract void store(Expression value,
InstructionStream stream)
public abstract void assign(Expression value,
InstructionStream stream,
int depth)
public final Expression preIncrement()
public final Expression postIncrement()
public Statement store(Expression value)
this = value.
value - The value to be assigned.
value to this.public Statement increment(int incr)
incr - The amount to increment var by.public Expression assign(Expression value)
this = value.
Note that var.assign(value).toStm() is equivalent to var.store(value).
value - The value to be assigned.
value, but assigns value to this as a side effect.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||