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

/* valadodocumentationscanner.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>

enum  {
	VALADOC_IMPORTER_VALADOC_DOCUMENTATION_SCANNER_0_PROPERTY,
	VALADOC_IMPORTER_VALADOC_DOCUMENTATION_SCANNER_NUM_PROPERTIES
};
static GParamSpec* valadoc_importer_valadoc_documentation_scanner_properties[VALADOC_IMPORTER_VALADOC_DOCUMENTATION_SCANNER_NUM_PROPERTIES];
#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_free0(var) (var = (g_free (var), NULL))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))

struct _ValadocImporterValadocDocumentationScannerPrivate {
	ValadocSettings* _settings;
	ValadocParser* _parser;
	gchar* _content;
	const gchar* _index;
	gboolean _stop;
	gint _last_line;
	gint _last_column;
	gint _line;
	gint _column;
	gunichar _last_char;
	gint _skip;
	GString* _current_string;
};


static gpointer valadoc_importer_valadoc_documentation_scanner_parent_class = NULL;
static ValadocScannerIface * valadoc_importer_valadoc_documentation_scanner_valadoc_scanner_parent_iface = NULL;

#define VALADOC_IMPORTER_VALADOC_DOCUMENTATION_SCANNER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VALADOC_IMPORTER_TYPE_VALADOC_DOCUMENTATION_SCANNER, ValadocImporterValadocDocumentationScannerPrivate))
static void valadoc_importer_valadoc_documentation_scanner_real_set_parser (ValadocScanner* base, ValadocParser* parser);
static void valadoc_importer_valadoc_documentation_scanner_real_reset (ValadocImporterValadocDocumentationScanner* self);
static void valadoc_importer_valadoc_documentation_scanner_real_scan (ValadocScanner* base, const gchar* content, GError** error);
static void valadoc_importer_valadoc_documentation_scanner_real_end (ValadocScanner* base, GError** error);
static void valadoc_importer_valadoc_documentation_scanner_emit_token (ValadocImporterValadocDocumentationScanner* self, ValadocTokenType* type, GError** error);
static void valadoc_importer_valadoc_documentation_scanner_real_stop (ValadocImporterValadocDocumentationScanner* self);
static gchar* valadoc_importer_valadoc_documentation_scanner_real_get_line_content (ValadocImporterValadocDocumentationScanner* self);
static void valadoc_importer_valadoc_documentation_scanner_append_char (ValadocImporterValadocDocumentationScanner* self, gunichar c);
static gint valadoc_importer_valadoc_documentation_scanner_real_get_line_start_column (ValadocImporterValadocDocumentationScanner* self);
static void valadoc_importer_valadoc_documentation_scanner_get_begin (ValadocImporterValadocDocumentationScanner* self, ValadocSourceLocation* result);
static void valadoc_importer_valadoc_documentation_scanner_get_end (ValadocImporterValadocDocumentationScanner* self, gint offset, ValadocSourceLocation* result);
static void valadoc_importer_valadoc_documentation_scanner_emit_current_word (ValadocImporterValadocDocumentationScanner* self, GError** error);
static void valadoc_importer_valadoc_documentation_scanner_finalize (GObject * obj);


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


ValadocImporterValadocDocumentationScanner* valadoc_importer_valadoc_documentation_scanner_construct (GType object_type, ValadocSettings* settings) {
	ValadocImporterValadocDocumentationScanner * self = NULL;
	ValadocSettings* _tmp0_;
	ValadocSettings* _tmp1_;
	g_return_val_if_fail (settings != NULL, NULL);
	self = (ValadocImporterValadocDocumentationScanner*) g_object_new (object_type, NULL);
	_tmp0_ = settings;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_settings);
	self->priv->_settings = _tmp1_;
	return self;
}


ValadocImporterValadocDocumentationScanner* valadoc_importer_valadoc_documentation_scanner_new (ValadocSettings* settings) {
	return valadoc_importer_valadoc_documentation_scanner_construct (VALADOC_IMPORTER_TYPE_VALADOC_DOCUMENTATION_SCANNER, settings);
}


static gpointer _valadoc_parser_ref0 (gpointer self) {
	return self ? valadoc_parser_ref (self) : NULL;
}


static void valadoc_importer_valadoc_documentation_scanner_real_set_parser (ValadocScanner* base, ValadocParser* parser) {
	ValadocImporterValadocDocumentationScanner * self;
	ValadocParser* _tmp0_;
	ValadocParser* _tmp1_;
	self = (ValadocImporterValadocDocumentationScanner*) base;
	g_return_if_fail (parser != NULL);
	_tmp0_ = parser;
	_tmp1_ = _valadoc_parser_ref0 (_tmp0_);
	_valadoc_parser_unref0 (self->priv->_parser);
	self->priv->_parser = _tmp1_;
}


static void valadoc_importer_valadoc_documentation_scanner_real_reset (ValadocImporterValadocDocumentationScanner* self) {
	GString* _tmp0_;
	self->priv->_stop = FALSE;
	self->priv->_last_line = 0;
	self->priv->_last_column = 0;
	self->priv->_line = 0;
	self->priv->_column = 0;
	self->priv->_last_char = (gunichar) 0;
	self->priv->_skip = 0;
	_tmp0_ = self->priv->_current_string;
	g_string_erase (_tmp0_, (gssize) 0, (gssize) -1);
}


void valadoc_importer_valadoc_documentation_scanner_reset (ValadocImporterValadocDocumentationScanner* self) {
	g_return_if_fail (self != NULL);
	VALADOC_IMPORTER_VALADOC_DOCUMENTATION_SCANNER_GET_CLASS (self)->reset (self);
}


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


static void valadoc_importer_valadoc_documentation_scanner_real_scan (ValadocScanner* base, const gchar* content, GError** error) {
	ValadocImporterValadocDocumentationScanner * self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	GError * _inner_error_ = NULL;
	self = (ValadocImporterValadocDocumentationScanner*) base;
	g_return_if_fail (content != NULL);
	_tmp0_ = content;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_content);
	self->priv->_content = _tmp1_;
	{
		const gchar* _tmp2_;
		gboolean _tmp3_ = FALSE;
		_tmp2_ = self->priv->_content;
		self->priv->_index = _tmp2_;
		_tmp3_ = TRUE;
		while (TRUE) {
			gboolean _tmp6_ = FALSE;
			gboolean _tmp7_;
			gunichar c = 0U;
			const gchar* _tmp10_;
			gunichar _tmp11_;
			gunichar _tmp12_;
			if (!_tmp3_) {
				const gchar* _tmp4_;
				const gchar* _tmp5_;
				_tmp4_ = self->priv->_index;
				_tmp5_ = g_utf8_next_char (_tmp4_);
				self->priv->_index = _tmp5_;
			}
			_tmp3_ = FALSE;
			_tmp7_ = self->priv->_stop;
			if (!_tmp7_) {
				const gchar* _tmp8_;
				gunichar _tmp9_;
				_tmp8_ = self->priv->_index;
				_tmp9_ = string_get_char (_tmp8_, (glong) 0);
				_tmp6_ = _tmp9_ != ((gunichar) 0);
			} else {
				_tmp6_ = FALSE;
			}
			if (!_tmp6_) {
				break;
			}
			_tmp10_ = self->priv->_index;
			_tmp11_ = string_get_char (_tmp10_, (glong) 0);
			c = _tmp11_;
			_tmp12_ = c;
			valadoc_importer_valadoc_documentation_scanner_accept (self, _tmp12_, &_inner_error_);
			if (G_UNLIKELY (_inner_error_ != NULL)) {
				if (_inner_error_->domain == VALADOC_PARSER_ERROR) {
					g_propagate_error (error, _inner_error_);
					return;
				} else {
					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 void valadoc_importer_valadoc_documentation_scanner_real_end (ValadocScanner* base, GError** error) {
	ValadocImporterValadocDocumentationScanner * self;
	ValadocTokenType* _tmp0_;
	GError * _inner_error_ = NULL;
	self = (ValadocImporterValadocDocumentationScanner*) base;
	_tmp0_ = valadoc_token_type_EOF;
	valadoc_importer_valadoc_documentation_scanner_emit_token (self, _tmp0_, &_inner_error_);
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		if (_inner_error_->domain == VALADOC_PARSER_ERROR) {
			g_propagate_error (error, _inner_error_);
			return;
		} else {
			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 void valadoc_importer_valadoc_documentation_scanner_real_stop (ValadocImporterValadocDocumentationScanner* self) {
	self->priv->_stop = TRUE;
}


void valadoc_importer_valadoc_documentation_scanner_stop (ValadocImporterValadocDocumentationScanner* self) {
	g_return_if_fail (self != NULL);
	VALADOC_IMPORTER_VALADOC_DOCUMENTATION_SCANNER_GET_CLASS (self)->stop (self);
}


gint valadoc_importer_valadoc_documentation_scanner_get_line (ValadocImporterValadocDocumentationScanner* self) {
	gint result = 0;
	gint _tmp0_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->_line;
	result = _tmp0_;
	return result;
}


static gchar* valadoc_importer_valadoc_documentation_scanner_real_get_line_content (ValadocImporterValadocDocumentationScanner* self) {
	gchar* result = NULL;
	GString* builder = NULL;
	GString* _tmp0_;
	const gchar* line_start = NULL;
	const gchar* _tmp1_;
	gunichar c = 0U;
	GString* _tmp21_;
	const gchar* _tmp22_;
	gchar* _tmp23_;
	_tmp0_ = g_string_new ("");
	builder = _tmp0_;
	_tmp1_ = self->priv->_index;
	line_start = _tmp1_;
	while (TRUE) {
		gboolean _tmp2_ = FALSE;
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		_tmp3_ = line_start;
		_tmp4_ = self->priv->_content;
		if (((gchar*) _tmp3_) > ((gchar*) _tmp4_)) {
			const gchar* _tmp5_;
			const gchar* _tmp6_;
			gunichar _tmp7_;
			_tmp5_ = line_start;
			_tmp6_ = g_utf8_prev_char (_tmp5_);
			_tmp7_ = string_get_char (_tmp6_, (glong) 0);
			_tmp2_ = _tmp7_ != ((gunichar) '\n');
		} else {
			_tmp2_ = FALSE;
		}
		if (!_tmp2_) {
			break;
		}
		_tmp8_ = line_start;
		_tmp9_ = g_utf8_prev_char (_tmp8_);
		line_start = _tmp9_;
	}
	while (TRUE) {
		gboolean _tmp10_ = FALSE;
		const gchar* _tmp11_;
		gunichar _tmp12_;
		gunichar _tmp13_;
		gunichar _tmp15_;
		const gchar* _tmp19_;
		const gchar* _tmp20_;
		_tmp11_ = line_start;
		_tmp12_ = string_get_char (_tmp11_, (glong) 0);
		c = _tmp12_;
		_tmp13_ = c;
		if (_tmp13_ != ((gunichar) '\n')) {
			gunichar _tmp14_;
			_tmp14_ = c;
			_tmp10_ = _tmp14_ != ((gunichar) '\0');
		} else {
			_tmp10_ = FALSE;
		}
		if (!_tmp10_) {
			break;
		}
		_tmp15_ = c;
		if (_tmp15_ == ((gunichar) '\t')) {
			GString* _tmp16_;
			_tmp16_ = builder;
			g_string_append_c (_tmp16_, ' ');
		} else {
			GString* _tmp17_;
			gunichar _tmp18_;
			_tmp17_ = builder;
			_tmp18_ = c;
			g_string_append_unichar (_tmp17_, _tmp18_);
		}
		_tmp19_ = line_start;
		_tmp20_ = g_utf8_next_char (_tmp19_);
		line_start = _tmp20_;
	}
	_tmp21_ = builder;
	_tmp22_ = _tmp21_->str;
	_tmp23_ = g_strdup (_tmp22_);
	result = _tmp23_;
	_g_string_free0 (builder);
	return result;
}


gchar* valadoc_importer_valadoc_documentation_scanner_get_line_content (ValadocImporterValadocDocumentationScanner* self) {
	g_return_val_if_fail (self != NULL, NULL);
	return VALADOC_IMPORTER_VALADOC_DOCUMENTATION_SCANNER_GET_CLASS (self)->get_line_content (self);
}


static gint string_index_of_nth_char (const gchar* self, glong c) {
	gint result = 0;
	glong _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = c;
	_tmp1_ = g_utf8_offset_to_pointer (self, _tmp0_);
	result = (gint) (_tmp1_ - ((gchar*) self));
	return result;
}


gunichar valadoc_importer_valadoc_documentation_scanner_get_next_char (ValadocImporterValadocDocumentationScanner* self, gint offset) {
	gunichar result = 0U;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gunichar _tmp4_;
	g_return_val_if_fail (self != NULL, 0U);
	_tmp0_ = self->priv->_index;
	_tmp1_ = self->priv->_index;
	_tmp2_ = offset;
	_tmp3_ = string_index_of_nth_char (_tmp1_, (glong) _tmp2_);
	_tmp4_ = string_get_char (_tmp0_, (glong) _tmp3_);
	result = _tmp4_;
	return result;
}


void valadoc_importer_valadoc_documentation_scanner_accept (ValadocImporterValadocDocumentationScanner* self, gunichar c, GError** error) {
	gint _tmp0_;
	gint _tmp1_;
	gunichar _tmp15_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_column;
	self->priv->_column = _tmp0_ + 1;
	_tmp1_ = self->priv->_skip;
	if (_tmp1_ == 0) {
		gunichar _tmp2_;
		_tmp2_ = c;
		switch (_tmp2_) {
			case '/':
			{
				gunichar _tmp3_;
				_tmp3_ = valadoc_importer_valadoc_documentation_scanner_get_next_char (self, 1);
				if (_tmp3_ == ((gunichar) '*')) {
					ValadocTokenType* _tmp4_;
					_tmp4_ = valadoc_token_type_VALADOC_COMMENT_START;
					valadoc_importer_valadoc_documentation_scanner_emit_token (self, _tmp4_, &_inner_error_);
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						if (_inner_error_->domain == VALADOC_PARSER_ERROR) {
							g_propagate_error (error, _inner_error_);
							return;
						} else {
							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;
						}
					}
					self->priv->_skip = 1;
				} else {
					gunichar _tmp5_;
					_tmp5_ = c;
					valadoc_importer_valadoc_documentation_scanner_append_char (self, _tmp5_);
				}
				break;
			}
			case '*':
			{
				gunichar _tmp6_;
				_tmp6_ = valadoc_importer_valadoc_documentation_scanner_get_next_char (self, 1);
				if (_tmp6_ == ((gunichar) '/')) {
					ValadocTokenType* _tmp7_;
					_tmp7_ = valadoc_token_type_VALADOC_COMMENT_END;
					valadoc_importer_valadoc_documentation_scanner_emit_token (self, _tmp7_, &_inner_error_);
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						if (_inner_error_->domain == VALADOC_PARSER_ERROR) {
							g_propagate_error (error, _inner_error_);
							return;
						} else {
							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;
						}
					}
					self->priv->_skip = 1;
				} else {
					gunichar _tmp8_;
					_tmp8_ = c;
					valadoc_importer_valadoc_documentation_scanner_append_char (self, _tmp8_);
				}
				break;
			}
			case '\t':
			{
				ValadocTokenType* _tmp9_;
				_tmp9_ = valadoc_token_type_VALADOC_TAB;
				valadoc_importer_valadoc_documentation_scanner_emit_token (self, _tmp9_, &_inner_error_);
				if (G_UNLIKELY (_inner_error_ != NULL)) {
					if (_inner_error_->domain == VALADOC_PARSER_ERROR) {
						g_propagate_error (error, _inner_error_);
						return;
					} else {
						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;
					}
				}
				break;
			}
			case ' ':
			{
				ValadocTokenType* _tmp10_;
				_tmp10_ = valadoc_token_type_VALADOC_SPACE;
				valadoc_importer_valadoc_documentation_scanner_emit_token (self, _tmp10_, &_inner_error_);
				if (G_UNLIKELY (_inner_error_ != NULL)) {
					if (_inner_error_->domain == VALADOC_PARSER_ERROR) {
						g_propagate_error (error, _inner_error_);
						return;
					} else {
						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;
					}
				}
				break;
			}
			case '\n':
			{
				ValadocTokenType* _tmp11_;
				gint _tmp12_;
				_tmp11_ = valadoc_token_type_VALADOC_EOL;
				valadoc_importer_valadoc_documentation_scanner_emit_token (self, _tmp11_, &_inner_error_);
				if (G_UNLIKELY (_inner_error_ != NULL)) {
					if (_inner_error_->domain == VALADOC_PARSER_ERROR) {
						g_propagate_error (error, _inner_error_);
						return;
					} else {
						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;
					}
				}
				_tmp12_ = self->priv->_line;
				self->priv->_line = _tmp12_ + 1;
				self->priv->_column = 0;
				self->priv->_last_column = 0;
				break;
			}
			default:
			{
				gunichar _tmp13_;
				_tmp13_ = c;
				valadoc_importer_valadoc_documentation_scanner_append_char (self, _tmp13_);
				break;
			}
		}
	} else {
		gint _tmp14_;
		_tmp14_ = self->priv->_skip;
		self->priv->_skip = _tmp14_ - 1;
	}
	_tmp15_ = c;
	self->priv->_last_char = _tmp15_;
}


static void valadoc_importer_valadoc_documentation_scanner_append_char (ValadocImporterValadocDocumentationScanner* self, gunichar c) {
	GString* _tmp0_;
	gunichar _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_current_string;
	_tmp1_ = c;
	g_string_append_unichar (_tmp0_, _tmp1_);
}


static gint valadoc_importer_valadoc_documentation_scanner_real_get_line_start_column (ValadocImporterValadocDocumentationScanner* self) {
	gint result = 0;
	result = 0;
	return result;
}


gint valadoc_importer_valadoc_documentation_scanner_get_line_start_column (ValadocImporterValadocDocumentationScanner* self) {
	g_return_val_if_fail (self != NULL, 0);
	return VALADOC_IMPORTER_VALADOC_DOCUMENTATION_SCANNER_GET_CLASS (self)->get_line_start_column (self);
}


static void valadoc_importer_valadoc_documentation_scanner_get_begin (ValadocImporterValadocDocumentationScanner* self, ValadocSourceLocation* result) {
	gint _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	ValadocSourceLocation _tmp3_ = {0};
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_last_line;
	_tmp1_ = valadoc_importer_valadoc_documentation_scanner_get_line_start_column (self);
	_tmp2_ = self->priv->_last_column;
	valadoc_source_location_init (&_tmp3_, _tmp0_, _tmp1_ + _tmp2_);
	*result = _tmp3_;
	return;
}


static void valadoc_importer_valadoc_documentation_scanner_get_end (ValadocImporterValadocDocumentationScanner* self, gint offset, ValadocSourceLocation* result) {
	gint _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	ValadocSourceLocation _tmp4_ = {0};
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_line;
	_tmp1_ = valadoc_importer_valadoc_documentation_scanner_get_line_start_column (self);
	_tmp2_ = self->priv->_column;
	_tmp3_ = offset;
	valadoc_source_location_init (&_tmp4_, _tmp0_, (_tmp1_ + _tmp2_) + _tmp3_);
	*result = _tmp4_;
	return;
}


static void valadoc_importer_valadoc_documentation_scanner_emit_current_word (ValadocImporterValadocDocumentationScanner* self, GError** error) {
	GString* _tmp0_;
	gssize _tmp1_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_current_string;
	_tmp1_ = _tmp0_->len;
	if (_tmp1_ > ((gssize) 0)) {
		ValadocParser* _tmp2_;
		GString* _tmp3_;
		const gchar* _tmp4_;
		ValadocSourceLocation _tmp5_ = {0};
		ValadocSourceLocation _tmp6_ = {0};
		ValadocToken* _tmp7_;
		ValadocToken* _tmp8_;
		GString* _tmp9_;
		gint _tmp10_;
		gint _tmp11_;
		_tmp2_ = self->priv->_parser;
		_tmp3_ = self->priv->_current_string;
		_tmp4_ = _tmp3_->str;
		valadoc_importer_valadoc_documentation_scanner_get_begin (self, &_tmp5_);
		valadoc_importer_valadoc_documentation_scanner_get_end (self, -1, &_tmp6_);
		_tmp7_ = valadoc_token_new_from_word (_tmp4_, &_tmp5_, &_tmp6_);
		_tmp8_ = _tmp7_;
		valadoc_parser_accept_token (_tmp2_, _tmp8_, &_inner_error_);
		_g_object_unref0 (_tmp8_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			if (_inner_error_->domain == VALADOC_PARSER_ERROR) {
				g_propagate_error (error, _inner_error_);
				return;
			} else {
				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;
			}
		}
		_tmp9_ = self->priv->_current_string;
		g_string_erase (_tmp9_, (gssize) 0, (gssize) -1);
		_tmp10_ = self->priv->_line;
		self->priv->_last_line = _tmp10_;
		_tmp11_ = self->priv->_column;
		self->priv->_last_column = _tmp11_ - 1;
	}
}


static void valadoc_importer_valadoc_documentation_scanner_emit_token (ValadocImporterValadocDocumentationScanner* self, ValadocTokenType* type, GError** error) {
	ValadocParser* _tmp0_;
	ValadocTokenType* _tmp1_;
	ValadocSourceLocation _tmp2_ = {0};
	gint _tmp3_;
	ValadocSourceLocation _tmp4_ = {0};
	ValadocToken* _tmp5_;
	ValadocToken* _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (type != NULL);
	valadoc_importer_valadoc_documentation_scanner_emit_current_word (self, &_inner_error_);
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		if (_inner_error_->domain == VALADOC_PARSER_ERROR) {
			g_propagate_error (error, _inner_error_);
			return;
		} else {
			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;
		}
	}
	_tmp0_ = self->priv->_parser;
	_tmp1_ = type;
	valadoc_importer_valadoc_documentation_scanner_get_begin (self, &_tmp2_);
	_tmp3_ = self->priv->_skip;
	valadoc_importer_valadoc_documentation_scanner_get_end (self, _tmp3_, &_tmp4_);
	_tmp5_ = valadoc_token_new_from_type (_tmp1_, &_tmp2_, &_tmp4_, NULL);
	_tmp6_ = _tmp5_;
	valadoc_parser_accept_token (_tmp0_, _tmp6_, &_inner_error_);
	_g_object_unref0 (_tmp6_);
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		if (_inner_error_->domain == VALADOC_PARSER_ERROR) {
			g_propagate_error (error, _inner_error_);
			return;
		} else {
			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;
		}
	}
	_tmp7_ = self->priv->_line;
	self->priv->_last_line = _tmp7_;
	_tmp8_ = self->priv->_column;
	self->priv->_last_column = _tmp8_;
}


static void valadoc_importer_valadoc_documentation_scanner_class_init (ValadocImporterValadocDocumentationScannerClass * klass) {
	valadoc_importer_valadoc_documentation_scanner_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ValadocImporterValadocDocumentationScannerPrivate));
	((ValadocImporterValadocDocumentationScannerClass *) klass)->reset = (void (*) (ValadocImporterValadocDocumentationScanner *)) valadoc_importer_valadoc_documentation_scanner_real_reset;
	((ValadocImporterValadocDocumentationScannerClass *) klass)->stop = (void (*) (ValadocImporterValadocDocumentationScanner *)) valadoc_importer_valadoc_documentation_scanner_real_stop;
	((ValadocImporterValadocDocumentationScannerClass *) klass)->get_line_content = (gchar* (*) (ValadocImporterValadocDocumentationScanner *)) valadoc_importer_valadoc_documentation_scanner_real_get_line_content;
	((ValadocImporterValadocDocumentationScannerClass *) klass)->get_line_start_column = (gint (*) (ValadocImporterValadocDocumentationScanner *)) valadoc_importer_valadoc_documentation_scanner_real_get_line_start_column;
	G_OBJECT_CLASS (klass)->finalize = valadoc_importer_valadoc_documentation_scanner_finalize;
}


static void valadoc_importer_valadoc_documentation_scanner_valadoc_scanner_interface_init (ValadocScannerIface * iface) {
	valadoc_importer_valadoc_documentation_scanner_valadoc_scanner_parent_iface = g_type_interface_peek_parent (iface);
	iface->set_parser = (void (*) (ValadocScanner *, ValadocParser*)) valadoc_importer_valadoc_documentation_scanner_real_set_parser;
	iface->reset = (void (*) (ValadocScanner *)) valadoc_importer_valadoc_documentation_scanner_reset;
	iface->scan = (void (*) (ValadocScanner *, const gchar*, GError**)) valadoc_importer_valadoc_documentation_scanner_real_scan;
	iface->end = (void (*) (ValadocScanner *, GError**)) valadoc_importer_valadoc_documentation_scanner_real_end;
	iface->stop = (void (*) (ValadocScanner *)) valadoc_importer_valadoc_documentation_scanner_stop;
	iface->get_line_content = (gchar* (*) (ValadocScanner *)) valadoc_importer_valadoc_documentation_scanner_get_line_content;
}


static void valadoc_importer_valadoc_documentation_scanner_instance_init (ValadocImporterValadocDocumentationScanner * self) {
	GString* _tmp0_;
	self->priv = VALADOC_IMPORTER_VALADOC_DOCUMENTATION_SCANNER_GET_PRIVATE (self);
	_tmp0_ = g_string_new ("");
	self->priv->_current_string = _tmp0_;
}


static void valadoc_importer_valadoc_documentation_scanner_finalize (GObject * obj) {
	ValadocImporterValadocDocumentationScanner * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_IMPORTER_TYPE_VALADOC_DOCUMENTATION_SCANNER, ValadocImporterValadocDocumentationScanner);
	_g_object_unref0 (self->priv->_settings);
	_valadoc_parser_unref0 (self->priv->_parser);
	_g_free0 (self->priv->_content);
	_g_string_free0 (self->priv->_current_string);
	G_OBJECT_CLASS (valadoc_importer_valadoc_documentation_scanner_parent_class)->finalize (obj);
}


GType valadoc_importer_valadoc_documentation_scanner_get_type (void) {
	static volatile gsize valadoc_importer_valadoc_documentation_scanner_type_id__volatile = 0;
	if (g_once_init_enter (&valadoc_importer_valadoc_documentation_scanner_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ValadocImporterValadocDocumentationScannerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_importer_valadoc_documentation_scanner_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocImporterValadocDocumentationScanner), 0, (GInstanceInitFunc) valadoc_importer_valadoc_documentation_scanner_instance_init, NULL };
		static const GInterfaceInfo valadoc_scanner_info = { (GInterfaceInitFunc) valadoc_importer_valadoc_documentation_scanner_valadoc_scanner_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType valadoc_importer_valadoc_documentation_scanner_type_id;
		valadoc_importer_valadoc_documentation_scanner_type_id = g_type_register_static (G_TYPE_OBJECT, "ValadocImporterValadocDocumentationScanner", &g_define_type_info, 0);
		g_type_add_interface_static (valadoc_importer_valadoc_documentation_scanner_type_id, VALADOC_TYPE_SCANNER, &valadoc_scanner_info);
		g_once_init_leave (&valadoc_importer_valadoc_documentation_scanner_type_id__volatile, valadoc_importer_valadoc_documentation_scanner_type_id);
	}
	return valadoc_importer_valadoc_documentation_scanner_type_id__volatile;
}



