Refactored semantic analysis\code generation to use visitor pattern with ast nodes