Eliminating go to's while preserving program structure
Suppose we want to eliminate the local `go to' statements of a Pascal program by replacing them with multilevel loop `exit' statements. The standard ground rules for eliminating `go tos require that we preserve the flow graph of the program, but they allow us to completely rewrite the control structures that glue together the program's atomic tests and actions. The `go tos can be eliminated from a program under those ground rules if and only if the flow graph of that program has the graph- theoretic property named reducibility. This paper considers a stricter set of ground rules, introduced by \textit{W. W. Peterson}, \textit{T. Kasami}, and \textit{N. Tokura} [Commun. ACM 16, 503-512 (1973; Zbl 0279.68008)], which demand that we preserve the program's original control structures, as well as its flow graph, while we eliminate its `go tos. In particular, we are allowed to delete the `go to' statements and the labels that they jump to and to insert various `exit' statements and labeled `repeat endloop' pairs for them to jump out of. But we are forbidden to change the rest of the program text in any way. The critical issue that determines whether `go tos can be eliminated under these stricter rules turns out to be the static order of the atomic tests and actions in the program text. This static order can be encoded in the program's flow graph by augmenting it with extra edges. It can then be shown that the reducibility of a program's augmented flow graph, augmenting edges and all, is a necessary and sufficient condition for the eliminability of `go tos from that program under the stricter rules.
- Byte code level cross-compilation for developing web applications
- Automatically replacing indices into parallel arrays with pointers to records
- Program structures: Some new characterisations
- To use or not to use the goto statement: programming styles viewed from Hoare Logic
- Theoretical foundations of dynamic program slicing
- Jump Minimization in Linear Time
- The Böhm-Jacopini theorem is false, propositionally
- The Hierarchy of Program Control Structures
- scientific article; zbMATH DE number 3965407 (Why is no real title available?)
- scientific article; zbMATH DE number 3995021 (Why is no real title available?)
- Restructuring Pascal Programs Containing Goto Statements
- An optimal algorithm for purging regular hammocks
- A unifying theory of control dependence and its application to arbitrary program structures
- Formal aspects of structured programming with goto statements
- Goto elimination in program algebra
- Generalized structured programs and loop trees
This page was built for publication: Eliminating go to's while preserving program structure
Report a bug (only for logged in users!)Click here to report a bug for this page (MaRDI item Q3813271)