changed architecture of javagen.ml

semantic_check.ml does not compile in last commit