Pseudo-code for a Pascal program
rewritten as a finite state machine
(the Pascal program has just been started by the server script and is passed
the client request)
- extract current state, list of breakpoints and value of
program variables from request sent by client viewer
- loop
- case CurrentState of
- State1: execute first instruction in main program; CurrentState=State2;
- ...
- StateN: execute n-th instruction in main program; CurrentState=...;
- end case
- if SingleStep or BreakPoint[CurrentState] then exit loop
- end loop
- embed current state and value of program variables in a URL
- output the state of the program in HTML syntax, with
Step and Continue buttons containing the URL just calculated.
- terminate.