Conversion from proprietary satellite control script language

Paul Duffin pduffin at hursley.ibm.com
Tue Jun 20 12:20:36 EDT 2000


TJ Judson wrote:
> 
> I'm afraid my only other answer is to use a language that supports
> "goto", like Tcl.
> 

Tcl does not support goto.

I think that it should be possible to analyse all the possible paths
through your satellite scripting language so that you create a graph
of flow, in those cases where you see a goto you *simply* replace
it with something else which does the job.

e.g. Pseudo C code.

   if (x) {
     goto end;
   }

   if (y) {
	:
   }

end:
   if (z) {
	:
   }

Replace with

   _goto_end_ = 0;
   if (x) {
     _goto_end_ = 1;
   }

   if (_goto_end_) {
      if (y) {
	:
      }
   }

   if (z) {
	:
   }

However whatever process you use you will have to exhaustively test your
resulting scripts.



More information about the Python-list mailing list