add symbol reference to some AST nodes and resolve builtin symbols