Analyze the scope the declaration/definition reside in by backtracking to the root.
See Implementation
Analyze the scope the declaration/definition reside in by backtracking to the root.