𝔖 Bobbio Scriptorium
✦   LIBER   ✦

GOTO Removal Based on Regular Expressions

✍ Scribed by MORRIS, PAUL H.; GRAY, RONALD A.; FILMAN, ROBERT E.


Publisher
John Wiley and Sons
Year
1997
Tongue
English
Weight
241 KB
Volume
9
Category
Article
ISSN
1040-550X

No coin nor oath required. For personal study only.

✦ Synopsis


We present an algorithm for eliminating GOTOs and replacing them with structured IF-THEN-ELSE and loop constructs. Previous approaches have treated GOTO removal as an isolated problem for programming languages. In this paper, we describe a way of reducing GOTO removal to the well-understood problem of converting a finite-state transition network to a regular expression. A semantics is provided showing how the regular expression form may be interpreted as a non-deterministic program. A set of pattern-based reduction rules is used to transform the regular expression form back to a conventional structured program. Besides achieving greater conceptual unity, the method leads to a simpler algorithm where the task of recognizing loop boundaries is separated from that of identifying loop exits. We have successfully applied the algorithm in systems for re-engineering COBOL/IMS database systems and assembly language code.


πŸ“œ SIMILAR VOLUMES