|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.transjvm.Statement
public abstract class Statement
Statements are the basic building blocks of JVM code
Field Summary | |
---|---|
static Statement |
RETURN_VOID
Return statement for methods of type VOID. |
static Statement |
SKIP
The "No operation" statement. |
Constructor Summary | |
---|---|
Statement()
|
Method Summary | |
---|---|
static Statement |
_goto(Label target)
Returns a statement that jumps to the Label target . |
static Statement |
_if(Expression cond,
Statement stmt)
Returns a Statement conditionally executing stmt. |
static Statement |
_if(Expression cond,
Statement _true,
Statement _false)
Returns a Statement conditionally executing either _true or _false. |
static Statement |
_return(Expression ret)
Returns a Statement which returns Expression ret from the current method. |
static Statement |
_switch(Expression value,
Case[] cases,
Label _default)
Returns a Statement branches to whichever Case matches value, _default otherwise. |
static Statement |
_switch(Expression value,
Case[] cases,
Label _default,
float density)
Returns a Statement branches to whichever Case matches value, _default otherwise. |
static Statement |
_throw(Expression throwable)
Returns a Statement throwing Expression throwable . |
static Statement |
always(Statement body,
Statement epilogue,
Variable errorStore)
Returns a Statement which executes body , followed by epilogue . |
static Statement |
callSuper(ConstructorID initID,
Expression... arguments)
Returns a statement which calls the super-class constructor with arguments. |
Statement |
concat(Statement other)
Returns a new Statement which executes this followed by other . |
static Statement |
defaultCallSuper(TypeID superClass)
Returns a statement which calls the super-class constructor with no arguments. |
static Statement |
delegate(TypeID[] params,
TypeID retType,
boolean isStatic,
MethodID proxyID)
|
static Statement |
guarded(Statement body,
Variable errorValue,
Handler... handlers)
Returns a Statement which executes body , handling exceptions which may occur. |
Statement |
line(int line)
Returns the same statement, but with the line number attached for debugging. |
static Statement |
list(java.util.List<Statement> list)
Returns a Statement representing a list of statements, to be executed sequentially. |
static Statement |
list(Statement... list)
Returns a Statement representing a list of statements, to be executed sequentially. |
abstract void |
write(InstructionStream stream)
Writes this Statement to the stream |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Statement SKIP
public static final Statement RETURN_VOID
Constructor Detail |
---|
public Statement()
Method Detail |
---|
public static Statement _switch(Expression value, Case[] cases, Label _default)
value
- The expression which determines which way to branch. Must be of type INT32.cases
- Possible branch targets._default
- The default target.public static Statement _switch(Expression value, Case[] cases, Label _default, float density)
value
- The expression which determines which way to branch. Must be of type INT32.cases
- Possible branch targets._default
- The default target.density
- The minimum density for array access, otherwise hash access.public static Statement guarded(Statement body, Variable errorValue, Handler... handlers)
body
, handling exceptions which may occur.
body
- The body of code to be executed.handlers
- The handlers guarding body
.errorValue
- The variable into which the throwable is to be stored.public static Statement always(Statement body, Statement epilogue, Variable errorStore)
body
, followed by epilogue
.
epilogue
is executed after body
whether, or not, an exception
is thrown. However if code in body
branches elsewhere, epilogue
will not be executed.
body
- The body of code to be executed.epilogue
- Code guaranteed to be executed whether or not an exeception occurs.errorStore
- The variable into which to store any throwable thrown during body
, whilst always
is executing.public static Statement _if(Expression cond, Statement _true, Statement _false)
cond
- The condition, must be of type BOOLEAN._true
- The statement executed if cond is true
._false
- The statement executed if cond is false
.public static Statement _throw(Expression throwable)
throwable
.
throwable
- Expression throwable must be a Throwable.public static Statement defaultCallSuper(TypeID superClass)
superClass
- The super-class.public static Statement callSuper(ConstructorID initID, Expression... arguments)
initID
- The super-class constructor.arguments
- The arguments to pass to the super-class constructor.public static Statement _goto(Label target)
target
.
target
- The target of the goto
statement.public static Statement _if(Expression cond, Statement stmt)
cond
- The condition, must be of type BOOLEAN.stmt
- The statement executed if cond is true
.public static Statement _return(Expression ret)
ret
from the current method.
ret
- The expression to be returned. Type must match the return type of the enclosing method.public final Statement concat(Statement other)
this
followed by other
.
other
- The statement to be executed after this
.
this
followed by other
.public final Statement line(int line)
public static final Statement list(java.util.List<Statement> list)
public static final Statement list(Statement... list)
java.lang.IllegalArgumentException
- if any member of list is not a Statement.public abstract void write(InstructionStream stream)
stream
- The InstructionStream
to write to.public static Statement delegate(TypeID[] params, TypeID retType, boolean isStatic, MethodID proxyID)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |