Add defined statements, initialize semaphores.