def generate_IR(self):
raw_api = []<EOL>for partial_ast in self._partial_asts:<EOL><INDENT>namespace_ast_node = self._extract_namespace_ast_node(partial_ast)<EOL>namespace = self.api.ensure_namespace(namespace_ast_node.name)<EOL>base_name = self._get_base_name(namespace.name, namespace.name)<EOL>self._item_by_canonical_name[base_name] = namespace_ast_node<EOL>if namespace_ast_node.doc is not None:<EOL><INDENT>namespace.add_doc(namespace_ast_node.doc)<EOL><DEDENT>raw_api.append((namespace, partial_ast))<EOL>self._add_data_types_and_routes_to_api(namespace, partial_ast)<EOL><DEDENT>self._add_imports_to_env(raw_api)<EOL>self._merge_patches()<EOL>self._populate_type_attributes()<EOL>self._populate_field_defaults()<EOL>self._populate_enumerated_subtypes()<EOL>self._populate_route_attributes()<EOL>self._populate_examples()<EOL>self._validate_doc_refs()<EOL>self._validate_annotations()<EOL>if self._routes is not None:<EOL><INDENT>self._filter_namespaces_by_route_whitelist()<EOL><DEDENT>self.api.normalize()<EOL>return self.api<EOL>
Parses the text of each spec and returns an API description. Returns
        None if an error was encountered during parsing.