symbol table creation and some type checking