public void swap(final Type prev,final Type type){
  if (type.getSize() == 1) {
    if (prev.getSize() == 1) {
      swap();
    }
 else {
      dupX2();
      pop();
    }
  }
 else {
    if (prev.getSize() == 1) {
      dup2X1();
      pop2();
    }
 else {
      dup2X2();
      pop2();
    }
  }
}

public void swap ( final Type prev , final Type type ) { if ( type . getSize ( ) == 1 ) { if ( prev . getSize ( ) == 1 ) { swap ( ) ; } else { dupX2 ( ) ; pop ( ) ; } } else { if ( prev . getSize ( ) == 1 ) { dup2X1 ( ) ; pop2 ( ) ; } else { dup2X2 ( ) ; pop2 ( ) ; } } }
generates the instructions to swap the top two stack values .
