Added support for Cast Expressions and added condition for cast expression in getLoopDirections.
Added method for generating code for cast expressions.