A.run()The sequence of commands in the body of the automaton will be executed from where it left off last time (or from the beginning of the body, if it's the first time the automaton is running), until a stop statement is reached, or until the end of the body. Usually the body of an automaton is inside a loop so that the end is never reached.
When the stop statement is reached, the execution of the automaton is suspended. The control of flow is returned to wherever the run command is issued. The values of all the local variables and parameters are retained and when the automaton is called a next time, it will start right after the stop statement that terminated the automaton last time.
It is also possible to use the keyword yield to transfer program control to another automaton. For example
global.u2=0; global.u1 = automaton for k = 1 : 5 this.put(k); yield global.u2; end end global.u2 = automaton while 1 k = this.get(); k * pi yield global.u1; end end u1 <-> u2; u1.run()Here the two automatons take turns to run, and yield to each other. They are called coroutines.