Finished (?) implementing semantic analyser