Many texts, especially in Chemistry and Biol-ogy,  describe complex processes.  To answer questions  about  such  processes  one  needs  to understand the interactions between the different entities and to track the state transition between the different stages of the process.   In this work, we tackle this problem by learning to generate corresponding code to a text that describes  a  chemical  reaction  process  and  a question that asks about the process outcome in  a  different  setup. We  define  a  domain-specific-language for such processes, and contribute to the community a unique dataset, curated  by  chemists,  of  process  texts,  simulation questions, and their corresponding codes. We  propose  a  reinforcement-learning  based approach  to  learn  to  generate  code  based  on texts  and  questions  optimizing  both  for  syntactic  code  similarity  and  the  semantic  run-time  similarity.