updated semantic analyzer and fixed typo

changed the method name for the new visitor and added code to the
sematic analyzer to make use of the new visitor