/* codedom.c generated by valac 0.12.1.1-323029-dirty, the Vala compiler
 * generated from codedom.vala, do not modify */

/* ast.vala
 *
 * Copyright (C) 2009  Andrea Del Signore
 *
 * 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, see <http://www.gnu.org/licenses/>.
 *
 * Author:
 * 	Andrea Del Signore <sejerpz@tin.it>
 */

#include <glib.h>
#include <glib-object.h>
#include <valagee.h>
#include <stdlib.h>
#include <string.h>
#include <gobject/gvaluecollector.h>


#define AFRODITE_TYPE_CODE_DOM (afrodite_code_dom_get_type ())
#define AFRODITE_CODE_DOM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AFRODITE_TYPE_CODE_DOM, AfroditeCodeDom))
#define AFRODITE_CODE_DOM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AFRODITE_TYPE_CODE_DOM, AfroditeCodeDomClass))
#define AFRODITE_IS_CODE_DOM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AFRODITE_TYPE_CODE_DOM))
#define AFRODITE_IS_CODE_DOM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AFRODITE_TYPE_CODE_DOM))
#define AFRODITE_CODE_DOM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AFRODITE_TYPE_CODE_DOM, AfroditeCodeDomClass))

typedef struct _AfroditeCodeDom AfroditeCodeDom;
typedef struct _AfroditeCodeDomClass AfroditeCodeDomClass;
typedef struct _AfroditeCodeDomPrivate AfroditeCodeDomPrivate;

#define AFRODITE_TYPE_SYMBOL (afrodite_symbol_get_type ())
#define AFRODITE_SYMBOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AFRODITE_TYPE_SYMBOL, AfroditeSymbol))
#define AFRODITE_SYMBOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AFRODITE_TYPE_SYMBOL, AfroditeSymbolClass))
#define AFRODITE_IS_SYMBOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AFRODITE_TYPE_SYMBOL))
#define AFRODITE_IS_SYMBOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AFRODITE_TYPE_SYMBOL))
#define AFRODITE_SYMBOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AFRODITE_TYPE_SYMBOL, AfroditeSymbolClass))

typedef struct _AfroditeSymbol AfroditeSymbol;
typedef struct _AfroditeSymbolClass AfroditeSymbolClass;

#define AFRODITE_TYPE_SOURCE_FILE (afrodite_source_file_get_type ())
#define AFRODITE_SOURCE_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AFRODITE_TYPE_SOURCE_FILE, AfroditeSourceFile))
#define AFRODITE_SOURCE_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AFRODITE_TYPE_SOURCE_FILE, AfroditeSourceFileClass))
#define AFRODITE_IS_SOURCE_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AFRODITE_TYPE_SOURCE_FILE))
#define AFRODITE_IS_SOURCE_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AFRODITE_TYPE_SOURCE_FILE))
#define AFRODITE_SOURCE_FILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AFRODITE_TYPE_SOURCE_FILE, AfroditeSourceFileClass))

typedef struct _AfroditeSourceFile AfroditeSourceFile;
typedef struct _AfroditeSourceFileClass AfroditeSourceFileClass;
#define _afrodite_source_file_unref0(var) ((var == NULL) ? NULL : (var = (afrodite_source_file_unref (var), NULL)))
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _vala_map_unref0(var) ((var == NULL) ? NULL : (var = (vala_map_unref (var), NULL)))

#define AFRODITE_TYPE_MEMBER_TYPE (afrodite_member_type_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))
#define _vala_iterator_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterator_unref (var), NULL)))

#define AFRODITE_TYPE_COMPARE_MODE (afrodite_compare_mode_get_type ())

#define AFRODITE_TYPE_SYMBOL_ACCESSIBILITY (afrodite_symbol_accessibility_get_type ())

#define AFRODITE_TYPE_MEMBER_BINDING (afrodite_member_binding_get_type ())

#define AFRODITE_TYPE_CASE_SENSITIVENESS (afrodite_case_sensitiveness_get_type ())
typedef struct _AfroditeSymbolPrivate AfroditeSymbolPrivate;

#define AFRODITE_TYPE_SOURCE_REFERENCE (afrodite_source_reference_get_type ())
#define AFRODITE_SOURCE_REFERENCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AFRODITE_TYPE_SOURCE_REFERENCE, AfroditeSourceReference))
#define AFRODITE_SOURCE_REFERENCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AFRODITE_TYPE_SOURCE_REFERENCE, AfroditeSourceReferenceClass))
#define AFRODITE_IS_SOURCE_REFERENCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AFRODITE_TYPE_SOURCE_REFERENCE))
#define AFRODITE_IS_SOURCE_REFERENCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AFRODITE_TYPE_SOURCE_REFERENCE))
#define AFRODITE_SOURCE_REFERENCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AFRODITE_TYPE_SOURCE_REFERENCE, AfroditeSourceReferenceClass))

typedef struct _AfroditeSourceReference AfroditeSourceReference;
typedef struct _AfroditeSourceReferenceClass AfroditeSourceReferenceClass;

#define AFRODITE_TYPE_QUERY_OPTIONS (afrodite_query_options_get_type ())
#define AFRODITE_QUERY_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AFRODITE_TYPE_QUERY_OPTIONS, AfroditeQueryOptions))
#define AFRODITE_QUERY_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AFRODITE_TYPE_QUERY_OPTIONS, AfroditeQueryOptionsClass))
#define AFRODITE_IS_QUERY_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AFRODITE_TYPE_QUERY_OPTIONS))
#define AFRODITE_IS_QUERY_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AFRODITE_TYPE_QUERY_OPTIONS))
#define AFRODITE_QUERY_OPTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AFRODITE_TYPE_QUERY_OPTIONS, AfroditeQueryOptionsClass))

typedef struct _AfroditeQueryOptions AfroditeQueryOptions;
typedef struct _AfroditeQueryOptionsClass AfroditeQueryOptionsClass;

#define AFRODITE_TYPE_QUERY_RESULT (afrodite_query_result_get_type ())
#define AFRODITE_QUERY_RESULT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AFRODITE_TYPE_QUERY_RESULT, AfroditeQueryResult))
#define AFRODITE_QUERY_RESULT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AFRODITE_TYPE_QUERY_RESULT, AfroditeQueryResultClass))
#define AFRODITE_IS_QUERY_RESULT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AFRODITE_TYPE_QUERY_RESULT))
#define AFRODITE_IS_QUERY_RESULT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AFRODITE_TYPE_QUERY_RESULT))
#define AFRODITE_QUERY_RESULT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AFRODITE_TYPE_QUERY_RESULT, AfroditeQueryResultClass))

typedef struct _AfroditeQueryResult AfroditeQueryResult;
typedef struct _AfroditeQueryResultClass AfroditeQueryResultClass;

#define AFRODITE_TYPE_LOOKUP_MODE (afrodite_lookup_mode_get_type ())
typedef struct _AfroditeQueryOptionsPrivate AfroditeQueryOptionsPrivate;

#define AFRODITE_TYPE_RESULT_ITEM (afrodite_result_item_get_type ())
#define AFRODITE_RESULT_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AFRODITE_TYPE_RESULT_ITEM, AfroditeResultItem))
#define AFRODITE_RESULT_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AFRODITE_TYPE_RESULT_ITEM, AfroditeResultItemClass))
#define AFRODITE_IS_RESULT_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AFRODITE_TYPE_RESULT_ITEM))
#define AFRODITE_IS_RESULT_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AFRODITE_TYPE_RESULT_ITEM))
#define AFRODITE_RESULT_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AFRODITE_TYPE_RESULT_ITEM, AfroditeResultItemClass))

typedef struct _AfroditeResultItem AfroditeResultItem;
typedef struct _AfroditeResultItemClass AfroditeResultItemClass;
#define _afrodite_result_item_unref0(var) ((var == NULL) ? NULL : (var = (afrodite_result_item_unref (var), NULL)))
#define _afrodite_query_result_unref0(var) ((var == NULL) ? NULL : (var = (afrodite_query_result_unref (var), NULL)))

#define AFRODITE_TYPE_DATA_TYPE (afrodite_data_type_get_type ())
#define AFRODITE_DATA_TYPE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AFRODITE_TYPE_DATA_TYPE, AfroditeDataType))
#define AFRODITE_DATA_TYPE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AFRODITE_TYPE_DATA_TYPE, AfroditeDataTypeClass))
#define AFRODITE_IS_DATA_TYPE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AFRODITE_TYPE_DATA_TYPE))
#define AFRODITE_IS_DATA_TYPE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AFRODITE_TYPE_DATA_TYPE))
#define AFRODITE_DATA_TYPE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AFRODITE_TYPE_DATA_TYPE, AfroditeDataTypeClass))

typedef struct _AfroditeDataType AfroditeDataType;
typedef struct _AfroditeDataTypeClass AfroditeDataTypeClass;
#define _afrodite_source_reference_unref0(var) ((var == NULL) ? NULL : (var = (afrodite_source_reference_unref (var), NULL)))
#define _afrodite_data_type_unref0(var) ((var == NULL) ? NULL : (var = (afrodite_data_type_unref (var), NULL)))
typedef struct _AfroditeParamSpecCodeDom AfroditeParamSpecCodeDom;

struct _AfroditeCodeDom {
	GTypeInstance parent_instance;
	volatile int ref_count;
	AfroditeCodeDomPrivate * priv;
	ValaHashMap* symbols;
	ValaList* unresolved_symbols;
};

struct _AfroditeCodeDomClass {
	GTypeClass parent_class;
	void (*finalize) (AfroditeCodeDom *self);
};

struct _AfroditeCodeDomPrivate {
	AfroditeSymbol* _root;
	ValaList* _source_files;
};

typedef enum  {
	AFRODITE_MEMBER_TYPE_NONE,
	AFRODITE_MEMBER_TYPE_VOID,
	AFRODITE_MEMBER_TYPE_CONSTANT,
	AFRODITE_MEMBER_TYPE_ENUM,
	AFRODITE_MEMBER_TYPE_ENUM_VALUE,
	AFRODITE_MEMBER_TYPE_FIELD,
	AFRODITE_MEMBER_TYPE_PROPERTY,
	AFRODITE_MEMBER_TYPE_LOCAL_VARIABLE,
	AFRODITE_MEMBER_TYPE_SIGNAL,
	AFRODITE_MEMBER_TYPE_CREATION_METHOD,
	AFRODITE_MEMBER_TYPE_CONSTRUCTOR,
	AFRODITE_MEMBER_TYPE_DESTRUCTOR,
	AFRODITE_MEMBER_TYPE_METHOD,
	AFRODITE_MEMBER_TYPE_DELEGATE,
	AFRODITE_MEMBER_TYPE_PARAMETER,
	AFRODITE_MEMBER_TYPE_TYPE_PARAMETER,
	AFRODITE_MEMBER_TYPE_ERROR_DOMAIN,
	AFRODITE_MEMBER_TYPE_ERROR_CODE,
	AFRODITE_MEMBER_TYPE_NAMESPACE,
	AFRODITE_MEMBER_TYPE_STRUCT,
	AFRODITE_MEMBER_TYPE_CLASS,
	AFRODITE_MEMBER_TYPE_INTERFACE,
	AFRODITE_MEMBER_TYPE_SCOPED_CODE_NODE
} AfroditeMemberType;

typedef enum  {
	AFRODITE_COMPARE_MODE_EXACT,
	AFRODITE_COMPARE_MODE_START_WITH
} AfroditeCompareMode;

typedef enum  {
	AFRODITE_SYMBOL_ACCESSIBILITY_PRIVATE = 1,
	AFRODITE_SYMBOL_ACCESSIBILITY_INTERNAL = 1 << 1,
	AFRODITE_SYMBOL_ACCESSIBILITY_PROTECTED = 1 << 2,
	AFRODITE_SYMBOL_ACCESSIBILITY_PUBLIC = 1 << 3,
	AFRODITE_SYMBOL_ACCESSIBILITY_ANY = ((AFRODITE_SYMBOL_ACCESSIBILITY_PRIVATE | AFRODITE_SYMBOL_ACCESSIBILITY_INTERNAL) | AFRODITE_SYMBOL_ACCESSIBILITY_PROTECTED) | AFRODITE_SYMBOL_ACCESSIBILITY_PUBLIC
} AfroditeSymbolAccessibility;

typedef enum  {
	AFRODITE_MEMBER_BINDING_INSTANCE = 1,
	AFRODITE_MEMBER_BINDING_CLASS = 1 << 1,
	AFRODITE_MEMBER_BINDING_STATIC = 1 << 2,
	AFRODITE_MEMBER_BINDING_ANY = (AFRODITE_MEMBER_BINDING_INSTANCE | AFRODITE_MEMBER_BINDING_CLASS) | AFRODITE_MEMBER_BINDING_STATIC
} AfroditeMemberBinding;

typedef enum  {
	AFRODITE_CASE_SENSITIVENESS_CASE_SENSITIVE,
	AFRODITE_CASE_SENSITIVENESS_CASE_INSENSITIVE,
	AFRODITE_CASE_SENSITIVENESS_AUTO
} AfroditeCaseSensitiveness;

struct _AfroditeSymbol {
	GObject parent_instance;
	AfroditeSymbolPrivate * priv;
	ValaList* _resolved_targets;
	ValaList* resolve_targets;
	AfroditeMemberBinding binding;
	gboolean is_virtual;
	gboolean is_abstract;
	gboolean overrides;
	gint _static_child_count;
	gint _creation_method_child_count;
};

struct _AfroditeSymbolClass {
	GObjectClass parent_class;
};

typedef enum  {
	AFRODITE_LOOKUP_MODE_Symbol,
	AFRODITE_LOOKUP_MODE_Type
} AfroditeLookupMode;

struct _AfroditeQueryOptions {
	GTypeInstance parent_instance;
	volatile int ref_count;
	AfroditeQueryOptionsPrivate * priv;
	gboolean all_symbols;
	gboolean only_creation_methods;
	gboolean only_static_factories;
	gboolean only_error_domains;
	gboolean exclude_creation_methods;
	gboolean exclude_code_node;
	AfroditeSymbolAccessibility access;
	gboolean auto_member_binding_mode;
	AfroditeMemberBinding binding;
	AfroditeCompareMode compare_mode;
};

struct _AfroditeQueryOptionsClass {
	GTypeClass parent_class;
	void (*finalize) (AfroditeQueryOptions *self);
};

struct _AfroditeParamSpecCodeDom {
	GParamSpec parent_instance;
};


static gpointer afrodite_code_dom_parent_class = NULL;

gpointer afrodite_code_dom_ref (gpointer instance);
void afrodite_code_dom_unref (gpointer instance);
GParamSpec* afrodite_param_spec_code_dom (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void afrodite_value_set_code_dom (GValue* value, gpointer v_object);
void afrodite_value_take_code_dom (GValue* value, gpointer v_object);
gpointer afrodite_value_get_code_dom (const GValue* value);
GType afrodite_code_dom_get_type (void) G_GNUC_CONST;
GType afrodite_symbol_get_type (void) G_GNUC_CONST;
gpointer afrodite_source_file_ref (gpointer instance);
void afrodite_source_file_unref (gpointer instance);
GParamSpec* afrodite_param_spec_source_file (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void afrodite_value_set_source_file (GValue* value, gpointer v_object);
void afrodite_value_take_source_file (GValue* value, gpointer v_object);
gpointer afrodite_value_get_source_file (const GValue* value);
GType afrodite_source_file_get_type (void) G_GNUC_CONST;
#define AFRODITE_CODE_DOM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), AFRODITE_TYPE_CODE_DOM, AfroditeCodeDomPrivate))
enum  {
	AFRODITE_CODE_DOM_DUMMY_PROPERTY
};
void afrodite_utils_trace (const gchar* format, ...);
ValaList* afrodite_code_dom_get_source_files (AfroditeCodeDom* self);
void afrodite_source_file_set_codedom (AfroditeSourceFile* self, AfroditeCodeDom* value);
void afrodite_code_dom_set_source_files (AfroditeCodeDom* self, ValaList* value);
GType afrodite_member_type_get_type (void) G_GNUC_CONST;
AfroditeSymbol* afrodite_symbol_new (const gchar* symbol_name, AfroditeMemberType type);
AfroditeSymbol* afrodite_symbol_construct (GType object_type, const gchar* symbol_name, AfroditeMemberType type);
void afrodite_code_dom_dump_symbols (AfroditeCodeDom* self);
gchar* afrodite_symbol_get_fully_qualified_name (AfroditeSymbol* self);
AfroditeSymbol* afrodite_code_dom_lookup (AfroditeCodeDom* self, const gchar* fully_qualified_name);
GType afrodite_compare_mode_get_type (void) G_GNUC_CONST;
GType afrodite_symbol_accessibility_get_type (void) G_GNUC_CONST;
GType afrodite_member_binding_get_type (void) G_GNUC_CONST;
static AfroditeSymbol* afrodite_code_dom_lookup_symbol (const gchar* qualified_name, AfroditeSymbol* parent_symbol, AfroditeSymbol** parent, AfroditeCompareMode mode, AfroditeSymbolAccessibility access, AfroditeMemberBinding binding);
gboolean afrodite_symbol_get_has_children (AfroditeSymbol* self);
ValaList* afrodite_symbol_get_children (AfroditeSymbol* self);
GType afrodite_case_sensitiveness_get_type (void) G_GNUC_CONST;
static gboolean afrodite_code_dom_compare_symbol_names (const gchar* name1, const gchar* name2, AfroditeCompareMode mode, AfroditeCaseSensitiveness case_sensitiveness);
const gchar* afrodite_symbol_get_name (AfroditeSymbol* self);
AfroditeSymbolAccessibility afrodite_symbol_get_access (AfroditeSymbol* self);
AfroditeSourceFile* afrodite_code_dom_add_source_file (AfroditeCodeDom* self, const gchar* filename);
AfroditeSourceFile* afrodite_code_dom_lookup_source_file (AfroditeCodeDom* self, const gchar* filename);
AfroditeSourceFile* afrodite_source_file_new (const gchar* filename);
AfroditeSourceFile* afrodite_source_file_construct (GType object_type, const gchar* filename);
const gchar* afrodite_source_file_get_filename (AfroditeSourceFile* self);
void afrodite_code_dom_remove_source (AfroditeCodeDom* self, AfroditeSourceFile* source);
gboolean afrodite_source_file_get_has_symbols (AfroditeSourceFile* self);
ValaList* afrodite_source_file_get_symbols (AfroditeSourceFile* self);
gboolean afrodite_symbol_get_has_source_references (AfroditeSymbol* self);
gpointer afrodite_source_reference_ref (gpointer instance);
void afrodite_source_reference_unref (gpointer instance);
GParamSpec* afrodite_param_spec_source_reference (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void afrodite_value_set_source_reference (GValue* value, gpointer v_object);
void afrodite_value_take_source_reference (GValue* value, gpointer v_object);
gpointer afrodite_value_get_source_reference (const GValue* value);
GType afrodite_source_reference_get_type (void) G_GNUC_CONST;
ValaList* afrodite_symbol_get_source_references (AfroditeSymbol* self);
void afrodite_source_file_remove_symbol_from_codedom (AfroditeSourceFile* self, AfroditeSymbol* symbol);
AfroditeSymbol* afrodite_code_dom_lookup_symbol_at (AfroditeCodeDom* self, const gchar* filename, gint line, gint column);
AfroditeSymbol* afrodite_code_dom_get_symbol_for_source_and_position (AfroditeCodeDom* self, AfroditeSourceFile* source, gint line, gint column);
gpointer afrodite_query_options_ref (gpointer instance);
void afrodite_query_options_unref (gpointer instance);
GParamSpec* afrodite_param_spec_query_options (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void afrodite_value_set_query_options (GValue* value, gpointer v_object);
void afrodite_value_take_query_options (GValue* value, gpointer v_object);
gpointer afrodite_value_get_query_options (const GValue* value);
GType afrodite_query_options_get_type (void) G_GNUC_CONST;
gpointer afrodite_query_result_ref (gpointer instance);
void afrodite_query_result_unref (gpointer instance);
GParamSpec* afrodite_param_spec_query_result (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void afrodite_value_set_query_result (GValue* value, gpointer v_object);
void afrodite_value_take_query_result (GValue* value, gpointer v_object);
gpointer afrodite_value_get_query_result (const GValue* value);
GType afrodite_query_result_get_type (void) G_GNUC_CONST;
AfroditeQueryResult* afrodite_code_dom_get_symbol_for_name_and_path (AfroditeCodeDom* self, AfroditeQueryOptions* options, const gchar* symbol_qualified_name, const gchar* path, gint line, gint column);
AfroditeQueryResult* afrodite_query_result_new (void);
AfroditeQueryResult* afrodite_query_result_construct (GType object_type);
GType afrodite_lookup_mode_get_type (void) G_GNUC_CONST;
static AfroditeSymbol* afrodite_code_dom_get_symbol_or_type_for_name_and_path (AfroditeCodeDom* self, AfroditeLookupMode mode, AfroditeMemberBinding binding, AfroditeQueryOptions* options, const gchar* symbol_qualified_name, const gchar* path, gint line, gint column);
gpointer afrodite_result_item_ref (gpointer instance);
void afrodite_result_item_unref (gpointer instance);
GParamSpec* afrodite_param_spec_result_item (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void afrodite_value_set_result_item (GValue* value, gpointer v_object);
void afrodite_value_take_result_item (GValue* value, gpointer v_object);
gpointer afrodite_value_get_result_item (const GValue* value);
GType afrodite_result_item_get_type (void) G_GNUC_CONST;
AfroditeResultItem* afrodite_query_result_new_result_item (AfroditeQueryResult* self, AfroditeResultItem* parent, AfroditeSymbol* symbol);
void afrodite_query_result_add_result_item (AfroditeQueryResult* self, AfroditeResultItem* item);
AfroditeQueryResult* afrodite_code_dom_get_symbol_type_for_name_and_path (AfroditeCodeDom* self, AfroditeQueryOptions* options, const gchar* symbol_qualified_name, const gchar* path, gint line, gint column);
static AfroditeSymbol* afrodite_code_dom_lookup_name_with_symbol (AfroditeCodeDom* self, const gchar* name, AfroditeSymbol* symbol, AfroditeSourceFile* source, AfroditeCompareMode mode, AfroditeSymbolAccessibility access, AfroditeMemberBinding binding);
gpointer afrodite_data_type_ref (gpointer instance);
void afrodite_data_type_unref (gpointer instance);
GParamSpec* afrodite_param_spec_data_type (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void afrodite_value_set_data_type (GValue* value, gpointer v_object);
void afrodite_value_take_data_type (GValue* value, gpointer v_object);
gpointer afrodite_value_get_data_type (const GValue* value);
GType afrodite_data_type_get_type (void) G_GNUC_CONST;
AfroditeDataType* afrodite_symbol_get_symbol_type (AfroditeSymbol* self);
AfroditeSymbol* afrodite_data_type_get_symbol (AfroditeDataType* self);
AfroditeMemberType afrodite_symbol_get_member_type (AfroditeSymbol* self);
static AfroditeSymbol* afrodite_code_dom_lookup_name_in_base_types (AfroditeCodeDom* self, const gchar* name, AfroditeSymbol* symbol, AfroditeSymbolAccessibility access, AfroditeMemberBinding binding);
AfroditeQueryResult* afrodite_code_dom_get_symbols_for_path (AfroditeCodeDom* self, AfroditeQueryOptions* options, const gchar* path);
static void afrodite_code_dom_get_child_symbols_for_path (AfroditeCodeDom* self, AfroditeQueryResult* _result_, AfroditeQueryOptions* options, const gchar* path, AfroditeResultItem* parent);
ValaList* afrodite_result_item_get_children (AfroditeResultItem* self);
AfroditeSymbol* afrodite_result_item_get_symbol (AfroditeResultItem* self);
static gboolean afrodite_code_dom_symbol_has_filename_reference (AfroditeCodeDom* self, const gchar* filename, AfroditeSymbol* symbol);
gboolean afrodite_symbol_check_options (AfroditeSymbol* self, AfroditeQueryOptions* options);
void afrodite_result_item_add_result_item (AfroditeResultItem* self, AfroditeResultItem* item);
AfroditeSymbol* afrodite_symbol_get_parent (AfroditeSymbol* self);
AfroditeSourceFile* afrodite_source_reference_get_file (AfroditeSourceReference* self);
gboolean afrodite_symbol_get_has_base_types (AfroditeSymbol* self);
ValaList* afrodite_symbol_get_base_types (AfroditeSymbol* self);
gboolean afrodite_data_type_get_unresolved (AfroditeDataType* self);
static AfroditeSymbol* afrodite_code_dom_lookup_this_symbol (AfroditeCodeDom* self, AfroditeSymbol* root);
static void afrodite_code_dom_append_visible_symbols (AfroditeCodeDom* self, ValaList* results, AfroditeSymbol* symbol, const gchar* name, AfroditeCompareMode mode, AfroditeCaseSensitiveness case_sensitiveness, AfroditeSymbolAccessibility access);
gboolean afrodite_symbol_get_has_local_variables (AfroditeSymbol* self);
ValaList* afrodite_symbol_get_local_variables (AfroditeSymbol* self);
const gchar* afrodite_data_type_get_name (AfroditeDataType* self);
AfroditeDataType* afrodite_data_type_copy (AfroditeDataType* self);
void afrodite_symbol_set_return_type (AfroditeSymbol* self, AfroditeDataType* value);
AfroditeDataType* afrodite_symbol_get_return_type (AfroditeSymbol* self);
void afrodite_data_type_set_symbol (AfroditeDataType* self, AfroditeSymbol* value);
gboolean afrodite_symbol_get_has_parameters (AfroditeSymbol* self);
ValaList* afrodite_symbol_get_parameters (AfroditeSymbol* self);
static void afrodite_code_dom_append_all_visible_symbols (AfroditeCodeDom* self, ValaList* results, AfroditeSymbol* symbol, const gchar* name, AfroditeCompareMode mode, AfroditeCaseSensitiveness case_sensitiveness);
ValaList* afrodite_code_dom_lookup_visible_symbols_from_symbol (AfroditeCodeDom* self, AfroditeSymbol* symbol, const gchar* name, AfroditeCompareMode mode, AfroditeCaseSensitiveness case_sensitiveness);
gboolean afrodite_source_file_get_has_using_directives (AfroditeSourceFile* self);
ValaList* afrodite_source_file_get_using_directives (AfroditeSourceFile* self);
const gchar* afrodite_data_type_get_type_name (AfroditeDataType* self);
AfroditeSourceReference* afrodite_symbol_lookup_source_reference_sourcefile (AfroditeSymbol* self, AfroditeSourceFile* source);
gboolean afrodite_source_reference_contains_position (AfroditeSourceReference* self, gint line, gint column);
gboolean afrodite_source_reference_contains_source_reference (AfroditeSourceReference* self, AfroditeSourceReference* child);
AfroditeCodeDom* afrodite_code_dom_new (void);
AfroditeCodeDom* afrodite_code_dom_construct (GType object_type);
AfroditeSymbol* afrodite_code_dom_get_root (AfroditeCodeDom* self);
void afrodite_code_dom_set_root (AfroditeCodeDom* self, AfroditeSymbol* value);
gboolean afrodite_code_dom_get_has_source_files (AfroditeCodeDom* self);
static void afrodite_code_dom_finalize (AfroditeCodeDom* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);


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


void afrodite_code_dom_dump_symbols (AfroditeCodeDom* self) {
	g_return_if_fail (self != NULL);
	{
		ValaCollection* _tmp0_ = NULL;
		ValaCollection* _tmp1_;
		ValaIterator* _tmp2_ = NULL;
		ValaIterator* _tmp3_;
		ValaIterator* _s_it;
		_tmp0_ = vala_map_get_values ((ValaMap*) self->symbols);
		_tmp1_ = _tmp0_;
		_tmp2_ = vala_iterable_iterator ((ValaIterable*) _tmp1_);
		_tmp3_ = _tmp2_;
		_vala_iterable_unref0 (_tmp1_);
		_s_it = _tmp3_;
		while (TRUE) {
			gboolean _tmp4_;
			gpointer _tmp5_ = NULL;
			AfroditeSymbol* s;
			gchar* _tmp6_ = NULL;
			gchar* _tmp7_;
			_tmp4_ = vala_iterator_next (_s_it);
			if (!_tmp4_) {
				break;
			}
			_tmp5_ = vala_iterator_get (_s_it);
			s = (AfroditeSymbol*) _tmp5_;
			_tmp6_ = afrodite_symbol_get_fully_qualified_name (s);
			_tmp7_ = _tmp6_;
			afrodite_utils_trace ("codedom.vala:49: %s (%p)", _tmp7_, s);
			_g_free0 (_tmp7_);
		}
		_vala_iterator_unref0 (_s_it);
	}
}


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


AfroditeSymbol* afrodite_code_dom_lookup (AfroditeCodeDom* self, const gchar* fully_qualified_name) {
	AfroditeSymbol* result = NULL;
	AfroditeSymbol* _result_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (fully_qualified_name != NULL, NULL);
	_result_ = NULL;
	{
		ValaCollection* _tmp0_ = NULL;
		ValaCollection* _tmp1_;
		ValaIterator* _tmp2_ = NULL;
		ValaIterator* _tmp3_;
		ValaIterator* _s_it;
		_tmp0_ = vala_map_get_values ((ValaMap*) self->symbols);
		_tmp1_ = _tmp0_;
		_tmp2_ = vala_iterable_iterator ((ValaIterable*) _tmp1_);
		_tmp3_ = _tmp2_;
		_vala_iterable_unref0 (_tmp1_);
		_s_it = _tmp3_;
		while (TRUE) {
			gboolean _tmp4_;
			gpointer _tmp5_ = NULL;
			AfroditeSymbol* s;
			_tmp4_ = vala_iterator_next (_s_it);
			if (!_tmp4_) {
				break;
			}
			_tmp5_ = vala_iterator_get (_s_it);
			s = (AfroditeSymbol*) _tmp5_;
			if (G_IS_OBJECT (s)) {
				gchar* _tmp6_ = NULL;
				gchar* _tmp7_;
				gboolean _tmp8_;
				_tmp6_ = afrodite_symbol_get_fully_qualified_name (s);
				_tmp7_ = _tmp6_;
				_tmp8_ = g_strcmp0 (_tmp7_, fully_qualified_name) == 0;
				_g_free0 (_tmp7_);
				if (_tmp8_) {
					AfroditeSymbol* _tmp9_;
					_tmp9_ = _g_object_ref0 (s);
					_g_object_unref0 (_result_);
					_result_ = _tmp9_;
					break;
				}
			} else {
				g_critical ("codedom.vala:71: FIXME: destroyed object in symbol table: %p", s);
			}
		}
		_vala_iterator_unref0 (_s_it);
	}
	result = _result_;
	return result;
}


static AfroditeSymbol* afrodite_code_dom_lookup_symbol (const gchar* qualified_name, AfroditeSymbol* parent_symbol, AfroditeSymbol** parent, AfroditeCompareMode mode, AfroditeSymbolAccessibility access, AfroditeMemberBinding binding) {
	AfroditeSymbol* result = NULL;
	gchar** _tmp0_;
	gchar** _tmp1_ = NULL;
	gchar** tmp;
	gint tmp_length1;
	gint _tmp_size_;
	gchar* _tmp2_;
	gchar* name;
	gboolean _tmp3_;
	g_return_val_if_fail (qualified_name != NULL, NULL);
	g_return_val_if_fail (parent_symbol != NULL, NULL);
	_tmp1_ = _tmp0_ = g_strsplit (qualified_name, ".", 2);
	tmp = _tmp1_;
	tmp_length1 = _vala_array_length (_tmp0_);
	_tmp_size_ = _vala_array_length (_tmp0_);
	_tmp2_ = g_strdup (tmp[0]);
	name = _tmp2_;
	_tmp3_ = afrodite_symbol_get_has_children (parent_symbol);
	if (!_tmp3_) {
		result = NULL;
		_g_free0 (name);
		tmp = (_vala_array_free (tmp, tmp_length1, (GDestroyNotify) g_free), NULL);
		return result;
	}
	{
		ValaList* _tmp4_ = NULL;
		ValaList* _tmp5_;
		ValaList* _symbol_list;
		gint _tmp6_;
		gint _symbol_size;
		gint _symbol_index;
		_tmp4_ = afrodite_symbol_get_children (parent_symbol);
		_tmp5_ = _vala_iterable_ref0 (_tmp4_);
		_symbol_list = _tmp5_;
		_tmp6_ = vala_collection_get_size ((ValaCollection*) _symbol_list);
		_symbol_size = _tmp6_;
		_symbol_index = -1;
		while (TRUE) {
			gpointer _tmp7_ = NULL;
			AfroditeSymbol* symbol;
			gboolean _tmp8_ = FALSE;
			gboolean _tmp9_ = FALSE;
			const gchar* _tmp10_ = NULL;
			gboolean _tmp11_;
			_symbol_index = _symbol_index + 1;
			if (!(_symbol_index < _symbol_size)) {
				break;
			}
			_tmp7_ = vala_list_get (_symbol_list, _symbol_index);
			symbol = (AfroditeSymbol*) _tmp7_;
			_tmp10_ = afrodite_symbol_get_name (symbol);
			_tmp11_ = afrodite_code_dom_compare_symbol_names (_tmp10_, name, mode, AFRODITE_CASE_SENSITIVENESS_CASE_SENSITIVE);
			if (_tmp11_) {
				AfroditeSymbolAccessibility _tmp12_;
				_tmp12_ = afrodite_symbol_get_access (symbol);
				_tmp9_ = (_tmp12_ & access) != 0;
			} else {
				_tmp9_ = FALSE;
			}
			if (_tmp9_) {
				_tmp8_ = (symbol->binding & binding) != 0;
			} else {
				_tmp8_ = FALSE;
			}
			if (_tmp8_) {
				if (tmp_length1 > 1) {
					AfroditeSymbol* child_sym;
					AfroditeSymbol* _tmp13_;
					gboolean _tmp14_;
					child_sym = NULL;
					_tmp13_ = _g_object_ref0 (symbol);
					_g_object_unref0 (*parent);
					*parent = _tmp13_;
					_tmp14_ = afrodite_symbol_get_has_children (symbol);
					if (_tmp14_) {
						AfroditeSymbol* _tmp15_ = NULL;
						_tmp15_ = afrodite_code_dom_lookup_symbol (tmp[1], symbol, parent, mode, access, binding);
						_g_object_unref0 (child_sym);
						child_sym = _tmp15_;
					}
					result = child_sym;
					_g_object_unref0 (symbol);
					_vala_iterable_unref0 (_symbol_list);
					_g_free0 (name);
					tmp = (_vala_array_free (tmp, tmp_length1, (GDestroyNotify) g_free), NULL);
					return result;
				} else {
					result = symbol;
					_vala_iterable_unref0 (_symbol_list);
					_g_free0 (name);
					tmp = (_vala_array_free (tmp, tmp_length1, (GDestroyNotify) g_free), NULL);
					return result;
				}
			}
			_g_object_unref0 (symbol);
		}
		_vala_iterable_unref0 (_symbol_list);
	}
	result = NULL;
	_g_free0 (name);
	tmp = (_vala_array_free (tmp, tmp_length1, (GDestroyNotify) g_free), NULL);
	return result;
}


AfroditeSourceFile* afrodite_code_dom_add_source_file (AfroditeCodeDom* self, const gchar* filename) {
	AfroditeSourceFile* result = NULL;
	AfroditeSourceFile* _tmp0_ = NULL;
	AfroditeSourceFile* file;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (filename != NULL, NULL);
	_tmp0_ = afrodite_code_dom_lookup_source_file (self, filename);
	file = _tmp0_;
	if (file == NULL) {
		AfroditeSourceFile* _tmp1_ = NULL;
		_tmp1_ = afrodite_source_file_new (filename);
		_afrodite_source_file_unref0 (file);
		file = _tmp1_;
		if (self->priv->_source_files == NULL) {
			ValaArrayList* _tmp2_ = NULL;
			ValaArrayList* _tmp3_;
			_tmp2_ = vala_array_list_new (AFRODITE_TYPE_SOURCE_FILE, (GBoxedCopyFunc) afrodite_source_file_ref, afrodite_source_file_unref, g_direct_equal);
			_tmp3_ = _tmp2_;
			afrodite_code_dom_set_source_files (self, (ValaList*) _tmp3_);
			_vala_iterable_unref0 (_tmp3_);
		}
		afrodite_source_file_set_codedom (file, self);
		vala_collection_add ((ValaCollection*) self->priv->_source_files, file);
	}
	result = file;
	return result;
}


AfroditeSourceFile* afrodite_code_dom_lookup_source_file (AfroditeCodeDom* self, const gchar* filename) {
	AfroditeSourceFile* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (filename != NULL, NULL);
	if (self->priv->_source_files != NULL) {
		{
			ValaList* _tmp0_;
			ValaList* _file_list;
			gint _tmp1_;
			gint _file_size;
			gint _file_index;
			_tmp0_ = _vala_iterable_ref0 (self->priv->_source_files);
			_file_list = _tmp0_;
			_tmp1_ = vala_collection_get_size ((ValaCollection*) _file_list);
			_file_size = _tmp1_;
			_file_index = -1;
			while (TRUE) {
				gpointer _tmp2_ = NULL;
				AfroditeSourceFile* file;
				const gchar* _tmp3_ = NULL;
				_file_index = _file_index + 1;
				if (!(_file_index < _file_size)) {
					break;
				}
				_tmp2_ = vala_list_get (_file_list, _file_index);
				file = (AfroditeSourceFile*) _tmp2_;
				_tmp3_ = afrodite_source_file_get_filename (file);
				if (g_strcmp0 (_tmp3_, filename) == 0) {
					result = file;
					_vala_iterable_unref0 (_file_list);
					return result;
				}
				_afrodite_source_file_unref0 (file);
			}
			_vala_iterable_unref0 (_file_list);
		}
	}
	result = NULL;
	return result;
}


void afrodite_code_dom_remove_source (AfroditeCodeDom* self, AfroditeSourceFile* source) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (source != NULL);
	g_return_if_fail (self->priv->_source_files != NULL);
	_tmp0_ = afrodite_source_file_get_has_symbols (source);
	if (_tmp0_) {
		{
			ValaList* _tmp1_ = NULL;
			ValaList* _tmp2_;
			ValaList* _symbol_list;
			gint _tmp3_;
			gint _symbol_size;
			gint _symbol_index;
			_tmp1_ = afrodite_source_file_get_symbols (source);
			_tmp2_ = _vala_iterable_ref0 (_tmp1_);
			_symbol_list = _tmp2_;
			_tmp3_ = vala_collection_get_size ((ValaCollection*) _symbol_list);
			_symbol_size = _tmp3_;
			_symbol_index = -1;
			while (TRUE) {
				gpointer _tmp4_ = NULL;
				AfroditeSymbol* _tmp5_;
				AfroditeSymbol* symbol;
				gboolean _tmp6_ = FALSE;
				gboolean _tmp7_;
				_symbol_index = _symbol_index + 1;
				if (!(_symbol_index < _symbol_size)) {
					break;
				}
				_tmp4_ = vala_list_get (_symbol_list, _symbol_index);
				_tmp5_ = _g_object_ref0 ((AfroditeSymbol*) _tmp4_);
				symbol = _tmp5_;
				_tmp7_ = afrodite_symbol_get_has_source_references (symbol);
				if (_tmp7_) {
					ValaList* _tmp8_ = NULL;
					gint _tmp9_;
					_tmp8_ = afrodite_symbol_get_source_references (symbol);
					_tmp9_ = vala_collection_get_size ((ValaCollection*) _tmp8_);
					_tmp6_ = _tmp9_ == 1;
				} else {
					_tmp6_ = FALSE;
				}
				if (_tmp6_) {
					afrodite_source_file_remove_symbol_from_codedom (source, symbol);
				}
				_g_object_unref0 (symbol);
			}
			_vala_iterable_unref0 (_symbol_list);
		}
	}
	vala_collection_remove ((ValaCollection*) self->priv->_source_files, source);
}


AfroditeSymbol* afrodite_code_dom_lookup_symbol_at (AfroditeCodeDom* self, const gchar* filename, gint line, gint column) {
	AfroditeSymbol* result = NULL;
	AfroditeSourceFile* _tmp0_ = NULL;
	AfroditeSourceFile* source;
	gboolean _tmp1_ = FALSE;
	AfroditeSymbol* _tmp3_ = NULL;
	AfroditeSymbol* sym;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (filename != NULL, NULL);
	_tmp0_ = afrodite_code_dom_lookup_source_file (self, filename);
	source = _tmp0_;
	if (source == NULL) {
		_tmp1_ = TRUE;
	} else {
		gboolean _tmp2_;
		_tmp2_ = afrodite_source_file_get_has_symbols (source);
		_tmp1_ = !_tmp2_;
	}
	if (_tmp1_) {
		result = NULL;
		_afrodite_source_file_unref0 (source);
		return result;
	}
	_tmp3_ = afrodite_code_dom_get_symbol_for_source_and_position (self, source, line, column);
	sym = _tmp3_;
	result = sym;
	_afrodite_source_file_unref0 (source);
	return result;
}


AfroditeQueryResult* afrodite_code_dom_get_symbol_for_name_and_path (AfroditeCodeDom* self, AfroditeQueryOptions* options, const gchar* symbol_qualified_name, const gchar* path, gint line, gint column) {
	AfroditeQueryResult* result = NULL;
	AfroditeQueryResult* _tmp0_ = NULL;
	AfroditeQueryResult* _result_;
	AfroditeSymbol* _tmp1_ = NULL;
	AfroditeSymbol* symbol;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (options != NULL, NULL);
	g_return_val_if_fail (symbol_qualified_name != NULL, NULL);
	g_return_val_if_fail (path != NULL, NULL);
	_tmp0_ = afrodite_query_result_new ();
	_result_ = _tmp0_;
	_tmp1_ = afrodite_code_dom_get_symbol_or_type_for_name_and_path (self, AFRODITE_LOOKUP_MODE_Symbol, options->binding, options, symbol_qualified_name, path, line, column);
	symbol = _tmp1_;
	if (symbol != NULL) {
		AfroditeResultItem* _tmp2_ = NULL;
		AfroditeResultItem* item;
		_tmp2_ = afrodite_query_result_new_result_item (_result_, NULL, symbol);
		item = _tmp2_;
		afrodite_query_result_add_result_item (_result_, item);
		_afrodite_result_item_unref0 (item);
	}
	result = _result_;
	_g_object_unref0 (symbol);
	return result;
}


AfroditeQueryResult* afrodite_code_dom_get_symbol_type_for_name_and_path (AfroditeCodeDom* self, AfroditeQueryOptions* options, const gchar* symbol_qualified_name, const gchar* path, gint line, gint column) {
	AfroditeQueryResult* result = NULL;
	AfroditeQueryResult* _tmp0_ = NULL;
	AfroditeQueryResult* _result_;
	AfroditeSymbol* _tmp1_ = NULL;
	AfroditeSymbol* symbol;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (options != NULL, NULL);
	g_return_val_if_fail (symbol_qualified_name != NULL, NULL);
	g_return_val_if_fail (path != NULL, NULL);
	_tmp0_ = afrodite_query_result_new ();
	_result_ = _tmp0_;
	_tmp1_ = afrodite_code_dom_get_symbol_or_type_for_name_and_path (self, AFRODITE_LOOKUP_MODE_Type, options->binding, options, symbol_qualified_name, path, line, column);
	symbol = _tmp1_;
	if (symbol != NULL) {
		AfroditeResultItem* _tmp2_ = NULL;
		AfroditeResultItem* item;
		_tmp2_ = afrodite_query_result_new_result_item (_result_, NULL, symbol);
		item = _tmp2_;
		afrodite_query_result_add_result_item (_result_, item);
		_afrodite_result_item_unref0 (item);
	}
	result = _result_;
	_g_object_unref0 (symbol);
	return result;
}


static AfroditeSymbol* afrodite_code_dom_get_symbol_or_type_for_name_and_path (AfroditeCodeDom* self, AfroditeLookupMode mode, AfroditeMemberBinding binding, AfroditeQueryOptions* options, const gchar* symbol_qualified_name, const gchar* path, gint line, gint column) {
	AfroditeSymbol* result = NULL;
	AfroditeSourceFile* _tmp0_ = NULL;
	AfroditeSourceFile* source;
	gboolean _tmp1_ = FALSE;
	AfroditeSymbol* _tmp4_ = NULL;
	AfroditeSymbol* sym;
	gboolean _tmp36_ = FALSE;
	gboolean _tmp37_ = FALSE;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (options != NULL, NULL);
	g_return_val_if_fail (symbol_qualified_name != NULL, NULL);
	g_return_val_if_fail (path != NULL, NULL);
	_tmp0_ = afrodite_code_dom_lookup_source_file (self, path);
	source = _tmp0_;
	if (source == NULL) {
		_tmp1_ = TRUE;
	} else {
		gboolean _tmp2_;
		_tmp2_ = afrodite_source_file_get_has_symbols (source);
		_tmp1_ = !_tmp2_;
	}
	if (_tmp1_) {
		const gchar* _tmp3_ = NULL;
		if (source == NULL) {
			_tmp3_ = "not found, so";
		} else {
			_tmp3_ = "found but";
		}
		g_warning ("codedom.vala:203: source file %s %s without any symbols", path, _tmp3_);
		result = NULL;
		_afrodite_source_file_unref0 (source);
		return result;
	}
	_tmp4_ = afrodite_code_dom_get_symbol_for_source_and_position (self, source, line, column);
	sym = _tmp4_;
	if (sym != NULL) {
		gchar** _tmp5_;
		gchar** _tmp6_ = NULL;
		gchar** parts;
		gint parts_length1;
		gint _parts_size_;
		AfroditeSymbol* _tmp7_ = NULL;
		gboolean _tmp8_ = FALSE;
		gboolean _tmp14_ = FALSE;
		gboolean _tmp15_ = FALSE;
		_tmp6_ = _tmp5_ = g_strsplit (symbol_qualified_name, ".", 0);
		parts = _tmp6_;
		parts_length1 = _vala_array_length (_tmp5_);
		_parts_size_ = _vala_array_length (_tmp5_);
		if (options->auto_member_binding_mode) {
			if (g_strcmp0 (parts[0], "this") == 0) {
				binding = binding & (~((gint) AFRODITE_MEMBER_BINDING_STATIC));
				options->binding = binding;
				options->access = options->access | AFRODITE_SYMBOL_ACCESSIBILITY_PRIVATE;
			} else {
				if (g_strcmp0 (parts[0], "base") == 0) {
					binding = binding & (~((gint) AFRODITE_MEMBER_BINDING_STATIC));
					options->binding = binding;
					options->access = (options->access & (~((gint) AFRODITE_SYMBOL_ACCESSIBILITY_PRIVATE))) | AFRODITE_SYMBOL_ACCESSIBILITY_PROTECTED;
				}
			}
		}
		_tmp7_ = afrodite_code_dom_lookup_name_with_symbol (self, parts[0], sym, source, options->compare_mode, AFRODITE_SYMBOL_ACCESSIBILITY_ANY, AFRODITE_MEMBER_BINDING_ANY);
		_g_object_unref0 (sym);
		sym = _tmp7_;
		if (sym != NULL) {
			AfroditeDataType* _tmp9_ = NULL;
			_tmp9_ = afrodite_symbol_get_symbol_type (sym);
			_tmp8_ = _tmp9_ != NULL;
		} else {
			_tmp8_ = FALSE;
		}
		if (_tmp8_) {
			gboolean _tmp10_ = FALSE;
			if (mode != AFRODITE_LOOKUP_MODE_Symbol) {
				_tmp10_ = TRUE;
			} else {
				_tmp10_ = parts_length1 > 1;
			}
			if (_tmp10_) {
				AfroditeDataType* _tmp11_ = NULL;
				AfroditeSymbol* _tmp12_ = NULL;
				AfroditeSymbol* _tmp13_;
				_tmp11_ = afrodite_symbol_get_symbol_type (sym);
				_tmp12_ = afrodite_data_type_get_symbol (_tmp11_);
				_tmp13_ = _g_object_ref0 (_tmp12_);
				_g_object_unref0 (sym);
				sym = _tmp13_;
			}
		}
		if (parts_length1 > 1) {
			_tmp15_ = sym != NULL;
		} else {
			_tmp15_ = FALSE;
		}
		if (_tmp15_) {
			gboolean _tmp16_;
			_tmp16_ = afrodite_symbol_get_has_children (sym);
			_tmp14_ = _tmp16_;
		} else {
			_tmp14_ = FALSE;
		}
		if (_tmp14_) {
			gboolean _tmp17_ = FALSE;
			AfroditeMemberType _tmp18_;
			_tmp18_ = afrodite_symbol_get_member_type (sym);
			if (_tmp18_ == AFRODITE_MEMBER_TYPE_NAMESPACE) {
				_tmp17_ = TRUE;
			} else {
				gboolean _tmp19_ = FALSE;
				const gchar* _tmp20_ = NULL;
				_tmp20_ = afrodite_symbol_get_name (sym);
				if (g_strcmp0 (parts[0], _tmp20_) == 0) {
					gboolean _tmp21_ = FALSE;
					gboolean _tmp22_ = FALSE;
					AfroditeMemberType _tmp23_;
					_tmp23_ = afrodite_symbol_get_member_type (sym);
					if (_tmp23_ == AFRODITE_MEMBER_TYPE_CLASS) {
						_tmp22_ = TRUE;
					} else {
						AfroditeMemberType _tmp24_;
						_tmp24_ = afrodite_symbol_get_member_type (sym);
						_tmp22_ = _tmp24_ == AFRODITE_MEMBER_TYPE_STRUCT;
					}
					if (_tmp22_) {
						_tmp21_ = TRUE;
					} else {
						AfroditeMemberType _tmp25_;
						_tmp25_ = afrodite_symbol_get_member_type (sym);
						_tmp21_ = _tmp25_ == AFRODITE_MEMBER_TYPE_INTERFACE;
					}
					_tmp19_ = _tmp21_;
				} else {
					_tmp19_ = FALSE;
				}
				_tmp17_ = _tmp19_;
			}
			if (_tmp17_) {
				binding = AFRODITE_MEMBER_BINDING_STATIC;
			}
			{
				gint i;
				i = 1;
				{
					gboolean _tmp26_;
					_tmp26_ = TRUE;
					while (TRUE) {
						AfroditeSymbol* _tmp27_;
						AfroditeSymbol* parent;
						AfroditeSymbol* dummy;
						AfroditeSymbol* _tmp28_ = NULL;
						gboolean _tmp30_ = FALSE;
						gboolean _tmp31_ = FALSE;
						if (!_tmp26_) {
							i++;
						}
						_tmp26_ = FALSE;
						if (!(i < parts_length1)) {
							break;
						}
						_tmp27_ = _g_object_ref0 (sym);
						parent = _tmp27_;
						dummy = NULL;
						_tmp28_ = afrodite_code_dom_lookup_symbol (parts[i], sym, &dummy, options->compare_mode, AFRODITE_SYMBOL_ACCESSIBILITY_ANY, AFRODITE_MEMBER_BINDING_ANY);
						_g_object_unref0 (sym);
						sym = _tmp28_;
						if (sym == NULL) {
							AfroditeSymbol* _tmp29_ = NULL;
							_tmp29_ = afrodite_code_dom_lookup_name_in_base_types (self, parts[i], parent, AFRODITE_SYMBOL_ACCESSIBILITY_ANY, AFRODITE_MEMBER_BINDING_ANY);
							_g_object_unref0 (sym);
							sym = _tmp29_;
						}
						if (sym != NULL) {
							_tmp31_ = mode == AFRODITE_LOOKUP_MODE_Type;
						} else {
							_tmp31_ = FALSE;
						}
						if (_tmp31_) {
							AfroditeDataType* _tmp32_ = NULL;
							_tmp32_ = afrodite_symbol_get_symbol_type (sym);
							_tmp30_ = _tmp32_ != NULL;
						} else {
							_tmp30_ = FALSE;
						}
						if (_tmp30_) {
							AfroditeDataType* _tmp33_ = NULL;
							AfroditeSymbol* _tmp34_ = NULL;
							AfroditeSymbol* _tmp35_;
							_tmp33_ = afrodite_symbol_get_symbol_type (sym);
							_tmp34_ = afrodite_data_type_get_symbol (_tmp33_);
							_tmp35_ = _g_object_ref0 (_tmp34_);
							_g_object_unref0 (sym);
							sym = _tmp35_;
						} else {
							_g_object_unref0 (dummy);
							_g_object_unref0 (parent);
							break;
						}
						_g_object_unref0 (dummy);
						_g_object_unref0 (parent);
					}
				}
			}
		}
		parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
	}
	if (sym != NULL) {
		AfroditeDataType* _tmp38_ = NULL;
		_tmp38_ = afrodite_symbol_get_symbol_type (sym);
		_tmp37_ = _tmp38_ != NULL;
	} else {
		_tmp37_ = FALSE;
	}
	if (_tmp37_) {
		_tmp36_ = mode == AFRODITE_LOOKUP_MODE_Type;
	} else {
		_tmp36_ = FALSE;
	}
	if (_tmp36_) {
		AfroditeDataType* _tmp39_ = NULL;
		AfroditeSymbol* _tmp40_ = NULL;
		AfroditeSymbol* _tmp41_;
		_tmp39_ = afrodite_symbol_get_symbol_type (sym);
		_tmp40_ = afrodite_data_type_get_symbol (_tmp39_);
		_tmp41_ = _g_object_ref0 (_tmp40_);
		result = _tmp41_;
		_g_object_unref0 (sym);
		_afrodite_source_file_unref0 (source);
		return result;
	} else {
		result = sym;
		_afrodite_source_file_unref0 (source);
		return result;
	}
	_g_object_unref0 (sym);
	_afrodite_source_file_unref0 (source);
}


AfroditeQueryResult* afrodite_code_dom_get_symbols_for_path (AfroditeCodeDom* self, AfroditeQueryOptions* options, const gchar* path) {
	AfroditeQueryResult* result = NULL;
	AfroditeQueryResult* _tmp0_ = NULL;
	AfroditeQueryResult* _result_;
	AfroditeResultItem* _tmp1_ = NULL;
	AfroditeResultItem* first;
	ValaList* _tmp2_ = NULL;
	gint _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (options != NULL, NULL);
	g_return_val_if_fail (path != NULL, NULL);
	_tmp0_ = afrodite_query_result_new ();
	_result_ = _tmp0_;
	_tmp1_ = afrodite_query_result_new_result_item (_result_, NULL, self->priv->_root);
	first = _tmp1_;
	afrodite_code_dom_get_child_symbols_for_path (self, _result_, options, path, first);
	_tmp2_ = afrodite_result_item_get_children (first);
	_tmp3_ = vala_collection_get_size ((ValaCollection*) _tmp2_);
	if (_tmp3_ > 0) {
		afrodite_query_result_add_result_item (_result_, first);
	}
	result = _result_;
	_afrodite_result_item_unref0 (first);
	return result;
}


static void afrodite_code_dom_get_child_symbols_for_path (AfroditeCodeDom* self, AfroditeQueryResult* _result_, AfroditeQueryOptions* options, const gchar* path, AfroditeResultItem* parent) {
	AfroditeSymbol* _tmp0_ = NULL;
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (_result_ != NULL);
	g_return_if_fail (path != NULL);
	g_return_if_fail (parent != NULL);
	_tmp0_ = afrodite_result_item_get_symbol (parent);
	_tmp1_ = afrodite_symbol_get_has_children (_tmp0_);
	if (!_tmp1_) {
		return;
	}
	{
		AfroditeSymbol* _tmp2_ = NULL;
		ValaList* _tmp3_ = NULL;
		ValaList* _tmp4_;
		ValaList* _symbol_list;
		gint _tmp5_;
		gint _symbol_size;
		gint _symbol_index;
		_tmp2_ = afrodite_result_item_get_symbol (parent);
		_tmp3_ = afrodite_symbol_get_children (_tmp2_);
		_tmp4_ = _vala_iterable_ref0 (_tmp3_);
		_symbol_list = _tmp4_;
		_tmp5_ = vala_collection_get_size ((ValaCollection*) _symbol_list);
		_symbol_size = _tmp5_;
		_symbol_index = -1;
		while (TRUE) {
			gpointer _tmp6_ = NULL;
			AfroditeSymbol* symbol;
			gboolean _tmp7_;
			_symbol_index = _symbol_index + 1;
			if (!(_symbol_index < _symbol_size)) {
				break;
			}
			_tmp6_ = vala_list_get (_symbol_list, _symbol_index);
			symbol = (AfroditeSymbol*) _tmp6_;
			_tmp7_ = afrodite_code_dom_symbol_has_filename_reference (self, path, symbol);
			if (_tmp7_) {
				gboolean _tmp8_;
				_tmp8_ = afrodite_symbol_check_options (symbol, options);
				if (_tmp8_) {
					AfroditeResultItem* _tmp9_ = NULL;
					AfroditeResultItem* result_item;
					gboolean _tmp10_;
					_tmp9_ = afrodite_query_result_new_result_item (_result_, parent, symbol);
					result_item = _tmp9_;
					afrodite_result_item_add_result_item (parent, result_item);
					_tmp10_ = afrodite_symbol_get_has_children (symbol);
					if (_tmp10_) {
						AfroditeSymbol* _tmp11_ = NULL;
						AfroditeSymbol* _tmp12_;
						AfroditeSymbol* item;
						gboolean circular_ref;
						_tmp11_ = afrodite_result_item_get_symbol (parent);
						_tmp12_ = _g_object_ref0 (_tmp11_);
						item = _tmp12_;
						circular_ref = FALSE;
						while (TRUE) {
							AfroditeSymbol* _tmp15_ = NULL;
							AfroditeSymbol* _tmp16_;
							if (!(item != NULL)) {
								break;
							}
							if (symbol == item) {
								gchar* _tmp13_ = NULL;
								gchar* _tmp14_;
								_tmp13_ = afrodite_symbol_get_fully_qualified_name (symbol);
								_tmp14_ = _tmp13_;
								g_critical ("codedom.vala:305: circular reference %s", _tmp14_);
								_g_free0 (_tmp14_);
								circular_ref = TRUE;
								break;
							}
							_tmp15_ = afrodite_symbol_get_parent (item);
							_tmp16_ = _g_object_ref0 (_tmp15_);
							_g_object_unref0 (item);
							item = _tmp16_;
						}
						if (!circular_ref) {
							afrodite_code_dom_get_child_symbols_for_path (self, _result_, options, path, result_item);
						}
						_g_object_unref0 (item);
					}
					_afrodite_result_item_unref0 (result_item);
				}
			}
			_g_object_unref0 (symbol);
		}
		_vala_iterable_unref0 (_symbol_list);
	}
}


static gboolean afrodite_code_dom_symbol_has_filename_reference (AfroditeCodeDom* self, const gchar* filename, AfroditeSymbol* symbol) {
	gboolean result = FALSE;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (filename != NULL, FALSE);
	g_return_val_if_fail (symbol != NULL, FALSE);
	_tmp0_ = afrodite_symbol_get_has_source_references (symbol);
	if (!_tmp0_) {
		result = FALSE;
		return result;
	}
	{
		ValaList* _tmp1_ = NULL;
		ValaList* _tmp2_;
		ValaList* _sr_list;
		gint _tmp3_;
		gint _sr_size;
		gint _sr_index;
		_tmp1_ = afrodite_symbol_get_source_references (symbol);
		_tmp2_ = _vala_iterable_ref0 (_tmp1_);
		_sr_list = _tmp2_;
		_tmp3_ = vala_collection_get_size ((ValaCollection*) _sr_list);
		_sr_size = _tmp3_;
		_sr_index = -1;
		while (TRUE) {
			gpointer _tmp4_ = NULL;
			AfroditeSourceReference* sr;
			AfroditeSourceFile* _tmp5_ = NULL;
			const gchar* _tmp6_ = NULL;
			_sr_index = _sr_index + 1;
			if (!(_sr_index < _sr_size)) {
				break;
			}
			_tmp4_ = vala_list_get (_sr_list, _sr_index);
			sr = (AfroditeSourceReference*) _tmp4_;
			_tmp5_ = afrodite_source_reference_get_file (sr);
			_tmp6_ = afrodite_source_file_get_filename (_tmp5_);
			if (g_strcmp0 (_tmp6_, filename) == 0) {
				result = TRUE;
				_afrodite_source_reference_unref0 (sr);
				_vala_iterable_unref0 (_sr_list);
				return result;
			}
			_afrodite_source_reference_unref0 (sr);
		}
		_vala_iterable_unref0 (_sr_list);
	}
	result = FALSE;
	return result;
}


static AfroditeSymbol* afrodite_code_dom_lookup_name_in_base_types (AfroditeCodeDom* self, const gchar* name, AfroditeSymbol* symbol, AfroditeSymbolAccessibility access, AfroditeMemberBinding binding) {
	AfroditeSymbol* result = NULL;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = afrodite_symbol_get_has_base_types (symbol);
	if (_tmp0_) {
		AfroditeSymbol* parent;
		parent = NULL;
		{
			ValaList* _tmp1_ = NULL;
			ValaList* _tmp2_;
			ValaList* _type_list;
			gint _tmp3_;
			gint _type_size;
			gint _type_index;
			_tmp1_ = afrodite_symbol_get_base_types (symbol);
			_tmp2_ = _vala_iterable_ref0 (_tmp1_);
			_type_list = _tmp2_;
			_tmp3_ = vala_collection_get_size ((ValaCollection*) _type_list);
			_type_size = _tmp3_;
			_type_index = -1;
			while (TRUE) {
				gpointer _tmp4_ = NULL;
				AfroditeDataType* type;
				gboolean _tmp5_;
				_type_index = _type_index + 1;
				if (!(_type_index < _type_size)) {
					break;
				}
				_tmp4_ = vala_list_get (_type_list, _type_index);
				type = (AfroditeDataType*) _tmp4_;
				_tmp5_ = afrodite_data_type_get_unresolved (type);
				if (!_tmp5_) {
					gboolean _tmp6_ = FALSE;
					gboolean _tmp7_ = FALSE;
					AfroditeSymbol* _tmp8_ = NULL;
					const gchar* _tmp9_ = NULL;
					AfroditeSymbol* _tmp15_ = NULL;
					gboolean _tmp16_;
					_tmp8_ = afrodite_data_type_get_symbol (type);
					_tmp9_ = afrodite_symbol_get_name (_tmp8_);
					if (g_strcmp0 (_tmp9_, name) == 0) {
						AfroditeSymbol* _tmp10_ = NULL;
						AfroditeSymbolAccessibility _tmp11_;
						_tmp10_ = afrodite_data_type_get_symbol (type);
						_tmp11_ = afrodite_symbol_get_access (_tmp10_);
						_tmp7_ = (_tmp11_ & access) != 0;
					} else {
						_tmp7_ = FALSE;
					}
					if (_tmp7_) {
						AfroditeSymbol* _tmp12_ = NULL;
						_tmp12_ = afrodite_data_type_get_symbol (type);
						_tmp6_ = (_tmp12_->binding & binding) != 0;
					} else {
						_tmp6_ = FALSE;
					}
					if (_tmp6_) {
						AfroditeSymbol* _tmp13_ = NULL;
						AfroditeSymbol* _tmp14_;
						_tmp13_ = afrodite_data_type_get_symbol (type);
						_tmp14_ = _g_object_ref0 (_tmp13_);
						result = _tmp14_;
						_afrodite_data_type_unref0 (type);
						_vala_iterable_unref0 (_type_list);
						_g_object_unref0 (parent);
						return result;
					}
					_tmp15_ = afrodite_data_type_get_symbol (type);
					_tmp16_ = afrodite_symbol_get_has_children (_tmp15_);
					if (_tmp16_) {
						AfroditeSymbol* _tmp17_ = NULL;
						AfroditeSymbol* _tmp18_ = NULL;
						AfroditeSymbol* sym;
						_tmp17_ = afrodite_data_type_get_symbol (type);
						_tmp18_ = afrodite_code_dom_lookup_symbol (name, _tmp17_, &parent, AFRODITE_COMPARE_MODE_EXACT, access, binding);
						sym = _tmp18_;
						if (sym != NULL) {
							result = sym;
							_afrodite_data_type_unref0 (type);
							_vala_iterable_unref0 (_type_list);
							_g_object_unref0 (parent);
							return result;
						}
						_g_object_unref0 (sym);
					}
				}
				_afrodite_data_type_unref0 (type);
			}
			_vala_iterable_unref0 (_type_list);
		}
		_g_object_unref0 (parent);
	}
	result = NULL;
	return result;
}


static AfroditeSymbol* afrodite_code_dom_lookup_this_symbol (AfroditeCodeDom* self, AfroditeSymbol* root) {
	AfroditeSymbol* result = NULL;
	AfroditeSymbol* _tmp0_;
	AfroditeSymbol* current;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = _g_object_ref0 (root);
	current = _tmp0_;
	while (TRUE) {
		gboolean _tmp1_ = FALSE;
		AfroditeMemberType _tmp2_;
		if (!(current != NULL)) {
			break;
		}
		_tmp2_ = afrodite_symbol_get_member_type (current);
		if (_tmp2_ == AFRODITE_MEMBER_TYPE_CLASS) {
			_tmp1_ = TRUE;
		} else {
			AfroditeMemberType _tmp3_;
			_tmp3_ = afrodite_symbol_get_member_type (current);
			_tmp1_ = _tmp3_ == AFRODITE_MEMBER_TYPE_STRUCT;
		}
		if (_tmp1_) {
			break;
		} else {
			AfroditeMemberType _tmp4_;
			_tmp4_ = afrodite_symbol_get_member_type (current);
			if (_tmp4_ == AFRODITE_MEMBER_TYPE_NAMESPACE) {
				_g_object_unref0 (current);
				current = NULL;
			} else {
				AfroditeSymbol* _tmp5_ = NULL;
				AfroditeSymbol* _tmp6_;
				_tmp5_ = afrodite_symbol_get_parent (current);
				_tmp6_ = _g_object_ref0 (_tmp5_);
				_g_object_unref0 (current);
				current = _tmp6_;
			}
		}
	}
	result = current;
	return result;
}


static void afrodite_code_dom_append_visible_symbols (AfroditeCodeDom* self, ValaList* results, AfroditeSymbol* symbol, const gchar* name, AfroditeCompareMode mode, AfroditeCaseSensitiveness case_sensitiveness, AfroditeSymbolAccessibility access) {
	gboolean _tmp0_;
	gboolean _tmp17_;
	gboolean _tmp34_;
	gboolean _tmp49_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (symbol != NULL);
	_tmp0_ = afrodite_symbol_get_has_local_variables (symbol);
	if (_tmp0_) {
		{
			ValaList* _tmp1_ = NULL;
			ValaList* _tmp2_;
			ValaList* _d_list;
			gint _tmp3_;
			gint _d_size;
			gint _d_index;
			_tmp1_ = afrodite_symbol_get_local_variables (symbol);
			_tmp2_ = _vala_iterable_ref0 (_tmp1_);
			_d_list = _tmp2_;
			_tmp3_ = vala_collection_get_size ((ValaCollection*) _d_list);
			_d_size = _tmp3_;
			_d_index = -1;
			while (TRUE) {
				gpointer _tmp4_ = NULL;
				AfroditeDataType* d;
				gboolean _tmp5_ = FALSE;
				gboolean _tmp6_ = FALSE;
				gboolean _tmp7_;
				_d_index = _d_index + 1;
				if (!(_d_index < _d_size)) {
					break;
				}
				_tmp4_ = vala_list_get (_d_list, _d_index);
				d = (AfroditeDataType*) _tmp4_;
				_tmp7_ = afrodite_data_type_get_unresolved (d);
				if (!_tmp7_) {
					_tmp6_ = (access & AFRODITE_SYMBOL_ACCESSIBILITY_PRIVATE) != 0;
				} else {
					_tmp6_ = FALSE;
				}
				if (_tmp6_) {
					gboolean _tmp8_ = FALSE;
					if (name == NULL) {
						_tmp8_ = TRUE;
					} else {
						const gchar* _tmp9_ = NULL;
						gboolean _tmp10_;
						_tmp9_ = afrodite_data_type_get_name (d);
						_tmp10_ = afrodite_code_dom_compare_symbol_names (_tmp9_, name, mode, case_sensitiveness);
						_tmp8_ = _tmp10_;
					}
					_tmp5_ = _tmp8_;
				} else {
					_tmp5_ = FALSE;
				}
				if (_tmp5_) {
					const gchar* _tmp11_ = NULL;
					AfroditeSymbol* _tmp12_ = NULL;
					AfroditeSymbol* s;
					AfroditeDataType* _tmp13_ = NULL;
					AfroditeDataType* _tmp14_;
					AfroditeDataType* _tmp15_ = NULL;
					AfroditeSymbol* _tmp16_ = NULL;
					_tmp11_ = afrodite_data_type_get_name (d);
					_tmp12_ = afrodite_symbol_new (_tmp11_, AFRODITE_MEMBER_TYPE_LOCAL_VARIABLE);
					s = _tmp12_;
					_tmp13_ = afrodite_data_type_copy (d);
					_tmp14_ = _tmp13_;
					afrodite_symbol_set_return_type (s, _tmp14_);
					_afrodite_data_type_unref0 (_tmp14_);
					_tmp15_ = afrodite_symbol_get_return_type (s);
					_tmp16_ = afrodite_data_type_get_symbol (d);
					afrodite_data_type_set_symbol (_tmp15_, _tmp16_);
					vala_collection_add ((ValaCollection*) results, s);
					_g_object_unref0 (s);
				}
				_afrodite_data_type_unref0 (d);
			}
			_vala_iterable_unref0 (_d_list);
		}
	}
	_tmp17_ = afrodite_symbol_get_has_parameters (symbol);
	if (_tmp17_) {
		{
			ValaList* _tmp18_ = NULL;
			ValaList* _tmp19_;
			ValaList* _d_list;
			gint _tmp20_;
			gint _d_size;
			gint _d_index;
			_tmp18_ = afrodite_symbol_get_parameters (symbol);
			_tmp19_ = _vala_iterable_ref0 (_tmp18_);
			_d_list = _tmp19_;
			_tmp20_ = vala_collection_get_size ((ValaCollection*) _d_list);
			_d_size = _tmp20_;
			_d_index = -1;
			while (TRUE) {
				gpointer _tmp21_ = NULL;
				AfroditeDataType* d;
				gboolean _tmp22_ = FALSE;
				gboolean _tmp23_ = FALSE;
				gboolean _tmp24_;
				_d_index = _d_index + 1;
				if (!(_d_index < _d_size)) {
					break;
				}
				_tmp21_ = vala_list_get (_d_list, _d_index);
				d = (AfroditeDataType*) _tmp21_;
				_tmp24_ = afrodite_data_type_get_unresolved (d);
				if (!_tmp24_) {
					_tmp23_ = (access & AFRODITE_SYMBOL_ACCESSIBILITY_PRIVATE) != 0;
				} else {
					_tmp23_ = FALSE;
				}
				if (_tmp23_) {
					gboolean _tmp25_ = FALSE;
					if (name == NULL) {
						_tmp25_ = TRUE;
					} else {
						const gchar* _tmp26_ = NULL;
						gboolean _tmp27_;
						_tmp26_ = afrodite_data_type_get_name (d);
						_tmp27_ = afrodite_code_dom_compare_symbol_names (_tmp26_, name, mode, case_sensitiveness);
						_tmp25_ = _tmp27_;
					}
					_tmp22_ = _tmp25_;
				} else {
					_tmp22_ = FALSE;
				}
				if (_tmp22_) {
					const gchar* _tmp28_ = NULL;
					AfroditeSymbol* _tmp29_ = NULL;
					AfroditeSymbol* s;
					AfroditeDataType* _tmp30_ = NULL;
					AfroditeDataType* _tmp31_;
					AfroditeDataType* _tmp32_ = NULL;
					AfroditeSymbol* _tmp33_ = NULL;
					_tmp28_ = afrodite_data_type_get_name (d);
					_tmp29_ = afrodite_symbol_new (_tmp28_, AFRODITE_MEMBER_TYPE_PARAMETER);
					s = _tmp29_;
					_tmp30_ = afrodite_data_type_copy (d);
					_tmp31_ = _tmp30_;
					afrodite_symbol_set_return_type (s, _tmp31_);
					_afrodite_data_type_unref0 (_tmp31_);
					_tmp32_ = afrodite_symbol_get_return_type (s);
					_tmp33_ = afrodite_data_type_get_symbol (d);
					afrodite_data_type_set_symbol (_tmp32_, _tmp33_);
					vala_collection_add ((ValaCollection*) results, s);
					_g_object_unref0 (s);
				}
				_afrodite_data_type_unref0 (d);
			}
			_vala_iterable_unref0 (_d_list);
		}
	}
	_tmp34_ = afrodite_symbol_get_has_children (symbol);
	if (_tmp34_) {
		{
			ValaList* _tmp35_ = NULL;
			ValaList* _tmp36_;
			ValaList* _s_list;
			gint _tmp37_;
			gint _s_size;
			gint _s_index;
			_tmp35_ = afrodite_symbol_get_children (symbol);
			_tmp36_ = _vala_iterable_ref0 (_tmp35_);
			_s_list = _tmp36_;
			_tmp37_ = vala_collection_get_size ((ValaCollection*) _s_list);
			_s_size = _tmp37_;
			_s_index = -1;
			while (TRUE) {
				gpointer _tmp38_ = NULL;
				AfroditeSymbol* s;
				gboolean _tmp39_ = FALSE;
				gboolean _tmp40_ = FALSE;
				AfroditeSymbolAccessibility _tmp41_;
				_s_index = _s_index + 1;
				if (!(_s_index < _s_size)) {
					break;
				}
				_tmp38_ = vala_list_get (_s_list, _s_index);
				s = (AfroditeSymbol*) _tmp38_;
				_tmp41_ = afrodite_symbol_get_access (s);
				if ((_tmp41_ & access) != 0) {
					gchar* _tmp42_ = NULL;
					gchar* _tmp43_;
					gchar* _tmp44_ = NULL;
					gchar* _tmp45_;
					_tmp42_ = afrodite_symbol_get_fully_qualified_name (s);
					_tmp43_ = _tmp42_;
					_tmp44_ = afrodite_symbol_get_fully_qualified_name (symbol);
					_tmp45_ = _tmp44_;
					_tmp40_ = g_strcmp0 (_tmp43_, _tmp45_) != 0;
					_g_free0 (_tmp45_);
					_g_free0 (_tmp43_);
				} else {
					_tmp40_ = FALSE;
				}
				if (_tmp40_) {
					gboolean _tmp46_ = FALSE;
					if (name == NULL) {
						_tmp46_ = TRUE;
					} else {
						const gchar* _tmp47_ = NULL;
						gboolean _tmp48_;
						_tmp47_ = afrodite_symbol_get_name (s);
						_tmp48_ = afrodite_code_dom_compare_symbol_names (_tmp47_, name, mode, case_sensitiveness);
						_tmp46_ = _tmp48_;
					}
					_tmp39_ = _tmp46_;
				} else {
					_tmp39_ = FALSE;
				}
				if (_tmp39_) {
					vala_collection_add ((ValaCollection*) results, s);
				}
				_g_object_unref0 (s);
			}
			_vala_iterable_unref0 (_s_list);
		}
	}
	_tmp49_ = afrodite_symbol_get_has_base_types (symbol);
	if (_tmp49_) {
		{
			ValaList* _tmp50_ = NULL;
			ValaList* _tmp51_;
			ValaList* _d_list;
			gint _tmp52_;
			gint _d_size;
			gint _d_index;
			_tmp50_ = afrodite_symbol_get_base_types (symbol);
			_tmp51_ = _vala_iterable_ref0 (_tmp50_);
			_d_list = _tmp51_;
			_tmp52_ = vala_collection_get_size ((ValaCollection*) _d_list);
			_d_size = _tmp52_;
			_d_index = -1;
			while (TRUE) {
				gpointer _tmp53_ = NULL;
				AfroditeDataType* d;
				gboolean _tmp54_;
				_d_index = _d_index + 1;
				if (!(_d_index < _d_size)) {
					break;
				}
				_tmp53_ = vala_list_get (_d_list, _d_index);
				d = (AfroditeDataType*) _tmp53_;
				_tmp54_ = afrodite_data_type_get_unresolved (d);
				if (!_tmp54_) {
					AfroditeSymbol* _tmp55_ = NULL;
					_tmp55_ = afrodite_data_type_get_symbol (d);
					afrodite_code_dom_append_visible_symbols (self, results, _tmp55_, name, mode, case_sensitiveness, (AFRODITE_SYMBOL_ACCESSIBILITY_INTERNAL | AFRODITE_SYMBOL_ACCESSIBILITY_PROTECTED) | AFRODITE_SYMBOL_ACCESSIBILITY_PUBLIC);
				}
				_afrodite_data_type_unref0 (d);
			}
			_vala_iterable_unref0 (_d_list);
		}
	}
}


static void afrodite_code_dom_append_all_visible_symbols (AfroditeCodeDom* self, ValaList* results, AfroditeSymbol* symbol, const gchar* name, AfroditeCompareMode mode, AfroditeCaseSensitiveness case_sensitiveness) {
	AfroditeSymbol* _tmp0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (results != NULL);
	afrodite_code_dom_append_visible_symbols (self, results, symbol, name, mode, case_sensitiveness, AFRODITE_SYMBOL_ACCESSIBILITY_ANY);
	_tmp0_ = afrodite_symbol_get_parent (symbol);
	if (_tmp0_ != NULL) {
		AfroditeSymbol* _tmp1_ = NULL;
		_tmp1_ = afrodite_symbol_get_parent (symbol);
		afrodite_code_dom_append_all_visible_symbols (self, results, _tmp1_, name, mode, case_sensitiveness);
	}
}


ValaList* afrodite_code_dom_lookup_visible_symbols_from_symbol (AfroditeCodeDom* self, AfroditeSymbol* symbol, const gchar* name, AfroditeCompareMode mode, AfroditeCaseSensitiveness case_sensitiveness) {
	ValaList* result = NULL;
	ValaArrayList* _tmp0_ = NULL;
	ValaList* results;
	gboolean _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (symbol != NULL, NULL);
	_tmp0_ = vala_array_list_new (AFRODITE_TYPE_SYMBOL, (GBoxedCopyFunc) g_object_ref, g_object_unref, g_direct_equal);
	results = (ValaList*) _tmp0_;
	afrodite_code_dom_append_all_visible_symbols (self, results, symbol, name, mode, case_sensitiveness);
	_tmp1_ = afrodite_symbol_get_has_source_references (symbol);
	if (_tmp1_) {
		ValaArrayList* _tmp2_ = NULL;
		ValaArrayList* using_done;
		_tmp2_ = vala_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, g_direct_equal);
		using_done = _tmp2_;
		{
			ValaList* _tmp3_ = NULL;
			ValaList* _tmp4_;
			ValaList* _s_list;
			gint _tmp5_;
			gint _s_size;
			gint _s_index;
			_tmp3_ = afrodite_symbol_get_source_references (symbol);
			_tmp4_ = _vala_iterable_ref0 (_tmp3_);
			_s_list = _tmp4_;
			_tmp5_ = vala_collection_get_size ((ValaCollection*) _s_list);
			_s_size = _tmp5_;
			_s_index = -1;
			while (TRUE) {
				gpointer _tmp6_ = NULL;
				AfroditeSourceReference* s;
				AfroditeSourceFile* _tmp7_ = NULL;
				gboolean _tmp8_;
				_s_index = _s_index + 1;
				if (!(_s_index < _s_size)) {
					break;
				}
				_tmp6_ = vala_list_get (_s_list, _s_index);
				s = (AfroditeSourceReference*) _tmp6_;
				_tmp7_ = afrodite_source_reference_get_file (s);
				_tmp8_ = afrodite_source_file_get_has_using_directives (_tmp7_);
				if (_tmp8_) {
					gchar* _tmp9_ = NULL;
					gchar* _tmp10_;
					AfroditeSourceFile* _tmp11_ = NULL;
					const gchar* _tmp12_ = NULL;
					_tmp9_ = afrodite_symbol_get_fully_qualified_name (symbol);
					_tmp10_ = _tmp9_;
					_tmp11_ = afrodite_source_reference_get_file (s);
					_tmp12_ = afrodite_source_file_get_filename (_tmp11_);
					afrodite_utils_trace ("codedom.vala:465: import symbol from symbol %s, file: %s", _tmp10_, _tmp12_);
					_g_free0 (_tmp10_);
					{
						AfroditeSourceFile* _tmp13_ = NULL;
						ValaList* _tmp14_ = NULL;
						ValaList* _tmp15_;
						ValaList* _u_list;
						gint _tmp16_;
						gint _u_size;
						gint _u_index;
						_tmp13_ = afrodite_source_reference_get_file (s);
						_tmp14_ = afrodite_source_file_get_using_directives (_tmp13_);
						_tmp15_ = _vala_iterable_ref0 (_tmp14_);
						_u_list = _tmp15_;
						_tmp16_ = vala_collection_get_size ((ValaCollection*) _u_list);
						_u_size = _tmp16_;
						_u_index = -1;
						while (TRUE) {
							gpointer _tmp17_ = NULL;
							AfroditeDataType* u;
							const gchar* _tmp18_ = NULL;
							gboolean _tmp19_;
							_u_index = _u_index + 1;
							if (!(_u_index < _u_size)) {
								break;
							}
							_tmp17_ = vala_list_get (_u_list, _u_index);
							u = (AfroditeDataType*) _tmp17_;
							_tmp18_ = afrodite_data_type_get_type_name (u);
							_tmp19_ = vala_collection_contains ((ValaCollection*) using_done, _tmp18_);
							if (!_tmp19_) {
								const gchar* _tmp20_ = NULL;
								const gchar* _tmp21_ = NULL;
								gboolean _tmp22_;
								_tmp20_ = afrodite_data_type_get_type_name (u);
								vala_collection_add ((ValaCollection*) using_done, _tmp20_);
								_tmp21_ = afrodite_data_type_get_type_name (u);
								afrodite_utils_trace ("codedom.vala:469:     import symbol from namespace: %s", _tmp21_);
								_tmp22_ = afrodite_data_type_get_unresolved (u);
								if (!_tmp22_) {
									AfroditeSymbol* _tmp23_ = NULL;
									_tmp23_ = afrodite_data_type_get_symbol (u);
									afrodite_code_dom_append_visible_symbols (self, results, _tmp23_, name, mode, case_sensitiveness, AFRODITE_SYMBOL_ACCESSIBILITY_INTERNAL | AFRODITE_SYMBOL_ACCESSIBILITY_PUBLIC);
								}
							}
							_afrodite_data_type_unref0 (u);
						}
						_vala_iterable_unref0 (_u_list);
					}
				}
				_afrodite_source_reference_unref0 (s);
			}
			_vala_iterable_unref0 (_s_list);
		}
		_vala_iterable_unref0 (using_done);
	}
	result = results;
	return result;
}


static gboolean afrodite_code_dom_compare_symbol_names (const gchar* name1, const gchar* name2, AfroditeCompareMode mode, AfroditeCaseSensitiveness case_sensitiveness) {
	gboolean result = FALSE;
	gchar* _tmp0_;
	gchar* a;
	gchar* _tmp1_;
	gchar* b;
	_tmp0_ = g_strdup (name1);
	a = _tmp0_;
	_tmp1_ = g_strdup (name2);
	b = _tmp1_;
	switch (case_sensitiveness) {
		case AFRODITE_CASE_SENSITIVENESS_CASE_INSENSITIVE:
		{
			gchar* _tmp2_ = NULL;
			gchar* _tmp4_;
			gchar* _tmp5_ = NULL;
			gchar* _tmp7_;
			if (name1 != NULL) {
				gchar* _tmp3_ = NULL;
				_tmp3_ = g_utf8_strdown (name1, (gssize) (-1));
				_g_free0 (_tmp2_);
				_tmp2_ = _tmp3_;
			} else {
				_g_free0 (_tmp2_);
				_tmp2_ = NULL;
			}
			_tmp4_ = g_strdup (_tmp2_);
			_g_free0 (a);
			a = _tmp4_;
			if (name2 != NULL) {
				gchar* _tmp6_ = NULL;
				_tmp6_ = g_utf8_strdown (name2, (gssize) (-1));
				_g_free0 (_tmp5_);
				_tmp5_ = _tmp6_;
			} else {
				_g_free0 (_tmp5_);
				_tmp5_ = NULL;
			}
			_tmp7_ = g_strdup (_tmp5_);
			_g_free0 (b);
			b = _tmp7_;
			_g_free0 (_tmp5_);
			_g_free0 (_tmp2_);
			break;
		}
		case AFRODITE_CASE_SENSITIVENESS_AUTO:
		{
			gchar* _tmp8_ = NULL;
			gchar* _tmp9_;
			gboolean _tmp10_;
			_tmp8_ = g_utf8_strdown (name2, (gssize) (-1));
			_tmp9_ = _tmp8_;
			_tmp10_ = g_strcmp0 (_tmp9_, name2) == 0;
			_g_free0 (_tmp9_);
			if (_tmp10_) {
				gchar* _tmp11_ = NULL;
				gchar* _tmp13_;
				gchar* _tmp14_ = NULL;
				gchar* _tmp16_;
				if (name1 != NULL) {
					gchar* _tmp12_ = NULL;
					_tmp12_ = g_utf8_strdown (name1, (gssize) (-1));
					_g_free0 (_tmp11_);
					_tmp11_ = _tmp12_;
				} else {
					_g_free0 (_tmp11_);
					_tmp11_ = NULL;
				}
				_tmp13_ = g_strdup (_tmp11_);
				_g_free0 (a);
				a = _tmp13_;
				if (name2 != NULL) {
					gchar* _tmp15_ = NULL;
					_tmp15_ = g_utf8_strdown (name2, (gssize) (-1));
					_g_free0 (_tmp14_);
					_tmp14_ = _tmp15_;
				} else {
					_g_free0 (_tmp14_);
					_tmp14_ = NULL;
				}
				_tmp16_ = g_strdup (_tmp14_);
				_g_free0 (b);
				b = _tmp16_;
				_g_free0 (_tmp14_);
				_g_free0 (_tmp11_);
			}
			break;
		}
		default:
		break;
	}
	if (mode == AFRODITE_COMPARE_MODE_START_WITH) {
		gboolean _tmp17_ = FALSE;
		if (a != NULL) {
			_tmp17_ = b != NULL;
		} else {
			_tmp17_ = FALSE;
		}
		if (_tmp17_) {
			gboolean _tmp18_;
			_tmp18_ = g_str_has_prefix (a, b);
			result = _tmp18_;
			_g_free0 (b);
			_g_free0 (a);
			return result;
		} else {
			result = FALSE;
			_g_free0 (b);
			_g_free0 (a);
			return result;
		}
	} else {
		result = g_strcmp0 (a, b) == 0;
		_g_free0 (b);
		_g_free0 (a);
		return result;
	}
	_g_free0 (b);
	_g_free0 (a);
}


static AfroditeSymbol* afrodite_code_dom_lookup_name_with_symbol (AfroditeCodeDom* self, const gchar* name, AfroditeSymbol* symbol, AfroditeSourceFile* source, AfroditeCompareMode mode, AfroditeSymbolAccessibility access, AfroditeMemberBinding binding) {
	AfroditeSymbol* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (source != NULL, NULL);
	if (g_strcmp0 (name, "this") == 0) {
		AfroditeSymbol* _tmp0_ = NULL;
		_tmp0_ = afrodite_code_dom_lookup_this_symbol (self, symbol);
		result = _tmp0_;
		return result;
	} else {
		if (g_strcmp0 (name, "base") == 0) {
			AfroditeSymbol* _tmp1_ = NULL;
			AfroditeSymbol* this_sym;
			gboolean _tmp2_ = FALSE;
			_tmp1_ = afrodite_code_dom_lookup_this_symbol (self, symbol);
			this_sym = _tmp1_;
			if (this_sym != NULL) {
				gboolean _tmp3_;
				_tmp3_ = afrodite_symbol_get_has_base_types (this_sym);
				_tmp2_ = _tmp3_;
			} else {
				_tmp2_ = FALSE;
			}
			if (_tmp2_) {
				{
					ValaList* _tmp4_ = NULL;
					ValaList* _tmp5_;
					ValaList* _type_list;
					gint _tmp6_;
					gint _type_size;
					gint _type_index;
					_tmp4_ = afrodite_symbol_get_base_types (this_sym);
					_tmp5_ = _vala_iterable_ref0 (_tmp4_);
					_type_list = _tmp5_;
					_tmp6_ = vala_collection_get_size ((ValaCollection*) _type_list);
					_type_size = _tmp6_;
					_type_index = -1;
					while (TRUE) {
						gpointer _tmp7_ = NULL;
						AfroditeDataType* type;
						gboolean _tmp8_ = FALSE;
						gboolean _tmp9_;
						_type_index = _type_index + 1;
						if (!(_type_index < _type_size)) {
							break;
						}
						_tmp7_ = vala_list_get (_type_list, _type_index);
						type = (AfroditeDataType*) _tmp7_;
						_tmp9_ = afrodite_data_type_get_unresolved (type);
						if (!_tmp9_) {
							AfroditeSymbol* _tmp10_ = NULL;
							AfroditeMemberType _tmp11_;
							_tmp10_ = afrodite_data_type_get_symbol (type);
							_tmp11_ = afrodite_symbol_get_member_type (_tmp10_);
							_tmp8_ = _tmp11_ == AFRODITE_MEMBER_TYPE_CLASS;
						} else {
							_tmp8_ = FALSE;
						}
						if (_tmp8_) {
							AfroditeSymbol* _tmp12_ = NULL;
							AfroditeSymbol* _tmp13_;
							_tmp12_ = afrodite_data_type_get_symbol (type);
							_tmp13_ = _g_object_ref0 (_tmp12_);
							result = _tmp13_;
							_afrodite_data_type_unref0 (type);
							_vala_iterable_unref0 (_type_list);
							_g_object_unref0 (this_sym);
							return result;
						}
						_afrodite_data_type_unref0 (type);
					}
					_vala_iterable_unref0 (_type_list);
				}
			}
			_g_object_unref0 (this_sym);
		} else {
			AfroditeSymbol* _tmp14_;
			AfroditeSymbol* current_sym;
			AfroditeSymbol* _tmp47_ = NULL;
			AfroditeSymbol* _tmp48_;
			AfroditeSymbol* _tmp63_ = NULL;
			AfroditeSymbol* sym;
			gboolean _tmp64_;
			_tmp14_ = _g_object_ref0 (symbol);
			current_sym = _tmp14_;
			while (TRUE) {
				gboolean _tmp15_;
				gboolean _tmp30_;
				AfroditeSymbol* _tmp45_ = NULL;
				AfroditeSymbol* _tmp46_;
				if (!(current_sym != NULL)) {
					break;
				}
				_tmp15_ = afrodite_symbol_get_has_local_variables (current_sym);
				if (_tmp15_) {
					{
						ValaList* _tmp16_ = NULL;
						ValaList* _tmp17_;
						ValaList* _type_list;
						gint _tmp18_;
						gint _type_size;
						gint _type_index;
						_tmp16_ = afrodite_symbol_get_local_variables (current_sym);
						_tmp17_ = _vala_iterable_ref0 (_tmp16_);
						_type_list = _tmp17_;
						_tmp18_ = vala_collection_get_size ((ValaCollection*) _type_list);
						_type_size = _tmp18_;
						_type_index = -1;
						while (TRUE) {
							gpointer _tmp19_ = NULL;
							AfroditeDataType* type;
							gboolean _tmp20_;
							_type_index = _type_index + 1;
							if (!(_type_index < _type_size)) {
								break;
							}
							_tmp19_ = vala_list_get (_type_list, _type_index);
							type = (AfroditeDataType*) _tmp19_;
							_tmp20_ = afrodite_data_type_get_unresolved (type);
							if (!_tmp20_) {
								gboolean _tmp21_ = FALSE;
								gboolean _tmp22_ = FALSE;
								const gchar* _tmp23_ = NULL;
								gboolean _tmp24_;
								_tmp23_ = afrodite_data_type_get_name (type);
								_tmp24_ = afrodite_code_dom_compare_symbol_names (_tmp23_, name, mode, AFRODITE_CASE_SENSITIVENESS_CASE_SENSITIVE);
								if (_tmp24_) {
									AfroditeSymbol* _tmp25_ = NULL;
									AfroditeSymbolAccessibility _tmp26_;
									_tmp25_ = afrodite_data_type_get_symbol (type);
									_tmp26_ = afrodite_symbol_get_access (_tmp25_);
									_tmp22_ = (_tmp26_ & access) != 0;
								} else {
									_tmp22_ = FALSE;
								}
								if (_tmp22_) {
									AfroditeSymbol* _tmp27_ = NULL;
									_tmp27_ = afrodite_data_type_get_symbol (type);
									_tmp21_ = (_tmp27_->binding & binding) != 0;
								} else {
									_tmp21_ = FALSE;
								}
								if (_tmp21_) {
									AfroditeSymbol* _tmp28_ = NULL;
									AfroditeSymbol* _tmp29_;
									_tmp28_ = afrodite_data_type_get_symbol (type);
									_tmp29_ = _g_object_ref0 (_tmp28_);
									result = _tmp29_;
									_afrodite_data_type_unref0 (type);
									_vala_iterable_unref0 (_type_list);
									_g_object_unref0 (current_sym);
									return result;
								}
							}
							_afrodite_data_type_unref0 (type);
						}
						_vala_iterable_unref0 (_type_list);
					}
				}
				_tmp30_ = afrodite_symbol_get_has_parameters (current_sym);
				if (_tmp30_) {
					{
						ValaList* _tmp31_ = NULL;
						ValaList* _tmp32_;
						ValaList* _type_list;
						gint _tmp33_;
						gint _type_size;
						gint _type_index;
						_tmp31_ = afrodite_symbol_get_parameters (current_sym);
						_tmp32_ = _vala_iterable_ref0 (_tmp31_);
						_type_list = _tmp32_;
						_tmp33_ = vala_collection_get_size ((ValaCollection*) _type_list);
						_type_size = _tmp33_;
						_type_index = -1;
						while (TRUE) {
							gpointer _tmp34_ = NULL;
							AfroditeDataType* type;
							gboolean _tmp35_;
							_type_index = _type_index + 1;
							if (!(_type_index < _type_size)) {
								break;
							}
							_tmp34_ = vala_list_get (_type_list, _type_index);
							type = (AfroditeDataType*) _tmp34_;
							_tmp35_ = afrodite_data_type_get_unresolved (type);
							if (!_tmp35_) {
								gboolean _tmp36_ = FALSE;
								gboolean _tmp37_ = FALSE;
								const gchar* _tmp38_ = NULL;
								gboolean _tmp39_;
								_tmp38_ = afrodite_data_type_get_name (type);
								_tmp39_ = afrodite_code_dom_compare_symbol_names (_tmp38_, name, mode, AFRODITE_CASE_SENSITIVENESS_CASE_SENSITIVE);
								if (_tmp39_) {
									AfroditeSymbol* _tmp40_ = NULL;
									AfroditeSymbolAccessibility _tmp41_;
									_tmp40_ = afrodite_data_type_get_symbol (type);
									_tmp41_ = afrodite_symbol_get_access (_tmp40_);
									_tmp37_ = (_tmp41_ & access) != 0;
								} else {
									_tmp37_ = FALSE;
								}
								if (_tmp37_) {
									AfroditeSymbol* _tmp42_ = NULL;
									_tmp42_ = afrodite_data_type_get_symbol (type);
									_tmp36_ = (_tmp42_->binding & binding) != 0;
								} else {
									_tmp36_ = FALSE;
								}
								if (_tmp36_) {
									AfroditeSymbol* _tmp43_ = NULL;
									AfroditeSymbol* _tmp44_;
									_tmp43_ = afrodite_data_type_get_symbol (type);
									_tmp44_ = _g_object_ref0 (_tmp43_);
									result = _tmp44_;
									_afrodite_data_type_unref0 (type);
									_vala_iterable_unref0 (_type_list);
									_g_object_unref0 (current_sym);
									return result;
								}
							}
							_afrodite_data_type_unref0 (type);
						}
						_vala_iterable_unref0 (_type_list);
					}
				}
				_tmp45_ = afrodite_symbol_get_parent (current_sym);
				_tmp46_ = _g_object_ref0 (_tmp45_);
				_g_object_unref0 (current_sym);
				current_sym = _tmp46_;
			}
			_tmp47_ = afrodite_symbol_get_parent (symbol);
			_tmp48_ = _g_object_ref0 (_tmp47_);
			_g_object_unref0 (current_sym);
			current_sym = _tmp48_;
			while (TRUE) {
				gboolean _tmp49_ = FALSE;
				AfroditeSymbol* _tmp61_ = NULL;
				AfroditeSymbol* _tmp62_;
				if (!(current_sym != NULL)) {
					break;
				}
				if (current_sym != NULL) {
					gboolean _tmp50_;
					_tmp50_ = afrodite_symbol_get_has_children (current_sym);
					_tmp49_ = _tmp50_;
				} else {
					_tmp49_ = FALSE;
				}
				if (_tmp49_) {
					{
						ValaList* _tmp51_ = NULL;
						ValaList* _tmp52_;
						ValaList* _sibling_list;
						gint _tmp53_;
						gint _sibling_size;
						gint _sibling_index;
						_tmp51_ = afrodite_symbol_get_children (current_sym);
						_tmp52_ = _vala_iterable_ref0 (_tmp51_);
						_sibling_list = _tmp52_;
						_tmp53_ = vala_collection_get_size ((ValaCollection*) _sibling_list);
						_sibling_size = _tmp53_;
						_sibling_index = -1;
						while (TRUE) {
							gpointer _tmp54_ = NULL;
							AfroditeSymbol* sibling;
							gboolean _tmp55_ = FALSE;
							gboolean _tmp56_ = FALSE;
							gboolean _tmp57_ = FALSE;
							_sibling_index = _sibling_index + 1;
							if (!(_sibling_index < _sibling_size)) {
								break;
							}
							_tmp54_ = vala_list_get (_sibling_list, _sibling_index);
							sibling = (AfroditeSymbol*) _tmp54_;
							if (sibling != symbol) {
								const gchar* _tmp58_ = NULL;
								gboolean _tmp59_;
								_tmp58_ = afrodite_symbol_get_name (sibling);
								_tmp59_ = afrodite_code_dom_compare_symbol_names (_tmp58_, name, mode, AFRODITE_CASE_SENSITIVENESS_CASE_SENSITIVE);
								_tmp57_ = _tmp59_;
							} else {
								_tmp57_ = FALSE;
							}
							if (_tmp57_) {
								AfroditeSymbolAccessibility _tmp60_;
								_tmp60_ = afrodite_symbol_get_access (sibling);
								_tmp56_ = (_tmp60_ & access) != 0;
							} else {
								_tmp56_ = FALSE;
							}
							if (_tmp56_) {
								_tmp55_ = (sibling->binding & binding) != 0;
							} else {
								_tmp55_ = FALSE;
							}
							if (_tmp55_) {
								result = sibling;
								_vala_iterable_unref0 (_sibling_list);
								_g_object_unref0 (current_sym);
								return result;
							}
							_g_object_unref0 (sibling);
						}
						_vala_iterable_unref0 (_sibling_list);
					}
				}
				_tmp61_ = afrodite_symbol_get_parent (current_sym);
				_tmp62_ = _g_object_ref0 (_tmp61_);
				_g_object_unref0 (current_sym);
				current_sym = _tmp62_;
			}
			_tmp63_ = afrodite_code_dom_lookup_name_in_base_types (self, name, symbol, access, binding);
			sym = _tmp63_;
			if (sym != NULL) {
				result = sym;
				_g_object_unref0 (current_sym);
				return result;
			}
			_tmp64_ = afrodite_source_file_get_has_using_directives (source);
			if (_tmp64_) {
				{
					ValaList* _tmp65_ = NULL;
					ValaList* _tmp66_;
					ValaList* _u_list;
					gint _tmp67_;
					gint _u_size;
					gint _u_index;
					_tmp65_ = afrodite_source_file_get_using_directives (source);
					_tmp66_ = _vala_iterable_ref0 (_tmp65_);
					_u_list = _tmp66_;
					_tmp67_ = vala_collection_get_size ((ValaCollection*) _u_list);
					_u_size = _tmp67_;
					_u_index = -1;
					while (TRUE) {
						gpointer _tmp68_ = NULL;
						AfroditeDataType* u;
						const gchar* _tmp69_ = NULL;
						AfroditeSymbol* _tmp70_ = NULL;
						_u_index = _u_index + 1;
						if (!(_u_index < _u_size)) {
							break;
						}
						_tmp68_ = vala_list_get (_u_list, _u_index);
						u = (AfroditeDataType*) _tmp68_;
						_tmp69_ = afrodite_data_type_get_type_name (u);
						_tmp70_ = afrodite_code_dom_lookup (self, _tmp69_);
						_g_object_unref0 (sym);
						sym = _tmp70_;
						if (sym != NULL) {
							AfroditeSymbol* _tmp71_ = NULL;
							AfroditeSymbol* _tmp72_;
							AfroditeSymbol* parent;
							const gchar* _tmp73_ = NULL;
							gboolean _tmp74_;
							_tmp71_ = afrodite_symbol_get_parent (sym);
							_tmp72_ = _g_object_ref0 (_tmp71_);
							parent = _tmp72_;
							_tmp73_ = afrodite_symbol_get_name (sym);
							_tmp74_ = afrodite_code_dom_compare_symbol_names (_tmp73_, name, mode, AFRODITE_CASE_SENSITIVENESS_CASE_SENSITIVE);
							if (_tmp74_) {
								result = sym;
								_g_object_unref0 (parent);
								_afrodite_data_type_unref0 (u);
								_vala_iterable_unref0 (_u_list);
								_g_object_unref0 (current_sym);
								return result;
							} else {
								gboolean _tmp75_;
								_tmp75_ = afrodite_symbol_get_has_children (sym);
								if (_tmp75_) {
									AfroditeSymbol* _tmp76_ = NULL;
									_tmp76_ = afrodite_code_dom_lookup_symbol (name, sym, &parent, mode, access, binding);
									_g_object_unref0 (sym);
									sym = _tmp76_;
									if (sym != NULL) {
										result = sym;
										_g_object_unref0 (parent);
										_afrodite_data_type_unref0 (u);
										_vala_iterable_unref0 (_u_list);
										_g_object_unref0 (current_sym);
										return result;
									}
								}
							}
							_g_object_unref0 (parent);
						}
						_afrodite_data_type_unref0 (u);
					}
					_vala_iterable_unref0 (_u_list);
				}
			}
			_g_object_unref0 (sym);
			_g_object_unref0 (current_sym);
		}
	}
	result = NULL;
	return result;
}


AfroditeSymbol* afrodite_code_dom_get_symbol_for_source_and_position (AfroditeCodeDom* self, AfroditeSourceFile* source, gint line, gint column) {
	AfroditeSymbol* result = NULL;
	AfroditeSymbol* _result_;
	AfroditeSourceReference* result_sr;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (source != NULL, NULL);
	_result_ = NULL;
	result_sr = NULL;
	_tmp0_ = afrodite_source_file_get_has_symbols (source);
	if (_tmp0_) {
		line++;
		{
			ValaList* _tmp1_ = NULL;
			ValaList* _tmp2_;
			ValaList* _symbol_list;
			gint _tmp3_;
			gint _symbol_size;
			gint _symbol_index;
			_tmp1_ = afrodite_source_file_get_symbols (source);
			_tmp2_ = _vala_iterable_ref0 (_tmp1_);
			_symbol_list = _tmp2_;
			_tmp3_ = vala_collection_get_size ((ValaCollection*) _symbol_list);
			_symbol_size = _tmp3_;
			_symbol_index = -1;
			while (TRUE) {
				gpointer _tmp4_ = NULL;
				AfroditeSymbol* _tmp5_;
				AfroditeSymbol* symbol;
				AfroditeSourceReference* _tmp6_ = NULL;
				AfroditeSourceReference* sr;
				gboolean _tmp7_;
				_symbol_index = _symbol_index + 1;
				if (!(_symbol_index < _symbol_size)) {
					break;
				}
				_tmp4_ = vala_list_get (_symbol_list, _symbol_index);
				_tmp5_ = _g_object_ref0 ((AfroditeSymbol*) _tmp4_);
				symbol = _tmp5_;
				_tmp6_ = afrodite_symbol_lookup_source_reference_sourcefile (symbol, source);
				sr = _tmp6_;
				if (sr == NULL) {
					_afrodite_source_reference_unref0 (sr);
					_g_object_unref0 (symbol);
					continue;
				}
				_tmp7_ = afrodite_source_reference_contains_position (sr, line, column);
				if (_tmp7_) {
					gboolean _tmp8_ = FALSE;
					if (_result_ == NULL) {
						_tmp8_ = TRUE;
					} else {
						gboolean _tmp9_;
						_tmp9_ = afrodite_source_reference_contains_source_reference (result_sr, sr);
						_tmp8_ = _tmp9_;
					}
					if (_tmp8_) {
						AfroditeSymbol* _tmp10_;
						_tmp10_ = _g_object_ref0 (symbol);
						_g_object_unref0 (_result_);
						_result_ = _tmp10_;
						result_sr = sr;
					}
				}
				_afrodite_source_reference_unref0 (sr);
				_g_object_unref0 (symbol);
			}
			_vala_iterable_unref0 (_symbol_list);
		}
	}
	if (_result_ == NULL) {
		afrodite_utils_trace ("codedom.vala:635: no symbol found");
	} else {
		gchar* _tmp11_ = NULL;
		gchar* _tmp12_;
		_tmp11_ = afrodite_symbol_get_fully_qualified_name (_result_);
		_tmp12_ = _tmp11_;
		afrodite_utils_trace ("codedom.vala:637:    found %s", _tmp12_);
		_g_free0 (_tmp12_);
	}
	result = _result_;
	return result;
}


AfroditeCodeDom* afrodite_code_dom_construct (GType object_type) {
	AfroditeCodeDom* self = NULL;
	self = (AfroditeCodeDom*) g_type_create_instance (object_type);
	return self;
}


AfroditeCodeDom* afrodite_code_dom_new (void) {
	return afrodite_code_dom_construct (AFRODITE_TYPE_CODE_DOM);
}


AfroditeSymbol* afrodite_code_dom_get_root (AfroditeCodeDom* self) {
	AfroditeSymbol* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self->priv->_root;
	return result;
}


void afrodite_code_dom_set_root (AfroditeCodeDom* self, AfroditeSymbol* value) {
	AfroditeSymbol* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_root);
	self->priv->_root = _tmp0_;
}


ValaList* afrodite_code_dom_get_source_files (AfroditeCodeDom* self) {
	ValaList* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self->priv->_source_files;
	return result;
}


void afrodite_code_dom_set_source_files (AfroditeCodeDom* self, ValaList* value) {
	ValaList* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _vala_iterable_ref0 (value);
	_vala_iterable_unref0 (self->priv->_source_files);
	self->priv->_source_files = _tmp0_;
}


gboolean afrodite_code_dom_get_has_source_files (AfroditeCodeDom* self) {
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_source_files != NULL;
	return result;
}


static void afrodite_value_code_dom_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void afrodite_value_code_dom_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		afrodite_code_dom_unref (value->data[0].v_pointer);
	}
}


static void afrodite_value_code_dom_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = afrodite_code_dom_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer afrodite_value_code_dom_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* afrodite_value_code_dom_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		AfroditeCodeDom* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = afrodite_code_dom_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* afrodite_value_code_dom_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	AfroditeCodeDom** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = afrodite_code_dom_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* afrodite_param_spec_code_dom (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	AfroditeParamSpecCodeDom* spec;
	g_return_val_if_fail (g_type_is_a (object_type, AFRODITE_TYPE_CODE_DOM), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


gpointer afrodite_value_get_code_dom (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, AFRODITE_TYPE_CODE_DOM), NULL);
	return value->data[0].v_pointer;
}


void afrodite_value_set_code_dom (GValue* value, gpointer v_object) {
	AfroditeCodeDom* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, AFRODITE_TYPE_CODE_DOM));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, AFRODITE_TYPE_CODE_DOM));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		afrodite_code_dom_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		afrodite_code_dom_unref (old);
	}
}


void afrodite_value_take_code_dom (GValue* value, gpointer v_object) {
	AfroditeCodeDom* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, AFRODITE_TYPE_CODE_DOM));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, AFRODITE_TYPE_CODE_DOM));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		afrodite_code_dom_unref (old);
	}
}


static void afrodite_code_dom_class_init (AfroditeCodeDomClass * klass) {
	afrodite_code_dom_parent_class = g_type_class_peek_parent (klass);
	AFRODITE_CODE_DOM_CLASS (klass)->finalize = afrodite_code_dom_finalize;
	g_type_class_add_private (klass, sizeof (AfroditeCodeDomPrivate));
}


static void afrodite_code_dom_instance_init (AfroditeCodeDom * self) {
	ValaHashMap* _tmp0_ = NULL;
	ValaArrayList* _tmp1_ = NULL;
	AfroditeSymbol* _tmp2_ = NULL;
	self->priv = AFRODITE_CODE_DOM_GET_PRIVATE (self);
	_tmp0_ = vala_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, AFRODITE_TYPE_SYMBOL, NULL, NULL, g_str_hash, g_str_equal, g_direct_equal);
	self->symbols = _tmp0_;
	_tmp1_ = vala_array_list_new (AFRODITE_TYPE_SYMBOL, NULL, NULL, g_direct_equal);
	self->unresolved_symbols = (ValaList*) _tmp1_;
	_tmp2_ = afrodite_symbol_new (NULL, AFRODITE_MEMBER_TYPE_NONE);
	self->priv->_root = _tmp2_;
	self->ref_count = 1;
}


static void afrodite_code_dom_finalize (AfroditeCodeDom* obj) {
	AfroditeCodeDom * self;
	self = AFRODITE_CODE_DOM (obj);
	afrodite_utils_trace ("codedom.vala:36: CodeDom destroy");
	{
		ValaList* _tmp0_;
		ValaList* _file_list;
		gint _tmp1_;
		gint _file_size;
		gint _file_index;
		_tmp0_ = _vala_iterable_ref0 (self->priv->_source_files);
		_file_list = _tmp0_;
		_tmp1_ = vala_collection_get_size ((ValaCollection*) _file_list);
		_file_size = _tmp1_;
		_file_index = -1;
		while (TRUE) {
			gpointer _tmp2_ = NULL;
			AfroditeSourceFile* file;
			_file_index = _file_index + 1;
			if (!(_file_index < _file_size)) {
				break;
			}
			_tmp2_ = vala_list_get (_file_list, _file_index);
			file = (AfroditeSourceFile*) _tmp2_;
			afrodite_source_file_set_codedom (file, NULL);
			_afrodite_source_file_unref0 (file);
		}
		_vala_iterable_unref0 (_file_list);
	}
	_g_object_unref0 (self->priv->_root);
	self->priv->_root = NULL;
	afrodite_code_dom_set_source_files (self, NULL);
	afrodite_utils_trace ("codedom.vala:43: CodeDom destroyed");
	_vala_map_unref0 (self->symbols);
	_vala_iterable_unref0 (self->unresolved_symbols);
	_g_object_unref0 (self->priv->_root);
	_vala_iterable_unref0 (self->priv->_source_files);
}


GType afrodite_code_dom_get_type (void) {
	static volatile gsize afrodite_code_dom_type_id__volatile = 0;
	if (g_once_init_enter (&afrodite_code_dom_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { afrodite_value_code_dom_init, afrodite_value_code_dom_free_value, afrodite_value_code_dom_copy_value, afrodite_value_code_dom_peek_pointer, "p", afrodite_value_code_dom_collect_value, "p", afrodite_value_code_dom_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (AfroditeCodeDomClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) afrodite_code_dom_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AfroditeCodeDom), 0, (GInstanceInitFunc) afrodite_code_dom_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType afrodite_code_dom_type_id;
		afrodite_code_dom_type_id = g_type_register_fundamental (g_type_fundamental_next (), "AfroditeCodeDom", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&afrodite_code_dom_type_id__volatile, afrodite_code_dom_type_id);
	}
	return afrodite_code_dom_type_id__volatile;
}


gpointer afrodite_code_dom_ref (gpointer instance) {
	AfroditeCodeDom* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


void afrodite_code_dom_unref (gpointer instance) {
	AfroditeCodeDom* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		AFRODITE_CODE_DOM_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}


static gint _vala_array_length (gpointer array) {
	int length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}



