The Meta-Environment API

toolbus.process
Class Iteration

java.lang.Object
  extended by toolbus.process.ProcessExpression
      extended by toolbus.process.Iteration

public class Iteration
extends ProcessExpression

Iteration implements the process expression P1 * P2. The current implementation does not handle the following case correctly: if Test1 then P1 * if Test2 then A . B . C fi else ... fi Problem: Test1 will be attached to A, but the first iteration of P1 may have modified local variables in such a way that Test1 has become false. We solve this in TscriptParser by prefixing every iteration with an extra tau so the test is always executed in an unmodified environment. So the above example becomes: if Test1 then tau. P1 * if Test2 then A . B . C fi else ... fi and Test1 will be attached to tau (and is guaranteed to be still true when this branch is taken).


Field Summary
private  ProcessExpression left
           
private  ProcessExpression right
           
 
Fields inherited from class toolbus.process.ProcessExpression
posInfo, tbfactory
 
Constructor Summary
Iteration(ProcessExpression left, ProcessExpression right, TBTermFactory tbfactory, PositionInformation posInfo)
           
 
Method Summary
protected  void compile(ProcessInstance P, java.util.Stack<java.lang.String> calls, State follow)
           
protected  void computeFirst()
           
protected  ProcessExpression copy()
           
 AtomList getAtoms()
           
protected  void replaceFormals(Environment env)
           
 java.lang.String toString()
           
 
Methods inherited from class toolbus.process.ProcessExpression
addToFirst, addToFollow, getFirst, getFollow, getPosInfo, setFirst, setFollow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

left

private final ProcessExpression left

right

private final ProcessExpression right
Constructor Detail

Iteration

public Iteration(ProcessExpression left,
                 ProcessExpression right,
                 TBTermFactory tbfactory,
                 PositionInformation posInfo)
Method Detail

copy

protected ProcessExpression copy()
Specified by:
copy in class ProcessExpression

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

computeFirst

protected void computeFirst()
Specified by:
computeFirst in class ProcessExpression

compile

protected void compile(ProcessInstance P,
                       java.util.Stack<java.lang.String> calls,
                       State follow)
                throws ToolBusException
Specified by:
compile in class ProcessExpression
Throws:
ToolBusException

replaceFormals

protected void replaceFormals(Environment env)
                       throws ToolBusException
Specified by:
replaceFormals in class ProcessExpression
Throws:
ToolBusException

getAtoms

public AtomList getAtoms()
Specified by:
getAtoms in class ProcessExpression

The Meta-Environment API