Added semantic analysis for variable lookup and array access