/* equation-lexer.c generated by valac 0.36.5, the Vala compiler
 * generated from equation-lexer.vala, do not modify */

/*
 * Copyright (C) 2012 Arth Patel
 * Copyright (C) 2012 Robert Ancell
 *
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version. See http://www.gnu.org/copyleft/gpl.html the full text of the
 * license.
 */
/* Enum for tokens generated by pre-lexer and lexer. */

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


#define TYPE_LEXER_TOKEN_TYPE (lexer_token_type_get_type ())

#define TYPE_PRE_LEXER (pre_lexer_get_type ())
#define PRE_LEXER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PRE_LEXER, PreLexer))
#define PRE_LEXER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PRE_LEXER, PreLexerClass))
#define IS_PRE_LEXER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PRE_LEXER))
#define IS_PRE_LEXER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PRE_LEXER))
#define PRE_LEXER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PRE_LEXER, PreLexerClass))

typedef struct _PreLexer PreLexer;
typedef struct _PreLexerClass PreLexerClass;
typedef struct _PreLexerPrivate PreLexerPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))

#define TYPE_LEXER_TOKEN (lexer_token_get_type ())
#define LEXER_TOKEN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LEXER_TOKEN, LexerToken))
#define LEXER_TOKEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LEXER_TOKEN, LexerTokenClass))
#define IS_LEXER_TOKEN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LEXER_TOKEN))
#define IS_LEXER_TOKEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LEXER_TOKEN))
#define LEXER_TOKEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LEXER_TOKEN, LexerTokenClass))

typedef struct _LexerToken LexerToken;
typedef struct _LexerTokenClass LexerTokenClass;
typedef struct _LexerTokenPrivate LexerTokenPrivate;

#define TYPE_LEXER (lexer_get_type ())
#define LEXER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LEXER, Lexer))
#define LEXER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LEXER, LexerClass))
#define IS_LEXER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LEXER))
#define IS_LEXER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LEXER))
#define LEXER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LEXER, LexerClass))

typedef struct _Lexer Lexer;
typedef struct _LexerClass LexerClass;
typedef struct _LexerPrivate LexerPrivate;

#define TYPE_PARSER (parser_get_type ())
#define PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PARSER, Parser))
#define PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PARSER, ParserClass))
#define IS_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PARSER))
#define IS_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PARSER))
#define PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PARSER, ParserClass))

typedef struct _Parser Parser;
typedef struct _ParserClass ParserClass;
#define _parser_unref0(var) ((var == NULL) ? NULL : (var = (parser_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))

#define TYPE_NUMBER (number_get_type ())
#define NUMBER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NUMBER, Number))
#define NUMBER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NUMBER, NumberClass))
#define IS_NUMBER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NUMBER))
#define IS_NUMBER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NUMBER))
#define NUMBER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NUMBER, NumberClass))

typedef struct _Number Number;
typedef struct _NumberClass NumberClass;

#define TYPE_ERROR_CODE (error_code_get_type ())

typedef enum  {
	LEXER_TOKEN_TYPE_UNKNOWN,
	LEXER_TOKEN_TYPE_PL_DECIMAL,
	LEXER_TOKEN_TYPE_PL_DIGIT,
	LEXER_TOKEN_TYPE_PL_HEX,
	LEXER_TOKEN_TYPE_PL_SUPER_DIGIT,
	LEXER_TOKEN_TYPE_PL_SUPER_MINUS,
	LEXER_TOKEN_TYPE_PL_SUB_DIGIT,
	LEXER_TOKEN_TYPE_PL_FRACTION,
	LEXER_TOKEN_TYPE_PL_DEGREE,
	LEXER_TOKEN_TYPE_PL_MINUTE,
	LEXER_TOKEN_TYPE_PL_SECOND,
	LEXER_TOKEN_TYPE_PL_LETTER,
	LEXER_TOKEN_TYPE_PL_EOS,
	LEXER_TOKEN_TYPE_PL_SKIP,
	LEXER_TOKEN_TYPE_ADD,
	LEXER_TOKEN_TYPE_SUBTRACT,
	LEXER_TOKEN_TYPE_MULTIPLY,
	LEXER_TOKEN_TYPE_DIVIDE,
	LEXER_TOKEN_TYPE_MOD,
	LEXER_TOKEN_TYPE_L_FLOOR,
	LEXER_TOKEN_TYPE_R_FLOOR,
	LEXER_TOKEN_TYPE_L_CEILING,
	LEXER_TOKEN_TYPE_R_CEILING,
	LEXER_TOKEN_TYPE_ROOT,
	LEXER_TOKEN_TYPE_ROOT_3,
	LEXER_TOKEN_TYPE_ROOT_4,
	LEXER_TOKEN_TYPE_NOT,
	LEXER_TOKEN_TYPE_AND,
	LEXER_TOKEN_TYPE_OR,
	LEXER_TOKEN_TYPE_XOR,
	LEXER_TOKEN_TYPE_IN,
	LEXER_TOKEN_TYPE_NUMBER,
	LEXER_TOKEN_TYPE_SUP_NUMBER,
	LEXER_TOKEN_TYPE_NSUP_NUMBER,
	LEXER_TOKEN_TYPE_SUB_NUMBER,
	LEXER_TOKEN_TYPE_FUNCTION,
	LEXER_TOKEN_TYPE_UNIT,
	LEXER_TOKEN_TYPE_VARIABLE,
	LEXER_TOKEN_TYPE_ASSIGN,
	LEXER_TOKEN_TYPE_L_R_BRACKET,
	LEXER_TOKEN_TYPE_R_R_BRACKET,
	LEXER_TOKEN_TYPE_L_S_BRACKET,
	LEXER_TOKEN_TYPE_R_S_BRACKET,
	LEXER_TOKEN_TYPE_L_C_BRACKET,
	LEXER_TOKEN_TYPE_R_C_BRACKET,
	LEXER_TOKEN_TYPE_ABS,
	LEXER_TOKEN_TYPE_POWER,
	LEXER_TOKEN_TYPE_FACTORIAL,
	LEXER_TOKEN_TYPE_PERCENTAGE,
	LEXER_TOKEN_TYPE_ARGUMENT_SEPARATOR
} LexerTokenType;

struct _PreLexer {
	GObject parent_instance;
	PreLexerPrivate * priv;
	gchar* stream;
	gint index;
	gint mark_index;
};

struct _PreLexerClass {
	GObjectClass parent_class;
};

struct _PreLexerPrivate {
	gboolean eos;
};

struct _LexerToken {
	GObject parent_instance;
	LexerTokenPrivate * priv;
	gchar* text;
	guint start_index;
	guint end_index;
	LexerTokenType type;
};

struct _LexerTokenClass {
	GObjectClass parent_class;
};

struct _Lexer {
	GObject parent_instance;
	LexerPrivate * priv;
	GList* tokens;
};

struct _LexerClass {
	GObjectClass parent_class;
};

struct _LexerPrivate {
	Parser* parser;
	PreLexer* prelexer;
	guint next_token;
	gint number_base;
};

typedef enum  {
	ERROR_CODE_NONE,
	ERROR_CODE_INVALID,
	ERROR_CODE_OVERFLOW,
	ERROR_CODE_UNKNOWN_VARIABLE,
	ERROR_CODE_UNKNOWN_FUNCTION,
	ERROR_CODE_UNKNOWN_CONVERSION,
	ERROR_CODE_MP
} ErrorCode;


static gpointer pre_lexer_parent_class = NULL;
static gpointer lexer_token_parent_class = NULL;
static gpointer lexer_parent_class = NULL;

GType lexer_token_type_get_type (void) G_GNUC_CONST;
GType pre_lexer_get_type (void) G_GNUC_CONST;
#define PRE_LEXER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_PRE_LEXER, PreLexerPrivate))
enum  {
	PRE_LEXER_DUMMY_PROPERTY
};
PreLexer* pre_lexer_new (const gchar* input);
PreLexer* pre_lexer_construct (GType object_type, const gchar* input);
void pre_lexer_roll_back (PreLexer* self);
void pre_lexer_set_marker (PreLexer* self);
gchar* pre_lexer_get_marked_substring (PreLexer* self);
LexerTokenType pre_lexer_get_next_token (PreLexer* self);
static void pre_lexer_finalize (GObject * obj);
GType lexer_token_get_type (void) G_GNUC_CONST;
enum  {
	LEXER_TOKEN_DUMMY_PROPERTY
};
LexerToken* lexer_token_new (void);
LexerToken* lexer_token_construct (GType object_type);
static void lexer_token_finalize (GObject * obj);
GType lexer_get_type (void) G_GNUC_CONST;
gpointer parser_ref (gpointer instance);
void parser_unref (gpointer instance);
GParamSpec* param_spec_parser (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_parser (GValue* value, gpointer v_object);
void value_take_parser (GValue* value, gpointer v_object);
gpointer value_get_parser (const GValue* value);
GType parser_get_type (void) G_GNUC_CONST;
#define LEXER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_LEXER, LexerPrivate))
enum  {
	LEXER_DUMMY_PROPERTY
};
static void _g_object_unref0_ (gpointer var);
static void _g_list_free__g_object_unref0_ (GList* self);
Lexer* lexer_new (const gchar* input, Parser* parser, gint number_base);
Lexer* lexer_construct (GType object_type, const gchar* input, Parser* parser, gint number_base);
void lexer_scan (Lexer* self);
static LexerToken* lexer_insert_next_token (Lexer* self);
LexerToken* lexer_get_next_token (Lexer* self);
void lexer_roll_back (Lexer* self);
static gboolean lexer_check_if_function (Lexer* self);
gboolean parser_function_is_defined (Parser* self, const gchar* name);
static gboolean lexer_check_if_unit (Lexer* self);
gboolean parser_unit_is_defined (Parser* self, const gchar* name);
static gboolean lexer_check_if_number (Lexer* self);
GType number_get_type (void) G_GNUC_CONST;
Number* mp_set_from_string (const gchar* str, gint default_base);
static LexerToken* lexer_insert_token (Lexer* self, LexerTokenType type);
GType error_code_get_type (void) G_GNUC_CONST;
void parser_set_error (Parser* self, ErrorCode errorno, const gchar* token, guint token_start, guint token_end);
static LexerToken* lexer_insert_digit (Lexer* self);
static LexerToken* lexer_insert_decimal (Lexer* self);
static LexerToken* lexer_insert_hex (Lexer* self);
static LexerToken* lexer_insert_letter (Lexer* self);
static LexerToken* lexer_insert_angle_num_dm (Lexer* self);
static LexerToken* lexer_insert_angle_num_dms (Lexer* self);
static LexerToken* lexer_insert_hex_dec (Lexer* self);
static LexerToken* lexer_insert_decimal_hex (Lexer* self);
static void lexer_finalize (GObject * obj);


GType lexer_token_type_get_type (void) {
	static volatile gsize lexer_token_type_type_id__volatile = 0;
	if (g_once_init_enter (&lexer_token_type_type_id__volatile)) {
		static const GEnumValue values[] = {{LEXER_TOKEN_TYPE_UNKNOWN, "LEXER_TOKEN_TYPE_UNKNOWN", "unknown"}, {LEXER_TOKEN_TYPE_PL_DECIMAL, "LEXER_TOKEN_TYPE_PL_DECIMAL", "pl-decimal"}, {LEXER_TOKEN_TYPE_PL_DIGIT, "LEXER_TOKEN_TYPE_PL_DIGIT", "pl-digit"}, {LEXER_TOKEN_TYPE_PL_HEX, "LEXER_TOKEN_TYPE_PL_HEX", "pl-hex"}, {LEXER_TOKEN_TYPE_PL_SUPER_DIGIT, "LEXER_TOKEN_TYPE_PL_SUPER_DIGIT", "pl-super-digit"}, {LEXER_TOKEN_TYPE_PL_SUPER_MINUS, "LEXER_TOKEN_TYPE_PL_SUPER_MINUS", "pl-super-minus"}, {LEXER_TOKEN_TYPE_PL_SUB_DIGIT, "LEXER_TOKEN_TYPE_PL_SUB_DIGIT", "pl-sub-digit"}, {LEXER_TOKEN_TYPE_PL_FRACTION, "LEXER_TOKEN_TYPE_PL_FRACTION", "pl-fraction"}, {LEXER_TOKEN_TYPE_PL_DEGREE, "LEXER_TOKEN_TYPE_PL_DEGREE", "pl-degree"}, {LEXER_TOKEN_TYPE_PL_MINUTE, "LEXER_TOKEN_TYPE_PL_MINUTE", "pl-minute"}, {LEXER_TOKEN_TYPE_PL_SECOND, "LEXER_TOKEN_TYPE_PL_SECOND", "pl-second"}, {LEXER_TOKEN_TYPE_PL_LETTER, "LEXER_TOKEN_TYPE_PL_LETTER", "pl-letter"}, {LEXER_TOKEN_TYPE_PL_EOS, "LEXER_TOKEN_TYPE_PL_EOS", "pl-eos"}, {LEXER_TOKEN_TYPE_PL_SKIP, "LEXER_TOKEN_TYPE_PL_SKIP", "pl-skip"}, {LEXER_TOKEN_TYPE_ADD, "LEXER_TOKEN_TYPE_ADD", "add"}, {LEXER_TOKEN_TYPE_SUBTRACT, "LEXER_TOKEN_TYPE_SUBTRACT", "subtract"}, {LEXER_TOKEN_TYPE_MULTIPLY, "LEXER_TOKEN_TYPE_MULTIPLY", "multiply"}, {LEXER_TOKEN_TYPE_DIVIDE, "LEXER_TOKEN_TYPE_DIVIDE", "divide"}, {LEXER_TOKEN_TYPE_MOD, "LEXER_TOKEN_TYPE_MOD", "mod"}, {LEXER_TOKEN_TYPE_L_FLOOR, "LEXER_TOKEN_TYPE_L_FLOOR", "l-floor"}, {LEXER_TOKEN_TYPE_R_FLOOR, "LEXER_TOKEN_TYPE_R_FLOOR", "r-floor"}, {LEXER_TOKEN_TYPE_L_CEILING, "LEXER_TOKEN_TYPE_L_CEILING", "l-ceiling"}, {LEXER_TOKEN_TYPE_R_CEILING, "LEXER_TOKEN_TYPE_R_CEILING", "r-ceiling"}, {LEXER_TOKEN_TYPE_ROOT, "LEXER_TOKEN_TYPE_ROOT", "root"}, {LEXER_TOKEN_TYPE_ROOT_3, "LEXER_TOKEN_TYPE_ROOT_3", "root-3"}, {LEXER_TOKEN_TYPE_ROOT_4, "LEXER_TOKEN_TYPE_ROOT_4", "root-4"}, {LEXER_TOKEN_TYPE_NOT, "LEXER_TOKEN_TYPE_NOT", "not"}, {LEXER_TOKEN_TYPE_AND, "LEXER_TOKEN_TYPE_AND", "and"}, {LEXER_TOKEN_TYPE_OR, "LEXER_TOKEN_TYPE_OR", "or"}, {LEXER_TOKEN_TYPE_XOR, "LEXER_TOKEN_TYPE_XOR", "xor"}, {LEXER_TOKEN_TYPE_IN, "LEXER_TOKEN_TYPE_IN", "in"}, {LEXER_TOKEN_TYPE_NUMBER, "LEXER_TOKEN_TYPE_NUMBER", "number"}, {LEXER_TOKEN_TYPE_SUP_NUMBER, "LEXER_TOKEN_TYPE_SUP_NUMBER", "sup-number"}, {LEXER_TOKEN_TYPE_NSUP_NUMBER, "LEXER_TOKEN_TYPE_NSUP_NUMBER", "nsup-number"}, {LEXER_TOKEN_TYPE_SUB_NUMBER, "LEXER_TOKEN_TYPE_SUB_NUMBER", "sub-number"}, {LEXER_TOKEN_TYPE_FUNCTION, "LEXER_TOKEN_TYPE_FUNCTION", "function"}, {LEXER_TOKEN_TYPE_UNIT, "LEXER_TOKEN_TYPE_UNIT", "unit"}, {LEXER_TOKEN_TYPE_VARIABLE, "LEXER_TOKEN_TYPE_VARIABLE", "variable"}, {LEXER_TOKEN_TYPE_ASSIGN, "LEXER_TOKEN_TYPE_ASSIGN", "assign"}, {LEXER_TOKEN_TYPE_L_R_BRACKET, "LEXER_TOKEN_TYPE_L_R_BRACKET", "l-r-bracket"}, {LEXER_TOKEN_TYPE_R_R_BRACKET, "LEXER_TOKEN_TYPE_R_R_BRACKET", "r-r-bracket"}, {LEXER_TOKEN_TYPE_L_S_BRACKET, "LEXER_TOKEN_TYPE_L_S_BRACKET", "l-s-bracket"}, {LEXER_TOKEN_TYPE_R_S_BRACKET, "LEXER_TOKEN_TYPE_R_S_BRACKET", "r-s-bracket"}, {LEXER_TOKEN_TYPE_L_C_BRACKET, "LEXER_TOKEN_TYPE_L_C_BRACKET", "l-c-bracket"}, {LEXER_TOKEN_TYPE_R_C_BRACKET, "LEXER_TOKEN_TYPE_R_C_BRACKET", "r-c-bracket"}, {LEXER_TOKEN_TYPE_ABS, "LEXER_TOKEN_TYPE_ABS", "abs"}, {LEXER_TOKEN_TYPE_POWER, "LEXER_TOKEN_TYPE_POWER", "power"}, {LEXER_TOKEN_TYPE_FACTORIAL, "LEXER_TOKEN_TYPE_FACTORIAL", "factorial"}, {LEXER_TOKEN_TYPE_PERCENTAGE, "LEXER_TOKEN_TYPE_PERCENTAGE", "percentage"}, {LEXER_TOKEN_TYPE_ARGUMENT_SEPARATOR, "LEXER_TOKEN_TYPE_ARGUMENT_SEPARATOR", "argument-separator"}, {0, NULL, NULL}};
		GType lexer_token_type_type_id;
		lexer_token_type_type_id = g_enum_register_static ("LexerTokenType", values);
		g_once_init_leave (&lexer_token_type_type_id__volatile, lexer_token_type_type_id);
	}
	return lexer_token_type_type_id__volatile;
}


PreLexer* pre_lexer_construct (GType object_type, const gchar* input) {
	PreLexer * self = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (input != NULL, NULL);
	self = (PreLexer*) g_object_new (object_type, NULL);
	_tmp0_ = input;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->stream);
	self->stream = _tmp1_;
	self->index = 0;
	self->mark_index = 0;
	return self;
}


PreLexer* pre_lexer_new (const gchar* input) {
	return pre_lexer_construct (TYPE_PRE_LEXER, input);
}


static gboolean string_get_prev_char (const gchar* self, gint* index, gunichar* c) {
	gunichar _vala_c = 0U;
	gboolean result = FALSE;
	gint _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = *index;
	if (0 < _tmp0_) {
		gint _tmp1_;
		gchar* _tmp2_;
		gint _tmp3_;
		gunichar _tmp4_;
		_tmp1_ = *index;
		_tmp2_ = g_utf8_prev_char (((gchar*) self) + _tmp1_);
		*index = (gint) (_tmp2_ - ((gchar*) self));
		_tmp3_ = *index;
		_tmp4_ = g_utf8_get_char (((gchar*) self) + _tmp3_);
		_vala_c = _tmp4_;
		result = TRUE;
		if (c) {
			*c = _vala_c;
		}
		return result;
	} else {
		_vala_c = (gunichar) 0;
		result = FALSE;
		if (c) {
			*c = _vala_c;
		}
		return result;
	}
	if (c) {
		*c = _vala_c;
	}
}


void pre_lexer_roll_back (PreLexer* self) {
	gboolean _tmp0_;
	gunichar c = 0U;
	const gchar* _tmp1_;
	gunichar _tmp2_ = 0U;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->eos;
	if (_tmp0_) {
		self->priv->eos = FALSE;
		return;
	}
	_tmp1_ = self->stream;
	string_get_prev_char (_tmp1_, &self->index, &_tmp2_);
	c = _tmp2_;
}


void pre_lexer_set_marker (PreLexer* self) {
	gint _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->index;
	self->mark_index = _tmp0_;
}


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


gchar* pre_lexer_get_marked_substring (PreLexer* self) {
	gchar* result = NULL;
	const gchar* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gchar* _tmp4_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->stream;
	_tmp1_ = self->mark_index;
	_tmp2_ = self->index;
	_tmp3_ = self->mark_index;
	_tmp4_ = string_substring (_tmp0_, (glong) _tmp1_, (glong) (_tmp2_ - _tmp3_));
	result = _tmp4_;
	return result;
}


static gboolean string_get_next_char (const gchar* self, gint* index, gunichar* c) {
	gunichar _vala_c = 0U;
	gboolean result = FALSE;
	gint _tmp0_;
	gunichar _tmp1_;
	gunichar _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = *index;
	_tmp1_ = g_utf8_get_char (((gchar*) self) + _tmp0_);
	_vala_c = _tmp1_;
	_tmp2_ = _vala_c;
	if (_tmp2_ != ((gunichar) 0)) {
		gint _tmp3_;
		gchar* _tmp4_;
		_tmp3_ = *index;
		_tmp4_ = g_utf8_next_char (((gchar*) self) + _tmp3_);
		*index = (gint) (_tmp4_ - ((gchar*) self));
		result = TRUE;
		if (c) {
			*c = _vala_c;
		}
		return result;
	} else {
		result = FALSE;
		if (c) {
			*c = _vala_c;
		}
		return result;
	}
	if (c) {
		*c = _vala_c;
	}
}


LexerTokenType pre_lexer_get_next_token (PreLexer* self) {
	LexerTokenType result = 0;
	gunichar c = 0U;
	const gchar* _tmp0_;
	gunichar _tmp1_ = 0U;
	gboolean _tmp2_;
	gboolean _tmp3_ = FALSE;
	gunichar _tmp4_;
	gunichar _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_ = FALSE;
	gboolean _tmp9_ = FALSE;
	gunichar _tmp10_;
	gboolean _tmp15_ = FALSE;
	gboolean _tmp16_ = FALSE;
	gboolean _tmp17_ = FALSE;
	gboolean _tmp18_ = FALSE;
	gboolean _tmp19_ = FALSE;
	gboolean _tmp20_ = FALSE;
	gboolean _tmp21_ = FALSE;
	gboolean _tmp22_ = FALSE;
	gboolean _tmp23_ = FALSE;
	gunichar _tmp24_;
	gunichar _tmp34_;
	gboolean _tmp35_ = FALSE;
	gboolean _tmp36_ = FALSE;
	gboolean _tmp37_ = FALSE;
	gboolean _tmp38_ = FALSE;
	gboolean _tmp39_ = FALSE;
	gboolean _tmp40_ = FALSE;
	gboolean _tmp41_ = FALSE;
	gboolean _tmp42_ = FALSE;
	gboolean _tmp43_ = FALSE;
	gunichar _tmp44_;
	gboolean _tmp54_ = FALSE;
	gboolean _tmp55_ = FALSE;
	gboolean _tmp56_ = FALSE;
	gboolean _tmp57_ = FALSE;
	gboolean _tmp58_ = FALSE;
	gboolean _tmp59_ = FALSE;
	gboolean _tmp60_ = FALSE;
	gboolean _tmp61_ = FALSE;
	gboolean _tmp62_ = FALSE;
	gboolean _tmp63_ = FALSE;
	gboolean _tmp64_ = FALSE;
	gboolean _tmp65_ = FALSE;
	gboolean _tmp66_ = FALSE;
	gboolean _tmp67_ = FALSE;
	gunichar _tmp68_;
	gunichar _tmp83_;
	gunichar _tmp84_;
	gunichar _tmp85_;
	gboolean _tmp86_ = FALSE;
	gunichar _tmp87_;
	gboolean _tmp88_;
	gunichar _tmp90_;
	gunichar _tmp91_;
	gboolean _tmp92_ = FALSE;
	gunichar _tmp93_;
	gboolean _tmp95_ = FALSE;
	gunichar _tmp96_;
	gunichar _tmp98_;
	gboolean _tmp99_ = FALSE;
	gboolean _tmp100_ = FALSE;
	gunichar _tmp101_;
	gboolean _tmp104_ = FALSE;
	gunichar _tmp105_;
	gboolean _tmp107_ = FALSE;
	gboolean _tmp108_ = FALSE;
	gunichar _tmp109_;
	gunichar _tmp112_;
	gunichar _tmp113_;
	gunichar _tmp114_;
	gunichar _tmp115_;
	gunichar _tmp116_;
	gunichar _tmp117_;
	gunichar _tmp118_;
	gunichar _tmp119_;
	gunichar _tmp120_;
	gunichar _tmp121_;
	gunichar _tmp122_;
	gunichar _tmp123_;
	gunichar _tmp124_;
	gunichar _tmp125_;
	gunichar _tmp126_;
	gunichar _tmp127_;
	gunichar _tmp128_;
	gunichar _tmp129_;
	gunichar _tmp130_;
	gboolean _tmp131_ = FALSE;
	gboolean _tmp132_ = FALSE;
	gboolean _tmp133_ = FALSE;
	gunichar _tmp134_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->stream;
	_tmp2_ = string_get_next_char (_tmp0_, &self->index, &_tmp1_);
	c = _tmp1_;
	if (!_tmp2_) {
		self->priv->eos = TRUE;
		result = LEXER_TOKEN_TYPE_PL_EOS;
		return result;
	}
	self->priv->eos = FALSE;
	_tmp4_ = c;
	if (_tmp4_ == ((gunichar) ',')) {
		_tmp3_ = TRUE;
	} else {
		gunichar _tmp5_;
		_tmp5_ = c;
		_tmp3_ = _tmp5_ == ((gunichar) '.');
	}
	if (_tmp3_) {
		result = LEXER_TOKEN_TYPE_PL_DECIMAL;
		return result;
	}
	_tmp6_ = c;
	_tmp7_ = g_unichar_isdigit (_tmp6_);
	if (_tmp7_) {
		result = LEXER_TOKEN_TYPE_PL_DIGIT;
		return result;
	}
	_tmp10_ = c;
	if (_tmp10_ >= ((gunichar) 'a')) {
		gunichar _tmp11_;
		_tmp11_ = c;
		_tmp9_ = _tmp11_ <= ((gunichar) 'f');
	} else {
		_tmp9_ = FALSE;
	}
	if (_tmp9_) {
		_tmp8_ = TRUE;
	} else {
		gboolean _tmp12_ = FALSE;
		gunichar _tmp13_;
		_tmp13_ = c;
		if (_tmp13_ >= ((gunichar) 'A')) {
			gunichar _tmp14_;
			_tmp14_ = c;
			_tmp12_ = _tmp14_ <= ((gunichar) 'F');
		} else {
			_tmp12_ = FALSE;
		}
		_tmp8_ = _tmp12_;
	}
	if (_tmp8_) {
		result = LEXER_TOKEN_TYPE_PL_HEX;
		return result;
	}
	_tmp24_ = c;
	if (_tmp24_ == 8304U) {
		_tmp23_ = TRUE;
	} else {
		gunichar _tmp25_;
		_tmp25_ = c;
		_tmp23_ = _tmp25_ == 185U;
	}
	if (_tmp23_) {
		_tmp22_ = TRUE;
	} else {
		gunichar _tmp26_;
		_tmp26_ = c;
		_tmp22_ = _tmp26_ == 178U;
	}
	if (_tmp22_) {
		_tmp21_ = TRUE;
	} else {
		gunichar _tmp27_;
		_tmp27_ = c;
		_tmp21_ = _tmp27_ == 179U;
	}
	if (_tmp21_) {
		_tmp20_ = TRUE;
	} else {
		gunichar _tmp28_;
		_tmp28_ = c;
		_tmp20_ = _tmp28_ == 8308U;
	}
	if (_tmp20_) {
		_tmp19_ = TRUE;
	} else {
		gunichar _tmp29_;
		_tmp29_ = c;
		_tmp19_ = _tmp29_ == 8309U;
	}
	if (_tmp19_) {
		_tmp18_ = TRUE;
	} else {
		gunichar _tmp30_;
		_tmp30_ = c;
		_tmp18_ = _tmp30_ == 8310U;
	}
	if (_tmp18_) {
		_tmp17_ = TRUE;
	} else {
		gunichar _tmp31_;
		_tmp31_ = c;
		_tmp17_ = _tmp31_ == 8311U;
	}
	if (_tmp17_) {
		_tmp16_ = TRUE;
	} else {
		gunichar _tmp32_;
		_tmp32_ = c;
		_tmp16_ = _tmp32_ == 8312U;
	}
	if (_tmp16_) {
		_tmp15_ = TRUE;
	} else {
		gunichar _tmp33_;
		_tmp33_ = c;
		_tmp15_ = _tmp33_ == 8313U;
	}
	if (_tmp15_) {
		result = LEXER_TOKEN_TYPE_PL_SUPER_DIGIT;
		return result;
	}
	_tmp34_ = c;
	if (_tmp34_ == 8315U) {
		result = LEXER_TOKEN_TYPE_PL_SUPER_MINUS;
		return result;
	}
	_tmp44_ = c;
	if (_tmp44_ == 8320U) {
		_tmp43_ = TRUE;
	} else {
		gunichar _tmp45_;
		_tmp45_ = c;
		_tmp43_ = _tmp45_ == 8321U;
	}
	if (_tmp43_) {
		_tmp42_ = TRUE;
	} else {
		gunichar _tmp46_;
		_tmp46_ = c;
		_tmp42_ = _tmp46_ == 8322U;
	}
	if (_tmp42_) {
		_tmp41_ = TRUE;
	} else {
		gunichar _tmp47_;
		_tmp47_ = c;
		_tmp41_ = _tmp47_ == 8323U;
	}
	if (_tmp41_) {
		_tmp40_ = TRUE;
	} else {
		gunichar _tmp48_;
		_tmp48_ = c;
		_tmp40_ = _tmp48_ == 8324U;
	}
	if (_tmp40_) {
		_tmp39_ = TRUE;
	} else {
		gunichar _tmp49_;
		_tmp49_ = c;
		_tmp39_ = _tmp49_ == 8325U;
	}
	if (_tmp39_) {
		_tmp38_ = TRUE;
	} else {
		gunichar _tmp50_;
		_tmp50_ = c;
		_tmp38_ = _tmp50_ == 8326U;
	}
	if (_tmp38_) {
		_tmp37_ = TRUE;
	} else {
		gunichar _tmp51_;
		_tmp51_ = c;
		_tmp37_ = _tmp51_ == 8327U;
	}
	if (_tmp37_) {
		_tmp36_ = TRUE;
	} else {
		gunichar _tmp52_;
		_tmp52_ = c;
		_tmp36_ = _tmp52_ == 8328U;
	}
	if (_tmp36_) {
		_tmp35_ = TRUE;
	} else {
		gunichar _tmp53_;
		_tmp53_ = c;
		_tmp35_ = _tmp53_ == 8329U;
	}
	if (_tmp35_) {
		result = LEXER_TOKEN_TYPE_PL_SUB_DIGIT;
		return result;
	}
	_tmp68_ = c;
	if (_tmp68_ == 189U) {
		_tmp67_ = TRUE;
	} else {
		gunichar _tmp69_;
		_tmp69_ = c;
		_tmp67_ = _tmp69_ == 8531U;
	}
	if (_tmp67_) {
		_tmp66_ = TRUE;
	} else {
		gunichar _tmp70_;
		_tmp70_ = c;
		_tmp66_ = _tmp70_ == 8532U;
	}
	if (_tmp66_) {
		_tmp65_ = TRUE;
	} else {
		gunichar _tmp71_;
		_tmp71_ = c;
		_tmp65_ = _tmp71_ == 188U;
	}
	if (_tmp65_) {
		_tmp64_ = TRUE;
	} else {
		gunichar _tmp72_;
		_tmp72_ = c;
		_tmp64_ = _tmp72_ == 190U;
	}
	if (_tmp64_) {
		_tmp63_ = TRUE;
	} else {
		gunichar _tmp73_;
		_tmp73_ = c;
		_tmp63_ = _tmp73_ == 8533U;
	}
	if (_tmp63_) {
		_tmp62_ = TRUE;
	} else {
		gunichar _tmp74_;
		_tmp74_ = c;
		_tmp62_ = _tmp74_ == 8534U;
	}
	if (_tmp62_) {
		_tmp61_ = TRUE;
	} else {
		gunichar _tmp75_;
		_tmp75_ = c;
		_tmp61_ = _tmp75_ == 8535U;
	}
	if (_tmp61_) {
		_tmp60_ = TRUE;
	} else {
		gunichar _tmp76_;
		_tmp76_ = c;
		_tmp60_ = _tmp76_ == 8536U;
	}
	if (_tmp60_) {
		_tmp59_ = TRUE;
	} else {
		gunichar _tmp77_;
		_tmp77_ = c;
		_tmp59_ = _tmp77_ == 8537U;
	}
	if (_tmp59_) {
		_tmp58_ = TRUE;
	} else {
		gunichar _tmp78_;
		_tmp78_ = c;
		_tmp58_ = _tmp78_ == 8538U;
	}
	if (_tmp58_) {
		_tmp57_ = TRUE;
	} else {
		gunichar _tmp79_;
		_tmp79_ = c;
		_tmp57_ = _tmp79_ == 8539U;
	}
	if (_tmp57_) {
		_tmp56_ = TRUE;
	} else {
		gunichar _tmp80_;
		_tmp80_ = c;
		_tmp56_ = _tmp80_ == 8540U;
	}
	if (_tmp56_) {
		_tmp55_ = TRUE;
	} else {
		gunichar _tmp81_;
		_tmp81_ = c;
		_tmp55_ = _tmp81_ == 8541U;
	}
	if (_tmp55_) {
		_tmp54_ = TRUE;
	} else {
		gunichar _tmp82_;
		_tmp82_ = c;
		_tmp54_ = _tmp82_ == 8542U;
	}
	if (_tmp54_) {
		result = LEXER_TOKEN_TYPE_PL_FRACTION;
		return result;
	}
	_tmp83_ = c;
	if (_tmp83_ == 176U) {
		result = LEXER_TOKEN_TYPE_PL_DEGREE;
		return result;
	}
	_tmp84_ = c;
	if (_tmp84_ == ((gunichar) '\'')) {
		result = LEXER_TOKEN_TYPE_PL_MINUTE;
		return result;
	}
	_tmp85_ = c;
	if (_tmp85_ == ((gunichar) '"')) {
		result = LEXER_TOKEN_TYPE_PL_SECOND;
		return result;
	}
	_tmp87_ = c;
	_tmp88_ = g_unichar_isalpha (_tmp87_);
	if (_tmp88_) {
		_tmp86_ = TRUE;
	} else {
		gunichar _tmp89_;
		_tmp89_ = c;
		_tmp86_ = _tmp89_ == ((gunichar) '_');
	}
	if (_tmp86_) {
		result = LEXER_TOKEN_TYPE_PL_LETTER;
		return result;
	}
	_tmp90_ = c;
	if (_tmp90_ == 8743U) {
		result = LEXER_TOKEN_TYPE_AND;
		return result;
	}
	_tmp91_ = c;
	if (_tmp91_ == 8744U) {
		result = LEXER_TOKEN_TYPE_OR;
		return result;
	}
	_tmp93_ = c;
	if (_tmp93_ == 8891U) {
		_tmp92_ = TRUE;
	} else {
		gunichar _tmp94_;
		_tmp94_ = c;
		_tmp92_ = _tmp94_ == 8853U;
	}
	if (_tmp92_) {
		result = LEXER_TOKEN_TYPE_XOR;
		return result;
	}
	_tmp96_ = c;
	if (_tmp96_ == 172U) {
		_tmp95_ = TRUE;
	} else {
		gunichar _tmp97_;
		_tmp97_ = c;
		_tmp95_ = _tmp97_ == ((gunichar) '~');
	}
	if (_tmp95_) {
		result = LEXER_TOKEN_TYPE_NOT;
		return result;
	}
	_tmp98_ = c;
	if (_tmp98_ == ((gunichar) '+')) {
		result = LEXER_TOKEN_TYPE_ADD;
		return result;
	}
	_tmp101_ = c;
	if (_tmp101_ == ((gunichar) '-')) {
		_tmp100_ = TRUE;
	} else {
		gunichar _tmp102_;
		_tmp102_ = c;
		_tmp100_ = _tmp102_ == 8722U;
	}
	if (_tmp100_) {
		_tmp99_ = TRUE;
	} else {
		gunichar _tmp103_;
		_tmp103_ = c;
		_tmp99_ = _tmp103_ == 8211U;
	}
	if (_tmp99_) {
		result = LEXER_TOKEN_TYPE_SUBTRACT;
		return result;
	}
	_tmp105_ = c;
	if (_tmp105_ == ((gunichar) '*')) {
		_tmp104_ = TRUE;
	} else {
		gunichar _tmp106_;
		_tmp106_ = c;
		_tmp104_ = _tmp106_ == 215U;
	}
	if (_tmp104_) {
		result = LEXER_TOKEN_TYPE_MULTIPLY;
		return result;
	}
	_tmp109_ = c;
	if (_tmp109_ == ((gunichar) '/')) {
		_tmp108_ = TRUE;
	} else {
		gunichar _tmp110_;
		_tmp110_ = c;
		_tmp108_ = _tmp110_ == 8725U;
	}
	if (_tmp108_) {
		_tmp107_ = TRUE;
	} else {
		gunichar _tmp111_;
		_tmp111_ = c;
		_tmp107_ = _tmp111_ == 247U;
	}
	if (_tmp107_) {
		result = LEXER_TOKEN_TYPE_DIVIDE;
		return result;
	}
	_tmp112_ = c;
	if (_tmp112_ == 8970U) {
		result = LEXER_TOKEN_TYPE_L_FLOOR;
		return result;
	}
	_tmp113_ = c;
	if (_tmp113_ == 8971U) {
		result = LEXER_TOKEN_TYPE_R_FLOOR;
		return result;
	}
	_tmp114_ = c;
	if (_tmp114_ == 8968U) {
		result = LEXER_TOKEN_TYPE_L_CEILING;
		return result;
	}
	_tmp115_ = c;
	if (_tmp115_ == 8969U) {
		result = LEXER_TOKEN_TYPE_R_CEILING;
		return result;
	}
	_tmp116_ = c;
	if (_tmp116_ == 8730U) {
		result = LEXER_TOKEN_TYPE_ROOT;
		return result;
	}
	_tmp117_ = c;
	if (_tmp117_ == 8731U) {
		result = LEXER_TOKEN_TYPE_ROOT_3;
		return result;
	}
	_tmp118_ = c;
	if (_tmp118_ == 8732U) {
		result = LEXER_TOKEN_TYPE_ROOT_4;
		return result;
	}
	_tmp119_ = c;
	if (_tmp119_ == ((gunichar) '=')) {
		result = LEXER_TOKEN_TYPE_ASSIGN;
		return result;
	}
	_tmp120_ = c;
	if (_tmp120_ == ((gunichar) '(')) {
		result = LEXER_TOKEN_TYPE_L_R_BRACKET;
		return result;
	}
	_tmp121_ = c;
	if (_tmp121_ == ((gunichar) ')')) {
		result = LEXER_TOKEN_TYPE_R_R_BRACKET;
		return result;
	}
	_tmp122_ = c;
	if (_tmp122_ == ((gunichar) '[')) {
		result = LEXER_TOKEN_TYPE_L_S_BRACKET;
		return result;
	}
	_tmp123_ = c;
	if (_tmp123_ == ((gunichar) ']')) {
		result = LEXER_TOKEN_TYPE_R_S_BRACKET;
		return result;
	}
	_tmp124_ = c;
	if (_tmp124_ == ((gunichar) '{')) {
		result = LEXER_TOKEN_TYPE_L_C_BRACKET;
		return result;
	}
	_tmp125_ = c;
	if (_tmp125_ == ((gunichar) '}')) {
		result = LEXER_TOKEN_TYPE_R_C_BRACKET;
		return result;
	}
	_tmp126_ = c;
	if (_tmp126_ == ((gunichar) '|')) {
		result = LEXER_TOKEN_TYPE_ABS;
		return result;
	}
	_tmp127_ = c;
	if (_tmp127_ == ((gunichar) '^')) {
		result = LEXER_TOKEN_TYPE_POWER;
		return result;
	}
	_tmp128_ = c;
	if (_tmp128_ == ((gunichar) '!')) {
		result = LEXER_TOKEN_TYPE_FACTORIAL;
		return result;
	}
	_tmp129_ = c;
	if (_tmp129_ == ((gunichar) '%')) {
		result = LEXER_TOKEN_TYPE_PERCENTAGE;
		return result;
	}
	_tmp130_ = c;
	if (_tmp130_ == ((gunichar) ';')) {
		result = LEXER_TOKEN_TYPE_ARGUMENT_SEPARATOR;
		return result;
	}
	_tmp134_ = c;
	if (_tmp134_ == ((gunichar) ' ')) {
		_tmp133_ = TRUE;
	} else {
		gunichar _tmp135_;
		_tmp135_ = c;
		_tmp133_ = _tmp135_ == ((gunichar) '\r');
	}
	if (_tmp133_) {
		_tmp132_ = TRUE;
	} else {
		gunichar _tmp136_;
		_tmp136_ = c;
		_tmp132_ = _tmp136_ == ((gunichar) '\t');
	}
	if (_tmp132_) {
		_tmp131_ = TRUE;
	} else {
		gunichar _tmp137_;
		_tmp137_ = c;
		_tmp131_ = _tmp137_ == ((gunichar) '\n');
	}
	if (_tmp131_) {
		result = LEXER_TOKEN_TYPE_PL_SKIP;
		return result;
	}
	result = LEXER_TOKEN_TYPE_UNKNOWN;
	return result;
}


static void pre_lexer_class_init (PreLexerClass * klass) {
	pre_lexer_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (PreLexerPrivate));
	G_OBJECT_CLASS (klass)->finalize = pre_lexer_finalize;
}


static void pre_lexer_instance_init (PreLexer * self) {
	self->priv = PRE_LEXER_GET_PRIVATE (self);
	self->priv->eos = FALSE;
}


static void pre_lexer_finalize (GObject * obj) {
	PreLexer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PRE_LEXER, PreLexer);
	_g_free0 (self->stream);
	G_OBJECT_CLASS (pre_lexer_parent_class)->finalize (obj);
}


GType pre_lexer_get_type (void) {
	static volatile gsize pre_lexer_type_id__volatile = 0;
	if (g_once_init_enter (&pre_lexer_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (PreLexerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pre_lexer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PreLexer), 0, (GInstanceInitFunc) pre_lexer_instance_init, NULL };
		GType pre_lexer_type_id;
		pre_lexer_type_id = g_type_register_static (G_TYPE_OBJECT, "PreLexer", &g_define_type_info, 0);
		g_once_init_leave (&pre_lexer_type_id__volatile, pre_lexer_type_id);
	}
	return pre_lexer_type_id__volatile;
}


LexerToken* lexer_token_construct (GType object_type) {
	LexerToken * self = NULL;
	self = (LexerToken*) g_object_new (object_type, NULL);
	return self;
}


LexerToken* lexer_token_new (void) {
	return lexer_token_construct (TYPE_LEXER_TOKEN);
}


static void lexer_token_class_init (LexerTokenClass * klass) {
	lexer_token_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = lexer_token_finalize;
}


static void lexer_token_instance_init (LexerToken * self) {
}


static void lexer_token_finalize (GObject * obj) {
	LexerToken * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_LEXER_TOKEN, LexerToken);
	_g_free0 (self->text);
	G_OBJECT_CLASS (lexer_token_parent_class)->finalize (obj);
}


GType lexer_token_get_type (void) {
	static volatile gsize lexer_token_type_id__volatile = 0;
	if (g_once_init_enter (&lexer_token_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (LexerTokenClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) lexer_token_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LexerToken), 0, (GInstanceInitFunc) lexer_token_instance_init, NULL };
		GType lexer_token_type_id;
		lexer_token_type_id = g_type_register_static (G_TYPE_OBJECT, "LexerToken", &g_define_type_info, 0);
		g_once_init_leave (&lexer_token_type_id__volatile, lexer_token_type_id);
	}
	return lexer_token_type_id__volatile;
}


static void _g_object_unref0_ (gpointer var) {
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}


static void _g_list_free__g_object_unref0_ (GList* self) {
	g_list_foreach (self, (GFunc) _g_object_unref0_, NULL);
	g_list_free (self);
}


static gpointer _parser_ref0 (gpointer self) {
	return self ? parser_ref (self) : NULL;
}


Lexer* lexer_construct (GType object_type, const gchar* input, Parser* parser, gint number_base) {
	Lexer * self = NULL;
	const gchar* _tmp0_;
	PreLexer* _tmp1_;
	Parser* _tmp2_;
	Parser* _tmp3_;
	gint _tmp4_;
	g_return_val_if_fail (input != NULL, NULL);
	g_return_val_if_fail (parser != NULL, NULL);
	self = (Lexer*) g_object_new (object_type, NULL);
	_tmp0_ = input;
	_tmp1_ = pre_lexer_new (_tmp0_);
	_g_object_unref0 (self->priv->prelexer);
	self->priv->prelexer = _tmp1_;
	__g_list_free__g_object_unref0_0 (self->tokens);
	self->tokens = NULL;
	self->priv->next_token = (guint) 0;
	_tmp2_ = parser;
	_tmp3_ = _parser_ref0 (_tmp2_);
	_parser_unref0 (self->priv->parser);
	self->priv->parser = _tmp3_;
	_tmp4_ = number_base;
	self->priv->number_base = _tmp4_;
	return self;
}


Lexer* lexer_new (const gchar* input, Parser* parser, gint number_base) {
	return lexer_construct (TYPE_LEXER, input, parser, number_base);
}


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


void lexer_scan (Lexer* self) {
	g_return_if_fail (self != NULL);
	while (TRUE) {
		LexerToken* token = NULL;
		LexerToken* _tmp0_;
		LexerToken* _tmp1_;
		LexerToken* _tmp2_;
		LexerToken* _tmp3_;
		LexerTokenType _tmp4_;
		_tmp0_ = lexer_insert_next_token (self);
		token = _tmp0_;
		_tmp1_ = token;
		_tmp2_ = _g_object_ref0 (_tmp1_);
		self->tokens = g_list_append (self->tokens, _tmp2_);
		_tmp3_ = token;
		_tmp4_ = _tmp3_->type;
		if (_tmp4_ == LEXER_TOKEN_TYPE_PL_EOS) {
			_g_object_unref0 (token);
			break;
		}
		_g_object_unref0 (token);
	}
}


LexerToken* lexer_get_next_token (Lexer* self) {
	LexerToken* result = NULL;
	guint _tmp0_;
	GList* _tmp1_;
	guint _tmp2_;
	GList* _tmp8_;
	guint _tmp9_;
	gconstpointer _tmp10_;
	LexerToken* _tmp11_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->next_token;
	_tmp1_ = self->tokens;
	_tmp2_ = g_list_length (_tmp1_);
	if (_tmp0_ >= _tmp2_) {
		GList* _tmp3_;
		GList* _tmp4_;
		guint _tmp5_;
		gconstpointer _tmp6_;
		LexerToken* _tmp7_;
		_tmp3_ = self->tokens;
		_tmp4_ = self->tokens;
		_tmp5_ = g_list_length (_tmp4_);
		_tmp6_ = g_list_nth_data (_tmp3_, _tmp5_ - 1);
		_tmp7_ = _g_object_ref0 ((LexerToken*) _tmp6_);
		result = _tmp7_;
		return result;
	}
	_tmp8_ = self->tokens;
	_tmp9_ = self->priv->next_token;
	self->priv->next_token = _tmp9_ + 1;
	_tmp10_ = g_list_nth_data (_tmp8_, _tmp9_);
	_tmp11_ = _g_object_ref0 ((LexerToken*) _tmp10_);
	result = _tmp11_;
	return result;
}


void lexer_roll_back (Lexer* self) {
	guint _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->next_token;
	if (_tmp0_ > ((guint) 0)) {
		guint _tmp1_;
		_tmp1_ = self->priv->next_token;
		self->priv->next_token = _tmp1_ - 1;
	}
}


static gboolean lexer_check_if_function (Lexer* self) {
	gboolean result = FALSE;
	gchar* name = NULL;
	PreLexer* _tmp0_;
	gchar* _tmp1_;
	Parser* _tmp2_;
	gboolean _tmp3_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->prelexer;
	_tmp1_ = pre_lexer_get_marked_substring (_tmp0_);
	name = _tmp1_;
	_tmp2_ = self->priv->parser;
	_tmp3_ = parser_function_is_defined (_tmp2_, name);
	result = _tmp3_;
	_g_free0 (name);
	return result;
}


static gboolean lexer_check_if_unit (Lexer* self) {
	gboolean result = FALSE;
	gint super_count = 0;
	PreLexer* _tmp3_;
	gchar* name = NULL;
	PreLexer* _tmp4_;
	gchar* _tmp5_;
	Parser* _tmp6_;
	const gchar* _tmp7_;
	gboolean _tmp8_;
	PreLexer* _tmp11_;
	gchar* _tmp12_;
	Parser* _tmp13_;
	const gchar* _tmp14_;
	gboolean _tmp15_;
	g_return_val_if_fail (self != NULL, FALSE);
	super_count = 0;
	while (TRUE) {
		PreLexer* _tmp0_;
		LexerTokenType _tmp1_;
		gint _tmp2_;
		_tmp0_ = self->priv->prelexer;
		_tmp1_ = pre_lexer_get_next_token (_tmp0_);
		if (!(_tmp1_ == LEXER_TOKEN_TYPE_PL_SUPER_DIGIT)) {
			break;
		}
		_tmp2_ = super_count;
		super_count = _tmp2_ + 1;
	}
	_tmp3_ = self->priv->prelexer;
	pre_lexer_roll_back (_tmp3_);
	_tmp4_ = self->priv->prelexer;
	_tmp5_ = pre_lexer_get_marked_substring (_tmp4_);
	name = _tmp5_;
	_tmp6_ = self->priv->parser;
	_tmp7_ = name;
	_tmp8_ = parser_unit_is_defined (_tmp6_, _tmp7_);
	if (_tmp8_) {
		result = TRUE;
		_g_free0 (name);
		return result;
	}
	while (TRUE) {
		gint _tmp9_;
		PreLexer* _tmp10_;
		_tmp9_ = super_count;
		super_count = _tmp9_ - 1;
		if (!(_tmp9_ > 0)) {
			break;
		}
		_tmp10_ = self->priv->prelexer;
		pre_lexer_roll_back (_tmp10_);
	}
	_tmp11_ = self->priv->prelexer;
	_tmp12_ = pre_lexer_get_marked_substring (_tmp11_);
	_g_free0 (name);
	name = _tmp12_;
	_tmp13_ = self->priv->parser;
	_tmp14_ = name;
	_tmp15_ = parser_unit_is_defined (_tmp13_, _tmp14_);
	result = _tmp15_;
	_g_free0 (name);
	return result;
}


static gboolean lexer_check_if_number (Lexer* self) {
	gboolean result = FALSE;
	gint count = 0;
	gchar* text = NULL;
	PreLexer* _tmp0_;
	gchar* _tmp1_;
	Number* tmp = NULL;
	const gchar* _tmp2_;
	gint _tmp3_;
	Number* _tmp4_;
	Number* _tmp5_;
	g_return_val_if_fail (self != NULL, FALSE);
	count = 0;
	_tmp0_ = self->priv->prelexer;
	_tmp1_ = pre_lexer_get_marked_substring (_tmp0_);
	text = _tmp1_;
	_tmp2_ = text;
	_tmp3_ = self->priv->number_base;
	_tmp4_ = mp_set_from_string (_tmp2_, _tmp3_);
	tmp = _tmp4_;
	_tmp5_ = tmp;
	if (_tmp5_ != NULL) {
		result = TRUE;
		_g_object_unref0 (tmp);
		_g_free0 (text);
		return result;
	} else {
		while (TRUE) {
			const gchar* _tmp6_;
			const gchar* _tmp7_;
			gint _tmp8_;
			Number* _tmp9_;
			Number* _tmp10_;
			gint _tmp11_;
			PreLexer* _tmp12_;
			PreLexer* _tmp13_;
			gchar* _tmp14_;
			_tmp6_ = text;
			if (!(g_strcmp0 (_tmp6_, "") != 0)) {
				break;
			}
			_tmp7_ = text;
			_tmp8_ = self->priv->number_base;
			_tmp9_ = mp_set_from_string (_tmp7_, _tmp8_);
			_g_object_unref0 (tmp);
			tmp = _tmp9_;
			_tmp10_ = tmp;
			if (_tmp10_ != NULL) {
				result = TRUE;
				_g_object_unref0 (tmp);
				_g_free0 (text);
				return result;
			}
			_tmp11_ = count;
			count = _tmp11_ + 1;
			_tmp12_ = self->priv->prelexer;
			pre_lexer_roll_back (_tmp12_);
			_tmp13_ = self->priv->prelexer;
			_tmp14_ = pre_lexer_get_marked_substring (_tmp13_);
			_g_free0 (text);
			text = _tmp14_;
		}
		while (TRUE) {
			gint _tmp15_;
			PreLexer* _tmp16_;
			_tmp15_ = count;
			count = _tmp15_ - 1;
			if (!(_tmp15_ > 0)) {
				break;
			}
			_tmp16_ = self->priv->prelexer;
			pre_lexer_get_next_token (_tmp16_);
		}
		result = FALSE;
		_g_object_unref0 (tmp);
		_g_free0 (text);
		return result;
	}
	_g_object_unref0 (tmp);
	_g_free0 (text);
}


static LexerToken* lexer_insert_token (Lexer* self, LexerTokenType type) {
	LexerToken* result = NULL;
	LexerToken* token = NULL;
	LexerToken* _tmp0_;
	PreLexer* _tmp1_;
	gchar* _tmp2_;
	PreLexer* _tmp3_;
	gint _tmp4_;
	PreLexer* _tmp5_;
	gint _tmp6_;
	LexerTokenType _tmp7_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = lexer_token_new ();
	token = _tmp0_;
	_tmp1_ = self->priv->prelexer;
	_tmp2_ = pre_lexer_get_marked_substring (_tmp1_);
	_g_free0 (token->text);
	token->text = _tmp2_;
	_tmp3_ = self->priv->prelexer;
	_tmp4_ = _tmp3_->mark_index;
	token->start_index = (guint) _tmp4_;
	_tmp5_ = self->priv->prelexer;
	_tmp6_ = _tmp5_->index;
	token->end_index = (guint) _tmp6_;
	_tmp7_ = type;
	token->type = _tmp7_;
	result = token;
	return result;
}


static LexerToken* lexer_insert_next_token (Lexer* self) {
	LexerToken* result = NULL;
	PreLexer* _tmp0_;
	LexerTokenType type = 0;
	PreLexer* _tmp1_;
	LexerTokenType _tmp2_;
	gboolean _tmp7_ = FALSE;
	gboolean _tmp8_ = FALSE;
	gboolean _tmp9_ = FALSE;
	gboolean _tmp10_ = FALSE;
	gboolean _tmp11_ = FALSE;
	gboolean _tmp12_ = FALSE;
	gboolean _tmp13_ = FALSE;
	gboolean _tmp14_ = FALSE;
	gboolean _tmp15_ = FALSE;
	gboolean _tmp16_ = FALSE;
	gboolean _tmp17_ = FALSE;
	gboolean _tmp18_ = FALSE;
	gboolean _tmp19_ = FALSE;
	gboolean _tmp20_ = FALSE;
	gboolean _tmp21_ = FALSE;
	gboolean _tmp22_ = FALSE;
	gboolean _tmp23_ = FALSE;
	gboolean _tmp24_ = FALSE;
	gboolean _tmp25_ = FALSE;
	gboolean _tmp26_ = FALSE;
	gboolean _tmp27_ = FALSE;
	gboolean _tmp28_ = FALSE;
	gboolean _tmp29_ = FALSE;
	gboolean _tmp30_ = FALSE;
	gboolean _tmp31_ = FALSE;
	gboolean _tmp32_ = FALSE;
	LexerTokenType _tmp33_;
	LexerTokenType _tmp62_;
	LexerTokenType _tmp79_;
	LexerTokenType _tmp84_;
	LexerTokenType _tmp89_;
	LexerTokenType _tmp91_;
	LexerTokenType _tmp93_;
	LexerTokenType _tmp95_;
	LexerTokenType _tmp97_;
	LexerTokenType _tmp99_;
	Parser* _tmp101_;
	PreLexer* _tmp102_;
	gchar* _tmp103_;
	gchar* _tmp104_;
	PreLexer* _tmp105_;
	gint _tmp106_;
	PreLexer* _tmp107_;
	gint _tmp108_;
	LexerToken* _tmp109_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->prelexer;
	pre_lexer_set_marker (_tmp0_);
	_tmp1_ = self->priv->prelexer;
	_tmp2_ = pre_lexer_get_next_token (_tmp1_);
	type = _tmp2_;
	while (TRUE) {
		LexerTokenType _tmp3_;
		PreLexer* _tmp4_;
		PreLexer* _tmp5_;
		LexerTokenType _tmp6_;
		_tmp3_ = type;
		if (!(_tmp3_ == LEXER_TOKEN_TYPE_PL_SKIP)) {
			break;
		}
		_tmp4_ = self->priv->prelexer;
		pre_lexer_set_marker (_tmp4_);
		_tmp5_ = self->priv->prelexer;
		_tmp6_ = pre_lexer_get_next_token (_tmp5_);
		type = _tmp6_;
	}
	_tmp33_ = type;
	if (_tmp33_ == LEXER_TOKEN_TYPE_AND) {
		_tmp32_ = TRUE;
	} else {
		LexerTokenType _tmp34_;
		_tmp34_ = type;
		_tmp32_ = _tmp34_ == LEXER_TOKEN_TYPE_OR;
	}
	if (_tmp32_) {
		_tmp31_ = TRUE;
	} else {
		LexerTokenType _tmp35_;
		_tmp35_ = type;
		_tmp31_ = _tmp35_ == LEXER_TOKEN_TYPE_XOR;
	}
	if (_tmp31_) {
		_tmp30_ = TRUE;
	} else {
		LexerTokenType _tmp36_;
		_tmp36_ = type;
		_tmp30_ = _tmp36_ == LEXER_TOKEN_TYPE_NOT;
	}
	if (_tmp30_) {
		_tmp29_ = TRUE;
	} else {
		LexerTokenType _tmp37_;
		_tmp37_ = type;
		_tmp29_ = _tmp37_ == LEXER_TOKEN_TYPE_ADD;
	}
	if (_tmp29_) {
		_tmp28_ = TRUE;
	} else {
		LexerTokenType _tmp38_;
		_tmp38_ = type;
		_tmp28_ = _tmp38_ == LEXER_TOKEN_TYPE_SUBTRACT;
	}
	if (_tmp28_) {
		_tmp27_ = TRUE;
	} else {
		LexerTokenType _tmp39_;
		_tmp39_ = type;
		_tmp27_ = _tmp39_ == LEXER_TOKEN_TYPE_MULTIPLY;
	}
	if (_tmp27_) {
		_tmp26_ = TRUE;
	} else {
		LexerTokenType _tmp40_;
		_tmp40_ = type;
		_tmp26_ = _tmp40_ == LEXER_TOKEN_TYPE_DIVIDE;
	}
	if (_tmp26_) {
		_tmp25_ = TRUE;
	} else {
		LexerTokenType _tmp41_;
		_tmp41_ = type;
		_tmp25_ = _tmp41_ == LEXER_TOKEN_TYPE_L_FLOOR;
	}
	if (_tmp25_) {
		_tmp24_ = TRUE;
	} else {
		LexerTokenType _tmp42_;
		_tmp42_ = type;
		_tmp24_ = _tmp42_ == LEXER_TOKEN_TYPE_R_FLOOR;
	}
	if (_tmp24_) {
		_tmp23_ = TRUE;
	} else {
		LexerTokenType _tmp43_;
		_tmp43_ = type;
		_tmp23_ = _tmp43_ == LEXER_TOKEN_TYPE_L_CEILING;
	}
	if (_tmp23_) {
		_tmp22_ = TRUE;
	} else {
		LexerTokenType _tmp44_;
		_tmp44_ = type;
		_tmp22_ = _tmp44_ == LEXER_TOKEN_TYPE_R_CEILING;
	}
	if (_tmp22_) {
		_tmp21_ = TRUE;
	} else {
		LexerTokenType _tmp45_;
		_tmp45_ = type;
		_tmp21_ = _tmp45_ == LEXER_TOKEN_TYPE_ROOT;
	}
	if (_tmp21_) {
		_tmp20_ = TRUE;
	} else {
		LexerTokenType _tmp46_;
		_tmp46_ = type;
		_tmp20_ = _tmp46_ == LEXER_TOKEN_TYPE_ROOT_3;
	}
	if (_tmp20_) {
		_tmp19_ = TRUE;
	} else {
		LexerTokenType _tmp47_;
		_tmp47_ = type;
		_tmp19_ = _tmp47_ == LEXER_TOKEN_TYPE_ROOT_4;
	}
	if (_tmp19_) {
		_tmp18_ = TRUE;
	} else {
		LexerTokenType _tmp48_;
		_tmp48_ = type;
		_tmp18_ = _tmp48_ == LEXER_TOKEN_TYPE_ASSIGN;
	}
	if (_tmp18_) {
		_tmp17_ = TRUE;
	} else {
		LexerTokenType _tmp49_;
		_tmp49_ = type;
		_tmp17_ = _tmp49_ == LEXER_TOKEN_TYPE_L_R_BRACKET;
	}
	if (_tmp17_) {
		_tmp16_ = TRUE;
	} else {
		LexerTokenType _tmp50_;
		_tmp50_ = type;
		_tmp16_ = _tmp50_ == LEXER_TOKEN_TYPE_R_R_BRACKET;
	}
	if (_tmp16_) {
		_tmp15_ = TRUE;
	} else {
		LexerTokenType _tmp51_;
		_tmp51_ = type;
		_tmp15_ = _tmp51_ == LEXER_TOKEN_TYPE_L_S_BRACKET;
	}
	if (_tmp15_) {
		_tmp14_ = TRUE;
	} else {
		LexerTokenType _tmp52_;
		_tmp52_ = type;
		_tmp14_ = _tmp52_ == LEXER_TOKEN_TYPE_R_S_BRACKET;
	}
	if (_tmp14_) {
		_tmp13_ = TRUE;
	} else {
		LexerTokenType _tmp53_;
		_tmp53_ = type;
		_tmp13_ = _tmp53_ == LEXER_TOKEN_TYPE_L_C_BRACKET;
	}
	if (_tmp13_) {
		_tmp12_ = TRUE;
	} else {
		LexerTokenType _tmp54_;
		_tmp54_ = type;
		_tmp12_ = _tmp54_ == LEXER_TOKEN_TYPE_R_C_BRACKET;
	}
	if (_tmp12_) {
		_tmp11_ = TRUE;
	} else {
		LexerTokenType _tmp55_;
		_tmp55_ = type;
		_tmp11_ = _tmp55_ == LEXER_TOKEN_TYPE_ABS;
	}
	if (_tmp11_) {
		_tmp10_ = TRUE;
	} else {
		LexerTokenType _tmp56_;
		_tmp56_ = type;
		_tmp10_ = _tmp56_ == LEXER_TOKEN_TYPE_POWER;
	}
	if (_tmp10_) {
		_tmp9_ = TRUE;
	} else {
		LexerTokenType _tmp57_;
		_tmp57_ = type;
		_tmp9_ = _tmp57_ == LEXER_TOKEN_TYPE_FACTORIAL;
	}
	if (_tmp9_) {
		_tmp8_ = TRUE;
	} else {
		LexerTokenType _tmp58_;
		_tmp58_ = type;
		_tmp8_ = _tmp58_ == LEXER_TOKEN_TYPE_PERCENTAGE;
	}
	if (_tmp8_) {
		_tmp7_ = TRUE;
	} else {
		LexerTokenType _tmp59_;
		_tmp59_ = type;
		_tmp7_ = _tmp59_ == LEXER_TOKEN_TYPE_ARGUMENT_SEPARATOR;
	}
	if (_tmp7_) {
		LexerTokenType _tmp60_;
		LexerToken* _tmp61_;
		_tmp60_ = type;
		_tmp61_ = lexer_insert_token (self, _tmp60_);
		result = _tmp61_;
		return result;
	}
	_tmp62_ = type;
	if (_tmp62_ == LEXER_TOKEN_TYPE_PL_SUPER_MINUS) {
		PreLexer* _tmp63_;
		LexerTokenType _tmp64_;
		LexerTokenType _tmp65_;
		PreLexer* _tmp77_;
		LexerToken* _tmp78_;
		_tmp63_ = self->priv->prelexer;
		_tmp64_ = pre_lexer_get_next_token (_tmp63_);
		type = _tmp64_;
		_tmp65_ = type;
		if (_tmp65_ != LEXER_TOKEN_TYPE_PL_SUPER_DIGIT) {
			Parser* _tmp66_;
			PreLexer* _tmp67_;
			gchar* _tmp68_;
			gchar* _tmp69_;
			PreLexer* _tmp70_;
			gint _tmp71_;
			PreLexer* _tmp72_;
			gint _tmp73_;
			LexerToken* _tmp74_;
			_tmp66_ = self->priv->parser;
			_tmp67_ = self->priv->prelexer;
			_tmp68_ = pre_lexer_get_marked_substring (_tmp67_);
			_tmp69_ = _tmp68_;
			_tmp70_ = self->priv->prelexer;
			_tmp71_ = _tmp70_->mark_index;
			_tmp72_ = self->priv->prelexer;
			_tmp73_ = _tmp72_->index;
			parser_set_error (_tmp66_, ERROR_CODE_MP, _tmp69_, (guint) _tmp71_, (guint) _tmp73_);
			_g_free0 (_tmp69_);
			_tmp74_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_UNKNOWN);
			result = _tmp74_;
			return result;
		}
		while (TRUE) {
			PreLexer* _tmp75_;
			LexerTokenType _tmp76_;
			_tmp75_ = self->priv->prelexer;
			_tmp76_ = pre_lexer_get_next_token (_tmp75_);
			if (!(_tmp76_ == LEXER_TOKEN_TYPE_PL_SUPER_DIGIT)) {
				break;
			}
		}
		_tmp77_ = self->priv->prelexer;
		pre_lexer_roll_back (_tmp77_);
		_tmp78_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_NSUP_NUMBER);
		result = _tmp78_;
		return result;
	}
	_tmp79_ = type;
	if (_tmp79_ == LEXER_TOKEN_TYPE_PL_SUPER_DIGIT) {
		PreLexer* _tmp82_;
		LexerToken* _tmp83_;
		while (TRUE) {
			PreLexer* _tmp80_;
			LexerTokenType _tmp81_;
			_tmp80_ = self->priv->prelexer;
			_tmp81_ = pre_lexer_get_next_token (_tmp80_);
			if (!(_tmp81_ == LEXER_TOKEN_TYPE_PL_SUPER_DIGIT)) {
				break;
			}
		}
		_tmp82_ = self->priv->prelexer;
		pre_lexer_roll_back (_tmp82_);
		_tmp83_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_SUP_NUMBER);
		result = _tmp83_;
		return result;
	}
	_tmp84_ = type;
	if (_tmp84_ == LEXER_TOKEN_TYPE_PL_SUB_DIGIT) {
		PreLexer* _tmp87_;
		LexerToken* _tmp88_;
		while (TRUE) {
			PreLexer* _tmp85_;
			LexerTokenType _tmp86_;
			_tmp85_ = self->priv->prelexer;
			_tmp86_ = pre_lexer_get_next_token (_tmp85_);
			if (!(_tmp86_ == LEXER_TOKEN_TYPE_PL_SUB_DIGIT)) {
				break;
			}
		}
		_tmp87_ = self->priv->prelexer;
		pre_lexer_roll_back (_tmp87_);
		_tmp88_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_SUB_NUMBER);
		result = _tmp88_;
		return result;
	}
	_tmp89_ = type;
	if (_tmp89_ == LEXER_TOKEN_TYPE_PL_FRACTION) {
		LexerToken* _tmp90_;
		_tmp90_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_NUMBER);
		result = _tmp90_;
		return result;
	}
	_tmp91_ = type;
	if (_tmp91_ == LEXER_TOKEN_TYPE_PL_DIGIT) {
		LexerToken* _tmp92_;
		_tmp92_ = lexer_insert_digit (self);
		result = _tmp92_;
		return result;
	}
	_tmp93_ = type;
	if (_tmp93_ == LEXER_TOKEN_TYPE_PL_DECIMAL) {
		LexerToken* _tmp94_;
		_tmp94_ = lexer_insert_decimal (self);
		result = _tmp94_;
		return result;
	}
	_tmp95_ = type;
	if (_tmp95_ == LEXER_TOKEN_TYPE_PL_HEX) {
		LexerToken* _tmp96_;
		_tmp96_ = lexer_insert_hex (self);
		result = _tmp96_;
		return result;
	}
	_tmp97_ = type;
	if (_tmp97_ == LEXER_TOKEN_TYPE_PL_LETTER) {
		LexerToken* _tmp98_;
		_tmp98_ = lexer_insert_letter (self);
		result = _tmp98_;
		return result;
	}
	_tmp99_ = type;
	if (_tmp99_ == LEXER_TOKEN_TYPE_PL_EOS) {
		LexerToken* _tmp100_;
		_tmp100_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_PL_EOS);
		result = _tmp100_;
		return result;
	}
	_tmp101_ = self->priv->parser;
	_tmp102_ = self->priv->prelexer;
	_tmp103_ = pre_lexer_get_marked_substring (_tmp102_);
	_tmp104_ = _tmp103_;
	_tmp105_ = self->priv->prelexer;
	_tmp106_ = _tmp105_->mark_index;
	_tmp107_ = self->priv->prelexer;
	_tmp108_ = _tmp107_->index;
	parser_set_error (_tmp101_, ERROR_CODE_INVALID, _tmp104_, (guint) _tmp106_, (guint) _tmp108_);
	_g_free0 (_tmp104_);
	_tmp109_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_UNKNOWN);
	result = _tmp109_;
	return result;
}


static LexerToken* lexer_insert_digit (Lexer* self) {
	LexerToken* result = NULL;
	LexerTokenType type = 0;
	PreLexer* _tmp0_;
	LexerTokenType _tmp1_;
	LexerTokenType _tmp5_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->prelexer;
	_tmp1_ = pre_lexer_get_next_token (_tmp0_);
	type = _tmp1_;
	while (TRUE) {
		LexerTokenType _tmp2_;
		PreLexer* _tmp3_;
		LexerTokenType _tmp4_;
		_tmp2_ = type;
		if (!(_tmp2_ == LEXER_TOKEN_TYPE_PL_DIGIT)) {
			break;
		}
		_tmp3_ = self->priv->prelexer;
		_tmp4_ = pre_lexer_get_next_token (_tmp3_);
		type = _tmp4_;
	}
	_tmp5_ = type;
	if (_tmp5_ == LEXER_TOKEN_TYPE_PL_FRACTION) {
		LexerToken* _tmp6_;
		_tmp6_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_NUMBER);
		result = _tmp6_;
		return result;
	} else {
		LexerTokenType _tmp7_;
		_tmp7_ = type;
		if (_tmp7_ == LEXER_TOKEN_TYPE_PL_SUB_DIGIT) {
			PreLexer* _tmp10_;
			LexerToken* _tmp11_;
			while (TRUE) {
				PreLexer* _tmp8_;
				LexerTokenType _tmp9_;
				_tmp8_ = self->priv->prelexer;
				_tmp9_ = pre_lexer_get_next_token (_tmp8_);
				if (!(_tmp9_ == LEXER_TOKEN_TYPE_PL_SUB_DIGIT)) {
					break;
				}
			}
			_tmp10_ = self->priv->prelexer;
			pre_lexer_roll_back (_tmp10_);
			_tmp11_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_NUMBER);
			result = _tmp11_;
			return result;
		} else {
			LexerTokenType _tmp12_;
			_tmp12_ = type;
			if (_tmp12_ == LEXER_TOKEN_TYPE_PL_DEGREE) {
				PreLexer* _tmp13_;
				LexerTokenType _tmp14_;
				LexerTokenType _tmp15_;
				_tmp13_ = self->priv->prelexer;
				_tmp14_ = pre_lexer_get_next_token (_tmp13_);
				type = _tmp14_;
				_tmp15_ = type;
				if (_tmp15_ == LEXER_TOKEN_TYPE_PL_DIGIT) {
					LexerTokenType _tmp19_;
					while (TRUE) {
						PreLexer* _tmp16_;
						LexerTokenType _tmp17_;
						LexerTokenType _tmp18_;
						_tmp16_ = self->priv->prelexer;
						_tmp17_ = pre_lexer_get_next_token (_tmp16_);
						type = _tmp17_;
						_tmp18_ = type;
						if (!(_tmp18_ == LEXER_TOKEN_TYPE_PL_DIGIT)) {
							break;
						}
					}
					_tmp19_ = type;
					if (_tmp19_ == LEXER_TOKEN_TYPE_PL_DECIMAL) {
						LexerToken* _tmp20_;
						_tmp20_ = lexer_insert_angle_num_dm (self);
						result = _tmp20_;
						return result;
					} else {
						LexerTokenType _tmp21_;
						_tmp21_ = type;
						if (_tmp21_ == LEXER_TOKEN_TYPE_PL_MINUTE) {
							PreLexer* _tmp22_;
							LexerTokenType _tmp23_;
							LexerTokenType _tmp24_;
							_tmp22_ = self->priv->prelexer;
							_tmp23_ = pre_lexer_get_next_token (_tmp22_);
							type = _tmp23_;
							_tmp24_ = type;
							if (_tmp24_ == LEXER_TOKEN_TYPE_PL_DIGIT) {
								LexerTokenType _tmp28_;
								while (TRUE) {
									PreLexer* _tmp25_;
									LexerTokenType _tmp26_;
									LexerTokenType _tmp27_;
									_tmp25_ = self->priv->prelexer;
									_tmp26_ = pre_lexer_get_next_token (_tmp25_);
									type = _tmp26_;
									_tmp27_ = type;
									if (!(_tmp27_ == LEXER_TOKEN_TYPE_PL_DIGIT)) {
										break;
									}
								}
								_tmp28_ = type;
								if (_tmp28_ == LEXER_TOKEN_TYPE_PL_DECIMAL) {
									LexerToken* _tmp29_;
									_tmp29_ = lexer_insert_angle_num_dms (self);
									result = _tmp29_;
									return result;
								} else {
									LexerTokenType _tmp30_;
									_tmp30_ = type;
									if (_tmp30_ == LEXER_TOKEN_TYPE_PL_SECOND) {
										LexerToken* _tmp31_;
										_tmp31_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_NUMBER);
										result = _tmp31_;
										return result;
									} else {
										Parser* _tmp32_;
										PreLexer* _tmp33_;
										gchar* _tmp34_;
										gchar* _tmp35_;
										PreLexer* _tmp36_;
										gint _tmp37_;
										PreLexer* _tmp38_;
										gint _tmp39_;
										LexerToken* _tmp40_;
										_tmp32_ = self->priv->parser;
										_tmp33_ = self->priv->prelexer;
										_tmp34_ = pre_lexer_get_marked_substring (_tmp33_);
										_tmp35_ = _tmp34_;
										_tmp36_ = self->priv->prelexer;
										_tmp37_ = _tmp36_->mark_index;
										_tmp38_ = self->priv->prelexer;
										_tmp39_ = _tmp38_->index;
										parser_set_error (_tmp32_, ERROR_CODE_MP, _tmp35_, (guint) _tmp37_, (guint) _tmp39_);
										_g_free0 (_tmp35_);
										_tmp40_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_UNKNOWN);
										result = _tmp40_;
										return result;
									}
								}
							} else {
								LexerTokenType _tmp41_;
								_tmp41_ = type;
								if (_tmp41_ == LEXER_TOKEN_TYPE_PL_DECIMAL) {
									LexerToken* _tmp42_;
									_tmp42_ = lexer_insert_angle_num_dms (self);
									result = _tmp42_;
									return result;
								} else {
									PreLexer* _tmp43_;
									LexerToken* _tmp44_;
									_tmp43_ = self->priv->prelexer;
									pre_lexer_roll_back (_tmp43_);
									_tmp44_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_NUMBER);
									result = _tmp44_;
									return result;
								}
							}
						} else {
							Parser* _tmp45_;
							PreLexer* _tmp46_;
							gchar* _tmp47_;
							gchar* _tmp48_;
							PreLexer* _tmp49_;
							gint _tmp50_;
							PreLexer* _tmp51_;
							gint _tmp52_;
							LexerToken* _tmp53_;
							_tmp45_ = self->priv->parser;
							_tmp46_ = self->priv->prelexer;
							_tmp47_ = pre_lexer_get_marked_substring (_tmp46_);
							_tmp48_ = _tmp47_;
							_tmp49_ = self->priv->prelexer;
							_tmp50_ = _tmp49_->mark_index;
							_tmp51_ = self->priv->prelexer;
							_tmp52_ = _tmp51_->index;
							parser_set_error (_tmp45_, ERROR_CODE_MP, _tmp48_, (guint) _tmp50_, (guint) _tmp52_);
							_g_free0 (_tmp48_);
							_tmp53_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_UNKNOWN);
							result = _tmp53_;
							return result;
						}
					}
				} else {
					LexerTokenType _tmp54_;
					_tmp54_ = type;
					if (_tmp54_ == LEXER_TOKEN_TYPE_PL_DECIMAL) {
						LexerToken* _tmp55_;
						_tmp55_ = lexer_insert_angle_num_dm (self);
						result = _tmp55_;
						return result;
					} else {
						LexerToken* _tmp56_;
						_tmp56_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_NUMBER);
						result = _tmp56_;
						return result;
					}
				}
			} else {
				LexerTokenType _tmp57_;
				_tmp57_ = type;
				if (_tmp57_ == LEXER_TOKEN_TYPE_PL_DECIMAL) {
					LexerToken* _tmp58_;
					_tmp58_ = lexer_insert_decimal (self);
					result = _tmp58_;
					return result;
				} else {
					LexerTokenType _tmp59_;
					_tmp59_ = type;
					if (_tmp59_ == LEXER_TOKEN_TYPE_PL_HEX) {
						LexerToken* _tmp60_;
						_tmp60_ = lexer_insert_hex_dec (self);
						result = _tmp60_;
						return result;
					} else {
						PreLexer* _tmp61_;
						LexerToken* _tmp62_;
						_tmp61_ = self->priv->prelexer;
						pre_lexer_roll_back (_tmp61_);
						_tmp62_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_NUMBER);
						result = _tmp62_;
						return result;
					}
				}
			}
		}
	}
}


static LexerToken* lexer_insert_angle_num_dm (Lexer* self) {
	LexerToken* result = NULL;
	LexerTokenType type = 0;
	PreLexer* _tmp0_;
	LexerTokenType _tmp1_;
	LexerTokenType _tmp2_;
	PreLexer* _tmp13_;
	LexerTokenType _tmp14_;
	LexerTokenType _tmp15_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->prelexer;
	_tmp1_ = pre_lexer_get_next_token (_tmp0_);
	type = _tmp1_;
	_tmp2_ = type;
	if (_tmp2_ != LEXER_TOKEN_TYPE_PL_DIGIT) {
		Parser* _tmp3_;
		PreLexer* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		PreLexer* _tmp7_;
		gint _tmp8_;
		PreLexer* _tmp9_;
		gint _tmp10_;
		LexerToken* _tmp11_;
		_tmp3_ = self->priv->parser;
		_tmp4_ = self->priv->prelexer;
		_tmp5_ = pre_lexer_get_marked_substring (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = self->priv->prelexer;
		_tmp8_ = _tmp7_->mark_index;
		_tmp9_ = self->priv->prelexer;
		_tmp10_ = _tmp9_->index;
		parser_set_error (_tmp3_, ERROR_CODE_MP, _tmp6_, (guint) _tmp8_, (guint) _tmp10_);
		_g_free0 (_tmp6_);
		_tmp11_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_UNKNOWN);
		result = _tmp11_;
		return result;
	}
	while (TRUE) {
		LexerTokenType _tmp12_;
		_tmp12_ = type;
		if (!(_tmp12_ == LEXER_TOKEN_TYPE_PL_DIGIT)) {
			break;
		}
	}
	_tmp13_ = self->priv->prelexer;
	_tmp14_ = pre_lexer_get_next_token (_tmp13_);
	type = _tmp14_;
	_tmp15_ = type;
	if (_tmp15_ == LEXER_TOKEN_TYPE_PL_MINUTE) {
		LexerToken* _tmp16_;
		_tmp16_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_NUMBER);
		result = _tmp16_;
		return result;
	} else {
		Parser* _tmp17_;
		PreLexer* _tmp18_;
		gchar* _tmp19_;
		gchar* _tmp20_;
		PreLexer* _tmp21_;
		gint _tmp22_;
		PreLexer* _tmp23_;
		gint _tmp24_;
		LexerToken* _tmp25_;
		_tmp17_ = self->priv->parser;
		_tmp18_ = self->priv->prelexer;
		_tmp19_ = pre_lexer_get_marked_substring (_tmp18_);
		_tmp20_ = _tmp19_;
		_tmp21_ = self->priv->prelexer;
		_tmp22_ = _tmp21_->mark_index;
		_tmp23_ = self->priv->prelexer;
		_tmp24_ = _tmp23_->index;
		parser_set_error (_tmp17_, ERROR_CODE_MP, _tmp20_, (guint) _tmp22_, (guint) _tmp24_);
		_g_free0 (_tmp20_);
		_tmp25_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_UNKNOWN);
		result = _tmp25_;
		return result;
	}
}


static LexerToken* lexer_insert_angle_num_dms (Lexer* self) {
	LexerToken* result = NULL;
	LexerTokenType type = 0;
	PreLexer* _tmp0_;
	LexerTokenType _tmp1_;
	LexerTokenType _tmp2_;
	LexerTokenType _tmp15_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->prelexer;
	_tmp1_ = pre_lexer_get_next_token (_tmp0_);
	type = _tmp1_;
	_tmp2_ = type;
	if (_tmp2_ != LEXER_TOKEN_TYPE_PL_DIGIT) {
		Parser* _tmp3_;
		PreLexer* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		PreLexer* _tmp7_;
		gint _tmp8_;
		PreLexer* _tmp9_;
		gint _tmp10_;
		LexerToken* _tmp11_;
		_tmp3_ = self->priv->parser;
		_tmp4_ = self->priv->prelexer;
		_tmp5_ = pre_lexer_get_marked_substring (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = self->priv->prelexer;
		_tmp8_ = _tmp7_->mark_index;
		_tmp9_ = self->priv->prelexer;
		_tmp10_ = _tmp9_->index;
		parser_set_error (_tmp3_, ERROR_CODE_MP, _tmp6_, (guint) _tmp8_, (guint) _tmp10_);
		_g_free0 (_tmp6_);
		_tmp11_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_UNKNOWN);
		result = _tmp11_;
		return result;
	}
	while (TRUE) {
		PreLexer* _tmp12_;
		LexerTokenType _tmp13_;
		LexerTokenType _tmp14_;
		_tmp12_ = self->priv->prelexer;
		_tmp13_ = pre_lexer_get_next_token (_tmp12_);
		type = _tmp13_;
		_tmp14_ = type;
		if (!(_tmp14_ == LEXER_TOKEN_TYPE_PL_DIGIT)) {
			break;
		}
	}
	_tmp15_ = type;
	if (_tmp15_ == LEXER_TOKEN_TYPE_PL_SECOND) {
		LexerToken* _tmp16_;
		_tmp16_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_NUMBER);
		result = _tmp16_;
		return result;
	} else {
		Parser* _tmp17_;
		PreLexer* _tmp18_;
		gchar* _tmp19_;
		gchar* _tmp20_;
		PreLexer* _tmp21_;
		gint _tmp22_;
		PreLexer* _tmp23_;
		gint _tmp24_;
		LexerToken* _tmp25_;
		_tmp17_ = self->priv->parser;
		_tmp18_ = self->priv->prelexer;
		_tmp19_ = pre_lexer_get_marked_substring (_tmp18_);
		_tmp20_ = _tmp19_;
		_tmp21_ = self->priv->prelexer;
		_tmp22_ = _tmp21_->mark_index;
		_tmp23_ = self->priv->prelexer;
		_tmp24_ = _tmp23_->index;
		parser_set_error (_tmp17_, ERROR_CODE_MP, _tmp20_, (guint) _tmp22_, (guint) _tmp24_);
		_g_free0 (_tmp20_);
		_tmp25_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_UNKNOWN);
		result = _tmp25_;
		return result;
	}
}


static LexerToken* lexer_insert_decimal (Lexer* self) {
	LexerToken* result = NULL;
	LexerTokenType type = 0;
	PreLexer* _tmp0_;
	LexerTokenType _tmp1_;
	LexerTokenType _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->prelexer;
	_tmp1_ = pre_lexer_get_next_token (_tmp0_);
	type = _tmp1_;
	_tmp2_ = type;
	if (_tmp2_ == LEXER_TOKEN_TYPE_PL_DIGIT) {
		LexerTokenType _tmp6_;
		while (TRUE) {
			PreLexer* _tmp3_;
			LexerTokenType _tmp4_;
			LexerTokenType _tmp5_;
			_tmp3_ = self->priv->prelexer;
			_tmp4_ = pre_lexer_get_next_token (_tmp3_);
			type = _tmp4_;
			_tmp5_ = type;
			if (!(_tmp5_ == LEXER_TOKEN_TYPE_PL_DIGIT)) {
				break;
			}
		}
		_tmp6_ = type;
		if (_tmp6_ == LEXER_TOKEN_TYPE_PL_DEGREE) {
			LexerToken* _tmp7_;
			_tmp7_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_NUMBER);
			result = _tmp7_;
			return result;
		} else {
			LexerTokenType _tmp8_;
			_tmp8_ = type;
			if (_tmp8_ == LEXER_TOKEN_TYPE_PL_HEX) {
				LexerToken* _tmp9_;
				_tmp9_ = lexer_insert_decimal_hex (self);
				result = _tmp9_;
				return result;
			} else {
				LexerTokenType _tmp10_;
				_tmp10_ = type;
				if (_tmp10_ == LEXER_TOKEN_TYPE_PL_SUB_DIGIT) {
					PreLexer* _tmp13_;
					LexerToken* _tmp14_;
					while (TRUE) {
						PreLexer* _tmp11_;
						LexerTokenType _tmp12_;
						_tmp11_ = self->priv->prelexer;
						_tmp12_ = pre_lexer_get_next_token (_tmp11_);
						if (!(_tmp12_ == LEXER_TOKEN_TYPE_PL_SUB_DIGIT)) {
							break;
						}
					}
					_tmp13_ = self->priv->prelexer;
					pre_lexer_roll_back (_tmp13_);
					_tmp14_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_NUMBER);
					result = _tmp14_;
					return result;
				} else {
					PreLexer* _tmp15_;
					LexerToken* _tmp16_;
					_tmp15_ = self->priv->prelexer;
					pre_lexer_roll_back (_tmp15_);
					_tmp16_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_NUMBER);
					result = _tmp16_;
					return result;
				}
			}
		}
	} else {
		LexerTokenType _tmp17_;
		_tmp17_ = type;
		if (_tmp17_ == LEXER_TOKEN_TYPE_PL_HEX) {
			LexerToken* _tmp18_;
			_tmp18_ = lexer_insert_decimal_hex (self);
			result = _tmp18_;
			return result;
		} else {
			Parser* _tmp19_;
			PreLexer* _tmp20_;
			gchar* _tmp21_;
			gchar* _tmp22_;
			PreLexer* _tmp23_;
			gint _tmp24_;
			PreLexer* _tmp25_;
			gint _tmp26_;
			LexerToken* _tmp27_;
			_tmp19_ = self->priv->parser;
			_tmp20_ = self->priv->prelexer;
			_tmp21_ = pre_lexer_get_marked_substring (_tmp20_);
			_tmp22_ = _tmp21_;
			_tmp23_ = self->priv->prelexer;
			_tmp24_ = _tmp23_->mark_index;
			_tmp25_ = self->priv->prelexer;
			_tmp26_ = _tmp25_->index;
			parser_set_error (_tmp19_, ERROR_CODE_MP, _tmp22_, (guint) _tmp24_, (guint) _tmp26_);
			_g_free0 (_tmp22_);
			_tmp27_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_UNKNOWN);
			result = _tmp27_;
			return result;
		}
	}
}


static LexerToken* lexer_insert_hex (Lexer* self) {
	LexerToken* result = NULL;
	LexerTokenType type = 0;
	PreLexer* _tmp0_;
	LexerTokenType _tmp1_;
	LexerTokenType _tmp5_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->prelexer;
	_tmp1_ = pre_lexer_get_next_token (_tmp0_);
	type = _tmp1_;
	while (TRUE) {
		LexerTokenType _tmp2_;
		PreLexer* _tmp3_;
		LexerTokenType _tmp4_;
		_tmp2_ = type;
		if (!(_tmp2_ == LEXER_TOKEN_TYPE_PL_HEX)) {
			break;
		}
		_tmp3_ = self->priv->prelexer;
		_tmp4_ = pre_lexer_get_next_token (_tmp3_);
		type = _tmp4_;
	}
	_tmp5_ = type;
	if (_tmp5_ == LEXER_TOKEN_TYPE_PL_DIGIT) {
		LexerToken* _tmp6_;
		_tmp6_ = lexer_insert_hex_dec (self);
		result = _tmp6_;
		return result;
	} else {
		LexerTokenType _tmp7_;
		_tmp7_ = type;
		if (_tmp7_ == LEXER_TOKEN_TYPE_PL_DECIMAL) {
			LexerToken* _tmp8_;
			_tmp8_ = lexer_insert_decimal_hex (self);
			result = _tmp8_;
			return result;
		} else {
			LexerTokenType _tmp9_;
			_tmp9_ = type;
			if (_tmp9_ == LEXER_TOKEN_TYPE_PL_SUB_DIGIT) {
				PreLexer* _tmp12_;
				gboolean _tmp13_;
				while (TRUE) {
					PreLexer* _tmp10_;
					LexerTokenType _tmp11_;
					_tmp10_ = self->priv->prelexer;
					_tmp11_ = pre_lexer_get_next_token (_tmp10_);
					if (!(_tmp11_ == LEXER_TOKEN_TYPE_PL_SUB_DIGIT)) {
						break;
					}
				}
				_tmp12_ = self->priv->prelexer;
				pre_lexer_roll_back (_tmp12_);
				_tmp13_ = lexer_check_if_number (self);
				if (_tmp13_) {
					LexerToken* _tmp14_;
					_tmp14_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_NUMBER);
					result = _tmp14_;
					return result;
				} else {
					gboolean _tmp15_;
					_tmp15_ = lexer_check_if_function (self);
					if (_tmp15_) {
						LexerToken* _tmp16_;
						_tmp16_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_FUNCTION);
						result = _tmp16_;
						return result;
					} else {
						gboolean _tmp17_;
						_tmp17_ = lexer_check_if_unit (self);
						if (_tmp17_) {
							LexerToken* _tmp18_;
							_tmp18_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_UNIT);
							result = _tmp18_;
							return result;
						} else {
							LexerToken* _tmp19_;
							_tmp19_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_VARIABLE);
							result = _tmp19_;
							return result;
						}
					}
				}
			} else {
				LexerTokenType _tmp20_;
				_tmp20_ = type;
				if (_tmp20_ == LEXER_TOKEN_TYPE_PL_LETTER) {
					LexerToken* _tmp21_;
					_tmp21_ = lexer_insert_letter (self);
					result = _tmp21_;
					return result;
				} else {
					PreLexer* _tmp22_;
					gboolean _tmp23_;
					_tmp22_ = self->priv->prelexer;
					pre_lexer_roll_back (_tmp22_);
					_tmp23_ = lexer_check_if_number (self);
					if (_tmp23_) {
						LexerToken* _tmp24_;
						_tmp24_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_NUMBER);
						result = _tmp24_;
						return result;
					} else {
						gboolean _tmp25_;
						_tmp25_ = lexer_check_if_function (self);
						if (_tmp25_) {
							LexerToken* _tmp26_;
							_tmp26_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_FUNCTION);
							result = _tmp26_;
							return result;
						} else {
							gboolean _tmp27_;
							_tmp27_ = lexer_check_if_unit (self);
							if (_tmp27_) {
								LexerToken* _tmp28_;
								_tmp28_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_UNIT);
								result = _tmp28_;
								return result;
							} else {
								LexerToken* _tmp29_;
								_tmp29_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_VARIABLE);
								result = _tmp29_;
								return result;
							}
						}
					}
				}
			}
		}
	}
}


static LexerToken* lexer_insert_hex_dec (Lexer* self) {
	LexerToken* result = NULL;
	LexerTokenType type = 0;
	PreLexer* _tmp0_;
	LexerTokenType _tmp1_;
	LexerTokenType _tmp7_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->prelexer;
	_tmp1_ = pre_lexer_get_next_token (_tmp0_);
	type = _tmp1_;
	while (TRUE) {
		gboolean _tmp2_ = FALSE;
		LexerTokenType _tmp3_;
		PreLexer* _tmp5_;
		LexerTokenType _tmp6_;
		_tmp3_ = type;
		if (_tmp3_ == LEXER_TOKEN_TYPE_PL_DIGIT) {
			_tmp2_ = TRUE;
		} else {
			LexerTokenType _tmp4_;
			_tmp4_ = type;
			_tmp2_ = _tmp4_ == LEXER_TOKEN_TYPE_PL_HEX;
		}
		if (!_tmp2_) {
			break;
		}
		_tmp5_ = self->priv->prelexer;
		_tmp6_ = pre_lexer_get_next_token (_tmp5_);
		type = _tmp6_;
	}
	_tmp7_ = type;
	if (_tmp7_ == LEXER_TOKEN_TYPE_PL_DECIMAL) {
		LexerToken* _tmp8_;
		_tmp8_ = lexer_insert_decimal_hex (self);
		result = _tmp8_;
		return result;
	} else {
		LexerTokenType _tmp9_;
		_tmp9_ = type;
		if (_tmp9_ == LEXER_TOKEN_TYPE_PL_SUB_DIGIT) {
			PreLexer* _tmp12_;
			LexerToken* _tmp13_;
			while (TRUE) {
				PreLexer* _tmp10_;
				LexerTokenType _tmp11_;
				_tmp10_ = self->priv->prelexer;
				_tmp11_ = pre_lexer_get_next_token (_tmp10_);
				if (!(_tmp11_ == LEXER_TOKEN_TYPE_PL_SUB_DIGIT)) {
					break;
				}
			}
			_tmp12_ = self->priv->prelexer;
			pre_lexer_roll_back (_tmp12_);
			_tmp13_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_NUMBER);
			result = _tmp13_;
			return result;
		} else {
			gboolean _tmp14_;
			Parser* _tmp16_;
			PreLexer* _tmp17_;
			gchar* _tmp18_;
			gchar* _tmp19_;
			PreLexer* _tmp20_;
			gint _tmp21_;
			PreLexer* _tmp22_;
			gint _tmp23_;
			LexerToken* _tmp24_;
			_tmp14_ = lexer_check_if_number (self);
			if (_tmp14_) {
				LexerToken* _tmp15_;
				_tmp15_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_NUMBER);
				result = _tmp15_;
				return result;
			}
			_tmp16_ = self->priv->parser;
			_tmp17_ = self->priv->prelexer;
			_tmp18_ = pre_lexer_get_marked_substring (_tmp17_);
			_tmp19_ = _tmp18_;
			_tmp20_ = self->priv->prelexer;
			_tmp21_ = _tmp20_->mark_index;
			_tmp22_ = self->priv->prelexer;
			_tmp23_ = _tmp22_->index;
			parser_set_error (_tmp16_, ERROR_CODE_MP, _tmp19_, (guint) _tmp21_, (guint) _tmp23_);
			_g_free0 (_tmp19_);
			_tmp24_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_UNKNOWN);
			result = _tmp24_;
			return result;
		}
	}
}


static LexerToken* lexer_insert_decimal_hex (Lexer* self) {
	LexerToken* result = NULL;
	LexerTokenType type = 0;
	PreLexer* _tmp0_;
	LexerTokenType _tmp1_;
	PreLexer* _tmp10_;
	LexerToken* _tmp11_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->prelexer;
	_tmp1_ = pre_lexer_get_next_token (_tmp0_);
	type = _tmp1_;
	while (TRUE) {
		gboolean _tmp2_ = FALSE;
		LexerTokenType _tmp3_;
		PreLexer* _tmp5_;
		LexerTokenType _tmp6_;
		_tmp3_ = type;
		if (_tmp3_ == LEXER_TOKEN_TYPE_PL_DIGIT) {
			_tmp2_ = TRUE;
		} else {
			LexerTokenType _tmp4_;
			_tmp4_ = type;
			_tmp2_ = _tmp4_ == LEXER_TOKEN_TYPE_PL_HEX;
		}
		if (!_tmp2_) {
			break;
		}
		_tmp5_ = self->priv->prelexer;
		_tmp6_ = pre_lexer_get_next_token (_tmp5_);
		type = _tmp6_;
	}
	while (TRUE) {
		LexerTokenType _tmp7_;
		PreLexer* _tmp8_;
		LexerTokenType _tmp9_;
		_tmp7_ = type;
		if (!(_tmp7_ == LEXER_TOKEN_TYPE_PL_SUB_DIGIT)) {
			break;
		}
		_tmp8_ = self->priv->prelexer;
		_tmp9_ = pre_lexer_get_next_token (_tmp8_);
		type = _tmp9_;
	}
	_tmp10_ = self->priv->prelexer;
	pre_lexer_roll_back (_tmp10_);
	_tmp11_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_NUMBER);
	result = _tmp11_;
	return result;
}


static LexerToken* lexer_insert_letter (Lexer* self) {
	LexerToken* result = NULL;
	LexerTokenType type = 0;
	PreLexer* _tmp0_;
	LexerTokenType _tmp1_;
	PreLexer* _tmp10_;
	gchar* name = NULL;
	PreLexer* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	const gchar* _tmp16_;
	const gchar* _tmp18_;
	const gchar* _tmp20_;
	const gchar* _tmp22_;
	const gchar* _tmp24_;
	const gchar* _tmp26_;
	gboolean _tmp28_;
	gboolean _tmp30_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->prelexer;
	_tmp1_ = pre_lexer_get_next_token (_tmp0_);
	type = _tmp1_;
	while (TRUE) {
		gboolean _tmp2_ = FALSE;
		LexerTokenType _tmp3_;
		PreLexer* _tmp5_;
		LexerTokenType _tmp6_;
		_tmp3_ = type;
		if (_tmp3_ == LEXER_TOKEN_TYPE_PL_LETTER) {
			_tmp2_ = TRUE;
		} else {
			LexerTokenType _tmp4_;
			_tmp4_ = type;
			_tmp2_ = _tmp4_ == LEXER_TOKEN_TYPE_PL_HEX;
		}
		if (!_tmp2_) {
			break;
		}
		_tmp5_ = self->priv->prelexer;
		_tmp6_ = pre_lexer_get_next_token (_tmp5_);
		type = _tmp6_;
	}
	while (TRUE) {
		LexerTokenType _tmp7_;
		PreLexer* _tmp8_;
		LexerTokenType _tmp9_;
		_tmp7_ = type;
		if (!(_tmp7_ == LEXER_TOKEN_TYPE_PL_SUB_DIGIT)) {
			break;
		}
		_tmp8_ = self->priv->prelexer;
		_tmp9_ = pre_lexer_get_next_token (_tmp8_);
		type = _tmp9_;
	}
	_tmp10_ = self->priv->prelexer;
	pre_lexer_roll_back (_tmp10_);
	_tmp11_ = self->priv->prelexer;
	_tmp12_ = pre_lexer_get_marked_substring (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = g_utf8_strdown (_tmp13_, (gssize) -1);
	_tmp15_ = _tmp14_;
	_g_free0 (_tmp13_);
	name = _tmp15_;
	_tmp16_ = name;
	if (g_strcmp0 (_tmp16_, "mod") == 0) {
		LexerToken* _tmp17_;
		_tmp17_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_MOD);
		result = _tmp17_;
		_g_free0 (name);
		return result;
	}
	_tmp18_ = name;
	if (g_strcmp0 (_tmp18_, "and") == 0) {
		LexerToken* _tmp19_;
		_tmp19_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_AND);
		result = _tmp19_;
		_g_free0 (name);
		return result;
	}
	_tmp20_ = name;
	if (g_strcmp0 (_tmp20_, "or") == 0) {
		LexerToken* _tmp21_;
		_tmp21_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_OR);
		result = _tmp21_;
		_g_free0 (name);
		return result;
	}
	_tmp22_ = name;
	if (g_strcmp0 (_tmp22_, "xor") == 0) {
		LexerToken* _tmp23_;
		_tmp23_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_XOR);
		result = _tmp23_;
		_g_free0 (name);
		return result;
	}
	_tmp24_ = name;
	if (g_strcmp0 (_tmp24_, "not") == 0) {
		LexerToken* _tmp25_;
		_tmp25_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_NOT);
		result = _tmp25_;
		_g_free0 (name);
		return result;
	}
	_tmp26_ = name;
	if (g_strcmp0 (_tmp26_, "in") == 0) {
		LexerToken* _tmp27_;
		_tmp27_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_IN);
		result = _tmp27_;
		_g_free0 (name);
		return result;
	}
	_tmp28_ = lexer_check_if_function (self);
	if (_tmp28_) {
		LexerToken* _tmp29_;
		_tmp29_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_FUNCTION);
		result = _tmp29_;
		_g_free0 (name);
		return result;
	}
	_tmp30_ = lexer_check_if_unit (self);
	if (_tmp30_) {
		LexerToken* _tmp31_;
		_tmp31_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_UNIT);
		result = _tmp31_;
		_g_free0 (name);
		return result;
	} else {
		LexerToken* _tmp32_;
		_tmp32_ = lexer_insert_token (self, LEXER_TOKEN_TYPE_VARIABLE);
		result = _tmp32_;
		_g_free0 (name);
		return result;
	}
	_g_free0 (name);
}


static void lexer_class_init (LexerClass * klass) {
	lexer_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (LexerPrivate));
	G_OBJECT_CLASS (klass)->finalize = lexer_finalize;
}


static void lexer_instance_init (Lexer * self) {
	self->priv = LEXER_GET_PRIVATE (self);
}


static void lexer_finalize (GObject * obj) {
	Lexer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_LEXER, Lexer);
	_parser_unref0 (self->priv->parser);
	_g_object_unref0 (self->priv->prelexer);
	__g_list_free__g_object_unref0_0 (self->tokens);
	G_OBJECT_CLASS (lexer_parent_class)->finalize (obj);
}


GType lexer_get_type (void) {
	static volatile gsize lexer_type_id__volatile = 0;
	if (g_once_init_enter (&lexer_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (LexerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) lexer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Lexer), 0, (GInstanceInitFunc) lexer_instance_init, NULL };
		GType lexer_type_id;
		lexer_type_id = g_type_register_static (G_TYPE_OBJECT, "Lexer", &g_define_type_info, 0);
		g_once_init_leave (&lexer_type_id__volatile, lexer_type_id);
	}
	return lexer_type_id__volatile;
}



