parse function name, args while building scope tree