Added IR Classes, minor fixes too.

IR Classes instead of validateSemantics method.
Line number on error display also fixed.