InputDecl Class Next: Event Based Instructions Up: Event Declarations Previous: IODecl Class

InputDecl Class

Class InputDecl  extends IODecl and define an input event.

public class InputDecl extends IODecl
  public InputDecl(String internalName,String externalName,
                                       Instruction body) 
    this.internalName = internalName; 
    this.externalName = externalName; 
    this.body = body;

  final public String toString(){ 
    return "input "+internalName+
           " is "+externalName+" in "+body+" end";

  final protected byte activation(Machine machine) 
    boolean present = machine.isGenerated(externalName);
    setInternal(machine);           // Set internal event
    if (present) machine.generate(internalName); // Transmit
    byte res = body.activ(machine); // Execute body
    saveInternal(machine);          // Save internal event
    return res;

OutputDecl  and InOutDecl  classes are very similar, and for simplicity we do not give their definitions here.