private void associateVariablesWithBlocks ( ) { int varRefNo = 0 ; int activeBlockNo = 0 ; int nextBlockNo = 1 ; while ( varRefNo < varRefTabCnt ) { VarRefTabRec vrtr = varRefTab [ varRefNo ] ; int varRefTPos = vrtr . tPosBegin ; int varNo = vrtr . varNo ; if ( varRefTPos >= blockTab [ activeBlockNo ] . tPosEnd ) { activeBlockNo = blockTab [ activeBlockNo ] . parentBlockNo ; continue ; } if ( nextBlockNo < blockTabCnt && varRefTPos >= blockTab [ nextBlockNo ] . tPosBegin ) { activeBlockNo = nextBlockNo ; nextBlockNo ++ ; continue ; } BlockTabRec btr = blockTab [ activeBlockNo ] ; if ( varRefTPos < btr . tPosBegin ) { throw new AssertionError ( ) ; } int blockVarNo = btr . blockVarCnt ++ ; if ( btr . blockVarCnt > btr . blockVarNoToVarNoMap . length ) { btr . blockVarNoToVarNoMap = ( int [ ] ) resizeArray ( btr . blockVarNoToVarNoMap , 2 * btr . blockVarCnt ) ; } btr . blockVarNoToVarNoMap [ blockVarNo ] = varNo ; if ( btr . firstVarRefNo == - 1 ) { btr . firstVarRefNo = varRefNo ; } vrtr . blockNo = activeBlockNo ; vrtr . blockVarNo = blockVarNo ; varRefNo ++ ; } }
Associates variable references with blocks .