Automated GOTO removal algorithm
问题 I've heard that it's been proven theoretically possible to express any control flow in a Turing-complete language using only structured programming constructs, (conditionals, loops and loop-breaks, and subroutine calls,) without any arbitrary GOTO statements. Is there any way to use that theory to automate refactoring of code that contains GOTO s into code that does not? Let's say I have an arbitrary single subroutine in a simple imperative language, such as C or Pascal. I also have a parser