get_globals_with_types_from_root function

Extract global variables with types from a parsed tree root