Generate code for 'if-else-if' construction