include ratfor.def /************************************************************************ * docode - generate code for a do loop * * * * This code allows two forms of do loops. The first is the * * original type as defined by Kernighan. The second is to * * incorporate the stuff within parenthesis. * ************************************************************************/ subroutine docode(lab) integer labgen integer lab integer gettok character token(maxtoken) call outtab call outstr('DO ') lab=labgen(2) call outnum(lab) if(gettok(token) != LEXLPAREN) { #old style do call outstr(token) call eatup } else { #new style do for(i = gettok(token);i != LEXRPAREN;i = gettok(token)) if(i == LEXLPAREN) { #if a "(" then call putchr("(") # put back the "(" call balpar # and gather up balanced "()" } else call outstr(token) } call outdon return end