Inside the automaton, to output a piece of data to port
this.put(x)or to output a piece of data to port
this.put(x, n)
To remove the next available piece of data from port , and assign it to x
x = this.get()or to remove the next available piece of data from port
x = this.get(n)
Two attribute functions input and output can be used to send a piece of data to a port of an automaton, or receive a piece of data. They are used outside the definition of the automaton, i.e., in the surrounding scope of the automaton. For example,
A.input(x) // input data at port 1 A.input(x, 2) // input data at port 2 x = A.output() // output data at port 1 x = A.output(2) // output data at port 2
Example
u = automaton n = 0; while n == 0 n = this.get(); while n > 0 this.put(n); --n; stop; end end end
oz 2009-12-22