The run method of the Program class implements recursive interpretation. When the program has been interpreted, that is, the run method has finished, results of the program execution are still in the variable table. As part of the execute method, the table is serialized and sent back to the client.
In our example, we can see6 the interaction diagram for a cat batch program in figure 5.
The run method of the Program calls the Run method of the ConcreteControlStructure representing the program (the WhileCtrlStruct in the interaction diagram). ControlStructures provide a Run method to interpret themselves. That is, a program has built-in its own interpreter; it is an instance of the INTERPRETER pattern . So, the While command calls the Run method of its inner component (SeqCtrlStruct in the interaction diagram for cat).