question: private void shiftMappingVectorTokensLeft ( int lineNum , int startCol , int shift ) { boolean lastWasBeginTLAToken = false ; int lastBeginTLATokCol = - 777 ; Vector line = ( Vector ) mappingVector . elementAt ( lineNum ) ; for ( int i = 0 ; i < line . size ( ) ; i ++ ) { MappingObject obj = ( MappingObject ) line . elementAt ( i ) ; if ( obj . getType ( ) == MappingObject . BEGIN_TLATOKEN ) { MappingObject . BeginTLAToken tobj = ( MappingObject . BeginTLAToken ) obj ; int col = tobj . getColumn ( ) ; if ( col >= startCol ) { tobj . setColumn ( col - shift ) ; } lastWasBeginTLAToken = true ; lastBeginTLATokCol = tobj . getColumn ( ) ; } else { if ( obj . getType ( ) == MappingObject . END_TLATOKEN ) { MappingObject . EndTLAToken tobj = ( MappingObject . EndTLAToken ) obj ; int col = tobj . getColumn ( ) ; if ( col >= startCol ) { tobj . setColumn ( col - shift ) ; } if ( lastWasBeginTLAToken && tobj . getColumn ( ) <= lastBeginTLATokCol ) { PcalDebug . ReportBug ( "PcalTLAGen.shiftMappingVectorTokensLeft created a null TLA Token" ) ; } } else if ( obj . getType ( ) == MappingObject . SOURCE_TOKEN ) { MappingObject . SourceToken tobj = ( MappingObject . SourceToken ) obj ; int col = tobj . getBeginColumn ( ) ; if ( col >= startCol ) { tobj . setBeginColumn ( col - shift ) ; } col = tobj . getEndColumn ( ) ; if ( col >= startCol ) { tobj . setEndColumn ( col - shift ) ; } lastWasBeginTLAToken = false ; } } } }
target:  Adjusts the objects in line lineNum of mappingVector so all column numbers starting with startCol are decreased by `shift'.  If any Begin/EndTLAToken pairs are changed to have a non-positive width, a bug is reported. Note: It is assumed that there is no aliasing of MappingTokens in mappingVector. That is, other than in transient local variables, the only pointer to a MappingToken in mappingVector is the single one in its line of mappingVector. I can't see how any aliasing of MappingTokens could arise. This method is called only by GenLabeledStmts.