Added semantic checks and code genereation v0.5