parsing scopes and their children