def get_dependencies_from_decl(decl, recursive=True):
result = []<EOL>if isinstance(decl, typedef.typedef_t) orisinstance(decl, variable.variable_t):<EOL><INDENT>return [dependency_info_t(decl, decl.decl_type)]<EOL><DEDENT>if isinstance(decl, namespace.namespace_t):<EOL><INDENT>if recursive:<EOL><INDENT>for d in decl.declarations:<EOL><INDENT>result.extend(get_dependencies_from_decl(d))<EOL><DEDENT><DEDENT>return result<EOL><DEDENT>if isinstance(decl, calldef.calldef_t):<EOL><INDENT>if decl.return_type:<EOL><INDENT>result.append(<EOL>dependency_info_t(decl, decl.return_type, hint="<STR_LIT>"))<EOL><DEDENT>for arg in decl.arguments:<EOL><INDENT>result.append(dependency_info_t(decl, arg.decl_type))<EOL><DEDENT>for exc in decl.exceptions:<EOL><INDENT>result.append(dependency_info_t(decl, exc, hint="<STR_LIT>"))<EOL><DEDENT>return result<EOL><DEDENT>if isinstance(decl, class_declaration.class_t):<EOL><INDENT>for base in decl.bases:<EOL><INDENT>result.append(<EOL>dependency_info_t(<EOL>decl,<EOL>base.related_class,<EOL>base.access_type,<EOL>"<STR_LIT>"))<EOL><DEDENT>if recursive:<EOL><INDENT>for access_type in class_declaration.ACCESS_TYPES.ALL:<EOL><INDENT>result.extend(<EOL>__find_out_member_dependencies(<EOL>decl.get_members(access_type), access_type))<EOL><DEDENT><DEDENT>return result<EOL><DEDENT>return result<EOL>
Returns the list of all types and declarations the declaration depends on.