/* symbolresolver.c generated by valac, the Vala compiler
 * generated from symbolresolver.vala, do not modify */

/* symbolresolver.vala
 *
 * Copyright (C) 2011  Florian Brosch
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Florian Brosch <flo.brosch@gmail.com>
 */

#include <glib.h>
#include <glib-object.h>
#include <valadoc.h>
#include <valagee.h>
#include <vala.h>


#define VALADOC_DRIVERS_TYPE_SYMBOL_RESOLVER (valadoc_drivers_symbol_resolver_get_type ())
#define VALADOC_DRIVERS_SYMBOL_RESOLVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALADOC_DRIVERS_TYPE_SYMBOL_RESOLVER, ValadocDriversSymbolResolver))
#define VALADOC_DRIVERS_SYMBOL_RESOLVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALADOC_DRIVERS_TYPE_SYMBOL_RESOLVER, ValadocDriversSymbolResolverClass))
#define VALADOC_DRIVERS_IS_SYMBOL_RESOLVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALADOC_DRIVERS_TYPE_SYMBOL_RESOLVER))
#define VALADOC_DRIVERS_IS_SYMBOL_RESOLVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALADOC_DRIVERS_TYPE_SYMBOL_RESOLVER))
#define VALADOC_DRIVERS_SYMBOL_RESOLVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALADOC_DRIVERS_TYPE_SYMBOL_RESOLVER, ValadocDriversSymbolResolverClass))

typedef struct _ValadocDriversSymbolResolver ValadocDriversSymbolResolver;
typedef struct _ValadocDriversSymbolResolverClass ValadocDriversSymbolResolverClass;
typedef struct _ValadocDriversSymbolResolverPrivate ValadocDriversSymbolResolverPrivate;
enum  {
	VALADOC_DRIVERS_SYMBOL_RESOLVER_0_PROPERTY,
	VALADOC_DRIVERS_SYMBOL_RESOLVER_NUM_PROPERTIES
};
static GParamSpec* valadoc_drivers_symbol_resolver_properties[VALADOC_DRIVERS_SYMBOL_RESOLVER_NUM_PROPERTIES];
#define _vala_map_unref0(var) ((var == NULL) ? NULL : (var = (vala_map_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _valadoc_api_tree_unref0(var) ((var == NULL) ? NULL : (var = (valadoc_api_tree_unref (var), NULL)))

#define VALADOC_DRIVERS_TYPE_TREE_BUILDER (valadoc_drivers_tree_builder_get_type ())
#define VALADOC_DRIVERS_TREE_BUILDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALADOC_DRIVERS_TYPE_TREE_BUILDER, ValadocDriversTreeBuilder))
#define VALADOC_DRIVERS_TREE_BUILDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALADOC_DRIVERS_TYPE_TREE_BUILDER, ValadocDriversTreeBuilderClass))
#define VALADOC_DRIVERS_IS_TREE_BUILDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALADOC_DRIVERS_TYPE_TREE_BUILDER))
#define VALADOC_DRIVERS_IS_TREE_BUILDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALADOC_DRIVERS_TYPE_TREE_BUILDER))
#define VALADOC_DRIVERS_TREE_BUILDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALADOC_DRIVERS_TYPE_TREE_BUILDER, ValadocDriversTreeBuilderClass))

typedef struct _ValadocDriversTreeBuilder ValadocDriversTreeBuilder;
typedef struct _ValadocDriversTreeBuilderClass ValadocDriversTreeBuilderClass;
#define _vala_code_node_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_node_unref (var), NULL)))
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
#define _vala_iterator_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterator_unref (var), NULL)))

#define VALADOC_API_TYPE_INITIALIZER_BUILDER (valadoc_api_initializer_builder_get_type ())
#define VALADOC_API_INITIALIZER_BUILDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALADOC_API_TYPE_INITIALIZER_BUILDER, ValadocApiInitializerBuilder))
#define VALADOC_API_INITIALIZER_BUILDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALADOC_API_TYPE_INITIALIZER_BUILDER, ValadocApiInitializerBuilderClass))
#define VALADOC_API_IS_INITIALIZER_BUILDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALADOC_API_TYPE_INITIALIZER_BUILDER))
#define VALADOC_API_IS_INITIALIZER_BUILDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALADOC_API_TYPE_INITIALIZER_BUILDER))
#define VALADOC_API_INITIALIZER_BUILDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALADOC_API_TYPE_INITIALIZER_BUILDER, ValadocApiInitializerBuilderClass))

typedef struct _ValadocApiInitializerBuilder ValadocApiInitializerBuilder;
typedef struct _ValadocApiInitializerBuilderClass ValadocApiInitializerBuilderClass;
#define _vala_code_visitor_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_visitor_unref (var), NULL)))
#define _valadoc_api_signature_builder_unref0(var) ((var == NULL) ? NULL : (var = (valadoc_api_signature_builder_unref (var), NULL)))

struct _ValadocDriversSymbolResolver {
	ValadocApiVisitor parent_instance;
	ValadocDriversSymbolResolverPrivate * priv;
};

struct _ValadocDriversSymbolResolverClass {
	ValadocApiVisitorClass parent_class;
};

struct _ValadocDriversSymbolResolverPrivate {
	ValaHashMap* symbol_map;
	ValadocApiClass* glib_error;
	ValadocApiTree* root;
};


static gpointer valadoc_drivers_symbol_resolver_parent_class = NULL;

GType valadoc_drivers_symbol_resolver_get_type (void) G_GNUC_CONST;
#define VALADOC_DRIVERS_SYMBOL_RESOLVER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VALADOC_DRIVERS_TYPE_SYMBOL_RESOLVER, ValadocDriversSymbolResolverPrivate))
GType valadoc_drivers_tree_builder_get_type (void) G_GNUC_CONST;
ValadocDriversSymbolResolver* valadoc_drivers_symbol_resolver_new (ValadocDriversTreeBuilder* builder);
ValadocDriversSymbolResolver* valadoc_drivers_symbol_resolver_construct (GType object_type, ValadocDriversTreeBuilder* builder);
ValaHashMap* valadoc_drivers_tree_builder_get_symbol_map (ValadocDriversTreeBuilder* self);
ValadocApiClass* valadoc_drivers_tree_builder_get_glib_error (ValadocDriversTreeBuilder* self);
ValadocApiSymbol* valadoc_drivers_symbol_resolver_resolve (ValadocDriversSymbolResolver* self, ValaSymbol* symbol);
static void valadoc_drivers_symbol_resolver_resolve_thrown_list (ValadocDriversSymbolResolver* self, ValadocApiSymbol* symbol, ValaList* types);
static void valadoc_drivers_symbol_resolver_resolve_array_type_references (ValadocDriversSymbolResolver* self, ValadocApiArray* ptr);
static void valadoc_drivers_symbol_resolver_resolve_pointer_type_references (ValadocDriversSymbolResolver* self, ValadocApiPointer* ptr);
static void valadoc_drivers_symbol_resolver_resolve_type_reference (ValadocDriversSymbolResolver* self, ValadocApiTypeReference* reference);
static void valadoc_drivers_symbol_resolver_real_visit_tree (ValadocApiVisitor* base, ValadocApiTree* item);
static void valadoc_drivers_symbol_resolver_real_visit_package (ValadocApiVisitor* base, ValadocApiPackage* item);
static void valadoc_drivers_symbol_resolver_real_visit_namespace (ValadocApiVisitor* base, ValadocApiNamespace* item);
static void valadoc_drivers_symbol_resolver_real_visit_interface (ValadocApiVisitor* base, ValadocApiInterface* item);
static void valadoc_drivers_symbol_resolver_real_visit_class (ValadocApiVisitor* base, ValadocApiClass* item);
static void valadoc_drivers_symbol_resolver_real_visit_struct (ValadocApiVisitor* base, ValadocApiStruct* item);
static void valadoc_drivers_symbol_resolver_real_visit_property (ValadocApiVisitor* base, ValadocApiProperty* item);
static void valadoc_drivers_symbol_resolver_real_visit_field (ValadocApiVisitor* base, ValadocApiField* item);
static void valadoc_drivers_symbol_resolver_real_visit_constant (ValadocApiVisitor* base, ValadocApiConstant* item);
static void valadoc_drivers_symbol_resolver_real_visit_delegate (ValadocApiVisitor* base, ValadocApiDelegate* item);
static void valadoc_drivers_symbol_resolver_real_visit_signal (ValadocApiVisitor* base, ValadocApiSignal* item);
static void valadoc_drivers_symbol_resolver_real_visit_method (ValadocApiVisitor* base, ValadocApiMethod* item);
static void valadoc_drivers_symbol_resolver_real_visit_type_parameter (ValadocApiVisitor* base, ValadocApiTypeParameter* item);
static void valadoc_drivers_symbol_resolver_real_visit_formal_parameter (ValadocApiVisitor* base, ValadocApiFormalParameter* item);
G_GNUC_INTERNAL GType valadoc_api_initializer_builder_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
G_GNUC_INTERNAL ValadocApiInitializerBuilder* valadoc_api_initializer_builder_new (ValadocApiSignatureBuilder* signature, ValaHashMap* symbol_map);
G_GNUC_INTERNAL ValadocApiInitializerBuilder* valadoc_api_initializer_builder_construct (GType object_type, ValadocApiSignatureBuilder* signature, ValaHashMap* symbol_map);
static void valadoc_drivers_symbol_resolver_real_visit_error_domain (ValadocApiVisitor* base, ValadocApiErrorDomain* item);
static void valadoc_drivers_symbol_resolver_real_visit_error_code (ValadocApiVisitor* base, ValadocApiErrorCode* item);
static void valadoc_drivers_symbol_resolver_real_visit_enum (ValadocApiVisitor* base, ValadocApiEnum* item);
static void valadoc_drivers_symbol_resolver_real_visit_enum_value (ValadocApiVisitor* base, ValadocApiEnumValue* item);
static void valadoc_drivers_symbol_resolver_finalize (GObject * obj);


ValadocDriversSymbolResolver* valadoc_drivers_symbol_resolver_construct (GType object_type, ValadocDriversTreeBuilder* builder) {
	ValadocDriversSymbolResolver * self = NULL;
	ValadocDriversTreeBuilder* _tmp0_;
	ValaHashMap* _tmp1_;
	ValadocDriversTreeBuilder* _tmp2_;
	ValadocApiClass* _tmp3_;
	g_return_val_if_fail (builder != NULL, NULL);
	self = (ValadocDriversSymbolResolver*) valadoc_api_visitor_construct (object_type);
	_tmp0_ = builder;
	_tmp1_ = valadoc_drivers_tree_builder_get_symbol_map (_tmp0_);
	_vala_map_unref0 (self->priv->symbol_map);
	self->priv->symbol_map = _tmp1_;
	_tmp2_ = builder;
	_tmp3_ = valadoc_drivers_tree_builder_get_glib_error (_tmp2_);
	_g_object_unref0 (self->priv->glib_error);
	self->priv->glib_error = _tmp3_;
	return self;
}


ValadocDriversSymbolResolver* valadoc_drivers_symbol_resolver_new (ValadocDriversTreeBuilder* builder) {
	return valadoc_drivers_symbol_resolver_construct (VALADOC_DRIVERS_TYPE_SYMBOL_RESOLVER, builder);
}


ValadocApiSymbol* valadoc_drivers_symbol_resolver_resolve (ValadocDriversSymbolResolver* self, ValaSymbol* symbol) {
	ValadocApiSymbol* result = NULL;
	ValaHashMap* _tmp0_;
	ValaSymbol* _tmp1_;
	gpointer _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (symbol != NULL, NULL);
	_tmp0_ = self->priv->symbol_map;
	_tmp1_ = symbol;
	_tmp2_ = vala_map_get ((ValaMap*) _tmp0_, _tmp1_);
	result = (ValadocApiSymbol*) _tmp2_;
	return result;
}


static gpointer _vala_iterable_ref0 (gpointer self) {
	return self ? vala_iterable_ref (self) : NULL;
}


static gpointer _vala_code_node_ref0 (gpointer self) {
	return self ? vala_code_node_ref (self) : NULL;
}


static void valadoc_drivers_symbol_resolver_resolve_thrown_list (ValadocDriversSymbolResolver* self, ValadocApiSymbol* symbol, ValaList* types) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (symbol != NULL);
	g_return_if_fail (types != NULL);
	{
		ValaList* _type_list = NULL;
		ValaList* _tmp0_;
		ValaList* _tmp1_;
		gint _type_size = 0;
		ValaList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _type_index = 0;
		_tmp0_ = types;
		_tmp1_ = _vala_iterable_ref0 (_tmp0_);
		_type_list = _tmp1_;
		_tmp2_ = _type_list;
		_tmp3_ = vala_collection_get_size ((ValaCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_type_size = _tmp4_;
		_type_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			gint _tmp7_;
			ValaDataType* type = NULL;
			ValaList* _tmp8_;
			gint _tmp9_;
			gpointer _tmp10_;
			ValaErrorDomain* vala_edom = NULL;
			ValaDataType* _tmp11_;
			ValaTypeSymbol* _tmp12_;
			ValaTypeSymbol* _tmp13_;
			ValaErrorDomain* _tmp14_;
			ValadocApiSymbol* edom = NULL;
			ValaHashMap* _tmp15_;
			ValaErrorDomain* _tmp16_;
			gpointer _tmp17_;
			ValadocApiSymbol* _tmp18_ = NULL;
			ValadocApiSymbol* _tmp19_;
			ValadocApiSymbol* _tmp21_;
			_tmp5_ = _type_index;
			_type_index = _tmp5_ + 1;
			_tmp6_ = _type_index;
			_tmp7_ = _type_size;
			if (!(_tmp6_ < _tmp7_)) {
				break;
			}
			_tmp8_ = _type_list;
			_tmp9_ = _type_index;
			_tmp10_ = vala_list_get (_tmp8_, _tmp9_);
			type = (ValaDataType*) _tmp10_;
			_tmp11_ = type;
			_tmp12_ = vala_data_type_get_data_type (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, VALA_TYPE_ERROR_DOMAIN, ValaErrorDomain));
			vala_edom = _tmp14_;
			_tmp15_ = self->priv->symbol_map;
			_tmp16_ = vala_edom;
			_tmp17_ = vala_map_get ((ValaMap*) _tmp15_, (ValaSymbol*) _tmp16_);
			edom = (ValadocApiSymbol*) _tmp17_;
			_tmp19_ = edom;
			_tmp18_ = _tmp19_;
			if (_tmp18_ == NULL) {
				ValadocApiClass* _tmp20_;
				_tmp20_ = self->priv->glib_error;
				_tmp18_ = (ValadocApiSymbol*) _tmp20_;
			}
			_tmp21_ = symbol;
			valadoc_api_node_add_child ((ValadocApiNode*) _tmp21_, _tmp18_);
			_g_object_unref0 (edom);
			_vala_code_node_unref0 (vala_edom);
			_vala_code_node_unref0 (type);
		}
		_vala_iterable_unref0 (_type_list);
	}
}


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


static void valadoc_drivers_symbol_resolver_resolve_array_type_references (ValadocDriversSymbolResolver* self, ValadocApiArray* ptr) {
	ValadocApiItem* data_type = NULL;
	ValadocApiArray* _tmp0_;
	ValadocApiItem* _tmp1_;
	ValadocApiItem* _tmp2_;
	ValadocApiItem* _tmp3_;
	ValadocApiItem* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (ptr != NULL);
	_tmp0_ = ptr;
	_tmp1_ = valadoc_api_array_get_data_type (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	data_type = _tmp3_;
	_tmp4_ = data_type;
	if (_tmp4_ == NULL) {
	} else {
		ValadocApiItem* _tmp5_;
		_tmp5_ = data_type;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, VALADOC_API_TYPE_ARRAY)) {
			ValadocApiItem* _tmp6_;
			_tmp6_ = data_type;
			valadoc_drivers_symbol_resolver_resolve_array_type_references (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, VALADOC_API_TYPE_ARRAY, ValadocApiArray));
		} else {
			ValadocApiItem* _tmp7_;
			_tmp7_ = data_type;
			if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, VALADOC_API_TYPE_POINTER)) {
				ValadocApiItem* _tmp8_;
				_tmp8_ = data_type;
				valadoc_drivers_symbol_resolver_resolve_pointer_type_references (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, VALADOC_API_TYPE_POINTER, ValadocApiPointer));
			} else {
				ValadocApiItem* _tmp9_;
				_tmp9_ = data_type;
				valadoc_drivers_symbol_resolver_resolve_type_reference (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, VALADOC_API_TYPE_TYPEREFERENCE, ValadocApiTypeReference));
			}
		}
	}
	_g_object_unref0 (data_type);
}


static void valadoc_drivers_symbol_resolver_resolve_pointer_type_references (ValadocDriversSymbolResolver* self, ValadocApiPointer* ptr) {
	ValadocApiItem* type = NULL;
	ValadocApiPointer* _tmp0_;
	ValadocApiItem* _tmp1_;
	ValadocApiItem* _tmp2_;
	ValadocApiItem* _tmp3_;
	ValadocApiItem* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (ptr != NULL);
	_tmp0_ = ptr;
	_tmp1_ = valadoc_api_pointer_get_data_type (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	type = _tmp3_;
	_tmp4_ = type;
	if (_tmp4_ == NULL) {
	} else {
		ValadocApiItem* _tmp5_;
		_tmp5_ = type;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, VALADOC_API_TYPE_ARRAY)) {
			ValadocApiItem* _tmp6_;
			_tmp6_ = type;
			valadoc_drivers_symbol_resolver_resolve_array_type_references (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, VALADOC_API_TYPE_ARRAY, ValadocApiArray));
		} else {
			ValadocApiItem* _tmp7_;
			_tmp7_ = type;
			if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, VALADOC_API_TYPE_POINTER)) {
				ValadocApiItem* _tmp8_;
				_tmp8_ = type;
				valadoc_drivers_symbol_resolver_resolve_pointer_type_references (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, VALADOC_API_TYPE_POINTER, ValadocApiPointer));
			} else {
				ValadocApiItem* _tmp9_;
				_tmp9_ = type;
				valadoc_drivers_symbol_resolver_resolve_type_reference (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, VALADOC_API_TYPE_TYPEREFERENCE, ValadocApiTypeReference));
			}
		}
	}
	_g_object_unref0 (type);
}


static void valadoc_drivers_symbol_resolver_resolve_type_reference (ValadocDriversSymbolResolver* self, ValadocApiTypeReference* reference) {
	ValaDataType* vtyperef = NULL;
	ValadocApiTypeReference* _tmp0_;
	void* _tmp1_;
	void* _tmp2_;
	ValaDataType* _tmp3_;
	ValaDataType* _tmp4_;
	ValadocApiTypeReference* _tmp49_;
	ValadocApiItem* _tmp50_;
	ValadocApiItem* _tmp51_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (reference != NULL);
	_tmp0_ = reference;
	_tmp1_ = valadoc_api_item_get_data ((ValadocApiItem*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, VALA_TYPE_DATA_TYPE, ValaDataType));
	vtyperef = _tmp3_;
	_tmp4_ = vtyperef;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, VALA_TYPE_ERROR_TYPE)) {
		ValaErrorDomain* verrdom = NULL;
		ValaDataType* _tmp5_;
		ValaErrorDomain* _tmp6_;
		ValaErrorDomain* _tmp7_;
		ValaErrorDomain* _tmp8_;
		ValaErrorDomain* _tmp9_;
		_tmp5_ = vtyperef;
		_tmp6_ = vala_error_type_get_error_domain (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, VALA_TYPE_ERROR_TYPE, ValaErrorType));
		_tmp7_ = _tmp6_;
		_tmp8_ = _vala_code_node_ref0 (_tmp7_);
		verrdom = _tmp8_;
		_tmp9_ = verrdom;
		if (_tmp9_ != NULL) {
			ValadocApiTypeReference* _tmp10_;
			ValaErrorDomain* _tmp11_;
			ValadocApiSymbol* _tmp12_;
			ValadocApiSymbol* _tmp13_;
			_tmp10_ = reference;
			_tmp11_ = verrdom;
			_tmp12_ = valadoc_drivers_symbol_resolver_resolve (self, (ValaSymbol*) _tmp11_);
			_tmp13_ = _tmp12_;
			valadoc_api_typereference_set_data_type (_tmp10_, (ValadocApiItem*) _tmp13_);
			_g_object_unref0 (_tmp13_);
		} else {
			ValadocApiTypeReference* _tmp14_;
			ValadocApiClass* _tmp15_;
			_tmp14_ = reference;
			_tmp15_ = self->priv->glib_error;
			valadoc_api_typereference_set_data_type (_tmp14_, (ValadocApiItem*) _tmp15_);
		}
		_vala_code_node_unref0 (verrdom);
	} else {
		ValaDataType* _tmp16_;
		_tmp16_ = vtyperef;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp16_, VALA_TYPE_DELEGATE_TYPE)) {
			ValadocApiTypeReference* _tmp17_;
			ValaDataType* _tmp18_;
			ValaDelegate* _tmp19_;
			ValaDelegate* _tmp20_;
			ValadocApiSymbol* _tmp21_;
			ValadocApiSymbol* _tmp22_;
			_tmp17_ = reference;
			_tmp18_ = vtyperef;
			_tmp19_ = vala_delegate_type_get_delegate_symbol (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, VALA_TYPE_DELEGATE_TYPE, ValaDelegateType));
			_tmp20_ = _tmp19_;
			_tmp21_ = valadoc_drivers_symbol_resolver_resolve (self, (ValaSymbol*) _tmp20_);
			_tmp22_ = _tmp21_;
			valadoc_api_typereference_set_data_type (_tmp17_, (ValadocApiItem*) _tmp22_);
			_g_object_unref0 (_tmp22_);
		} else {
			ValaDataType* _tmp23_;
			_tmp23_ = vtyperef;
			if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp23_, VALA_TYPE_GENERIC_TYPE)) {
				ValadocApiTypeReference* _tmp24_;
				ValaDataType* _tmp25_;
				ValaTypeParameter* _tmp26_;
				ValaTypeParameter* _tmp27_;
				ValadocApiSymbol* _tmp28_;
				ValadocApiSymbol* _tmp29_;
				_tmp24_ = reference;
				_tmp25_ = vtyperef;
				_tmp26_ = vala_data_type_get_type_parameter ((ValaDataType*) G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, VALA_TYPE_GENERIC_TYPE, ValaGenericType));
				_tmp27_ = _tmp26_;
				_tmp28_ = valadoc_drivers_symbol_resolver_resolve (self, (ValaSymbol*) _tmp27_);
				_tmp29_ = _tmp28_;
				valadoc_api_typereference_set_data_type (_tmp24_, (ValadocApiItem*) _tmp29_);
				_g_object_unref0 (_tmp29_);
			} else {
				ValaDataType* _tmp30_;
				ValaTypeSymbol* _tmp31_;
				ValaTypeSymbol* _tmp32_;
				_tmp30_ = vtyperef;
				_tmp31_ = vala_data_type_get_data_type (_tmp30_);
				_tmp32_ = _tmp31_;
				if (_tmp32_ != NULL) {
					ValadocApiTypeReference* _tmp33_;
					ValaDataType* _tmp34_;
					ValaTypeSymbol* _tmp35_;
					ValaTypeSymbol* _tmp36_;
					ValadocApiSymbol* _tmp37_;
					ValadocApiSymbol* _tmp38_;
					_tmp33_ = reference;
					_tmp34_ = vtyperef;
					_tmp35_ = vala_data_type_get_data_type (_tmp34_);
					_tmp36_ = _tmp35_;
					_tmp37_ = valadoc_drivers_symbol_resolver_resolve (self, (ValaSymbol*) _tmp36_);
					_tmp38_ = _tmp37_;
					valadoc_api_typereference_set_data_type (_tmp33_, (ValadocApiItem*) _tmp38_);
					_g_object_unref0 (_tmp38_);
				}
			}
		}
	}
	{
		ValaIterator* _type_param_ref_it = NULL;
		ValadocApiTypeReference* _tmp39_;
		ValaCollection* _tmp40_;
		ValaCollection* _tmp41_;
		ValaIterator* _tmp42_;
		ValaIterator* _tmp43_;
		_tmp39_ = reference;
		_tmp40_ = valadoc_api_typereference_get_type_arguments (_tmp39_);
		_tmp41_ = _tmp40_;
		_tmp42_ = vala_iterable_iterator ((ValaIterable*) _tmp41_);
		_tmp43_ = _tmp42_;
		_vala_iterable_unref0 (_tmp41_);
		_type_param_ref_it = _tmp43_;
		while (TRUE) {
			ValaIterator* _tmp44_;
			gboolean _tmp45_;
			ValadocApiTypeReference* type_param_ref = NULL;
			ValaIterator* _tmp46_;
			gpointer _tmp47_;
			ValadocApiTypeReference* _tmp48_;
			_tmp44_ = _type_param_ref_it;
			_tmp45_ = vala_iterator_next (_tmp44_);
			if (!_tmp45_) {
				break;
			}
			_tmp46_ = _type_param_ref_it;
			_tmp47_ = vala_iterator_get (_tmp46_);
			type_param_ref = (ValadocApiTypeReference*) _tmp47_;
			_tmp48_ = type_param_ref;
			valadoc_drivers_symbol_resolver_resolve_type_reference (self, _tmp48_);
			_g_object_unref0 (type_param_ref);
		}
		_vala_iterator_unref0 (_type_param_ref_it);
	}
	_tmp49_ = reference;
	_tmp50_ = valadoc_api_typereference_get_data_type (_tmp49_);
	_tmp51_ = _tmp50_;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp51_, VALADOC_API_TYPE_POINTER)) {
		ValadocApiTypeReference* _tmp52_;
		ValadocApiItem* _tmp53_;
		ValadocApiItem* _tmp54_;
		_tmp52_ = reference;
		_tmp53_ = valadoc_api_typereference_get_data_type (_tmp52_);
		_tmp54_ = _tmp53_;
		valadoc_drivers_symbol_resolver_resolve_pointer_type_references (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp54_, VALADOC_API_TYPE_POINTER, ValadocApiPointer));
	} else {
		ValadocApiTypeReference* _tmp55_;
		ValadocApiItem* _tmp56_;
		ValadocApiItem* _tmp57_;
		_tmp55_ = reference;
		_tmp56_ = valadoc_api_typereference_get_data_type (_tmp55_);
		_tmp57_ = _tmp56_;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp57_, VALADOC_API_TYPE_ARRAY)) {
			ValadocApiTypeReference* _tmp58_;
			ValadocApiItem* _tmp59_;
			ValadocApiItem* _tmp60_;
			_tmp58_ = reference;
			_tmp59_ = valadoc_api_typereference_get_data_type (_tmp58_);
			_tmp60_ = _tmp59_;
			valadoc_drivers_symbol_resolver_resolve_array_type_references (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp60_, VALADOC_API_TYPE_ARRAY, ValadocApiArray));
		}
	}
	_vala_code_node_unref0 (vtyperef);
}


/**
 * {@inheritDoc}
 */
static gpointer _valadoc_api_tree_ref0 (gpointer self) {
	return self ? valadoc_api_tree_ref (self) : NULL;
}


static void valadoc_drivers_symbol_resolver_real_visit_tree (ValadocApiVisitor* base, ValadocApiTree* item) {
	ValadocDriversSymbolResolver * self;
	ValadocApiTree* _tmp0_;
	ValadocApiTree* _tmp1_;
	ValadocApiTree* _tmp2_;
	self = (ValadocDriversSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = item;
	_tmp1_ = _valadoc_api_tree_ref0 (_tmp0_);
	_valadoc_api_tree_unref0 (self->priv->root);
	self->priv->root = _tmp1_;
	_tmp2_ = item;
	valadoc_api_tree_accept_children (_tmp2_, (ValadocApiVisitor*) self);
	_valadoc_api_tree_unref0 (self->priv->root);
	self->priv->root = NULL;
}


/**
 * {@inheritDoc}
 */
static void valadoc_drivers_symbol_resolver_real_visit_package (ValadocApiVisitor* base, ValadocApiPackage* item) {
	ValadocDriversSymbolResolver * self;
	ValadocApiPackage* _tmp0_;
	self = (ValadocDriversSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = item;
	valadoc_api_node_accept_all_children ((ValadocApiNode*) _tmp0_, (ValadocApiVisitor*) self, FALSE);
}


/**
 * {@inheritDoc}
 */
static void valadoc_drivers_symbol_resolver_real_visit_namespace (ValadocApiVisitor* base, ValadocApiNamespace* item) {
	ValadocDriversSymbolResolver * self;
	ValadocApiNamespace* _tmp0_;
	self = (ValadocDriversSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = item;
	valadoc_api_node_accept_all_children ((ValadocApiNode*) _tmp0_, (ValadocApiVisitor*) self, FALSE);
}


/**
 * {@inheritDoc}
 */
static void valadoc_drivers_symbol_resolver_real_visit_interface (ValadocApiVisitor* base, ValadocApiInterface* item) {
	ValadocDriversSymbolResolver * self;
	ValaCollection* interfaces = NULL;
	ValadocApiInterface* _tmp0_;
	ValaCollection* _tmp1_;
	ValadocApiInterface* _tmp9_;
	ValadocApiTypeReference* _tmp10_;
	ValadocApiTypeReference* _tmp11_;
	ValadocApiInterface* _tmp15_;
	self = (ValadocDriversSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = item;
	_tmp1_ = valadoc_api_interface_get_implemented_interface_list (_tmp0_);
	interfaces = _tmp1_;
	{
		ValaIterator* _type_ref_it = NULL;
		ValaCollection* _tmp2_;
		ValaIterator* _tmp3_;
		_tmp2_ = interfaces;
		_tmp3_ = vala_iterable_iterator ((ValaIterable*) _tmp2_);
		_type_ref_it = _tmp3_;
		while (TRUE) {
			ValaIterator* _tmp4_;
			gboolean _tmp5_;
			ValadocApiTypeReference* type_ref = NULL;
			ValaIterator* _tmp6_;
			gpointer _tmp7_;
			ValadocApiTypeReference* _tmp8_;
			_tmp4_ = _type_ref_it;
			_tmp5_ = vala_iterator_next (_tmp4_);
			if (!_tmp5_) {
				break;
			}
			_tmp6_ = _type_ref_it;
			_tmp7_ = vala_iterator_get (_tmp6_);
			type_ref = (ValadocApiTypeReference*) _tmp7_;
			_tmp8_ = type_ref;
			valadoc_drivers_symbol_resolver_resolve_type_reference (self, _tmp8_);
			_g_object_unref0 (type_ref);
		}
		_vala_iterator_unref0 (_type_ref_it);
	}
	_tmp9_ = item;
	_tmp10_ = valadoc_api_interface_get_base_type (_tmp9_);
	_tmp11_ = _tmp10_;
	if (_tmp11_ != NULL) {
		ValadocApiInterface* _tmp12_;
		ValadocApiTypeReference* _tmp13_;
		ValadocApiTypeReference* _tmp14_;
		_tmp12_ = item;
		_tmp13_ = valadoc_api_interface_get_base_type (_tmp12_);
		_tmp14_ = _tmp13_;
		valadoc_drivers_symbol_resolver_resolve_type_reference (self, _tmp14_);
	}
	_tmp15_ = item;
	valadoc_api_node_accept_all_children ((ValadocApiNode*) _tmp15_, (ValadocApiVisitor*) self, FALSE);
	_vala_iterable_unref0 (interfaces);
}


/**
 * {@inheritDoc}
 */
static void valadoc_drivers_symbol_resolver_real_visit_class (ValadocApiVisitor* base, ValadocApiClass* item) {
	ValadocDriversSymbolResolver * self;
	ValaCollection* interfaces = NULL;
	ValadocApiClass* _tmp0_;
	ValaCollection* _tmp1_;
	ValadocApiClass* _tmp9_;
	ValadocApiTypeReference* _tmp10_;
	ValadocApiTypeReference* _tmp11_;
	ValadocApiClass* _tmp15_;
	self = (ValadocDriversSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = item;
	_tmp1_ = valadoc_api_class_get_implemented_interface_list (_tmp0_);
	interfaces = _tmp1_;
	{
		ValaIterator* _type_ref_it = NULL;
		ValaCollection* _tmp2_;
		ValaIterator* _tmp3_;
		_tmp2_ = interfaces;
		_tmp3_ = vala_iterable_iterator ((ValaIterable*) _tmp2_);
		_type_ref_it = _tmp3_;
		while (TRUE) {
			ValaIterator* _tmp4_;
			gboolean _tmp5_;
			ValadocApiTypeReference* type_ref = NULL;
			ValaIterator* _tmp6_;
			gpointer _tmp7_;
			ValadocApiTypeReference* _tmp8_;
			_tmp4_ = _type_ref_it;
			_tmp5_ = vala_iterator_next (_tmp4_);
			if (!_tmp5_) {
				break;
			}
			_tmp6_ = _type_ref_it;
			_tmp7_ = vala_iterator_get (_tmp6_);
			type_ref = (ValadocApiTypeReference*) _tmp7_;
			_tmp8_ = type_ref;
			valadoc_drivers_symbol_resolver_resolve_type_reference (self, _tmp8_);
			_g_object_unref0 (type_ref);
		}
		_vala_iterator_unref0 (_type_ref_it);
	}
	_tmp9_ = item;
	_tmp10_ = valadoc_api_class_get_base_type (_tmp9_);
	_tmp11_ = _tmp10_;
	if (_tmp11_ != NULL) {
		ValadocApiClass* _tmp12_;
		ValadocApiTypeReference* _tmp13_;
		ValadocApiTypeReference* _tmp14_;
		_tmp12_ = item;
		_tmp13_ = valadoc_api_class_get_base_type (_tmp12_);
		_tmp14_ = _tmp13_;
		valadoc_drivers_symbol_resolver_resolve_type_reference (self, _tmp14_);
	}
	_tmp15_ = item;
	valadoc_api_node_accept_all_children ((ValadocApiNode*) _tmp15_, (ValadocApiVisitor*) self, FALSE);
	_vala_iterable_unref0 (interfaces);
}


/**
 * {@inheritDoc}
 */
static void valadoc_drivers_symbol_resolver_real_visit_struct (ValadocApiVisitor* base, ValadocApiStruct* item) {
	ValadocDriversSymbolResolver * self;
	ValadocApiStruct* _tmp0_;
	ValadocApiTypeReference* _tmp1_;
	ValadocApiTypeReference* _tmp2_;
	ValadocApiStruct* _tmp6_;
	self = (ValadocDriversSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = item;
	_tmp1_ = valadoc_api_struct_get_base_type (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != NULL) {
		ValadocApiStruct* _tmp3_;
		ValadocApiTypeReference* _tmp4_;
		ValadocApiTypeReference* _tmp5_;
		_tmp3_ = item;
		_tmp4_ = valadoc_api_struct_get_base_type (_tmp3_);
		_tmp5_ = _tmp4_;
		valadoc_drivers_symbol_resolver_resolve_type_reference (self, _tmp5_);
	}
	_tmp6_ = item;
	valadoc_api_node_accept_all_children ((ValadocApiNode*) _tmp6_, (ValadocApiVisitor*) self, FALSE);
}


/**
 * {@inheritDoc}
 */
static void valadoc_drivers_symbol_resolver_real_visit_property (ValadocApiVisitor* base, ValadocApiProperty* item) {
	ValadocDriversSymbolResolver * self;
	ValaProperty* vala_property = NULL;
	ValadocApiProperty* _tmp0_;
	void* _tmp1_;
	void* _tmp2_;
	ValaProperty* _tmp3_;
	ValaProperty* base_vala_property = NULL;
	ValaProperty* _tmp4_;
	ValaProperty* _tmp5_;
	ValaProperty* _tmp6_;
	gboolean _tmp18_ = FALSE;
	ValaProperty* _tmp19_;
	ValaProperty* _tmp20_;
	ValaProperty* _tmp28_;
	ValadocApiProperty* _tmp33_;
	ValadocApiTypeReference* _tmp34_;
	ValadocApiTypeReference* _tmp35_;
	ValadocApiProperty* _tmp36_;
	self = (ValadocDriversSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = item;
	_tmp1_ = valadoc_api_item_get_data ((ValadocApiItem*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, VALA_TYPE_PROPERTY) ? ((ValaProperty*) _tmp2_) : NULL);
	vala_property = _tmp3_;
	base_vala_property = NULL;
	_tmp4_ = vala_property;
	_tmp5_ = vala_property_get_base_property (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_ != NULL) {
		ValaProperty* _tmp7_;
		ValaProperty* _tmp8_;
		ValaProperty* _tmp9_;
		ValaProperty* _tmp10_;
		_tmp7_ = vala_property;
		_tmp8_ = vala_property_get_base_property (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = _vala_code_node_ref0 (_tmp9_);
		_vala_code_node_unref0 (base_vala_property);
		base_vala_property = _tmp10_;
	} else {
		ValaProperty* _tmp11_;
		ValaProperty* _tmp12_;
		ValaProperty* _tmp13_;
		_tmp11_ = vala_property;
		_tmp12_ = vala_property_get_base_interface_property (_tmp11_);
		_tmp13_ = _tmp12_;
		if (_tmp13_ != NULL) {
			ValaProperty* _tmp14_;
			ValaProperty* _tmp15_;
			ValaProperty* _tmp16_;
			ValaProperty* _tmp17_;
			_tmp14_ = vala_property;
			_tmp15_ = vala_property_get_base_interface_property (_tmp14_);
			_tmp16_ = _tmp15_;
			_tmp17_ = _vala_code_node_ref0 (_tmp16_);
			_vala_code_node_unref0 (base_vala_property);
			base_vala_property = _tmp17_;
		}
	}
	_tmp19_ = base_vala_property;
	_tmp20_ = vala_property;
	if (_tmp19_ == _tmp20_) {
		ValaProperty* _tmp21_;
		ValaProperty* _tmp22_;
		ValaProperty* _tmp23_;
		_tmp21_ = vala_property;
		_tmp22_ = vala_property_get_base_interface_property (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp18_ = _tmp23_ != NULL;
	} else {
		_tmp18_ = FALSE;
	}
	if (_tmp18_) {
		ValaProperty* _tmp24_;
		ValaProperty* _tmp25_;
		ValaProperty* _tmp26_;
		ValaProperty* _tmp27_;
		_tmp24_ = vala_property;
		_tmp25_ = vala_property_get_base_interface_property (_tmp24_);
		_tmp26_ = _tmp25_;
		_tmp27_ = _vala_code_node_ref0 (_tmp26_);
		_vala_code_node_unref0 (base_vala_property);
		base_vala_property = _tmp27_;
	}
	_tmp28_ = base_vala_property;
	if (_tmp28_ != NULL) {
		ValadocApiProperty* _tmp29_;
		ValaProperty* _tmp30_;
		ValadocApiSymbol* _tmp31_;
		ValadocApiProperty* _tmp32_;
		_tmp29_ = item;
		_tmp30_ = base_vala_property;
		_tmp31_ = valadoc_drivers_symbol_resolver_resolve (self, (ValaSymbol*) _tmp30_);
		_tmp32_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, VALADOC_API_TYPE_PROPERTY, ValadocApiProperty);
		valadoc_api_property_set_base_property (_tmp29_, _tmp32_);
		_g_object_unref0 (_tmp32_);
	}
	_tmp33_ = item;
	_tmp34_ = valadoc_api_property_get_property_type (_tmp33_);
	_tmp35_ = _tmp34_;
	valadoc_drivers_symbol_resolver_resolve_type_reference (self, _tmp35_);
	_tmp36_ = item;
	valadoc_api_node_accept_all_children ((ValadocApiNode*) _tmp36_, (ValadocApiVisitor*) self, FALSE);
	_vala_code_node_unref0 (base_vala_property);
	_vala_code_node_unref0 (vala_property);
}


/**
 * {@inheritDoc}
 */
static void valadoc_drivers_symbol_resolver_real_visit_field (ValadocApiVisitor* base, ValadocApiField* item) {
	ValadocDriversSymbolResolver * self;
	ValadocApiField* _tmp0_;
	ValadocApiTypeReference* _tmp1_;
	ValadocApiTypeReference* _tmp2_;
	ValadocApiField* _tmp3_;
	self = (ValadocDriversSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = item;
	_tmp1_ = valadoc_api_field_get_field_type (_tmp0_);
	_tmp2_ = _tmp1_;
	valadoc_drivers_symbol_resolver_resolve_type_reference (self, _tmp2_);
	_tmp3_ = item;
	valadoc_api_node_accept_all_children ((ValadocApiNode*) _tmp3_, (ValadocApiVisitor*) self, FALSE);
}


/**
 * {@inheritDoc}
 */
static void valadoc_drivers_symbol_resolver_real_visit_constant (ValadocApiVisitor* base, ValadocApiConstant* item) {
	ValadocDriversSymbolResolver * self;
	ValadocApiConstant* _tmp0_;
	ValadocApiTypeReference* _tmp1_;
	ValadocApiTypeReference* _tmp2_;
	ValadocApiConstant* _tmp3_;
	self = (ValadocDriversSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = item;
	_tmp1_ = valadoc_api_constant_get_constant_type (_tmp0_);
	_tmp2_ = _tmp1_;
	valadoc_drivers_symbol_resolver_resolve_type_reference (self, _tmp2_);
	_tmp3_ = item;
	valadoc_api_node_accept_all_children ((ValadocApiNode*) _tmp3_, (ValadocApiVisitor*) self, FALSE);
}


/**
 * {@inheritDoc}
 */
static void valadoc_drivers_symbol_resolver_real_visit_delegate (ValadocApiVisitor* base, ValadocApiDelegate* item) {
	ValadocDriversSymbolResolver * self;
	ValaDelegate* vala_delegate = NULL;
	ValadocApiDelegate* _tmp0_;
	void* _tmp1_;
	void* _tmp2_;
	ValaDelegate* _tmp3_;
	ValadocApiDelegate* _tmp4_;
	ValadocApiTypeReference* _tmp5_;
	ValadocApiTypeReference* _tmp6_;
	ValadocApiDelegate* _tmp7_;
	ValaList* _tmp8_;
	ValaList* _tmp9_;
	ValadocApiDelegate* _tmp10_;
	self = (ValadocDriversSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = item;
	_tmp1_ = valadoc_api_item_get_data ((ValadocApiItem*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, VALA_TYPE_DELEGATE) ? ((ValaDelegate*) _tmp2_) : NULL);
	vala_delegate = _tmp3_;
	_tmp4_ = item;
	_tmp5_ = valadoc_api_callable_get_return_type ((ValadocApiCallable*) _tmp4_);
	_tmp6_ = _tmp5_;
	valadoc_drivers_symbol_resolver_resolve_type_reference (self, _tmp6_);
	_tmp7_ = item;
	_tmp8_ = vala_code_node_get_error_types ((ValaCodeNode*) vala_delegate);
	_tmp9_ = _tmp8_;
	valadoc_drivers_symbol_resolver_resolve_thrown_list (self, (ValadocApiSymbol*) _tmp7_, _tmp9_);
	_vala_iterable_unref0 (_tmp9_);
	_tmp10_ = item;
	valadoc_api_node_accept_all_children ((ValadocApiNode*) _tmp10_, (ValadocApiVisitor*) self, FALSE);
	_vala_code_node_unref0 (vala_delegate);
}


/**
 * {@inheritDoc}
 */
static void valadoc_drivers_symbol_resolver_real_visit_signal (ValadocApiVisitor* base, ValadocApiSignal* item) {
	ValadocDriversSymbolResolver * self;
	ValadocApiSignal* _tmp0_;
	ValadocApiTypeReference* _tmp1_;
	ValadocApiTypeReference* _tmp2_;
	ValadocApiSignal* _tmp3_;
	self = (ValadocDriversSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = item;
	_tmp1_ = valadoc_api_callable_get_return_type ((ValadocApiCallable*) _tmp0_);
	_tmp2_ = _tmp1_;
	valadoc_drivers_symbol_resolver_resolve_type_reference (self, _tmp2_);
	_tmp3_ = item;
	valadoc_api_node_accept_all_children ((ValadocApiNode*) _tmp3_, (ValadocApiVisitor*) self, FALSE);
}


/**
 * {@inheritDoc}
 */
static void valadoc_drivers_symbol_resolver_real_visit_method (ValadocApiVisitor* base, ValadocApiMethod* item) {
	ValadocDriversSymbolResolver * self;
	ValaMethod* vala_method = NULL;
	ValadocApiMethod* _tmp0_;
	void* _tmp1_;
	void* _tmp2_;
	ValaMethod* _tmp3_;
	ValaMethod* base_vala_method = NULL;
	ValaMethod* _tmp4_;
	ValaMethod* _tmp5_;
	ValaMethod* _tmp6_;
	gboolean _tmp18_ = FALSE;
	ValaMethod* _tmp19_;
	ValaMethod* _tmp20_;
	ValaMethod* _tmp28_;
	ValadocApiMethod* _tmp33_;
	ValaMethod* _tmp34_;
	ValaList* _tmp35_;
	ValaList* _tmp36_;
	ValadocApiMethod* _tmp37_;
	ValadocApiTypeReference* _tmp38_;
	ValadocApiTypeReference* _tmp39_;
	ValadocApiMethod* _tmp40_;
	self = (ValadocDriversSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = item;
	_tmp1_ = valadoc_api_item_get_data ((ValadocApiItem*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, VALA_TYPE_METHOD) ? ((ValaMethod*) _tmp2_) : NULL);
	vala_method = _tmp3_;
	base_vala_method = NULL;
	_tmp4_ = vala_method;
	_tmp5_ = vala_method_get_base_method (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_ != NULL) {
		ValaMethod* _tmp7_;
		ValaMethod* _tmp8_;
		ValaMethod* _tmp9_;
		ValaMethod* _tmp10_;
		_tmp7_ = vala_method;
		_tmp8_ = vala_method_get_base_method (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = _vala_code_node_ref0 (_tmp9_);
		_vala_code_node_unref0 (base_vala_method);
		base_vala_method = _tmp10_;
	} else {
		ValaMethod* _tmp11_;
		ValaMethod* _tmp12_;
		ValaMethod* _tmp13_;
		_tmp11_ = vala_method;
		_tmp12_ = vala_method_get_base_interface_method (_tmp11_);
		_tmp13_ = _tmp12_;
		if (_tmp13_ != NULL) {
			ValaMethod* _tmp14_;
			ValaMethod* _tmp15_;
			ValaMethod* _tmp16_;
			ValaMethod* _tmp17_;
			_tmp14_ = vala_method;
			_tmp15_ = vala_method_get_base_interface_method (_tmp14_);
			_tmp16_ = _tmp15_;
			_tmp17_ = _vala_code_node_ref0 (_tmp16_);
			_vala_code_node_unref0 (base_vala_method);
			base_vala_method = _tmp17_;
		}
	}
	_tmp19_ = base_vala_method;
	_tmp20_ = vala_method;
	if (_tmp19_ == _tmp20_) {
		ValaMethod* _tmp21_;
		ValaMethod* _tmp22_;
		ValaMethod* _tmp23_;
		_tmp21_ = vala_method;
		_tmp22_ = vala_method_get_base_interface_method (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp18_ = _tmp23_ != NULL;
	} else {
		_tmp18_ = FALSE;
	}
	if (_tmp18_) {
		ValaMethod* _tmp24_;
		ValaMethod* _tmp25_;
		ValaMethod* _tmp26_;
		ValaMethod* _tmp27_;
		_tmp24_ = vala_method;
		_tmp25_ = vala_method_get_base_interface_method (_tmp24_);
		_tmp26_ = _tmp25_;
		_tmp27_ = _vala_code_node_ref0 (_tmp26_);
		_vala_code_node_unref0 (base_vala_method);
		base_vala_method = _tmp27_;
	}
	_tmp28_ = base_vala_method;
	if (_tmp28_ != NULL) {
		ValadocApiMethod* _tmp29_;
		ValaMethod* _tmp30_;
		ValadocApiSymbol* _tmp31_;
		ValadocApiMethod* _tmp32_;
		_tmp29_ = item;
		_tmp30_ = base_vala_method;
		_tmp31_ = valadoc_drivers_symbol_resolver_resolve (self, (ValaSymbol*) _tmp30_);
		_tmp32_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, VALADOC_API_TYPE_METHOD, ValadocApiMethod);
		valadoc_api_method_set_base_method (_tmp29_, _tmp32_);
		_g_object_unref0 (_tmp32_);
	}
	_tmp33_ = item;
	_tmp34_ = vala_method;
	_tmp35_ = vala_code_node_get_error_types ((ValaCodeNode*) _tmp34_);
	_tmp36_ = _tmp35_;
	valadoc_drivers_symbol_resolver_resolve_thrown_list (self, (ValadocApiSymbol*) _tmp33_, _tmp36_);
	_vala_iterable_unref0 (_tmp36_);
	_tmp37_ = item;
	_tmp38_ = valadoc_api_callable_get_return_type ((ValadocApiCallable*) _tmp37_);
	_tmp39_ = _tmp38_;
	valadoc_drivers_symbol_resolver_resolve_type_reference (self, _tmp39_);
	_tmp40_ = item;
	valadoc_api_node_accept_all_children ((ValadocApiNode*) _tmp40_, (ValadocApiVisitor*) self, FALSE);
	_vala_code_node_unref0 (base_vala_method);
	_vala_code_node_unref0 (vala_method);
}


/**
 * {@inheritDoc}
 */
static void valadoc_drivers_symbol_resolver_real_visit_type_parameter (ValadocApiVisitor* base, ValadocApiTypeParameter* item) {
	ValadocDriversSymbolResolver * self;
	ValadocApiTypeParameter* _tmp0_;
	self = (ValadocDriversSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = item;
	valadoc_api_node_accept_all_children ((ValadocApiNode*) _tmp0_, (ValadocApiVisitor*) self, FALSE);
}


/**
 * {@inheritDoc}
 */
static void valadoc_drivers_symbol_resolver_real_visit_formal_parameter (ValadocApiVisitor* base, ValadocApiFormalParameter* item) {
	ValadocDriversSymbolResolver * self;
	ValadocApiFormalParameter* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	ValadocApiFormalParameter* _tmp3_;
	void* _tmp4_;
	void* _tmp5_;
	ValaExpression* _tmp6_;
	ValaExpression* _tmp7_;
	ValadocApiFormalParameter* _tmp22_;
	ValadocApiTypeReference* _tmp23_;
	ValadocApiTypeReference* _tmp24_;
	ValadocApiFormalParameter* _tmp25_;
	self = (ValadocDriversSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = item;
	_tmp1_ = valadoc_api_formal_parameter_get_ellipsis (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		return;
	}
	_tmp3_ = item;
	_tmp4_ = valadoc_api_item_get_data ((ValadocApiItem*) _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = vala_variable_get_initializer ((ValaVariable*) G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, VALA_TYPE_PARAMETER, ValaParameter));
	_tmp7_ = _tmp6_;
	if (_tmp7_ != NULL) {
		ValadocApiSignatureBuilder* signature = NULL;
		ValadocApiSignatureBuilder* _tmp8_;
		ValadocApiInitializerBuilder* ibuilder = NULL;
		ValadocApiSignatureBuilder* _tmp9_;
		ValaHashMap* _tmp10_;
		ValadocApiInitializerBuilder* _tmp11_;
		ValadocApiFormalParameter* _tmp12_;
		void* _tmp13_;
		void* _tmp14_;
		ValaExpression* _tmp15_;
		ValaExpression* _tmp16_;
		ValadocApiInitializerBuilder* _tmp17_;
		ValadocApiFormalParameter* _tmp18_;
		ValadocApiSignatureBuilder* _tmp19_;
		ValadocContentRun* _tmp20_;
		ValadocContentRun* _tmp21_;
		_tmp8_ = valadoc_api_signature_builder_new ();
		signature = _tmp8_;
		_tmp9_ = signature;
		_tmp10_ = self->priv->symbol_map;
		_tmp11_ = valadoc_api_initializer_builder_new (_tmp9_, _tmp10_);
		ibuilder = _tmp11_;
		_tmp12_ = item;
		_tmp13_ = valadoc_api_item_get_data ((ValadocApiItem*) _tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = vala_variable_get_initializer ((ValaVariable*) G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, VALA_TYPE_PARAMETER, ValaParameter));
		_tmp16_ = _tmp15_;
		_tmp17_ = ibuilder;
		vala_code_node_accept ((ValaCodeNode*) _tmp16_, (ValaCodeVisitor*) _tmp17_);
		_tmp18_ = item;
		_tmp19_ = signature;
		_tmp20_ = valadoc_api_signature_builder_get (_tmp19_);
		_tmp21_ = _tmp20_;
		valadoc_api_formal_parameter_set_default_value (_tmp18_, _tmp21_);
		_g_object_unref0 (_tmp21_);
		_vala_code_visitor_unref0 (ibuilder);
		_valadoc_api_signature_builder_unref0 (signature);
	}
	_tmp22_ = item;
	_tmp23_ = valadoc_api_formal_parameter_get_parameter_type (_tmp22_);
	_tmp24_ = _tmp23_;
	valadoc_drivers_symbol_resolver_resolve_type_reference (self, _tmp24_);
	_tmp25_ = item;
	valadoc_api_node_accept_all_children ((ValadocApiNode*) _tmp25_, (ValadocApiVisitor*) self, FALSE);
}


/**
 * {@inheritDoc}
 */
static void valadoc_drivers_symbol_resolver_real_visit_error_domain (ValadocApiVisitor* base, ValadocApiErrorDomain* item) {
	ValadocDriversSymbolResolver * self;
	ValadocApiErrorDomain* _tmp0_;
	self = (ValadocDriversSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = item;
	valadoc_api_node_accept_all_children ((ValadocApiNode*) _tmp0_, (ValadocApiVisitor*) self, FALSE);
}


/**
 * {@inheritDoc}
 */
static void valadoc_drivers_symbol_resolver_real_visit_error_code (ValadocApiVisitor* base, ValadocApiErrorCode* item) {
	ValadocDriversSymbolResolver * self;
	ValadocApiErrorCode* _tmp0_;
	self = (ValadocDriversSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = item;
	valadoc_api_node_accept_all_children ((ValadocApiNode*) _tmp0_, (ValadocApiVisitor*) self, FALSE);
}


/**
 * {@inheritDoc}
 */
static void valadoc_drivers_symbol_resolver_real_visit_enum (ValadocApiVisitor* base, ValadocApiEnum* item) {
	ValadocDriversSymbolResolver * self;
	ValadocApiEnum* _tmp0_;
	self = (ValadocDriversSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = item;
	valadoc_api_node_accept_all_children ((ValadocApiNode*) _tmp0_, (ValadocApiVisitor*) self, FALSE);
}


/**
 * {@inheritDoc}
 */
static void valadoc_drivers_symbol_resolver_real_visit_enum_value (ValadocApiVisitor* base, ValadocApiEnumValue* item) {
	ValadocDriversSymbolResolver * self;
	ValadocApiEnumValue* _tmp0_;
	void* _tmp1_;
	void* _tmp2_;
	ValaExpression* _tmp3_;
	ValaExpression* _tmp4_;
	ValadocApiEnumValue* _tmp19_;
	self = (ValadocDriversSymbolResolver*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = item;
	_tmp1_ = valadoc_api_item_get_data ((ValadocApiItem*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = vala_constant_get_value ((ValaConstant*) G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, VALA_TYPE_ENUM_VALUE, ValaEnumValue));
	_tmp4_ = _tmp3_;
	if (_tmp4_ != NULL) {
		ValadocApiSignatureBuilder* signature = NULL;
		ValadocApiSignatureBuilder* _tmp5_;
		ValadocApiInitializerBuilder* ibuilder = NULL;
		ValadocApiSignatureBuilder* _tmp6_;
		ValaHashMap* _tmp7_;
		ValadocApiInitializerBuilder* _tmp8_;
		ValadocApiEnumValue* _tmp9_;
		void* _tmp10_;
		void* _tmp11_;
		ValaExpression* _tmp12_;
		ValaExpression* _tmp13_;
		ValadocApiInitializerBuilder* _tmp14_;
		ValadocApiEnumValue* _tmp15_;
		ValadocApiSignatureBuilder* _tmp16_;
		ValadocContentRun* _tmp17_;
		ValadocContentRun* _tmp18_;
		_tmp5_ = valadoc_api_signature_builder_new ();
		signature = _tmp5_;
		_tmp6_ = signature;
		_tmp7_ = self->priv->symbol_map;
		_tmp8_ = valadoc_api_initializer_builder_new (_tmp6_, _tmp7_);
		ibuilder = _tmp8_;
		_tmp9_ = item;
		_tmp10_ = valadoc_api_item_get_data ((ValadocApiItem*) _tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = vala_constant_get_value ((ValaConstant*) G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, VALA_TYPE_ENUM_VALUE, ValaEnumValue));
		_tmp13_ = _tmp12_;
		_tmp14_ = ibuilder;
		vala_code_node_accept ((ValaCodeNode*) _tmp13_, (ValaCodeVisitor*) _tmp14_);
		_tmp15_ = item;
		_tmp16_ = signature;
		_tmp17_ = valadoc_api_signature_builder_get (_tmp16_);
		_tmp18_ = _tmp17_;
		valadoc_api_enum_value_set_default_value (_tmp15_, _tmp18_);
		_g_object_unref0 (_tmp18_);
		_vala_code_visitor_unref0 (ibuilder);
		_valadoc_api_signature_builder_unref0 (signature);
	}
	_tmp19_ = item;
	valadoc_api_node_accept_all_children ((ValadocApiNode*) _tmp19_, (ValadocApiVisitor*) self, FALSE);
}


static void valadoc_drivers_symbol_resolver_class_init (ValadocDriversSymbolResolverClass * klass) {
	valadoc_drivers_symbol_resolver_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ValadocDriversSymbolResolverPrivate));
	((ValadocApiVisitorClass *) klass)->visit_tree = (void (*) (ValadocApiVisitor *, ValadocApiTree*)) valadoc_drivers_symbol_resolver_real_visit_tree;
	((ValadocApiVisitorClass *) klass)->visit_package = (void (*) (ValadocApiVisitor *, ValadocApiPackage*)) valadoc_drivers_symbol_resolver_real_visit_package;
	((ValadocApiVisitorClass *) klass)->visit_namespace = (void (*) (ValadocApiVisitor *, ValadocApiNamespace*)) valadoc_drivers_symbol_resolver_real_visit_namespace;
	((ValadocApiVisitorClass *) klass)->visit_interface = (void (*) (ValadocApiVisitor *, ValadocApiInterface*)) valadoc_drivers_symbol_resolver_real_visit_interface;
	((ValadocApiVisitorClass *) klass)->visit_class = (void (*) (ValadocApiVisitor *, ValadocApiClass*)) valadoc_drivers_symbol_resolver_real_visit_class;
	((ValadocApiVisitorClass *) klass)->visit_struct = (void (*) (ValadocApiVisitor *, ValadocApiStruct*)) valadoc_drivers_symbol_resolver_real_visit_struct;
	((ValadocApiVisitorClass *) klass)->visit_property = (void (*) (ValadocApiVisitor *, ValadocApiProperty*)) valadoc_drivers_symbol_resolver_real_visit_property;
	((ValadocApiVisitorClass *) klass)->visit_field = (void (*) (ValadocApiVisitor *, ValadocApiField*)) valadoc_drivers_symbol_resolver_real_visit_field;
	((ValadocApiVisitorClass *) klass)->visit_constant = (void (*) (ValadocApiVisitor *, ValadocApiConstant*)) valadoc_drivers_symbol_resolver_real_visit_constant;
	((ValadocApiVisitorClass *) klass)->visit_delegate = (void (*) (ValadocApiVisitor *, ValadocApiDelegate*)) valadoc_drivers_symbol_resolver_real_visit_delegate;
	((ValadocApiVisitorClass *) klass)->visit_signal = (void (*) (ValadocApiVisitor *, ValadocApiSignal*)) valadoc_drivers_symbol_resolver_real_visit_signal;
	((ValadocApiVisitorClass *) klass)->visit_method = (void (*) (ValadocApiVisitor *, ValadocApiMethod*)) valadoc_drivers_symbol_resolver_real_visit_method;
	((ValadocApiVisitorClass *) klass)->visit_type_parameter = (void (*) (ValadocApiVisitor *, ValadocApiTypeParameter*)) valadoc_drivers_symbol_resolver_real_visit_type_parameter;
	((ValadocApiVisitorClass *) klass)->visit_formal_parameter = (void (*) (ValadocApiVisitor *, ValadocApiFormalParameter*)) valadoc_drivers_symbol_resolver_real_visit_formal_parameter;
	((ValadocApiVisitorClass *) klass)->visit_error_domain = (void (*) (ValadocApiVisitor *, ValadocApiErrorDomain*)) valadoc_drivers_symbol_resolver_real_visit_error_domain;
	((ValadocApiVisitorClass *) klass)->visit_error_code = (void (*) (ValadocApiVisitor *, ValadocApiErrorCode*)) valadoc_drivers_symbol_resolver_real_visit_error_code;
	((ValadocApiVisitorClass *) klass)->visit_enum = (void (*) (ValadocApiVisitor *, ValadocApiEnum*)) valadoc_drivers_symbol_resolver_real_visit_enum;
	((ValadocApiVisitorClass *) klass)->visit_enum_value = (void (*) (ValadocApiVisitor *, ValadocApiEnumValue*)) valadoc_drivers_symbol_resolver_real_visit_enum_value;
	G_OBJECT_CLASS (klass)->finalize = valadoc_drivers_symbol_resolver_finalize;
}


static void valadoc_drivers_symbol_resolver_instance_init (ValadocDriversSymbolResolver * self) {
	self->priv = VALADOC_DRIVERS_SYMBOL_RESOLVER_GET_PRIVATE (self);
}


static void valadoc_drivers_symbol_resolver_finalize (GObject * obj) {
	ValadocDriversSymbolResolver * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_DRIVERS_TYPE_SYMBOL_RESOLVER, ValadocDriversSymbolResolver);
	_vala_map_unref0 (self->priv->symbol_map);
	_g_object_unref0 (self->priv->glib_error);
	_valadoc_api_tree_unref0 (self->priv->root);
	G_OBJECT_CLASS (valadoc_drivers_symbol_resolver_parent_class)->finalize (obj);
}


GType valadoc_drivers_symbol_resolver_get_type (void) {
	static volatile gsize valadoc_drivers_symbol_resolver_type_id__volatile = 0;
	if (g_once_init_enter (&valadoc_drivers_symbol_resolver_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ValadocDriversSymbolResolverClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_drivers_symbol_resolver_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocDriversSymbolResolver), 0, (GInstanceInitFunc) valadoc_drivers_symbol_resolver_instance_init, NULL };
		GType valadoc_drivers_symbol_resolver_type_id;
		valadoc_drivers_symbol_resolver_type_id = g_type_register_static (VALADOC_API_TYPE_VISITOR, "ValadocDriversSymbolResolver", &g_define_type_info, 0);
		g_once_init_leave (&valadoc_drivers_symbol_resolver_type_id__volatile, valadoc_drivers_symbol_resolver_type_id);
	}
	return valadoc_drivers_symbol_resolver_type_id__volatile;
}



