orc.trace
Class DerivedTracer.DerivedTokenTracer

java.lang.Object
  extended by orc.trace.DerivedTracer.DerivedTokenTracer
All Implemented Interfaces:
Locatable, Located, TokenTracer
Enclosing class:
DerivedTracer

protected abstract class DerivedTracer.DerivedTokenTracer
extends java.lang.Object
implements TokenTracer


Nested Class Summary
 
Nested classes/interfaces inherited from interface orc.trace.TokenTracer
TokenTracer.BeforeTrace, TokenTracer.PullTrace, TokenTracer.StoreTrace
 
Field Summary
protected  TokenTracer tracer
           
 
Constructor Summary
DerivedTracer.DerivedTokenTracer(TokenTracer tracer)
           
 
Method Summary
 void after(TokenTracer.BeforeTrace before)
          Indicate that the right side of a semicolon combinator is continuing.
 TokenTracer.BeforeTrace before()
          Leaving the left side of a semicolon combinator.
 void block(TokenTracer.PullTrace pull)
          Block a thread waiting for a future.
 void choke(TokenTracer.StoreTrace store)
          Killed through the setting of a future.
 void die()
          Terminate a thread.
 void enter(Closure closure)
          Enter a closure.
 void error(TokenException error)
          Report an error.
 TokenTracer fork()
          Create a new thread.
 SourceLocation getSourceLocation()
           
 void leave(int depth)
          Leave "depth" closures EXPERIMENTAL
 void print(java.lang.String value, boolean newline)
          Print to stdout.
 void publish(java.lang.Object value)
          Publish a value from the program.
 TokenTracer.PullTrace pull()
          Create a new future for a pull.
 void receive(java.lang.Object value)
          Return from a site call.
 void send(java.lang.Object site, java.lang.Object[] arguments)
          Call a site.
 void setSourceLocation(SourceLocation location)
           
 TokenTracer.StoreTrace store(TokenTracer.PullTrace event, java.lang.Object value)
          Store a value for a future.
 void unblock(TokenTracer.StoreTrace store)
          Receive a future we were waiting for.
 void useStored(TokenTracer.StoreTrace storeTrace)
          Called when a token reads a value from a group cell which has already been stored.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tracer

protected TokenTracer tracer
Constructor Detail

DerivedTracer.DerivedTokenTracer

public DerivedTracer.DerivedTokenTracer(TokenTracer tracer)
Method Detail

after

public void after(TokenTracer.BeforeTrace before)
Description copied from interface: TokenTracer
Indicate that the right side of a semicolon combinator is continuing.

Specified by:
after in interface TokenTracer
Parameters:
before - the BeforeEvent which triggered this event

before

public TokenTracer.BeforeTrace before()
Description copied from interface: TokenTracer
Leaving the left side of a semicolon combinator. If the thread is "leaving" because it is dying, this will be followed by a TokenTracer.die(); otherwise it may be followed by any number of events which happen outside the scope of the semicolon.

Specified by:
before in interface TokenTracer
Returns:
a tag which you can pass to TokenTracer.after(BeforeTrace).

block

public void block(TokenTracer.PullTrace pull)
Description copied from interface: TokenTracer
Block a thread waiting for a future.

Specified by:
block in interface TokenTracer

choke

public void choke(TokenTracer.StoreTrace store)
Description copied from interface: TokenTracer
Killed through the setting of a future. Should be followed by TokenTracer.die().

Specified by:
choke in interface TokenTracer

die

public void die()
Description copied from interface: TokenTracer
Terminate a thread.

Specified by:
die in interface TokenTracer

enter

public void enter(Closure closure)
Description copied from interface: TokenTracer
Enter a closure. EXPERIMENTAL

Specified by:
enter in interface TokenTracer

leave

public void leave(int depth)
Description copied from interface: TokenTracer
Leave "depth" closures EXPERIMENTAL

Specified by:
leave in interface TokenTracer

error

public void error(TokenException error)
Description copied from interface: TokenTracer
Report an error. Should be followed by TokenTracer.die().

Specified by:
error in interface TokenTracer

fork

public TokenTracer fork()
Description copied from interface: TokenTracer
Create a new thread. By convention the new thread should evaluate the right side of the combinator.

Specified by:
fork in interface TokenTracer

getSourceLocation

public SourceLocation getSourceLocation()
Specified by:
getSourceLocation in interface Located

print

public void print(java.lang.String value,
                  boolean newline)
Description copied from interface: TokenTracer
Print to stdout.

Specified by:
print in interface TokenTracer

publish

public void publish(java.lang.Object value)
Description copied from interface: TokenTracer
Publish a value from the program. Should be followed by TokenTracer.die().

Specified by:
publish in interface TokenTracer

pull

public TokenTracer.PullTrace pull()
Description copied from interface: TokenTracer
Create a new future for a pull. Should be followed by TokenTracer.fork().

Specified by:
pull in interface TokenTracer

receive

public void receive(java.lang.Object value)
Description copied from interface: TokenTracer
Return from a site call. Should be called after TokenTracer.send(Object, Object[]).

Specified by:
receive in interface TokenTracer

send

public void send(java.lang.Object site,
                 java.lang.Object[] arguments)
Description copied from interface: TokenTracer
Call a site.

Specified by:
send in interface TokenTracer

setSourceLocation

public void setSourceLocation(SourceLocation location)
Specified by:
setSourceLocation in interface Locatable

store

public TokenTracer.StoreTrace store(TokenTracer.PullTrace event,
                                    java.lang.Object value)
Description copied from interface: TokenTracer
Store a value for a future. The return value should be used when tracing the results of this store. If this returns null, clients are free to not call TokenTracer.choke(StoreTrace).

The engine guarantees that all TokenTracer.choke(orc.trace.TokenTracer.StoreTrace) and TokenTracer.unblock(orc.trace.TokenTracer.StoreTrace) events will occur before the TokenTracer.die() event for this tracer.

Specified by:
store in interface TokenTracer
See Also:
TokenTracer.choke(orc.trace.TokenTracer.StoreTrace), TokenTracer.unblock(orc.trace.TokenTracer.StoreTrace)

unblock

public void unblock(TokenTracer.StoreTrace store)
Description copied from interface: TokenTracer
Receive a future we were waiting for.

Specified by:
unblock in interface TokenTracer

useStored

public void useStored(TokenTracer.StoreTrace storeTrace)
Description copied from interface: TokenTracer
Called when a token reads a value from a group cell which has already been stored.

Specified by:
useStored in interface TokenTracer
Parameters:
storeTrace - the trace produced when TokenTracer.store(orc.trace.TokenTracer.PullTrace, Object) was called