def cache_nodes(gir_root, all_girs):
ns_node = gir_root.find('<STR_LIT>' % NS_MAP['<STR_LIT>'])<EOL>id_prefixes = ns_node.attrib['<STR_LIT>' % NS_MAP['<STR_LIT:c>']]<EOL>sym_prefixes = ns_node.attrib['<STR_LIT>' % NS_MAP['<STR_LIT:c>']]<EOL>id_key = '<STR_LIT>' % NS_MAP['<STR_LIT:c>']<EOL>for node in gir_root.xpath(<EOL>'<STR_LIT>',<EOL>namespaces=NS_MAP):<EOL><INDENT>make_translations (node.attrib[id_key], node)<EOL><DEDENT>id_type = c_ns('<STR_LIT:type>')<EOL>glib_type = glib_ns('<STR_LIT>')<EOL>class_tag = core_ns('<STR_LIT:class>')<EOL>callback_tag = core_ns('<STR_LIT>')<EOL>interface_tag = core_ns('<STR_LIT>')<EOL>for node in gir_root.xpath('<STR_LIT>',<EOL>namespaces=NS_MAP):<EOL><INDENT>try:<EOL><INDENT>name = node.attrib[id_type]<EOL><DEDENT>except KeyError:<EOL><INDENT>name = node.attrib[glib_type]<EOL><DEDENT>make_translations (name, node)<EOL>gi_name = '<STR_LIT:.>'.join(get_gi_name_components(node))<EOL>ALL_GI_TYPES[gi_name] = get_klass_name(node)<EOL>if node.tag in (class_tag, interface_tag):<EOL><INDENT>__update_hierarchies (ns_node.attrib.get('<STR_LIT:name>'), node, gi_name)<EOL>make_translations('<STR_LIT>' % (name, name), node)<EOL>__generate_smart_filters(id_prefixes, sym_prefixes, node)<EOL><DEDENT>elif node.tag in (callback_tag,):<EOL><INDENT>ALL_CALLBACK_TYPES.add(node.attrib[c_ns('<STR_LIT:type>')])<EOL><DEDENT><DEDENT>for field in gir_root.xpath('<STR_LIT>', namespaces=NS_MAP):<EOL><INDENT>unique_name = get_field_c_name(field)<EOL>make_translations(unique_name, field)<EOL><DEDENT>for node in gir_root.xpath(<EOL>'<STR_LIT>',<EOL>namespaces=NS_MAP):<EOL><INDENT>name = '<STR_LIT>' % (get_klass_name(node.getparent()),<EOL>node.attrib['<STR_LIT:name>'])<EOL>make_translations (name, node)<EOL><DEDENT>for node in gir_root.xpath(<EOL>'<STR_LIT>',<EOL>namespaces=NS_MAP):<EOL><INDENT>name = '<STR_LIT>' % (get_klass_name(node.getparent()),<EOL>node.attrib['<STR_LIT:name>'])<EOL>make_translations (name, node)<EOL><DEDENT>for node in gir_root.xpath(<EOL>'<STR_LIT>',<EOL>namespaces=NS_MAP):<EOL><INDENT>name = get_symbol_names(node)[<NUM_LIT:0>]<EOL>make_translations (name, node)<EOL><DEDENT>for inc in gir_root.findall('<STR_LIT>',<EOL>namespaces = NS_MAP):<EOL><INDENT>inc_name = inc.attrib["<STR_LIT:name>"]<EOL>inc_version = inc.attrib["<STR_LIT:version>"]<EOL>gir_file = __find_gir_file('<STR_LIT>' % (inc_name, inc_version), all_girs)<EOL>if not gir_file:<EOL><INDENT>warn('<STR_LIT>', "<STR_LIT>" %<EOL>(inc_name, inc_version))<EOL>continue<EOL><DEDENT>if gir_file in __PARSED_GIRS:<EOL><INDENT>continue<EOL><DEDENT>__PARSED_GIRS.add(gir_file)<EOL>inc_gir_root = etree.parse(gir_file).getroot()<EOL>cache_nodes(inc_gir_root, all_girs)<EOL><DEDENT>
Identify and store all the gir symbols the symbols we will document
may link to, or be typed with