org.erights.e.elang.interp
Interface ControlLoop

All Known Subinterfaces:
CmdLoop

public interface ControlLoop

Untamed:

Author:
Mark S. Miller
See Also:
org.erights.e.elang.comtrolLoopMakerAuthor

Method Summary
 void blockAtTop()
          Enabled: Called by an E program to stall the interpreter at the next top level expression, until continueAtTop or exitAtTop is called.
 void continueAtTop()
          Enabled: Allows an E interpreter that has been block(ed)AtTop to continue
 void exitAtTop()
          Enabled: optProblem defaults to null, indicating success.
 void exitAtTop(Throwable optProblem)
          Enabled: Causes the E interpreter to exit the next time it's between top-level expression evaluations.
 Object getFinalExitStatusVow()
          Enabled: Returns a vow which will resolve to the loop's final exit status, once it does exit.
 Object getNextExitStatus()
          Enabled:
 void waitAtTop(Object ref)
          Enabled: Blocks until ref is resolved, or until we are made to continue for other reasons.
 

Method Detail

blockAtTop

public void blockAtTop()
Enabled: Called by an E program to stall the interpreter at the next top level expression, until continueAtTop or exitAtTop is called.


continueAtTop

public void continueAtTop()
Enabled: Allows an E interpreter that has been block(ed)AtTop to continue


waitAtTop

public void waitAtTop(Object ref)
Enabled: Blocks until ref is resolved, or until we are made to continue for other reasons.


exitAtTop

public void exitAtTop()
Enabled: optProblem defaults to null, indicating success.


exitAtTop

public void exitAtTop(Throwable optProblem)
Enabled: Causes the E interpreter to exit the next time it's between top-level expression evaluations.

If optProblem is null, then this is a successful (even if premature) exit. Otherwise, it's an exceptional exit complaining of the problem. For the main interpreter, a normal exit exits with exitCode 0. An exceptional exit complains and exits with exitCode -1.

If block(ed)AtTop, an exitAtTop will happen immediately, rather than waiting for a continueAtTop.


getNextExitStatus

public Object getNextExitStatus()
Enabled:


getFinalExitStatusVow

public Object getFinalExitStatusVow()
Enabled: Returns a vow which will resolve to the loop's final exit status, once it does exit.

While this control loop is still running, the returned finalExitStatusVow will remain unresolved. Once this loop has exited, the vow will be resolved to true for success or a broken reference for failure.



comments?