Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: $Revision: 1.6.2.16 $; site ima.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!ima!johnl From: johnl@ima.UUCP Newsgroups: net.lang Subject: Re: compiling nested conditionals Message-ID: <39700001@ima.UUCP> Date: Tue, 18-Jun-85 14:16:00 EDT Article-I.D.: ima.39700001 Posted: Tue Jun 18 14:16:00 1985 Date-Received: Fri, 21-Jun-85 01:19:24 EDT References: <328@sbcs.UUCP> Lines: 23 Nf-ID: #R:sbcs:-32800:ima:39700001:000:746 Nf-From: ima!johnl Jun 18 14:16:00 1985 > My solution has been to generate the label of the ultimate branch target > and pass it down during syntax-directed translation, so that goto-chains > are never generated. Both the Ritchie and PCC C compilers and their f77 and Pascal cousins use this approach for compliling complicated conditional expressions. As noted, it works very well. It's particularly useful for things like Ratfor output, since Ratfor tends to translate this: if (expression) stuff into this: if(.not.(expression)) goto 12345 stuff 12345 continue Even if the conditional expression is pretty complicated, the compilers unscramble them well enough that there is no evidence in the runtime code that the scrambling happened. John Levine, ima!johnl