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

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

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

enum  {
	VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_0_PROPERTY,
	VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_FILE_EXTENSION_PROPERTY,
	VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_NUM_PROPERTIES
};
static GParamSpec* valadoc_importer_valadoc_documentation_importer_properties[VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_NUM_PROPERTIES];

#define VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_TYPE_INSERTION_MODE (valadoc_importer_valadoc_documentation_importer_insertion_mode_get_type ())
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _valadoc_parser_unref0(var) ((var == NULL) ? NULL : (var = (valadoc_parser_unref (var), NULL)))
#define _g_mapped_file_unref0(var) ((var == NULL) ? NULL : (var = (g_mapped_file_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _ValadocImporterValadocDocumentationImporterPrivate {
	ValadocImporterValadocDocumentationScanner* _scanner;
	ValadocDocumentationParser* _doc_parser;
	ValadocParser* _parser;
	GMappedFile* _mapped_file;
	gchar* _filename;
	gchar* _cname;
	GString* _comment;
	ValadocSourceLocation _comment_location;
	ValadocErrorReporter* reporter;
};

typedef enum  {
	VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_INSERTION_MODE_APPEND,
	VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_INSERTION_MODE_PREPEND,
	VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_INSERTION_MODE_REPLACE
} ValadocImporterValadocDocumentationImporterInsertionMode;


static gpointer valadoc_importer_valadoc_documentation_importer_parent_class = NULL;
static ValadocResourceLocatorIface * valadoc_importer_valadoc_documentation_importer_valadoc_resource_locator_parent_iface = NULL;

#define VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VALADOC_IMPORTER_TYPE_VALADOC_DOCUMENTATION_IMPORTER, ValadocImporterValadocDocumentationImporterPrivate))
static GType valadoc_importer_valadoc_documentation_importer_insertion_mode_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static void __lambda134_ (ValadocImporterValadocDocumentationImporter* self, ValadocToken* token, GError** error);
static void ___lambda134__valadoc_token_type_action (ValadocToken* token, gpointer self, GError** error);
static void valadoc_importer_valadoc_documentation_importer_add_comment (ValadocImporterValadocDocumentationImporter* self, ValadocToken* token, GError** error);
static void _valadoc_importer_valadoc_documentation_importer_add_comment_valadoc_token_type_action (ValadocToken* token, gpointer self, GError** error);
static void __lambda135_ (ValadocImporterValadocDocumentationImporter* self, ValadocToken* token, GError** error);
static void ___lambda135__valadoc_token_type_action (ValadocToken* token, gpointer self, GError** error);
static void __lambda136_ (ValadocImporterValadocDocumentationImporter* self, GError** error);
static void valadoc_importer_valadoc_documentation_importer_add_documentation (ValadocImporterValadocDocumentationImporter* self, const gchar* _symbol_name, GString* comment, const gchar* filename, ValadocSourceLocation* src_ref);
static void ___lambda136__valadoc_rule_action (gpointer self, GError** error);
static void __lambda137_ (ValadocImporterValadocDocumentationImporter* self, ValadocToken* token, GError** error);
static void ___lambda137__valadoc_token_type_action (ValadocToken* token, gpointer self, GError** error);
G_GNUC_INTERNAL void valadoc_api_node_set_documentation (ValadocApiNode* self, ValadocContentComment* value);
static void valadoc_importer_valadoc_documentation_importer_merge_taglets (ValadocImporterValadocDocumentationImporter* self, ValadocContentComment* comment, ValadocContentComment* imported);
static void valadoc_importer_valadoc_documentation_importer_real_process (ValadocImporterDocumentationImporter* base, const gchar* filename);
static void valadoc_importer_valadoc_documentation_importer_finalize (GObject * obj);
static void _vala_valadoc_importer_valadoc_documentation_importer_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
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 GType valadoc_importer_valadoc_documentation_importer_insertion_mode_get_type (void) {
	static volatile gsize valadoc_importer_valadoc_documentation_importer_insertion_mode_type_id__volatile = 0;
	if (g_once_init_enter (&valadoc_importer_valadoc_documentation_importer_insertion_mode_type_id__volatile)) {
		static const GEnumValue values[] = {{VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_INSERTION_MODE_APPEND, "VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_INSERTION_MODE_APPEND", "append"}, {VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_INSERTION_MODE_PREPEND, "VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_INSERTION_MODE_PREPEND", "prepend"}, {VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_INSERTION_MODE_REPLACE, "VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_INSERTION_MODE_REPLACE", "replace"}, {0, NULL, NULL}};
		GType valadoc_importer_valadoc_documentation_importer_insertion_mode_type_id;
		valadoc_importer_valadoc_documentation_importer_insertion_mode_type_id = g_enum_register_static ("ValadocImporterValadocDocumentationImporterInsertionMode", values);
		g_once_init_leave (&valadoc_importer_valadoc_documentation_importer_insertion_mode_type_id__volatile, valadoc_importer_valadoc_documentation_importer_insertion_mode_type_id);
	}
	return valadoc_importer_valadoc_documentation_importer_insertion_mode_type_id__volatile;
}


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


static void __lambda134_ (ValadocImporterValadocDocumentationImporter* self, ValadocToken* token, GError** error) {
	ValadocToken* _tmp0_;
	ValadocSourceLocation _tmp1_ = {0};
	ValadocSourceLocation _tmp2_;
	g_return_if_fail (token != NULL);
	_tmp0_ = token;
	valadoc_token_get_end (_tmp0_, &_tmp1_);
	_tmp2_ = _tmp1_;
	self->priv->_comment_location = _tmp2_;
}


static void ___lambda134__valadoc_token_type_action (ValadocToken* token, gpointer self, GError** error) {
	__lambda134_ ((ValadocImporterValadocDocumentationImporter*) self, token, error);
}


static void _valadoc_importer_valadoc_documentation_importer_add_comment_valadoc_token_type_action (ValadocToken* token, gpointer self, GError** error) {
	valadoc_importer_valadoc_documentation_importer_add_comment ((ValadocImporterValadocDocumentationImporter*) self, token, error);
}


static void __lambda135_ (ValadocImporterValadocDocumentationImporter* self, ValadocToken* token, GError** error) {
	ValadocToken* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (token != NULL);
	_tmp0_ = token;
	_tmp1_ = valadoc_token_to_string (_tmp0_);
	_g_free0 (self->priv->_cname);
	self->priv->_cname = _tmp1_;
}


static void ___lambda135__valadoc_token_type_action (ValadocToken* token, gpointer self, GError** error) {
	__lambda135_ ((ValadocImporterValadocDocumentationImporter*) self, token, error);
}


static void __lambda136_ (ValadocImporterValadocDocumentationImporter* self, GError** error) {
	const gchar* _tmp0_;
	GString* _tmp1_;
	const gchar* _tmp2_;
	ValadocSourceLocation _tmp3_;
	GString* _tmp4_;
	_tmp0_ = self->priv->_cname;
	_tmp1_ = self->priv->_comment;
	_tmp2_ = self->priv->_filename;
	_tmp3_ = self->priv->_comment_location;
	valadoc_importer_valadoc_documentation_importer_add_documentation (self, _tmp0_, _tmp1_, _tmp2_, &_tmp3_);
	_tmp4_ = self->priv->_comment;
	g_string_erase (_tmp4_, (gssize) 0, (gssize) -1);
	_g_free0 (self->priv->_cname);
	self->priv->_cname = NULL;
}


static void ___lambda136__valadoc_rule_action (gpointer self, GError** error) {
	__lambda136_ ((ValadocImporterValadocDocumentationImporter*) self, error);
}


static void __lambda137_ (ValadocImporterValadocDocumentationImporter* self, ValadocToken* token, GError** error) {
	ValadocToken* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	ValadocSourceLocation _tmp4_;
	g_return_if_fail (token != NULL);
	_tmp0_ = token;
	_tmp1_ = valadoc_token_to_string (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->_filename;
	_tmp4_ = self->priv->_comment_location;
	valadoc_importer_valadoc_documentation_importer_add_documentation (self, _tmp2_, NULL, _tmp3_, &_tmp4_);
	_g_free0 (_tmp2_);
}


static void ___lambda137__valadoc_token_type_action (ValadocToken* token, gpointer self, GError** error) {
	__lambda137_ ((ValadocImporterValadocDocumentationImporter*) self, token, error);
}


ValadocImporterValadocDocumentationImporter* valadoc_importer_valadoc_documentation_importer_construct (GType object_type, ValadocApiTree* tree, ValadocDocumentationParser* parser, ValadocModuleLoader* modules, ValadocSettings* settings, ValadocErrorReporter* reporter) {
	ValadocImporterValadocDocumentationImporter * self = NULL;
	ValadocApiTree* _tmp0_;
	ValadocModuleLoader* _tmp1_;
	ValadocSettings* _tmp2_;
	ValadocSettings* _tmp3_;
	ValadocModuleLoader* _tmp4_;
	ValadocContentContentFactory* _tmp5_;
	ValadocErrorReporter* _tmp6_;
	ValadocErrorReporter* _tmp7_;
	ValadocSettings* _tmp8_;
	ValadocImporterValadocDocumentationScanner* _tmp9_;
	ValadocDocumentationParser* _tmp10_;
	ValadocDocumentationParser* _tmp11_;
	ValadocSettings* _tmp12_;
	ValadocImporterValadocDocumentationScanner* _tmp13_;
	ValadocSettings* _tmp14_;
	ValadocImporterValadocDocumentationScanner* _tmp15_;
	ValadocErrorReporter* _tmp16_;
	ValadocParser* _tmp17_;
	ValadocImporterValadocDocumentationScanner* _tmp18_;
	ValadocParser* _tmp19_;
	GString* _tmp20_;
	ValadocRule* unprinted_spaces = NULL;
	ValadocTokenType* _tmp21_;
	GObject* _tmp22_;
	ValadocTokenType* _tmp23_;
	GObject* _tmp24_;
	GObject** _tmp25_;
	GObject** _tmp26_;
	gint _tmp26__length1;
	ValadocRule* _tmp27_;
	GObject** _tmp28_;
	GObject** _tmp29_;
	gint _tmp29__length1;
	ValadocRule* _tmp30_;
	ValadocRule* _tmp31_;
	ValadocRule* empty_lines = NULL;
	GObject* _tmp32_;
	ValadocTokenType* _tmp33_;
	GObject* _tmp34_;
	GObject** _tmp35_;
	GObject** _tmp36_;
	gint _tmp36__length1;
	ValadocRule* _tmp37_;
	GObject** _tmp38_;
	GObject** _tmp39_;
	gint _tmp39__length1;
	ValadocRule* _tmp40_;
	ValadocRule* _tmp41_;
	ValadocRule* _tmp42_;
	ValadocRule* _tmp43_;
	ValadocRule* optional_empty_lines = NULL;
	GObject* _tmp44_;
	GObject** _tmp45_;
	GObject** _tmp46_;
	gint _tmp46__length1;
	ValadocRule* _tmp47_;
	ValadocRule* _tmp48_;
	ValadocRule* documentation = NULL;
	ValadocTokenType* _tmp49_;
	ValadocTokenType* _tmp50_;
	ValadocTokenType* _tmp51_;
	ValadocTokenType* _tmp52_;
	ValadocTokenType* _tmp53_;
	ValadocTokenType* _tmp54_;
	ValadocTokenType* _tmp55_;
	ValadocTokenType* _tmp56_;
	ValadocTokenType* _tmp57_;
	ValadocTokenType* _tmp58_;
	ValadocTokenType* _tmp59_;
	ValadocTokenType* _tmp60_;
	GObject** _tmp61_;
	GObject** _tmp62_;
	gint _tmp62__length1;
	ValadocRule* _tmp63_;
	GObject** _tmp64_;
	GObject** _tmp65_;
	gint _tmp65__length1;
	ValadocRule* _tmp66_;
	ValadocTokenType* _tmp67_;
	GObject* _tmp68_;
	GObject* _tmp69_;
	ValadocTokenType* _tmp70_;
	ValadocTokenType* _tmp71_;
	GObject** _tmp72_;
	GObject** _tmp73_;
	gint _tmp73__length1;
	ValadocRule* _tmp74_;
	ValadocRule* _tmp75_;
	ValadocRule* _tmp76_;
	ValadocTokenType* _tmp77_;
	ValadocTokenType* _tmp78_;
	GObject** _tmp79_;
	GObject** _tmp80_;
	gint _tmp80__length1;
	ValadocRule* _tmp81_;
	ValadocRule* _tmp82_;
	ValadocRule* _tmp83_;
	ValadocRule* _tmp84_;
	ValadocRule* file = NULL;
	GObject* _tmp85_;
	GObject* _tmp86_;
	GObject** _tmp87_;
	GObject** _tmp88_;
	gint _tmp88__length1;
	ValadocRule* _tmp89_;
	GObject** _tmp90_;
	GObject** _tmp91_;
	gint _tmp91__length1;
	ValadocRule* _tmp92_;
	ValadocRule* _tmp93_;
	ValadocRule* _tmp94_;
	ValadocRule* _tmp95_;
	ValadocParser* _tmp96_;
	g_return_val_if_fail (tree != NULL, NULL);
	g_return_val_if_fail (parser != NULL, NULL);
	g_return_val_if_fail (modules != NULL, NULL);
	g_return_val_if_fail (settings != NULL, NULL);
	g_return_val_if_fail (reporter != NULL, NULL);
	_tmp0_ = tree;
	_tmp1_ = modules;
	_tmp2_ = settings;
	self = (ValadocImporterValadocDocumentationImporter*) valadoc_importer_documentation_importer_construct (object_type, _tmp0_, _tmp1_, _tmp2_);
	_tmp3_ = settings;
	_tmp4_ = modules;
	_tmp5_ = valadoc_content_content_factory_new (_tmp3_, (ValadocResourceLocator*) self, _tmp4_);
	_g_object_unref0 (self->factory);
	self->factory = _tmp5_;
	_tmp6_ = reporter;
	_tmp7_ = _g_object_ref0 (_tmp6_);
	_g_object_unref0 (self->priv->reporter);
	self->priv->reporter = _tmp7_;
	_tmp8_ = settings;
	_tmp9_ = valadoc_importer_valadoc_documentation_scanner_new (_tmp8_);
	_g_object_unref0 (self->priv->_scanner);
	self->priv->_scanner = _tmp9_;
	_tmp10_ = parser;
	_tmp11_ = _g_object_ref0 (_tmp10_);
	_g_object_unref0 (self->priv->_doc_parser);
	self->priv->_doc_parser = _tmp11_;
	_tmp12_ = settings;
	_tmp13_ = valadoc_importer_valadoc_documentation_scanner_new (_tmp12_);
	_g_object_unref0 (self->priv->_scanner);
	self->priv->_scanner = _tmp13_;
	_tmp14_ = settings;
	_tmp15_ = self->priv->_scanner;
	_tmp16_ = reporter;
	_tmp17_ = valadoc_parser_new (_tmp14_, (ValadocScanner*) _tmp15_, _tmp16_);
	_valadoc_parser_unref0 (self->priv->_parser);
	self->priv->_parser = _tmp17_;
	_tmp18_ = self->priv->_scanner;
	_tmp19_ = self->priv->_parser;
	valadoc_scanner_set_parser ((ValadocScanner*) _tmp18_, _tmp19_);
	_tmp20_ = g_string_new ("");
	_g_string_free0 (self->priv->_comment);
	self->priv->_comment = _tmp20_;
	_tmp21_ = valadoc_token_type_VALADOC_SPACE;
	_tmp22_ = _g_object_ref0 ((GObject*) _tmp21_);
	_tmp23_ = valadoc_token_type_VALADOC_TAB;
	_tmp24_ = _g_object_ref0 ((GObject*) _tmp23_);
	_tmp25_ = g_new0 (GObject*, 2 + 1);
	_tmp25_[0] = _tmp22_;
	_tmp25_[1] = _tmp24_;
	_tmp26_ = _tmp25_;
	_tmp26__length1 = 2;
	_tmp27_ = valadoc_rule_one_of (_tmp26_, 2);
	_tmp28_ = g_new0 (GObject*, 1 + 1);
	_tmp28_[0] = (GObject*) _tmp27_;
	_tmp29_ = _tmp28_;
	_tmp29__length1 = 1;
	_tmp30_ = valadoc_rule_many (_tmp29_, 1);
	_tmp31_ = _tmp30_;
	_tmp29_ = (_vala_array_free (_tmp29_, _tmp29__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp26_ = (_vala_array_free (_tmp26_, _tmp26__length1, (GDestroyNotify) g_object_unref), NULL);
	unprinted_spaces = _tmp31_;
	_tmp32_ = _g_object_ref0 ((GObject*) unprinted_spaces);
	_tmp33_ = valadoc_token_type_VALADOC_EOL;
	_tmp34_ = _g_object_ref0 ((GObject*) _tmp33_);
	_tmp35_ = g_new0 (GObject*, 2 + 1);
	_tmp35_[0] = _tmp32_;
	_tmp35_[1] = _tmp34_;
	_tmp36_ = _tmp35_;
	_tmp36__length1 = 2;
	_tmp37_ = valadoc_rule_one_of (_tmp36_, 2);
	_tmp38_ = g_new0 (GObject*, 1 + 1);
	_tmp38_[0] = (GObject*) _tmp37_;
	_tmp39_ = _tmp38_;
	_tmp39__length1 = 1;
	_tmp40_ = valadoc_rule_many (_tmp39_, 1);
	_tmp41_ = _tmp40_;
	_tmp42_ = valadoc_rule_set_name (_tmp41_, "EmptyLines");
	_tmp43_ = _tmp42_;
	_g_object_unref0 (_tmp41_);
	_tmp39_ = (_vala_array_free (_tmp39_, _tmp39__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp36_ = (_vala_array_free (_tmp36_, _tmp36__length1, (GDestroyNotify) g_object_unref), NULL);
	empty_lines = _tmp43_;
	_tmp44_ = _g_object_ref0 ((GObject*) empty_lines);
	_tmp45_ = g_new0 (GObject*, 1 + 1);
	_tmp45_[0] = _tmp44_;
	_tmp46_ = _tmp45_;
	_tmp46__length1 = 1;
	_tmp47_ = valadoc_rule_option (_tmp46_, 1);
	_tmp48_ = _tmp47_;
	_tmp46_ = (_vala_array_free (_tmp46_, _tmp46__length1, (GDestroyNotify) g_object_unref), NULL);
	optional_empty_lines = _tmp48_;
	_tmp49_ = valadoc_token_type_VALADOC_COMMENT_START;
	_tmp50_ = valadoc_token_type_action (_tmp49_, ___lambda134__valadoc_token_type_action, self);
	_tmp51_ = valadoc_token_type_ANY_WORD;
	_tmp52_ = valadoc_token_type_action (_tmp51_, _valadoc_importer_valadoc_documentation_importer_add_comment_valadoc_token_type_action, self);
	_tmp53_ = valadoc_token_type_VALADOC_COMMENT_START;
	_tmp54_ = valadoc_token_type_action (_tmp53_, _valadoc_importer_valadoc_documentation_importer_add_comment_valadoc_token_type_action, self);
	_tmp55_ = valadoc_token_type_VALADOC_SPACE;
	_tmp56_ = valadoc_token_type_action (_tmp55_, _valadoc_importer_valadoc_documentation_importer_add_comment_valadoc_token_type_action, self);
	_tmp57_ = valadoc_token_type_VALADOC_TAB;
	_tmp58_ = valadoc_token_type_action (_tmp57_, _valadoc_importer_valadoc_documentation_importer_add_comment_valadoc_token_type_action, self);
	_tmp59_ = valadoc_token_type_VALADOC_EOL;
	_tmp60_ = valadoc_token_type_action (_tmp59_, _valadoc_importer_valadoc_documentation_importer_add_comment_valadoc_token_type_action, self);
	_tmp61_ = g_new0 (GObject*, 5 + 1);
	_tmp61_[0] = (GObject*) _tmp52_;
	_tmp61_[1] = (GObject*) _tmp54_;
	_tmp61_[2] = (GObject*) _tmp56_;
	_tmp61_[3] = (GObject*) _tmp58_;
	_tmp61_[4] = (GObject*) _tmp60_;
	_tmp62_ = _tmp61_;
	_tmp62__length1 = 5;
	_tmp63_ = valadoc_rule_one_of (_tmp62_, 5);
	_tmp64_ = g_new0 (GObject*, 1 + 1);
	_tmp64_[0] = (GObject*) _tmp63_;
	_tmp65_ = _tmp64_;
	_tmp65__length1 = 1;
	_tmp66_ = valadoc_rule_many (_tmp65_, 1);
	_tmp67_ = valadoc_token_type_VALADOC_COMMENT_END;
	_tmp68_ = _g_object_ref0 ((GObject*) _tmp67_);
	_tmp69_ = _g_object_ref0 ((GObject*) optional_empty_lines);
	_tmp70_ = valadoc_token_type_ANY_WORD;
	_tmp71_ = valadoc_token_type_action (_tmp70_, ___lambda135__valadoc_token_type_action, self);
	_tmp72_ = g_new0 (GObject*, 5 + 1);
	_tmp72_[0] = (GObject*) _tmp50_;
	_tmp72_[1] = (GObject*) _tmp66_;
	_tmp72_[2] = _tmp68_;
	_tmp72_[3] = _tmp69_;
	_tmp72_[4] = (GObject*) _tmp71_;
	_tmp73_ = _tmp72_;
	_tmp73__length1 = 5;
	_tmp74_ = valadoc_rule_seq (_tmp73_, 5);
	_tmp75_ = _tmp74_;
	_tmp76_ = valadoc_rule_set_reduce (_tmp75_, ___lambda136__valadoc_rule_action, self);
	_tmp77_ = valadoc_token_type_ANY_WORD;
	_tmp78_ = valadoc_token_type_action (_tmp77_, ___lambda137__valadoc_token_type_action, self);
	_tmp79_ = g_new0 (GObject*, 2 + 1);
	_tmp79_[0] = (GObject*) _tmp76_;
	_tmp79_[1] = (GObject*) _tmp78_;
	_tmp80_ = _tmp79_;
	_tmp80__length1 = 2;
	_tmp81_ = valadoc_rule_one_of (_tmp80_, 2);
	_tmp82_ = _tmp81_;
	_tmp83_ = valadoc_rule_set_name (_tmp82_, "Documentation");
	_tmp84_ = _tmp83_;
	_g_object_unref0 (_tmp82_);
	_tmp80_ = (_vala_array_free (_tmp80_, _tmp80__length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (_tmp75_);
	_tmp73_ = (_vala_array_free (_tmp73_, _tmp73__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp65_ = (_vala_array_free (_tmp65_, _tmp65__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp62_ = (_vala_array_free (_tmp62_, _tmp62__length1, (GDestroyNotify) g_object_unref), NULL);
	documentation = _tmp84_;
	_tmp85_ = _g_object_ref0 ((GObject*) documentation);
	_tmp86_ = _g_object_ref0 ((GObject*) optional_empty_lines);
	_tmp87_ = g_new0 (GObject*, 2 + 1);
	_tmp87_[0] = _tmp85_;
	_tmp87_[1] = _tmp86_;
	_tmp88_ = _tmp87_;
	_tmp88__length1 = 2;
	_tmp89_ = valadoc_rule_one_of (_tmp88_, 2);
	_tmp90_ = g_new0 (GObject*, 1 + 1);
	_tmp90_[0] = (GObject*) _tmp89_;
	_tmp91_ = _tmp90_;
	_tmp91__length1 = 1;
	_tmp92_ = valadoc_rule_many (_tmp91_, 1);
	_tmp93_ = _tmp92_;
	_tmp94_ = valadoc_rule_set_name (_tmp93_, "ValadocFile");
	_tmp95_ = _tmp94_;
	_g_object_unref0 (_tmp93_);
	_tmp91_ = (_vala_array_free (_tmp91_, _tmp91__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp88_ = (_vala_array_free (_tmp88_, _tmp88__length1, (GDestroyNotify) g_object_unref), NULL);
	file = _tmp95_;
	_tmp96_ = self->priv->_parser;
	valadoc_parser_set_root_rule (_tmp96_, file);
	_g_object_unref0 (file);
	_g_object_unref0 (documentation);
	_g_object_unref0 (optional_empty_lines);
	_g_object_unref0 (empty_lines);
	_g_object_unref0 (unprinted_spaces);
	return self;
}


ValadocImporterValadocDocumentationImporter* valadoc_importer_valadoc_documentation_importer_new (ValadocApiTree* tree, ValadocDocumentationParser* parser, ValadocModuleLoader* modules, ValadocSettings* settings, ValadocErrorReporter* reporter) {
	return valadoc_importer_valadoc_documentation_importer_construct (VALADOC_IMPORTER_TYPE_VALADOC_DOCUMENTATION_IMPORTER, tree, parser, modules, settings, reporter);
}


static void valadoc_importer_valadoc_documentation_importer_add_comment (ValadocImporterValadocDocumentationImporter* self, ValadocToken* token, GError** error) {
	GString* _tmp0_;
	ValadocToken* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (token != NULL);
	_tmp0_ = self->priv->_comment;
	_tmp1_ = token;
	_tmp2_ = valadoc_token_to_string (_tmp1_);
	_tmp3_ = _tmp2_;
	g_string_append (_tmp0_, _tmp3_);
	_g_free0 (_tmp3_);
}


static glong string_strnlen (gchar* str, glong maxlen) {
	glong result = 0L;
	gchar* end = NULL;
	gchar* _tmp0_;
	glong _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	_tmp0_ = str;
	_tmp1_ = maxlen;
	_tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_);
	end = _tmp2_;
	_tmp3_ = end;
	if (_tmp3_ == NULL) {
		glong _tmp4_;
		_tmp4_ = maxlen;
		result = _tmp4_;
		return result;
	} else {
		gchar* _tmp5_;
		gchar* _tmp6_;
		_tmp5_ = end;
		_tmp6_ = str;
		result = (glong) (_tmp5_ - _tmp6_);
		return result;
	}
}


static gchar* string_substring (const gchar* self, glong offset, glong len) {
	gchar* result = NULL;
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	glong _tmp1_;
	glong _tmp8_;
	glong _tmp14_;
	glong _tmp17_;
	glong _tmp18_;
	glong _tmp19_;
	glong _tmp20_;
	glong _tmp21_;
	gchar* _tmp22_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = offset;
	if (_tmp1_ >= ((glong) 0)) {
		glong _tmp2_;
		_tmp2_ = len;
		_tmp0_ = _tmp2_ >= ((glong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		glong _tmp3_;
		glong _tmp4_;
		glong _tmp5_;
		_tmp3_ = offset;
		_tmp4_ = len;
		_tmp5_ = string_strnlen ((gchar*) self, _tmp3_ + _tmp4_);
		string_length = _tmp5_;
	} else {
		gint _tmp6_;
		gint _tmp7_;
		_tmp6_ = strlen (self);
		_tmp7_ = _tmp6_;
		string_length = (glong) _tmp7_;
	}
	_tmp8_ = offset;
	if (_tmp8_ < ((glong) 0)) {
		glong _tmp9_;
		glong _tmp10_;
		glong _tmp11_;
		_tmp9_ = string_length;
		_tmp10_ = offset;
		offset = _tmp9_ + _tmp10_;
		_tmp11_ = offset;
		g_return_val_if_fail (_tmp11_ >= ((glong) 0), NULL);
	} else {
		glong _tmp12_;
		glong _tmp13_;
		_tmp12_ = offset;
		_tmp13_ = string_length;
		g_return_val_if_fail (_tmp12_ <= _tmp13_, NULL);
	}
	_tmp14_ = len;
	if (_tmp14_ < ((glong) 0)) {
		glong _tmp15_;
		glong _tmp16_;
		_tmp15_ = string_length;
		_tmp16_ = offset;
		len = _tmp15_ - _tmp16_;
	}
	_tmp17_ = offset;
	_tmp18_ = len;
	_tmp19_ = string_length;
	g_return_val_if_fail ((_tmp17_ + _tmp18_) <= _tmp19_, NULL);
	_tmp20_ = offset;
	_tmp21_ = len;
	_tmp22_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) _tmp21_);
	result = _tmp22_;
	return result;
}


static void valadoc_importer_valadoc_documentation_importer_add_documentation (ValadocImporterValadocDocumentationImporter* self, const gchar* _symbol_name, GString* comment, const gchar* filename, ValadocSourceLocation* src_ref) {
	ValadocApiNode* symbol = NULL;
	ValadocImporterValadocDocumentationImporterInsertionMode insertion_mode = 0;
	gchar* symbol_name = NULL;
	const gchar* _tmp0_;
	gboolean _tmp1_;
	const gchar* _tmp16_;
	gboolean _tmp17_;
	ValadocApiNode* _tmp26_;
	GString* _tmp32_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (_symbol_name != NULL);
	g_return_if_fail (filename != NULL);
	g_return_if_fail (src_ref != NULL);
	symbol = NULL;
	_tmp0_ = _symbol_name;
	_tmp1_ = g_str_has_suffix (_tmp0_, "::append");
	if (_tmp1_) {
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
		gchar* _tmp6_;
		_tmp2_ = _symbol_name;
		_tmp3_ = _symbol_name;
		_tmp4_ = strlen (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = string_substring (_tmp2_, (glong) 0, (glong) (_tmp5_ - 8));
		_g_free0 (symbol_name);
		symbol_name = _tmp6_;
		insertion_mode = VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_INSERTION_MODE_APPEND;
	} else {
		const gchar* _tmp7_;
		gboolean _tmp8_;
		_tmp7_ = _symbol_name;
		_tmp8_ = g_str_has_suffix (_tmp7_, "::prepend");
		if (_tmp8_) {
			const gchar* _tmp9_;
			const gchar* _tmp10_;
			gint _tmp11_;
			gint _tmp12_;
			gchar* _tmp13_;
			_tmp9_ = _symbol_name;
			_tmp10_ = _symbol_name;
			_tmp11_ = strlen (_tmp10_);
			_tmp12_ = _tmp11_;
			_tmp13_ = string_substring (_tmp9_, (glong) 0, (glong) (_tmp12_ - 9));
			_g_free0 (symbol_name);
			symbol_name = _tmp13_;
			insertion_mode = VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_INSERTION_MODE_PREPEND;
		} else {
			const gchar* _tmp14_;
			gchar* _tmp15_;
			_tmp14_ = _symbol_name;
			_tmp15_ = g_strdup (_tmp14_);
			_g_free0 (symbol_name);
			symbol_name = _tmp15_;
			insertion_mode = VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_INSERTION_MODE_REPLACE;
		}
	}
	_tmp16_ = symbol_name;
	_tmp17_ = g_str_has_prefix (_tmp16_, "c::");
	if (_tmp17_) {
		ValadocApiTree* _tmp18_;
		const gchar* _tmp19_;
		gchar* _tmp20_;
		gchar* _tmp21_;
		ValadocApiNode* _tmp22_;
		_tmp18_ = ((ValadocImporterDocumentationImporter*) self)->tree;
		_tmp19_ = symbol_name;
		_tmp20_ = string_substring (_tmp19_, (glong) 3, (glong) -1);
		_tmp21_ = _tmp20_;
		_tmp22_ = valadoc_api_tree_search_symbol_cstr (_tmp18_, NULL, _tmp21_);
		_g_object_unref0 (symbol);
		symbol = _tmp22_;
		_g_free0 (_tmp21_);
	} else {
		ValadocApiTree* _tmp23_;
		const gchar* _tmp24_;
		ValadocApiNode* _tmp25_;
		_tmp23_ = ((ValadocImporterDocumentationImporter*) self)->tree;
		_tmp24_ = symbol_name;
		_tmp25_ = valadoc_api_tree_search_symbol_str (_tmp23_, NULL, _tmp24_);
		_g_object_unref0 (symbol);
		symbol = _tmp25_;
	}
	_tmp26_ = symbol;
	if (_tmp26_ == NULL) {
		ValadocSettings* _tmp27_;
		gboolean _tmp28_;
		_tmp27_ = ((ValadocImporterDocumentationImporter*) self)->settings;
		_tmp28_ = _tmp27_->verbose;
		if (_tmp28_) {
			ValadocErrorReporter* _tmp29_;
			const gchar* _tmp30_;
			const gchar* _tmp31_;
			_tmp29_ = self->priv->reporter;
			_tmp30_ = filename;
			_tmp31_ = symbol_name;
			valadoc_error_reporter_simple_warning (_tmp29_, _tmp30_, "Node `%s' does not exist", _tmp31_);
		}
		_g_free0 (symbol_name);
		_g_object_unref0 (symbol);
		return;
	}
	_tmp32_ = comment;
	if (_tmp32_ != NULL) {
		ValadocContentComment* docu = NULL;
		ValadocDocumentationParser* _tmp33_;
		ValadocApiNode* _tmp34_;
		GString* _tmp35_;
		const gchar* _tmp36_;
		const gchar* _tmp37_;
		ValadocSourceLocation _tmp38_;
		gint _tmp39_;
		ValadocSourceLocation _tmp40_;
		gint _tmp41_;
		ValadocContentComment* _tmp42_;
		ValadocContentComment* _tmp43_;
		_tmp33_ = self->priv->_doc_parser;
		_tmp34_ = symbol;
		_tmp35_ = comment;
		_tmp36_ = _tmp35_->str;
		_tmp37_ = filename;
		_tmp38_ = *src_ref;
		_tmp39_ = _tmp38_.line;
		_tmp40_ = *src_ref;
		_tmp41_ = _tmp40_.column;
		_tmp42_ = valadoc_documentation_parser_parse_comment_str (_tmp33_, _tmp34_, _tmp36_, _tmp37_, _tmp39_, _tmp41_);
		docu = _tmp42_;
		_tmp43_ = docu;
		if (_tmp43_ != NULL) {
			ValadocContentComment* _tmp44_;
			ValadocApiTree* _tmp45_;
			ValadocApiNode* _tmp46_;
			const gchar* _tmp47_;
			ValadocErrorReporter* _tmp48_;
			ValadocSettings* _tmp49_;
			gboolean _tmp50_ = FALSE;
			ValadocApiNode* _tmp51_;
			ValadocContentComment* _tmp52_;
			ValadocContentComment* _tmp53_;
			_tmp44_ = docu;
			_tmp45_ = ((ValadocImporterDocumentationImporter*) self)->tree;
			_tmp46_ = symbol;
			_tmp47_ = filename;
			_tmp48_ = self->priv->reporter;
			_tmp49_ = ((ValadocImporterDocumentationImporter*) self)->settings;
			valadoc_content_content_element_check ((ValadocContentContentElement*) _tmp44_, _tmp45_, _tmp46_, _tmp47_, _tmp48_, _tmp49_);
			_tmp51_ = symbol;
			_tmp52_ = valadoc_api_node_get_documentation (_tmp51_);
			_tmp53_ = _tmp52_;
			if (_tmp53_ == NULL) {
				_tmp50_ = TRUE;
			} else {
				ValadocImporterValadocDocumentationImporterInsertionMode _tmp54_;
				_tmp54_ = insertion_mode;
				_tmp50_ = _tmp54_ == VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_INSERTION_MODE_REPLACE;
			}
			if (_tmp50_) {
				ValadocImporterValadocDocumentationImporterInsertionMode _tmp55_;
				ValadocApiNode* _tmp62_;
				ValadocContentComment* _tmp63_;
				_tmp55_ = insertion_mode;
				if (_tmp55_ == VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_INSERTION_MODE_APPEND) {
					ValadocContentComment* _tmp56_;
					ValaList* _tmp57_;
					ValaList* _tmp58_;
					ValadocContentContentFactory* _tmp59_;
					ValadocContentParagraph* _tmp60_;
					ValadocContentParagraph* _tmp61_;
					_tmp56_ = docu;
					_tmp57_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp56_);
					_tmp58_ = _tmp57_;
					_tmp59_ = self->factory;
					_tmp60_ = valadoc_content_content_factory_create_paragraph (_tmp59_);
					_tmp61_ = _tmp60_;
					vala_list_insert (_tmp58_, 0, (ValadocContentBlock*) _tmp61_);
					_g_object_unref0 (_tmp61_);
				}
				_tmp62_ = symbol;
				_tmp63_ = docu;
				valadoc_api_node_set_documentation (_tmp62_, _tmp63_);
			} else {
				ValadocImporterValadocDocumentationImporterInsertionMode _tmp64_;
				_tmp64_ = insertion_mode;
				if (_tmp64_ == VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_INSERTION_MODE_APPEND) {
					ValadocApiNode* _tmp65_;
					ValadocContentComment* _tmp66_;
					ValadocContentComment* _tmp67_;
					ValaList* _tmp68_;
					ValaList* _tmp69_;
					ValadocContentComment* _tmp70_;
					ValaList* _tmp71_;
					ValaList* _tmp72_;
					ValadocApiNode* _tmp73_;
					ValadocContentComment* _tmp74_;
					ValadocContentComment* _tmp75_;
					ValadocContentComment* _tmp76_;
					_tmp65_ = symbol;
					_tmp66_ = valadoc_api_node_get_documentation (_tmp65_);
					_tmp67_ = _tmp66_;
					_tmp68_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp67_);
					_tmp69_ = _tmp68_;
					_tmp70_ = docu;
					_tmp71_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp70_);
					_tmp72_ = _tmp71_;
					vala_collection_add_all ((ValaCollection*) _tmp69_, (ValaCollection*) _tmp72_);
					_tmp73_ = symbol;
					_tmp74_ = valadoc_api_node_get_documentation (_tmp73_);
					_tmp75_ = _tmp74_;
					_tmp76_ = docu;
					valadoc_importer_valadoc_documentation_importer_merge_taglets (self, _tmp75_, _tmp76_);
				} else {
					ValadocImporterValadocDocumentationImporterInsertionMode _tmp77_;
					_tmp77_ = insertion_mode;
					if (_tmp77_ == VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_INSERTION_MODE_PREPEND) {
						ValadocApiNode* _tmp78_;
						ValadocContentComment* _tmp79_;
						ValadocContentComment* _tmp80_;
						ValaList* _tmp81_;
						ValaList* _tmp82_;
						ValadocContentComment* _tmp83_;
						ValaList* _tmp84_;
						ValaList* _tmp85_;
						ValadocApiNode* _tmp86_;
						ValadocContentComment* _tmp87_;
						ValadocContentComment* _tmp88_;
						ValadocContentComment* _tmp89_;
						_tmp78_ = symbol;
						_tmp79_ = valadoc_api_node_get_documentation (_tmp78_);
						_tmp80_ = _tmp79_;
						_tmp81_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp80_);
						_tmp82_ = _tmp81_;
						_tmp83_ = docu;
						_tmp84_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp83_);
						_tmp85_ = _tmp84_;
						vala_list_insert_all (_tmp82_, 0, (ValaCollection*) _tmp85_);
						_tmp86_ = symbol;
						_tmp87_ = valadoc_api_node_get_documentation (_tmp86_);
						_tmp88_ = _tmp87_;
						_tmp89_ = docu;
						valadoc_importer_valadoc_documentation_importer_merge_taglets (self, _tmp88_, _tmp89_);
					}
				}
			}
		}
		_g_object_unref0 (docu);
	}
	_g_free0 (symbol_name);
	_g_object_unref0 (symbol);
}


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


static void valadoc_importer_valadoc_documentation_importer_merge_taglets (ValadocImporterValadocDocumentationImporter* self, ValadocContentComment* comment, ValadocContentComment* imported) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (comment != NULL);
	g_return_if_fail (imported != NULL);
	{
		ValaList* _taglet_list = NULL;
		ValadocContentComment* _tmp0_;
		ValaList* _tmp1_;
		ValaList* _tmp2_;
		ValaList* _tmp3_;
		gint _taglet_size = 0;
		ValaList* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		gint _taglet_index = 0;
		_tmp0_ = imported;
		_tmp1_ = valadoc_content_comment_get_taglets (_tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _vala_iterable_ref0 (_tmp2_);
		_taglet_list = _tmp3_;
		_tmp4_ = _taglet_list;
		_tmp5_ = vala_collection_get_size ((ValaCollection*) _tmp4_);
		_tmp6_ = _tmp5_;
		_taglet_size = _tmp6_;
		_taglet_index = -1;
		while (TRUE) {
			gint _tmp7_;
			gint _tmp8_;
			gint _tmp9_;
			ValadocContentTaglet* taglet = NULL;
			ValaList* _tmp10_;
			gint _tmp11_;
			gpointer _tmp12_;
			ValadocContentComment* _tmp13_;
			ValaList* _tmp14_;
			ValaList* _tmp15_;
			ValadocContentTaglet* _tmp16_;
			_tmp7_ = _taglet_index;
			_taglet_index = _tmp7_ + 1;
			_tmp8_ = _taglet_index;
			_tmp9_ = _taglet_size;
			if (!(_tmp8_ < _tmp9_)) {
				break;
			}
			_tmp10_ = _taglet_list;
			_tmp11_ = _taglet_index;
			_tmp12_ = vala_list_get (_tmp10_, _tmp11_);
			taglet = (ValadocContentTaglet*) _tmp12_;
			_tmp13_ = imported;
			_tmp14_ = valadoc_content_comment_get_taglets (_tmp13_);
			_tmp15_ = _tmp14_;
			_tmp16_ = taglet;
			vala_collection_add ((ValaCollection*) _tmp15_, _tmp16_);
			_g_object_unref0 (taglet);
		}
		_vala_iterable_unref0 (_taglet_list);
	}
}


static void valadoc_importer_valadoc_documentation_importer_real_process (ValadocImporterDocumentationImporter* base, const gchar* filename) {
	ValadocImporterValadocDocumentationImporter * self;
	GError * _inner_error_ = NULL;
	self = (ValadocImporterValadocDocumentationImporter*) base;
	g_return_if_fail (filename != NULL);
	{
		const gchar* _tmp0_;
		gchar* _tmp1_;
		GMappedFile* _tmp2_ = NULL;
		const gchar* _tmp3_;
		GMappedFile* _tmp4_;
		GMappedFile* _tmp5_;
		gchar* content = NULL;
		GMappedFile* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		_tmp0_ = filename;
		_tmp1_ = g_strdup (_tmp0_);
		_g_free0 (self->priv->_filename);
		self->priv->_filename = _tmp1_;
		_tmp3_ = filename;
		_tmp4_ = g_mapped_file_new (_tmp3_, FALSE, &_inner_error_);
		_tmp2_ = _tmp4_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			if (_inner_error_->domain == G_FILE_ERROR) {
				goto __catch18_g_file_error;
			}
			if (_inner_error_->domain == VALADOC_PARSER_ERROR) {
				goto __catch18_valadoc_parser_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return;
		}
		_tmp5_ = _tmp2_;
		_tmp2_ = NULL;
		_g_mapped_file_unref0 (self->priv->_mapped_file);
		self->priv->_mapped_file = _tmp5_;
		_tmp6_ = self->priv->_mapped_file;
		_tmp7_ = g_mapped_file_get_contents (_tmp6_);
		content = _tmp7_;
		_tmp8_ = content;
		if (_tmp8_ != NULL) {
			ValadocParser* _tmp9_;
			gchar* _tmp10_;
			const gchar* _tmp11_;
			_tmp9_ = self->priv->_parser;
			_tmp10_ = content;
			_tmp11_ = filename;
			valadoc_parser_parse (_tmp9_, (const gchar*) _tmp10_, _tmp11_, 0, 0, &_inner_error_);
			if (G_UNLIKELY (_inner_error_ != NULL)) {
				_g_mapped_file_unref0 (_tmp2_);
				if (_inner_error_->domain == G_FILE_ERROR) {
					goto __catch18_g_file_error;
				}
				if (_inner_error_->domain == VALADOC_PARSER_ERROR) {
					goto __catch18_valadoc_parser_error;
				}
				_g_mapped_file_unref0 (_tmp2_);
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
				g_clear_error (&_inner_error_);
				return;
			}
		}
		_g_mapped_file_unref0 (_tmp2_);
	}
	goto __finally18;
	__catch18_g_file_error:
	{
		GError* err = NULL;
		ValadocErrorReporter* _tmp12_;
		const gchar* _tmp13_;
		GError* _tmp14_;
		const gchar* _tmp15_;
		err = _inner_error_;
		_inner_error_ = NULL;
		_tmp12_ = self->priv->reporter;
		_tmp13_ = filename;
		_tmp14_ = err;
		_tmp15_ = _tmp14_->message;
		valadoc_error_reporter_simple_error (_tmp12_, NULL, "Unable to map file `%s': %s", _tmp13_, _tmp15_);
		_g_error_free0 (err);
	}
	goto __finally18;
	__catch18_valadoc_parser_error:
	{
		GError* err = NULL;
		err = _inner_error_;
		_inner_error_ = NULL;
		_g_error_free0 (err);
	}
	__finally18:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


static const gchar* valadoc_importer_valadoc_documentation_importer_real_get_file_extension (ValadocImporterDocumentationImporter* base) {
	const gchar* result;
	ValadocImporterValadocDocumentationImporter* self;
	self = (ValadocImporterValadocDocumentationImporter*) base;
	result = "valadoc";
	return result;
}


static void valadoc_importer_valadoc_documentation_importer_class_init (ValadocImporterValadocDocumentationImporterClass * klass) {
	valadoc_importer_valadoc_documentation_importer_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ValadocImporterValadocDocumentationImporterPrivate));
	((ValadocImporterDocumentationImporterClass *) klass)->process = (void (*) (ValadocImporterDocumentationImporter *, const gchar*)) valadoc_importer_valadoc_documentation_importer_real_process;
	VALADOC_IMPORTER_DOCUMENTATION_IMPORTER_CLASS (klass)->get_file_extension = valadoc_importer_valadoc_documentation_importer_real_get_file_extension;
	G_OBJECT_CLASS (klass)->get_property = _vala_valadoc_importer_valadoc_documentation_importer_get_property;
	G_OBJECT_CLASS (klass)->finalize = valadoc_importer_valadoc_documentation_importer_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_FILE_EXTENSION_PROPERTY, valadoc_importer_valadoc_documentation_importer_properties[VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_FILE_EXTENSION_PROPERTY] = g_param_spec_string ("file-extension", "file-extension", "file-extension", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void valadoc_importer_valadoc_documentation_importer_valadoc_resource_locator_interface_init (ValadocResourceLocatorIface * iface) {
	valadoc_importer_valadoc_documentation_importer_valadoc_resource_locator_parent_iface = g_type_interface_peek_parent (iface);
	iface->resolve = (gchar* (*) (ValadocResourceLocator *, const gchar*)) valadoc_importer_documentation_importer_resolve;
}


static void valadoc_importer_valadoc_documentation_importer_instance_init (ValadocImporterValadocDocumentationImporter * self) {
	self->priv = VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_GET_PRIVATE (self);
}


static void valadoc_importer_valadoc_documentation_importer_finalize (GObject * obj) {
	ValadocImporterValadocDocumentationImporter * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_IMPORTER_TYPE_VALADOC_DOCUMENTATION_IMPORTER, ValadocImporterValadocDocumentationImporter);
	_g_object_unref0 (self->priv->_scanner);
	_g_object_unref0 (self->priv->_doc_parser);
	_valadoc_parser_unref0 (self->priv->_parser);
	_g_mapped_file_unref0 (self->priv->_mapped_file);
	_g_free0 (self->priv->_filename);
	_g_free0 (self->priv->_cname);
	_g_string_free0 (self->priv->_comment);
	_g_object_unref0 (self->factory);
	_g_object_unref0 (self->priv->reporter);
	G_OBJECT_CLASS (valadoc_importer_valadoc_documentation_importer_parent_class)->finalize (obj);
}


GType valadoc_importer_valadoc_documentation_importer_get_type (void) {
	static volatile gsize valadoc_importer_valadoc_documentation_importer_type_id__volatile = 0;
	if (g_once_init_enter (&valadoc_importer_valadoc_documentation_importer_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ValadocImporterValadocDocumentationImporterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_importer_valadoc_documentation_importer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocImporterValadocDocumentationImporter), 0, (GInstanceInitFunc) valadoc_importer_valadoc_documentation_importer_instance_init, NULL };
		static const GInterfaceInfo valadoc_resource_locator_info = { (GInterfaceInitFunc) valadoc_importer_valadoc_documentation_importer_valadoc_resource_locator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType valadoc_importer_valadoc_documentation_importer_type_id;
		valadoc_importer_valadoc_documentation_importer_type_id = g_type_register_static (VALADOC_IMPORTER_TYPE_DOCUMENTATION_IMPORTER, "ValadocImporterValadocDocumentationImporter", &g_define_type_info, 0);
		g_type_add_interface_static (valadoc_importer_valadoc_documentation_importer_type_id, VALADOC_TYPE_RESOURCE_LOCATOR, &valadoc_resource_locator_info);
		g_once_init_leave (&valadoc_importer_valadoc_documentation_importer_type_id__volatile, valadoc_importer_valadoc_documentation_importer_type_id);
	}
	return valadoc_importer_valadoc_documentation_importer_type_id__volatile;
}


static void _vala_valadoc_importer_valadoc_documentation_importer_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ValadocImporterValadocDocumentationImporter * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_IMPORTER_TYPE_VALADOC_DOCUMENTATION_IMPORTER, ValadocImporterValadocDocumentationImporter);
	switch (property_id) {
		case VALADOC_IMPORTER_VALADOC_DOCUMENTATION_IMPORTER_FILE_EXTENSION_PROPERTY:
		g_value_set_string (value, valadoc_importer_documentation_importer_get_file_extension ((ValadocImporterDocumentationImporter*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


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);
}



