|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sleep.engine.Block
public class Block
A Block is the fundamental unit of parsed and ready to execute sleep code.
To execute a block of code:
ScriptInstance script; // asume Block code; // assume ScriptEnvironment env = script.getEnvironment(); Scalar value = SleepUtils.runCode(code, env);
The variable value would contain the return value after the block was executed. It is recommended blocks only be run using SleepUtils.runCode() as there is a little bit of synchronization and cleanup that has to be done prior to and after executing a block of code.
Scalar
,
ScriptEnvironment
,
ScriptInstance
,
Serialized FormField Summary | |
---|---|
protected Step |
first
our first step in this block |
protected Step |
last
our last step in this block |
protected java.lang.String |
source
an identifier/tag/whatever identifying the source of this block (i.e. |
Constructor Summary | |
---|---|
Block(java.lang.String _src)
|
Method Summary | |
---|---|
void |
add(Step n)
|
Scalar |
evaluate(ScriptEnvironment environment)
evaluates this block of code. |
Scalar |
evaluate(ScriptEnvironment environment,
Step start)
evaluates this block of code. |
int |
getApproximateLineNumber()
Returns an approximated line number for the steps in this block object... |
java.lang.String |
getApproximateLineRange()
Returns an approximate range of line numbers for the steps in this block object. |
int |
getHighLineNumber()
return the highest line number associated with this block |
int |
getLowLineNumber()
return the lowest line number associated with this block |
java.lang.String |
getSource()
Returns the source identifier for this block |
java.lang.String |
getSourceLocation()
Returns a string representation of where in the source code this block originated from |
java.lang.String |
toString()
Returns a string representation of the Abstract Syntax Tree (AST). |
java.lang.String |
toString(java.lang.String prefix)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Step first
protected Step last
protected java.lang.String source
Constructor Detail |
---|
public Block(java.lang.String _src)
Method Detail |
---|
public java.lang.String toString(java.lang.String prefix)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getSource()
public int getApproximateLineNumber()
public int getHighLineNumber()
public int getLowLineNumber()
public java.lang.String getApproximateLineRange()
public java.lang.String getSourceLocation()
public void add(Step n)
public Scalar evaluate(ScriptEnvironment environment)
public Scalar evaluate(ScriptEnvironment environment, Step start)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |