|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorc.runtime.Token
public final class Token
Representation of an active thread of execution. Tokens move over the node graph as they are executed. They contain an environment, and may belong to a group. They also preserve the call chain and contain a value to be passed to the next token.
Nested Class Summary | |
---|---|
protected static class |
Token.Continuation
Return pointer for a function call. |
Field Summary | |
---|---|
protected boolean |
alive
|
protected Token.Continuation |
continuation
|
protected OrcEngine |
engine
|
protected Env<java.lang.Object> |
env
|
protected GroupCell |
group
|
protected SourceLocation |
location
The location of the token in the source code. |
protected Node |
node
|
protected Region |
region
|
protected java.lang.Object |
result
|
protected TokenTracer |
tracer
|
Constructor Summary | |
---|---|
|
Token(Node node,
Env<java.lang.Object> env,
GroupCell group,
Region region,
OrcEngine engine,
TokenTracer tracer)
|
protected |
Token(Node node,
Env<java.lang.Object> env,
Token.Continuation continuation,
GroupCell group,
Region region,
java.lang.Object result,
OrcEngine engine,
TokenTracer tracer)
Copy constructor |
Method Summary | |
---|---|
void |
activate()
|
Token |
bind(java.lang.Object f)
Push a new future onto the environment stack |
int |
compareTo(Token t)
|
void |
debug(java.lang.String s)
|
void |
die()
|
Token |
enterClosure(Node node,
Env<java.lang.Object> env,
Node next)
Enter a closure by moving to a new node and environment, and setting the continuation for leaveClosure() . |
void |
error(TokenException problem)
|
void |
finalize()
|
Token |
fork()
Fork a token. |
Token |
fork(GroupCell group,
Region region)
Fork a token with a specified group and region. |
OrcEngine |
getEngine()
|
Env<java.lang.Object> |
getEnvironment()
|
GroupCell |
getGroup()
|
Node |
getNode()
|
Region |
getRegion()
|
java.lang.Object |
getResult()
|
SourceLocation |
getSourceLocation()
|
TokenTracer |
getTracer()
|
Token |
leaveClosure()
Leave a closure by returning to the continuation set by enterClosure(Node, Env, Node) . |
java.lang.Object |
lookup(Arg var)
Lookup a variable in the environment |
Token |
move(Node node)
Move to a node node |
void |
print(java.lang.String string,
boolean newline)
Print something (for use by the print and println sites). |
void |
process()
If a token is alive, calls the node to perform the next action. |
void |
publish()
Publish a value to the top level. |
void |
requireCapability(java.lang.String name,
boolean ifNull)
|
void |
resume()
|
void |
resume(java.lang.Object object)
|
Token |
setEnv(Env<java.lang.Object> e)
|
Token |
setGroup(GroupCell group)
|
void |
setPending()
|
Token |
setRegion(Region region)
Migrate the token from one region to another. |
Token |
setResult(java.lang.Object result)
|
void |
setSourceLocation(SourceLocation location)
|
void |
unsetPending()
|
Token |
unwind(int width)
Pop values off of the environment stack. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Node node
protected Env<java.lang.Object> env
protected GroupCell group
protected Region region
protected OrcEngine engine
protected SourceLocation location
protected TokenTracer tracer
protected Token.Continuation continuation
protected java.lang.Object result
protected boolean alive
Constructor Detail |
---|
protected Token(Node node, Env<java.lang.Object> env, Token.Continuation continuation, GroupCell group, Region region, java.lang.Object result, OrcEngine engine, TokenTracer tracer)
public Token(Node node, Env<java.lang.Object> env, GroupCell group, Region region, OrcEngine engine, TokenTracer tracer)
Method Detail |
---|
public void die()
public void finalize()
finalize
in class java.lang.Object
public void process()
public Node getNode()
public GroupCell getGroup()
public Env<java.lang.Object> getEnvironment()
public java.lang.Object getResult()
public OrcEngine getEngine()
public Region getRegion()
public Token setResult(java.lang.Object result)
public Token setGroup(GroupCell group)
public Token setRegion(Region region)
public TokenTracer getTracer()
public Token setEnv(Env<java.lang.Object> e)
public Token move(Node node)
node
- the node to move to
public Token enterClosure(Node node, Env<java.lang.Object> env, Node next)
leaveClosure()
.
public Token leaveClosure()
enterClosure(Node, Env, Node)
.
public Token bind(java.lang.Object f)
f
- future to push
public Token unwind(int width)
width
- number of bindings to leave
public java.lang.Object lookup(Arg var)
var
- variable name
public int compareTo(Token t)
compareTo
in interface java.lang.Comparable<Token>
public void debug(java.lang.String s)
public void activate()
public void resume(java.lang.Object object)
public void resume()
public void error(TokenException problem)
public void print(java.lang.String string, boolean newline)
public void publish()
public Token fork()
fork(GroupCell, Region)
public Token fork(GroupCell group, Region region)
public void setSourceLocation(SourceLocation location)
setSourceLocation
in interface Locatable
public SourceLocation getSourceLocation()
getSourceLocation
in interface Located
public void setPending()
public void unsetPending()
public void requireCapability(java.lang.String name, boolean ifNull) throws CapabilityException
CapabilityException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |