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

/* valasymbol.vala
 *
 * Copyright (C) 2006-2010  Jürg Billeter
 *
 * 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:
 * 	Jürg Billeter <j@bitron.ch>
 */

#include <glib.h>
#include <glib-object.h>
#include "vala.h"
#include <stdlib.h>
#include <string.h>

#define _g_free0(var) (var = (g_free (var), NULL))
#define _vala_comment_unref0(var) ((var == NULL) ? NULL : (var = (vala_comment_unref (var), NULL)))
#define _vala_version_attribute_unref0(var) ((var == NULL) ? NULL : (var = (vala_version_attribute_unref (var), NULL)))
#define _vala_scope_unref0(var) ((var == NULL) ? NULL : (var = (vala_scope_unref (var), NULL)))
#define _vala_code_node_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_node_unref (var), NULL)))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))

struct _ValaSymbolPrivate {
	gchar* _name;
	gboolean _active;
	gboolean _used;
	ValaSymbolAccessibility _access;
	ValaComment* _comment;
	ValaVersionAttribute* _version;
	gboolean _hides;
	gboolean _external;
	ValaScope* _owner;
	ValaScope* _scope;
};


static gpointer vala_symbol_parent_class = NULL;

#define VALA_SYMBOL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VALA_TYPE_SYMBOL, ValaSymbolPrivate))
static gboolean vala_symbol_real_is_instance_member (ValaSymbol* self);
static gboolean vala_symbol_real_is_class_member (ValaSymbol* self);
static void vala_symbol_real_add_namespace (ValaSymbol* self, ValaNamespace* ns);
static void vala_symbol_real_add_class (ValaSymbol* self, ValaClass* cl);
static void vala_symbol_real_add_interface (ValaSymbol* self, ValaInterface* iface);
static void vala_symbol_real_add_struct (ValaSymbol* self, ValaStruct* st);
static void vala_symbol_real_add_enum (ValaSymbol* self, ValaEnum* en);
static void vala_symbol_real_add_error_domain (ValaSymbol* self, ValaErrorDomain* edomain);
static void vala_symbol_real_add_delegate (ValaSymbol* self, ValaDelegate* d);
static void vala_symbol_real_add_constant (ValaSymbol* self, ValaConstant* constant);
static void vala_symbol_real_add_field (ValaSymbol* self, ValaField* f);
static void vala_symbol_real_add_method (ValaSymbol* self, ValaMethod* m);
static void vala_symbol_real_add_property (ValaSymbol* self, ValaProperty* prop);
static void vala_symbol_real_add_signal (ValaSymbol* self, ValaSignal* sig);
static void vala_symbol_real_add_constructor (ValaSymbol* self, ValaConstructor* c);
static void vala_symbol_real_add_destructor (ValaSymbol* self, ValaDestructor* d);
static void vala_symbol_finalize (ValaCodeNode * obj);


/**
 * Check if this symbol is just internal API (and therefore doesn't need 
 * to be listed in header files for instance) by traversing parent symbols
 * and checking their accessibility.
 */
static gpointer _vala_code_node_ref0 (gpointer self) {
	return self ? vala_code_node_ref (self) : NULL;
}


gboolean vala_symbol_is_internal_symbol (ValaSymbol* self) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->_external;
	if (!_tmp1_) {
		gboolean _tmp2_;
		gboolean _tmp3_;
		_tmp2_ = vala_symbol_get_external_package (self);
		_tmp3_ = _tmp2_;
		_tmp0_ = _tmp3_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		result = TRUE;
		return result;
	}
	{
		ValaSymbol* sym = NULL;
		ValaSymbol* _tmp4_;
		_tmp4_ = _vala_code_node_ref0 (self);
		sym = _tmp4_;
		{
			gboolean _tmp5_ = FALSE;
			_tmp5_ = TRUE;
			while (TRUE) {
				ValaSymbol* _tmp10_;
				gboolean _tmp11_ = FALSE;
				ValaSymbol* _tmp12_;
				ValaSymbolAccessibility _tmp13_;
				if (!_tmp5_) {
					ValaSymbol* _tmp6_;
					ValaSymbol* _tmp7_;
					ValaSymbol* _tmp8_;
					ValaSymbol* _tmp9_;
					_tmp6_ = sym;
					_tmp7_ = vala_symbol_get_parent_symbol (_tmp6_);
					_tmp8_ = _tmp7_;
					_tmp9_ = _vala_code_node_ref0 (_tmp8_);
					_vala_code_node_unref0 (sym);
					sym = _tmp9_;
				}
				_tmp5_ = FALSE;
				_tmp10_ = sym;
				if (!(NULL != _tmp10_)) {
					break;
				}
				_tmp12_ = sym;
				_tmp13_ = _tmp12_->priv->_access;
				if (_tmp13_ == VALA_SYMBOL_ACCESSIBILITY_PRIVATE) {
					_tmp11_ = TRUE;
				} else {
					ValaSymbol* _tmp14_;
					ValaSymbolAccessibility _tmp15_;
					_tmp14_ = sym;
					_tmp15_ = _tmp14_->priv->_access;
					_tmp11_ = _tmp15_ == VALA_SYMBOL_ACCESSIBILITY_INTERNAL;
				}
				if (_tmp11_) {
					result = TRUE;
					_vala_code_node_unref0 (sym);
					return result;
				}
			}
		}
		_vala_code_node_unref0 (sym);
	}
	result = FALSE;
	return result;
}


gboolean vala_symbol_is_private_symbol (ValaSymbol* self) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->_external;
	if (!_tmp1_) {
		gboolean _tmp2_;
		gboolean _tmp3_;
		_tmp2_ = vala_symbol_get_external_package (self);
		_tmp3_ = _tmp2_;
		_tmp0_ = _tmp3_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		result = TRUE;
		return result;
	}
	{
		ValaSymbol* sym = NULL;
		ValaSymbol* _tmp4_;
		_tmp4_ = _vala_code_node_ref0 (self);
		sym = _tmp4_;
		{
			gboolean _tmp5_ = FALSE;
			_tmp5_ = TRUE;
			while (TRUE) {
				ValaSymbol* _tmp10_;
				ValaSymbol* _tmp11_;
				ValaSymbolAccessibility _tmp12_;
				if (!_tmp5_) {
					ValaSymbol* _tmp6_;
					ValaSymbol* _tmp7_;
					ValaSymbol* _tmp8_;
					ValaSymbol* _tmp9_;
					_tmp6_ = sym;
					_tmp7_ = vala_symbol_get_parent_symbol (_tmp6_);
					_tmp8_ = _tmp7_;
					_tmp9_ = _vala_code_node_ref0 (_tmp8_);
					_vala_code_node_unref0 (sym);
					sym = _tmp9_;
				}
				_tmp5_ = FALSE;
				_tmp10_ = sym;
				if (!(NULL != _tmp10_)) {
					break;
				}
				_tmp11_ = sym;
				_tmp12_ = _tmp11_->priv->_access;
				if (_tmp12_ == VALA_SYMBOL_ACCESSIBILITY_PRIVATE) {
					result = TRUE;
					_vala_code_node_unref0 (sym);
					return result;
				}
			}
		}
		_vala_code_node_unref0 (sym);
	}
	result = FALSE;
	return result;
}


ValaSymbol* vala_symbol_construct (GType object_type, const gchar* name, ValaSourceReference* source_reference, ValaComment* comment) {
	ValaSymbol* self = NULL;
	const gchar* _tmp0_;
	ValaSourceReference* _tmp1_;
	ValaComment* _tmp2_;
	ValaScope* _tmp3_;
	self = (ValaSymbol*) vala_code_node_construct (object_type);
	_tmp0_ = name;
	vala_symbol_set_name (self, _tmp0_);
	_tmp1_ = source_reference;
	vala_code_node_set_source_reference ((ValaCodeNode*) self, _tmp1_);
	_tmp2_ = comment;
	vala_symbol_set_comment (self, _tmp2_);
	_tmp3_ = vala_scope_new (self);
	_vala_scope_unref0 (self->priv->_scope);
	self->priv->_scope = _tmp3_;
	return self;
}


/**
 * Returns the fully expanded name of this symbol for use in
 * human-readable messages.
 *
 * @return full name
 */
gchar* vala_symbol_get_full_name (ValaSymbol* self) {
	gchar* result = NULL;
	ValaSymbol* _tmp0_;
	ValaSymbol* _tmp1_;
	const gchar* _tmp4_;
	ValaSymbol* _tmp8_;
	ValaSymbol* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gboolean _tmp12_;
	const gchar* _tmp15_;
	gboolean _tmp16_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = vala_symbol_get_parent_symbol (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		const gchar* _tmp2_;
		gchar* _tmp3_;
		_tmp2_ = self->priv->_name;
		_tmp3_ = g_strdup (_tmp2_);
		result = _tmp3_;
		return result;
	}
	_tmp4_ = self->priv->_name;
	if (_tmp4_ == NULL) {
		ValaSymbol* _tmp5_;
		ValaSymbol* _tmp6_;
		gchar* _tmp7_;
		_tmp5_ = vala_symbol_get_parent_symbol (self);
		_tmp6_ = _tmp5_;
		_tmp7_ = vala_symbol_get_full_name (_tmp6_);
		result = _tmp7_;
		return result;
	}
	_tmp8_ = vala_symbol_get_parent_symbol (self);
	_tmp9_ = _tmp8_;
	_tmp10_ = vala_symbol_get_full_name (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = _tmp11_ == NULL;
	_g_free0 (_tmp11_);
	if (_tmp12_) {
		const gchar* _tmp13_;
		gchar* _tmp14_;
		_tmp13_ = self->priv->_name;
		_tmp14_ = g_strdup (_tmp13_);
		result = _tmp14_;
		return result;
	}
	_tmp15_ = self->priv->_name;
	_tmp16_ = g_str_has_prefix (_tmp15_, ".");
	if (_tmp16_) {
		ValaSymbol* _tmp17_;
		ValaSymbol* _tmp18_;
		gchar* _tmp19_;
		gchar* _tmp20_;
		const gchar* _tmp21_;
		gchar* _tmp22_;
		gchar* _tmp23_;
		_tmp17_ = vala_symbol_get_parent_symbol (self);
		_tmp18_ = _tmp17_;
		_tmp19_ = vala_symbol_get_full_name (_tmp18_);
		_tmp20_ = _tmp19_;
		_tmp21_ = self->priv->_name;
		_tmp22_ = g_strdup_printf ("%s%s", _tmp20_, _tmp21_);
		_tmp23_ = _tmp22_;
		_g_free0 (_tmp20_);
		result = _tmp23_;
		return result;
	} else {
		ValaSymbol* _tmp24_;
		ValaSymbol* _tmp25_;
		gchar* _tmp26_;
		gchar* _tmp27_;
		const gchar* _tmp28_;
		gchar* _tmp29_;
		gchar* _tmp30_;
		_tmp24_ = vala_symbol_get_parent_symbol (self);
		_tmp25_ = _tmp24_;
		_tmp26_ = vala_symbol_get_full_name (_tmp25_);
		_tmp27_ = _tmp26_;
		_tmp28_ = self->priv->_name;
		_tmp29_ = g_strdup_printf ("%s.%s", _tmp27_, _tmp28_);
		_tmp30_ = _tmp29_;
		_g_free0 (_tmp27_);
		result = _tmp30_;
		return result;
	}
}


/**
 * Converts a string from CamelCase to lower_case.
 *
 * @param camel_case a string in camel case
 * @return           the specified string converted to lower case
 */
static gboolean string_contains (const gchar* self, const gchar* needle) {
	gboolean result = FALSE;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = needle;
	_tmp1_ = strstr ((gchar*) self, (gchar*) _tmp0_);
	result = _tmp1_ != NULL;
	return result;
}


static gunichar string_get_char (const gchar* self, glong index) {
	gunichar result = 0U;
	glong _tmp0_;
	gunichar _tmp1_;
	g_return_val_if_fail (self != NULL, 0U);
	_tmp0_ = index;
	_tmp1_ = g_utf8_get_char (((gchar*) self) + _tmp0_);
	result = _tmp1_;
	return result;
}


gchar* vala_symbol_camel_case_to_lower_case (const gchar* camel_case) {
	gchar* result = NULL;
	const gchar* _tmp0_;
	gboolean _tmp1_;
	GString* result_builder = NULL;
	GString* _tmp4_;
	const gchar* i = NULL;
	const gchar* _tmp5_;
	gboolean first = FALSE;
	GString* _tmp48_;
	const gchar* _tmp49_;
	gchar* _tmp50_;
	g_return_val_if_fail (camel_case != NULL, NULL);
	_tmp0_ = camel_case;
	_tmp1_ = string_contains (_tmp0_, "_");
	if (_tmp1_) {
		const gchar* _tmp2_;
		gchar* _tmp3_;
		_tmp2_ = camel_case;
		_tmp3_ = g_utf8_strdown (_tmp2_, (gssize) -1);
		result = _tmp3_;
		return result;
	}
	_tmp4_ = g_string_new ("");
	result_builder = _tmp4_;
	_tmp5_ = camel_case;
	i = _tmp5_;
	first = TRUE;
	while (TRUE) {
		const gchar* _tmp6_;
		gint _tmp7_;
		gint _tmp8_;
		gunichar c = 0U;
		const gchar* _tmp9_;
		gunichar _tmp10_;
		gboolean _tmp11_ = FALSE;
		gunichar _tmp12_;
		gboolean _tmp13_;
		GString* _tmp43_;
		gunichar _tmp44_;
		gunichar _tmp45_;
		const gchar* _tmp46_;
		const gchar* _tmp47_;
		_tmp6_ = i;
		_tmp7_ = strlen (_tmp6_);
		_tmp8_ = _tmp7_;
		if (!(_tmp8_ > 0)) {
			break;
		}
		_tmp9_ = i;
		_tmp10_ = string_get_char (_tmp9_, (glong) 0);
		c = _tmp10_;
		_tmp12_ = c;
		_tmp13_ = g_unichar_isupper (_tmp12_);
		if (_tmp13_) {
			gboolean _tmp14_;
			_tmp14_ = first;
			_tmp11_ = !_tmp14_;
		} else {
			_tmp11_ = FALSE;
		}
		if (_tmp11_) {
			const gchar* t = NULL;
			const gchar* _tmp15_;
			const gchar* _tmp16_;
			gboolean prev_upper = FALSE;
			const gchar* _tmp17_;
			gunichar _tmp18_;
			gboolean _tmp19_;
			const gchar* _tmp20_;
			const gchar* _tmp21_;
			gboolean next_upper = FALSE;
			const gchar* _tmp22_;
			gunichar _tmp23_;
			gboolean _tmp24_;
			gboolean _tmp25_ = FALSE;
			gboolean _tmp26_;
			_tmp15_ = i;
			_tmp16_ = g_utf8_prev_char (_tmp15_);
			t = _tmp16_;
			_tmp17_ = t;
			_tmp18_ = string_get_char (_tmp17_, (glong) 0);
			_tmp19_ = g_unichar_isupper (_tmp18_);
			prev_upper = _tmp19_;
			_tmp20_ = i;
			_tmp21_ = g_utf8_next_char (_tmp20_);
			t = _tmp21_;
			_tmp22_ = t;
			_tmp23_ = string_get_char (_tmp22_, (glong) 0);
			_tmp24_ = g_unichar_isupper (_tmp23_);
			next_upper = _tmp24_;
			_tmp26_ = prev_upper;
			if (!_tmp26_) {
				_tmp25_ = TRUE;
			} else {
				gboolean _tmp27_ = FALSE;
				const gchar* _tmp28_;
				gint _tmp29_;
				gint _tmp30_;
				_tmp28_ = i;
				_tmp29_ = strlen (_tmp28_);
				_tmp30_ = _tmp29_;
				if (_tmp30_ >= 2) {
					gboolean _tmp31_;
					_tmp31_ = next_upper;
					_tmp27_ = !_tmp31_;
				} else {
					_tmp27_ = FALSE;
				}
				_tmp25_ = _tmp27_;
			}
			if (_tmp25_) {
				glong len = 0L;
				GString* _tmp32_;
				const gchar* _tmp33_;
				gint _tmp34_;
				gint _tmp35_;
				gboolean _tmp36_ = FALSE;
				glong _tmp37_;
				_tmp32_ = result_builder;
				_tmp33_ = _tmp32_->str;
				_tmp34_ = strlen (_tmp33_);
				_tmp35_ = _tmp34_;
				len = (glong) _tmp35_;
				_tmp37_ = len;
				if (_tmp37_ != ((glong) 1)) {
					GString* _tmp38_;
					const gchar* _tmp39_;
					glong _tmp40_;
					gunichar _tmp41_;
					_tmp38_ = result_builder;
					_tmp39_ = _tmp38_->str;
					_tmp40_ = len;
					_tmp41_ = string_get_char (_tmp39_, _tmp40_ - 2);
					_tmp36_ = _tmp41_ != ((gunichar) '_');
				} else {
					_tmp36_ = FALSE;
				}
				if (_tmp36_) {
					GString* _tmp42_;
					_tmp42_ = result_builder;
					g_string_append_c (_tmp42_, '_');
				}
			}
		}
		_tmp43_ = result_builder;
		_tmp44_ = c;
		_tmp45_ = g_unichar_tolower (_tmp44_);
		g_string_append_unichar (_tmp43_, _tmp45_);
		first = FALSE;
		_tmp46_ = i;
		_tmp47_ = g_utf8_next_char (_tmp46_);
		i = _tmp47_;
	}
	_tmp48_ = result_builder;
	_tmp49_ = _tmp48_->str;
	_tmp50_ = g_strdup (_tmp49_);
	result = _tmp50_;
	_g_string_free0 (result_builder);
	return result;
}


/**
 * Converts a string from lower_case to CamelCase.
 *
 * @param lower_case a string in lower case
 * @return           the specified string converted to camel case
 */
gchar* vala_symbol_lower_case_to_camel_case (const gchar* lower_case) {
	gchar* result = NULL;
	GString* result_builder = NULL;
	GString* _tmp0_;
	const gchar* i = NULL;
	const gchar* _tmp1_;
	gboolean last_underscore = FALSE;
	GString* _tmp20_;
	const gchar* _tmp21_;
	gchar* _tmp22_;
	g_return_val_if_fail (lower_case != NULL, NULL);
	_tmp0_ = g_string_new ("");
	result_builder = _tmp0_;
	_tmp1_ = lower_case;
	i = _tmp1_;
	last_underscore = TRUE;
	while (TRUE) {
		const gchar* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gunichar c = 0U;
		const gchar* _tmp5_;
		gunichar _tmp6_;
		gunichar _tmp7_;
		const gchar* _tmp18_;
		const gchar* _tmp19_;
		_tmp2_ = i;
		_tmp3_ = strlen (_tmp2_);
		_tmp4_ = _tmp3_;
		if (!(_tmp4_ > 0)) {
			break;
		}
		_tmp5_ = i;
		_tmp6_ = string_get_char (_tmp5_, (glong) 0);
		c = _tmp6_;
		_tmp7_ = c;
		if (_tmp7_ == ((gunichar) '_')) {
			last_underscore = TRUE;
		} else {
			gunichar _tmp8_;
			gboolean _tmp9_;
			_tmp8_ = c;
			_tmp9_ = g_unichar_isupper (_tmp8_);
			if (_tmp9_) {
				const gchar* _tmp10_;
				gchar* _tmp11_;
				_tmp10_ = lower_case;
				_tmp11_ = g_strdup (_tmp10_);
				result = _tmp11_;
				_g_string_free0 (result_builder);
				return result;
			} else {
				gboolean _tmp12_;
				_tmp12_ = last_underscore;
				if (_tmp12_) {
					GString* _tmp13_;
					gunichar _tmp14_;
					gunichar _tmp15_;
					_tmp13_ = result_builder;
					_tmp14_ = c;
					_tmp15_ = g_unichar_toupper (_tmp14_);
					g_string_append_unichar (_tmp13_, _tmp15_);
					last_underscore = FALSE;
				} else {
					GString* _tmp16_;
					gunichar _tmp17_;
					_tmp16_ = result_builder;
					_tmp17_ = c;
					g_string_append_unichar (_tmp16_, _tmp17_);
				}
			}
		}
		_tmp18_ = i;
		_tmp19_ = g_utf8_next_char (_tmp18_);
		i = _tmp19_;
	}
	_tmp20_ = result_builder;
	_tmp21_ = _tmp20_->str;
	_tmp22_ = g_strdup (_tmp21_);
	result = _tmp22_;
	_g_string_free0 (result_builder);
	return result;
}


static gpointer _vala_scope_ref0 (gpointer self) {
	return self ? vala_scope_ref (self) : NULL;
}


ValaScope* vala_symbol_get_top_accessible_scope (ValaSymbol* self, gboolean is_internal) {
	ValaScope* result = NULL;
	ValaSymbolAccessibility _tmp0_;
	ValaSymbolAccessibility _tmp4_;
	ValaSymbol* _tmp5_;
	ValaSymbol* _tmp6_;
	ValaSymbol* _tmp11_;
	ValaSymbol* _tmp12_;
	gboolean _tmp13_;
	ValaScope* _tmp14_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_access;
	if (_tmp0_ == VALA_SYMBOL_ACCESSIBILITY_PRIVATE) {
		ValaScope* _tmp1_;
		ValaScope* _tmp2_;
		ValaScope* _tmp3_;
		_tmp1_ = vala_symbol_get_owner (self);
		_tmp2_ = _tmp1_;
		_tmp3_ = _vala_scope_ref0 (_tmp2_);
		result = _tmp3_;
		return result;
	}
	_tmp4_ = self->priv->_access;
	if (_tmp4_ == VALA_SYMBOL_ACCESSIBILITY_INTERNAL) {
		is_internal = TRUE;
	}
	_tmp5_ = vala_symbol_get_parent_symbol (self);
	_tmp6_ = _tmp5_;
	if (_tmp6_ == NULL) {
		gboolean _tmp7_;
		_tmp7_ = is_internal;
		if (_tmp7_) {
			ValaScope* _tmp8_;
			ValaScope* _tmp9_;
			ValaScope* _tmp10_;
			_tmp8_ = vala_symbol_get_scope (self);
			_tmp9_ = _tmp8_;
			_tmp10_ = _vala_scope_ref0 (_tmp9_);
			result = _tmp10_;
			return result;
		} else {
			result = NULL;
			return result;
		}
	}
	_tmp11_ = vala_symbol_get_parent_symbol (self);
	_tmp12_ = _tmp11_;
	_tmp13_ = is_internal;
	_tmp14_ = vala_symbol_get_top_accessible_scope (_tmp12_, _tmp13_);
	result = _tmp14_;
	return result;
}


static gboolean vala_symbol_real_is_instance_member (ValaSymbol* self) {
	gboolean result = FALSE;
	gboolean instance = FALSE;
	instance = TRUE;
	if (G_TYPE_CHECK_INSTANCE_TYPE (self, VALA_TYPE_FIELD)) {
		ValaField* f = NULL;
		ValaField* _tmp0_;
		ValaField* _tmp1_;
		ValaMemberBinding _tmp2_;
		ValaMemberBinding _tmp3_;
		_tmp0_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (self, VALA_TYPE_FIELD, ValaField));
		f = _tmp0_;
		_tmp1_ = f;
		_tmp2_ = vala_field_get_binding (_tmp1_);
		_tmp3_ = _tmp2_;
		instance = _tmp3_ == VALA_MEMBER_BINDING_INSTANCE;
		_vala_code_node_unref0 (f);
	} else {
		if (G_TYPE_CHECK_INSTANCE_TYPE (self, VALA_TYPE_METHOD)) {
			ValaMethod* m = NULL;
			ValaMethod* _tmp4_;
			ValaMethod* _tmp5_;
			_tmp4_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (self, VALA_TYPE_METHOD, ValaMethod));
			m = _tmp4_;
			_tmp5_ = m;
			if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, VALA_TYPE_CREATION_METHOD)) {
				ValaMethod* _tmp6_;
				ValaMemberBinding _tmp7_;
				ValaMemberBinding _tmp8_;
				_tmp6_ = m;
				_tmp7_ = vala_method_get_binding (_tmp6_);
				_tmp8_ = _tmp7_;
				instance = _tmp8_ == VALA_MEMBER_BINDING_INSTANCE;
			}
			_vala_code_node_unref0 (m);
		} else {
			if (G_TYPE_CHECK_INSTANCE_TYPE (self, VALA_TYPE_PROPERTY)) {
				ValaProperty* prop = NULL;
				ValaProperty* _tmp9_;
				ValaProperty* _tmp10_;
				ValaMemberBinding _tmp11_;
				ValaMemberBinding _tmp12_;
				_tmp9_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (self, VALA_TYPE_PROPERTY, ValaProperty));
				prop = _tmp9_;
				_tmp10_ = prop;
				_tmp11_ = vala_property_get_binding (_tmp10_);
				_tmp12_ = _tmp11_;
				instance = _tmp12_ == VALA_MEMBER_BINDING_INSTANCE;
				_vala_code_node_unref0 (prop);
			} else {
				if (G_TYPE_CHECK_INSTANCE_TYPE (self, VALA_TYPE_ENUM_VALUE)) {
					instance = FALSE;
				} else {
					if (G_TYPE_CHECK_INSTANCE_TYPE (self, VALA_TYPE_ERROR_CODE)) {
						instance = FALSE;
					}
				}
			}
		}
	}
	result = instance;
	return result;
}


gboolean vala_symbol_is_instance_member (ValaSymbol* self) {
	g_return_val_if_fail (self != NULL, FALSE);
	return VALA_SYMBOL_GET_CLASS (self)->is_instance_member (self);
}


static gboolean vala_symbol_real_is_class_member (ValaSymbol* self) {
	gboolean result = FALSE;
	gboolean isclass = FALSE;
	isclass = TRUE;
	if (G_TYPE_CHECK_INSTANCE_TYPE (self, VALA_TYPE_FIELD)) {
		ValaField* f = NULL;
		ValaField* _tmp0_;
		ValaField* _tmp1_;
		ValaMemberBinding _tmp2_;
		ValaMemberBinding _tmp3_;
		_tmp0_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (self, VALA_TYPE_FIELD, ValaField));
		f = _tmp0_;
		_tmp1_ = f;
		_tmp2_ = vala_field_get_binding (_tmp1_);
		_tmp3_ = _tmp2_;
		isclass = _tmp3_ == VALA_MEMBER_BINDING_CLASS;
		_vala_code_node_unref0 (f);
	} else {
		if (G_TYPE_CHECK_INSTANCE_TYPE (self, VALA_TYPE_METHOD)) {
			ValaMethod* m = NULL;
			ValaMethod* _tmp4_;
			ValaMethod* _tmp5_;
			_tmp4_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (self, VALA_TYPE_METHOD, ValaMethod));
			m = _tmp4_;
			_tmp5_ = m;
			if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, VALA_TYPE_CREATION_METHOD)) {
				ValaMethod* _tmp6_;
				ValaMemberBinding _tmp7_;
				ValaMemberBinding _tmp8_;
				_tmp6_ = m;
				_tmp7_ = vala_method_get_binding (_tmp6_);
				_tmp8_ = _tmp7_;
				isclass = _tmp8_ == VALA_MEMBER_BINDING_CLASS;
			}
			_vala_code_node_unref0 (m);
		} else {
			if (G_TYPE_CHECK_INSTANCE_TYPE (self, VALA_TYPE_PROPERTY)) {
				ValaProperty* prop = NULL;
				ValaProperty* _tmp9_;
				ValaProperty* _tmp10_;
				ValaMemberBinding _tmp11_;
				ValaMemberBinding _tmp12_;
				_tmp9_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (self, VALA_TYPE_PROPERTY, ValaProperty));
				prop = _tmp9_;
				_tmp10_ = prop;
				_tmp11_ = vala_property_get_binding (_tmp10_);
				_tmp12_ = _tmp11_;
				isclass = _tmp12_ == VALA_MEMBER_BINDING_CLASS;
				_vala_code_node_unref0 (prop);
			} else {
				if (G_TYPE_CHECK_INSTANCE_TYPE (self, VALA_TYPE_ENUM_VALUE)) {
					isclass = FALSE;
				} else {
					if (G_TYPE_CHECK_INSTANCE_TYPE (self, VALA_TYPE_ERROR_CODE)) {
						isclass = FALSE;
					}
				}
			}
		}
	}
	result = isclass;
	return result;
}


gboolean vala_symbol_is_class_member (ValaSymbol* self) {
	g_return_val_if_fail (self != NULL, FALSE);
	return VALA_SYMBOL_GET_CLASS (self)->is_class_member (self);
}


ValaSymbol* vala_symbol_get_hidden_member (ValaSymbol* self) {
	ValaSymbol* result = NULL;
	ValaSymbol* sym = NULL;
	ValaSymbol* _tmp0_;
	ValaSymbol* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	sym = NULL;
	_tmp0_ = vala_symbol_get_parent_symbol (self);
	_tmp1_ = _tmp0_;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALA_TYPE_CLASS)) {
		ValaClass* cl = NULL;
		ValaSymbol* _tmp2_;
		ValaSymbol* _tmp3_;
		ValaClass* _tmp4_;
		ValaClass* _tmp5_;
		ValaClass* _tmp6_;
		_tmp2_ = vala_symbol_get_parent_symbol (self);
		_tmp3_ = _tmp2_;
		_tmp4_ = vala_class_get_base_class (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, VALA_TYPE_CLASS, ValaClass));
		_tmp5_ = _tmp4_;
		_tmp6_ = _vala_code_node_ref0 (_tmp5_);
		cl = _tmp6_;
		while (TRUE) {
			ValaClass* _tmp7_;
			ValaClass* _tmp8_;
			ValaScope* _tmp9_;
			ValaScope* _tmp10_;
			const gchar* _tmp11_;
			ValaSymbol* _tmp12_;
			gboolean _tmp13_ = FALSE;
			ValaSymbol* _tmp14_;
			ValaClass* _tmp17_;
			ValaClass* _tmp18_;
			ValaClass* _tmp19_;
			ValaClass* _tmp20_;
			_tmp7_ = cl;
			if (!(_tmp7_ != NULL)) {
				break;
			}
			_tmp8_ = cl;
			_tmp9_ = vala_symbol_get_scope ((ValaSymbol*) _tmp8_);
			_tmp10_ = _tmp9_;
			_tmp11_ = self->priv->_name;
			_tmp12_ = vala_scope_lookup (_tmp10_, _tmp11_);
			_vala_code_node_unref0 (sym);
			sym = _tmp12_;
			_tmp14_ = sym;
			if (_tmp14_ != NULL) {
				ValaSymbol* _tmp15_;
				ValaSymbolAccessibility _tmp16_;
				_tmp15_ = sym;
				_tmp16_ = _tmp15_->priv->_access;
				_tmp13_ = _tmp16_ != VALA_SYMBOL_ACCESSIBILITY_PRIVATE;
			} else {
				_tmp13_ = FALSE;
			}
			if (_tmp13_) {
				result = sym;
				_vala_code_node_unref0 (cl);
				return result;
			}
			_tmp17_ = cl;
			_tmp18_ = vala_class_get_base_class (_tmp17_);
			_tmp19_ = _tmp18_;
			_tmp20_ = _vala_code_node_ref0 (_tmp19_);
			_vala_code_node_unref0 (cl);
			cl = _tmp20_;
		}
		_vala_code_node_unref0 (cl);
	} else {
		ValaSymbol* _tmp21_;
		ValaSymbol* _tmp22_;
		_tmp21_ = vala_symbol_get_parent_symbol (self);
		_tmp22_ = _tmp21_;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp22_, VALA_TYPE_STRUCT)) {
			ValaStruct* st = NULL;
			ValaSymbol* _tmp23_;
			ValaSymbol* _tmp24_;
			ValaStruct* _tmp25_;
			ValaStruct* _tmp26_;
			ValaStruct* _tmp27_;
			_tmp23_ = vala_symbol_get_parent_symbol (self);
			_tmp24_ = _tmp23_;
			_tmp25_ = vala_struct_get_base_struct (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, VALA_TYPE_STRUCT, ValaStruct));
			_tmp26_ = _tmp25_;
			_tmp27_ = _vala_code_node_ref0 (_tmp26_);
			st = _tmp27_;
			while (TRUE) {
				ValaStruct* _tmp28_;
				ValaStruct* _tmp29_;
				ValaScope* _tmp30_;
				ValaScope* _tmp31_;
				const gchar* _tmp32_;
				ValaSymbol* _tmp33_;
				gboolean _tmp34_ = FALSE;
				ValaSymbol* _tmp35_;
				ValaStruct* _tmp38_;
				ValaStruct* _tmp39_;
				ValaStruct* _tmp40_;
				ValaStruct* _tmp41_;
				_tmp28_ = st;
				if (!(_tmp28_ != NULL)) {
					break;
				}
				_tmp29_ = st;
				_tmp30_ = vala_symbol_get_scope ((ValaSymbol*) _tmp29_);
				_tmp31_ = _tmp30_;
				_tmp32_ = self->priv->_name;
				_tmp33_ = vala_scope_lookup (_tmp31_, _tmp32_);
				_vala_code_node_unref0 (sym);
				sym = _tmp33_;
				_tmp35_ = sym;
				if (_tmp35_ != NULL) {
					ValaSymbol* _tmp36_;
					ValaSymbolAccessibility _tmp37_;
					_tmp36_ = sym;
					_tmp37_ = _tmp36_->priv->_access;
					_tmp34_ = _tmp37_ != VALA_SYMBOL_ACCESSIBILITY_PRIVATE;
				} else {
					_tmp34_ = FALSE;
				}
				if (_tmp34_) {
					result = sym;
					_vala_code_node_unref0 (st);
					return result;
				}
				_tmp38_ = st;
				_tmp39_ = vala_struct_get_base_struct (_tmp38_);
				_tmp40_ = _tmp39_;
				_tmp41_ = _vala_code_node_ref0 (_tmp40_);
				_vala_code_node_unref0 (st);
				st = _tmp41_;
			}
			_vala_code_node_unref0 (st);
		}
	}
	result = NULL;
	_vala_code_node_unref0 (sym);
	return result;
}


gboolean vala_symbol_is_accessible (ValaSymbol* self, ValaSymbol* sym) {
	gboolean result = FALSE;
	ValaScope* sym_scope = NULL;
	ValaSymbol* _tmp0_;
	ValaScope* _tmp1_;
	ValaScope* this_scope = NULL;
	ValaScope* _tmp2_;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_ = FALSE;
	ValaScope* _tmp5_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (sym != NULL, FALSE);
	_tmp0_ = sym;
	_tmp1_ = vala_symbol_get_top_accessible_scope (_tmp0_, FALSE);
	sym_scope = _tmp1_;
	_tmp2_ = vala_symbol_get_top_accessible_scope (self, FALSE);
	this_scope = _tmp2_;
	_tmp5_ = sym_scope;
	if (_tmp5_ == NULL) {
		ValaScope* _tmp6_;
		_tmp6_ = this_scope;
		_tmp4_ = _tmp6_ != NULL;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		_tmp3_ = TRUE;
	} else {
		gboolean _tmp7_ = FALSE;
		ValaScope* _tmp8_;
		_tmp8_ = sym_scope;
		if (_tmp8_ != NULL) {
			ValaScope* _tmp9_;
			ValaScope* _tmp10_;
			gboolean _tmp11_;
			_tmp9_ = sym_scope;
			_tmp10_ = this_scope;
			_tmp11_ = vala_scope_is_subscope_of (_tmp9_, _tmp10_);
			_tmp7_ = !_tmp11_;
		} else {
			_tmp7_ = FALSE;
		}
		_tmp3_ = _tmp7_;
	}
	if (_tmp3_) {
		result = FALSE;
		_vala_scope_unref0 (this_scope);
		_vala_scope_unref0 (sym_scope);
		return result;
	}
	result = TRUE;
	_vala_scope_unref0 (this_scope);
	_vala_scope_unref0 (sym_scope);
	return result;
}


static void vala_symbol_real_add_namespace (ValaSymbol* self, ValaNamespace* ns) {
	ValaNamespace* _tmp0_;
	ValaSourceReference* _tmp1_;
	ValaSourceReference* _tmp2_;
	g_return_if_fail (ns != NULL);
	_tmp0_ = ns;
	_tmp1_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp0_);
	_tmp2_ = _tmp1_;
	vala_report_error (_tmp2_, "unexpected declaration");
}


void vala_symbol_add_namespace (ValaSymbol* self, ValaNamespace* ns) {
	g_return_if_fail (self != NULL);
	VALA_SYMBOL_GET_CLASS (self)->add_namespace (self, ns);
}


static void vala_symbol_real_add_class (ValaSymbol* self, ValaClass* cl) {
	ValaClass* _tmp0_;
	ValaSourceReference* _tmp1_;
	ValaSourceReference* _tmp2_;
	g_return_if_fail (cl != NULL);
	_tmp0_ = cl;
	_tmp1_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp0_);
	_tmp2_ = _tmp1_;
	vala_report_error (_tmp2_, "unexpected declaration");
}


void vala_symbol_add_class (ValaSymbol* self, ValaClass* cl) {
	g_return_if_fail (self != NULL);
	VALA_SYMBOL_GET_CLASS (self)->add_class (self, cl);
}


static void vala_symbol_real_add_interface (ValaSymbol* self, ValaInterface* iface) {
	ValaInterface* _tmp0_;
	ValaSourceReference* _tmp1_;
	ValaSourceReference* _tmp2_;
	g_return_if_fail (iface != NULL);
	_tmp0_ = iface;
	_tmp1_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp0_);
	_tmp2_ = _tmp1_;
	vala_report_error (_tmp2_, "unexpected declaration");
}


void vala_symbol_add_interface (ValaSymbol* self, ValaInterface* iface) {
	g_return_if_fail (self != NULL);
	VALA_SYMBOL_GET_CLASS (self)->add_interface (self, iface);
}


static void vala_symbol_real_add_struct (ValaSymbol* self, ValaStruct* st) {
	ValaStruct* _tmp0_;
	ValaSourceReference* _tmp1_;
	ValaSourceReference* _tmp2_;
	g_return_if_fail (st != NULL);
	_tmp0_ = st;
	_tmp1_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp0_);
	_tmp2_ = _tmp1_;
	vala_report_error (_tmp2_, "unexpected declaration");
}


void vala_symbol_add_struct (ValaSymbol* self, ValaStruct* st) {
	g_return_if_fail (self != NULL);
	VALA_SYMBOL_GET_CLASS (self)->add_struct (self, st);
}


static void vala_symbol_real_add_enum (ValaSymbol* self, ValaEnum* en) {
	ValaEnum* _tmp0_;
	ValaSourceReference* _tmp1_;
	ValaSourceReference* _tmp2_;
	g_return_if_fail (en != NULL);
	_tmp0_ = en;
	_tmp1_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp0_);
	_tmp2_ = _tmp1_;
	vala_report_error (_tmp2_, "unexpected declaration");
}


void vala_symbol_add_enum (ValaSymbol* self, ValaEnum* en) {
	g_return_if_fail (self != NULL);
	VALA_SYMBOL_GET_CLASS (self)->add_enum (self, en);
}


static void vala_symbol_real_add_error_domain (ValaSymbol* self, ValaErrorDomain* edomain) {
	ValaErrorDomain* _tmp0_;
	ValaSourceReference* _tmp1_;
	ValaSourceReference* _tmp2_;
	g_return_if_fail (edomain != NULL);
	_tmp0_ = edomain;
	_tmp1_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp0_);
	_tmp2_ = _tmp1_;
	vala_report_error (_tmp2_, "unexpected declaration");
}


void vala_symbol_add_error_domain (ValaSymbol* self, ValaErrorDomain* edomain) {
	g_return_if_fail (self != NULL);
	VALA_SYMBOL_GET_CLASS (self)->add_error_domain (self, edomain);
}


static void vala_symbol_real_add_delegate (ValaSymbol* self, ValaDelegate* d) {
	ValaDelegate* _tmp0_;
	ValaSourceReference* _tmp1_;
	ValaSourceReference* _tmp2_;
	g_return_if_fail (d != NULL);
	_tmp0_ = d;
	_tmp1_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp0_);
	_tmp2_ = _tmp1_;
	vala_report_error (_tmp2_, "unexpected declaration");
}


void vala_symbol_add_delegate (ValaSymbol* self, ValaDelegate* d) {
	g_return_if_fail (self != NULL);
	VALA_SYMBOL_GET_CLASS (self)->add_delegate (self, d);
}


static void vala_symbol_real_add_constant (ValaSymbol* self, ValaConstant* constant) {
	ValaConstant* _tmp0_;
	ValaSourceReference* _tmp1_;
	ValaSourceReference* _tmp2_;
	g_return_if_fail (constant != NULL);
	_tmp0_ = constant;
	_tmp1_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp0_);
	_tmp2_ = _tmp1_;
	vala_report_error (_tmp2_, "unexpected declaration");
}


void vala_symbol_add_constant (ValaSymbol* self, ValaConstant* constant) {
	g_return_if_fail (self != NULL);
	VALA_SYMBOL_GET_CLASS (self)->add_constant (self, constant);
}


static void vala_symbol_real_add_field (ValaSymbol* self, ValaField* f) {
	ValaField* _tmp0_;
	ValaSourceReference* _tmp1_;
	ValaSourceReference* _tmp2_;
	g_return_if_fail (f != NULL);
	_tmp0_ = f;
	_tmp1_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp0_);
	_tmp2_ = _tmp1_;
	vala_report_error (_tmp2_, "unexpected declaration");
}


void vala_symbol_add_field (ValaSymbol* self, ValaField* f) {
	g_return_if_fail (self != NULL);
	VALA_SYMBOL_GET_CLASS (self)->add_field (self, f);
}


static void vala_symbol_real_add_method (ValaSymbol* self, ValaMethod* m) {
	ValaMethod* _tmp0_;
	ValaSourceReference* _tmp1_;
	ValaSourceReference* _tmp2_;
	g_return_if_fail (m != NULL);
	_tmp0_ = m;
	_tmp1_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp0_);
	_tmp2_ = _tmp1_;
	vala_report_error (_tmp2_, "unexpected declaration");
}


void vala_symbol_add_method (ValaSymbol* self, ValaMethod* m) {
	g_return_if_fail (self != NULL);
	VALA_SYMBOL_GET_CLASS (self)->add_method (self, m);
}


static void vala_symbol_real_add_property (ValaSymbol* self, ValaProperty* prop) {
	ValaProperty* _tmp0_;
	ValaSourceReference* _tmp1_;
	ValaSourceReference* _tmp2_;
	g_return_if_fail (prop != NULL);
	_tmp0_ = prop;
	_tmp1_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp0_);
	_tmp2_ = _tmp1_;
	vala_report_error (_tmp2_, "unexpected declaration");
}


void vala_symbol_add_property (ValaSymbol* self, ValaProperty* prop) {
	g_return_if_fail (self != NULL);
	VALA_SYMBOL_GET_CLASS (self)->add_property (self, prop);
}


static void vala_symbol_real_add_signal (ValaSymbol* self, ValaSignal* sig) {
	ValaSignal* _tmp0_;
	ValaSourceReference* _tmp1_;
	ValaSourceReference* _tmp2_;
	g_return_if_fail (sig != NULL);
	_tmp0_ = sig;
	_tmp1_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp0_);
	_tmp2_ = _tmp1_;
	vala_report_error (_tmp2_, "unexpected declaration");
}


void vala_symbol_add_signal (ValaSymbol* self, ValaSignal* sig) {
	g_return_if_fail (self != NULL);
	VALA_SYMBOL_GET_CLASS (self)->add_signal (self, sig);
}


static void vala_symbol_real_add_constructor (ValaSymbol* self, ValaConstructor* c) {
	ValaConstructor* _tmp0_;
	ValaSourceReference* _tmp1_;
	ValaSourceReference* _tmp2_;
	g_return_if_fail (c != NULL);
	_tmp0_ = c;
	_tmp1_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp0_);
	_tmp2_ = _tmp1_;
	vala_report_error (_tmp2_, "unexpected declaration");
}


void vala_symbol_add_constructor (ValaSymbol* self, ValaConstructor* c) {
	g_return_if_fail (self != NULL);
	VALA_SYMBOL_GET_CLASS (self)->add_constructor (self, c);
}


static void vala_symbol_real_add_destructor (ValaSymbol* self, ValaDestructor* d) {
	ValaDestructor* _tmp0_;
	ValaSourceReference* _tmp1_;
	ValaSourceReference* _tmp2_;
	g_return_if_fail (d != NULL);
	_tmp0_ = d;
	_tmp1_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp0_);
	_tmp2_ = _tmp1_;
	vala_report_error (_tmp2_, "unexpected declaration");
}


void vala_symbol_add_destructor (ValaSymbol* self, ValaDestructor* d) {
	g_return_if_fail (self != NULL);
	VALA_SYMBOL_GET_CLASS (self)->add_destructor (self, d);
}


ValaSymbol* vala_symbol_get_parent_symbol (ValaSymbol* self) {
	ValaSymbol* result;
	ValaScope* _tmp0_;
	ValaScope* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = vala_symbol_get_owner (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		result = NULL;
		return result;
	} else {
		ValaScope* _tmp2_;
		ValaScope* _tmp3_;
		ValaSymbol* _tmp4_;
		ValaSymbol* _tmp5_;
		_tmp2_ = vala_symbol_get_owner (self);
		_tmp3_ = _tmp2_;
		_tmp4_ = vala_scope_get_owner (_tmp3_);
		_tmp5_ = _tmp4_;
		result = _tmp5_;
		return result;
	}
}


ValaScope* vala_symbol_get_owner (ValaSymbol* self) {
	ValaScope* result;
	ValaScope* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_owner;
	result = _tmp0_;
	return result;
}


void vala_symbol_set_owner (ValaSymbol* self, ValaScope* value) {
	ValaScope* _tmp0_;
	ValaScope* _tmp1_;
	ValaScope* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_owner = _tmp0_;
	_tmp1_ = self->priv->_scope;
	_tmp2_ = value;
	vala_scope_set_parent_scope (_tmp1_, _tmp2_);
}


const gchar* vala_symbol_get_name (ValaSymbol* self) {
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_name;
	result = _tmp0_;
	return result;
}


void vala_symbol_set_name (ValaSymbol* self, const gchar* value) {
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_name);
	self->priv->_name = _tmp1_;
}


gboolean vala_symbol_get_active (ValaSymbol* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_active;
	result = _tmp0_;
	return result;
}


void vala_symbol_set_active (ValaSymbol* self, gboolean value) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_active = _tmp0_;
}


gboolean vala_symbol_get_used (ValaSymbol* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_used;
	result = _tmp0_;
	return result;
}


void vala_symbol_set_used (ValaSymbol* self, gboolean value) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_used = _tmp0_;
}


ValaSymbolAccessibility vala_symbol_get_access (ValaSymbol* self) {
	ValaSymbolAccessibility result;
	ValaSymbolAccessibility _tmp0_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->_access;
	result = _tmp0_;
	return result;
}


void vala_symbol_set_access (ValaSymbol* self, ValaSymbolAccessibility value) {
	ValaSymbolAccessibility _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_access = _tmp0_;
}


ValaComment* vala_symbol_get_comment (ValaSymbol* self) {
	ValaComment* result;
	ValaComment* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_comment;
	result = _tmp0_;
	return result;
}


static gpointer _vala_comment_ref0 (gpointer self) {
	return self ? vala_comment_ref (self) : NULL;
}


void vala_symbol_set_comment (ValaSymbol* self, ValaComment* value) {
	ValaComment* _tmp0_;
	ValaComment* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _vala_comment_ref0 (_tmp0_);
	_vala_comment_unref0 (self->priv->_comment);
	self->priv->_comment = _tmp1_;
}


ValaVersionAttribute* vala_symbol_get_version (ValaSymbol* self) {
	ValaVersionAttribute* result;
	ValaVersionAttribute* _tmp0_;
	ValaVersionAttribute* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_version;
	if (_tmp0_ == NULL) {
		ValaVersionAttribute* _tmp1_;
		_tmp1_ = vala_version_attribute_new (self);
		_vala_version_attribute_unref0 (self->priv->_version);
		self->priv->_version = _tmp1_;
	}
	_tmp2_ = self->priv->_version;
	result = _tmp2_;
	return result;
}


gboolean vala_symbol_get_hides (ValaSymbol* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_hides;
	result = _tmp0_;
	return result;
}


void vala_symbol_set_hides (ValaSymbol* self, gboolean value) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_hides = _tmp0_;
}


ValaScope* vala_symbol_get_scope (ValaSymbol* self) {
	ValaScope* result;
	ValaScope* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_scope;
	result = _tmp0_;
	return result;
}


gboolean vala_symbol_get_external (ValaSymbol* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_external;
	result = _tmp0_;
	return result;
}


void vala_symbol_set_external (ValaSymbol* self, gboolean value) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_external = _tmp0_;
}


gboolean vala_symbol_get_external_package (ValaSymbol* self) {
	gboolean result;
	ValaSourceFileType _tmp0_;
	ValaSourceFileType _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = vala_symbol_get_source_type (self);
	_tmp1_ = _tmp0_;
	result = _tmp1_ == VALA_SOURCE_FILE_TYPE_PACKAGE;
	return result;
}


gboolean vala_symbol_get_from_commandline (ValaSymbol* self) {
	gboolean result;
	ValaSourceReference* _tmp0_;
	ValaSourceReference* _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		ValaSourceReference* _tmp2_;
		ValaSourceReference* _tmp3_;
		ValaSourceFile* _tmp4_;
		ValaSourceFile* _tmp5_;
		gboolean _tmp6_;
		gboolean _tmp7_;
		_tmp2_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
		_tmp3_ = _tmp2_;
		_tmp4_ = vala_source_reference_get_file (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = vala_source_file_get_from_commandline (_tmp5_);
		_tmp7_ = _tmp6_;
		result = _tmp7_;
		return result;
	} else {
		result = FALSE;
		return result;
	}
}


ValaSourceFileType vala_symbol_get_source_type (ValaSymbol* self) {
	ValaSourceFileType result;
	ValaSourceReference* _tmp0_;
	ValaSourceReference* _tmp1_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		ValaSourceReference* _tmp2_;
		ValaSourceReference* _tmp3_;
		ValaSourceFile* _tmp4_;
		ValaSourceFile* _tmp5_;
		ValaSourceFileType _tmp6_;
		ValaSourceFileType _tmp7_;
		_tmp2_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
		_tmp3_ = _tmp2_;
		_tmp4_ = vala_source_reference_get_file (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = vala_source_file_get_file_type (_tmp5_);
		_tmp7_ = _tmp6_;
		result = _tmp7_;
		return result;
	} else {
		result = VALA_SOURCE_FILE_TYPE_NONE;
		return result;
	}
}


static void vala_symbol_class_init (ValaSymbolClass * klass) {
	vala_symbol_parent_class = g_type_class_peek_parent (klass);
	((ValaCodeNodeClass *) klass)->finalize = vala_symbol_finalize;
	g_type_class_add_private (klass, sizeof (ValaSymbolPrivate));
	((ValaSymbolClass *) klass)->is_instance_member = (gboolean (*) (ValaSymbol *)) vala_symbol_real_is_instance_member;
	((ValaSymbolClass *) klass)->is_class_member = (gboolean (*) (ValaSymbol *)) vala_symbol_real_is_class_member;
	((ValaSymbolClass *) klass)->add_namespace = (void (*) (ValaSymbol *, ValaNamespace*)) vala_symbol_real_add_namespace;
	((ValaSymbolClass *) klass)->add_class = (void (*) (ValaSymbol *, ValaClass*)) vala_symbol_real_add_class;
	((ValaSymbolClass *) klass)->add_interface = (void (*) (ValaSymbol *, ValaInterface*)) vala_symbol_real_add_interface;
	((ValaSymbolClass *) klass)->add_struct = (void (*) (ValaSymbol *, ValaStruct*)) vala_symbol_real_add_struct;
	((ValaSymbolClass *) klass)->add_enum = (void (*) (ValaSymbol *, ValaEnum*)) vala_symbol_real_add_enum;
	((ValaSymbolClass *) klass)->add_error_domain = (void (*) (ValaSymbol *, ValaErrorDomain*)) vala_symbol_real_add_error_domain;
	((ValaSymbolClass *) klass)->add_delegate = (void (*) (ValaSymbol *, ValaDelegate*)) vala_symbol_real_add_delegate;
	((ValaSymbolClass *) klass)->add_constant = (void (*) (ValaSymbol *, ValaConstant*)) vala_symbol_real_add_constant;
	((ValaSymbolClass *) klass)->add_field = (void (*) (ValaSymbol *, ValaField*)) vala_symbol_real_add_field;
	((ValaSymbolClass *) klass)->add_method = (void (*) (ValaSymbol *, ValaMethod*)) vala_symbol_real_add_method;
	((ValaSymbolClass *) klass)->add_property = (void (*) (ValaSymbol *, ValaProperty*)) vala_symbol_real_add_property;
	((ValaSymbolClass *) klass)->add_signal = (void (*) (ValaSymbol *, ValaSignal*)) vala_symbol_real_add_signal;
	((ValaSymbolClass *) klass)->add_constructor = (void (*) (ValaSymbol *, ValaConstructor*)) vala_symbol_real_add_constructor;
	((ValaSymbolClass *) klass)->add_destructor = (void (*) (ValaSymbol *, ValaDestructor*)) vala_symbol_real_add_destructor;
}


static void vala_symbol_instance_init (ValaSymbol * self) {
	self->priv = VALA_SYMBOL_GET_PRIVATE (self);
	self->priv->_active = TRUE;
}


static void vala_symbol_finalize (ValaCodeNode * obj) {
	ValaSymbol * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALA_TYPE_SYMBOL, ValaSymbol);
	_g_free0 (self->priv->_name);
	_vala_comment_unref0 (self->priv->_comment);
	_vala_version_attribute_unref0 (self->priv->_version);
	_vala_scope_unref0 (self->priv->_scope);
	VALA_CODE_NODE_CLASS (vala_symbol_parent_class)->finalize (obj);
}


/**
 * Represents a node in the symbol tree.
 */
GType vala_symbol_get_type (void) {
	static volatile gsize vala_symbol_type_id__volatile = 0;
	if (g_once_init_enter (&vala_symbol_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ValaSymbolClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_symbol_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaSymbol), 0, (GInstanceInitFunc) vala_symbol_instance_init, NULL };
		GType vala_symbol_type_id;
		vala_symbol_type_id = g_type_register_static (VALA_TYPE_CODE_NODE, "ValaSymbol", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
		g_once_init_leave (&vala_symbol_type_id__volatile, vala_symbol_type_id);
	}
	return vala_symbol_type_id__volatile;
}


GType vala_symbol_accessibility_get_type (void) {
	static volatile gsize vala_symbol_accessibility_type_id__volatile = 0;
	if (g_once_init_enter (&vala_symbol_accessibility_type_id__volatile)) {
		static const GEnumValue values[] = {{VALA_SYMBOL_ACCESSIBILITY_PRIVATE, "VALA_SYMBOL_ACCESSIBILITY_PRIVATE", "private"}, {VALA_SYMBOL_ACCESSIBILITY_INTERNAL, "VALA_SYMBOL_ACCESSIBILITY_INTERNAL", "internal"}, {VALA_SYMBOL_ACCESSIBILITY_PROTECTED, "VALA_SYMBOL_ACCESSIBILITY_PROTECTED", "protected"}, {VALA_SYMBOL_ACCESSIBILITY_PUBLIC, "VALA_SYMBOL_ACCESSIBILITY_PUBLIC", "public"}, {0, NULL, NULL}};
		GType vala_symbol_accessibility_type_id;
		vala_symbol_accessibility_type_id = g_enum_register_static ("ValaSymbolAccessibility", values);
		g_once_init_leave (&vala_symbol_accessibility_type_id__volatile, vala_symbol_accessibility_type_id);
	}
	return vala_symbol_accessibility_type_id__volatile;
}


GType vala_member_binding_get_type (void) {
	static volatile gsize vala_member_binding_type_id__volatile = 0;
	if (g_once_init_enter (&vala_member_binding_type_id__volatile)) {
		static const GEnumValue values[] = {{VALA_MEMBER_BINDING_INSTANCE, "VALA_MEMBER_BINDING_INSTANCE", "instance"}, {VALA_MEMBER_BINDING_CLASS, "VALA_MEMBER_BINDING_CLASS", "class"}, {VALA_MEMBER_BINDING_STATIC, "VALA_MEMBER_BINDING_STATIC", "static"}, {0, NULL, NULL}};
		GType vala_member_binding_type_id;
		vala_member_binding_type_id = g_enum_register_static ("ValaMemberBinding", values);
		g_once_init_leave (&vala_member_binding_type_id__volatile, vala_member_binding_type_id);
	}
	return vala_member_binding_type_id__volatile;
}



