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

/*
 * Copyright (c) 2024-2025 focus-timer contributors
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 *
 * Authors: Kamil Prusko <kamilprusko@gmail.com>
 */

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "ft_core.h"
#include <glib-object.h>
#include <glib/gi18n-lib.h>
#include <gobject/gvaluecollector.h>
#include <stdarg.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define _ft_value_unref0(var) ((var == NULL) ? NULL : (var = (ft_value_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _FtParamSpecValue FtParamSpecValue;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
typedef struct _FtExpressionParser FtExpressionParser;
#define _ft_expression_parser_free0(var) ((var == NULL) ? NULL : (var = (ft_expression_parser_free (var), NULL)))
#define _ft_expression_unref0(var) ((var == NULL) ? NULL : (var = (ft_expression_unref (var), NULL)))
typedef struct _FtParamSpecExpression FtParamSpecExpression;
#define _ft_variable_spec_unref0(var) ((var == NULL) ? NULL : (var = (ft_variable_spec_unref (var), NULL)))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))

struct _FtParamSpecValue {
	GParamSpec parent_instance;
};

struct _FtParamSpecExpression {
	GParamSpec parent_instance;
};

static gpointer ft_value_parent_class = NULL;
static gpointer ft_boolean_value_parent_class = NULL;
static gpointer ft_timestamp_value_parent_class = NULL;
static gpointer ft_interval_value_parent_class = NULL;
static gpointer ft_string_value_parent_class = NULL;
static gpointer ft_state_value_parent_class = NULL;
static gpointer ft_status_value_parent_class = NULL;
static gpointer ft_expression_parent_class = NULL;
static gpointer ft_constant_parent_class = NULL;
static gpointer ft_variable_parent_class = NULL;
static gpointer ft_operation_parent_class = NULL;
static gpointer ft_comparison_parent_class = NULL;

VALA_EXTERN gchar* ft_quote_string (const gchar* text);
VALA_EXTERN guint ft_operator_get_precedence (FtOperator self);
static inline FtValue* ft_operator_apply_and (FtValue* value_1,
                                FtValue* value_2);
static inline FtValue* ft_operator_apply_or (FtValue* value_1,
                               FtValue* value_2);
VALA_EXTERN FtValue* ft_value_apply_eq (FtValue* self,
                            FtValue* other,
                            GError** error);
VALA_EXTERN FtValue* ft_value_apply_lt (FtValue* self,
                            FtValue* other,
                            GError** error);
VALA_EXTERN FtValue* ft_value_apply_gt (FtValue* self,
                            FtValue* other,
                            GError** error);
static GType ft_value_real_get_value_type (FtValue* self);
static gchar* ft_value_real_get_type_name (FtValue* self);
static gboolean ft_value_real_to_boolean (FtValue* self);
static gchar* ft_value_real_to_representation (FtValue* self);
static GVariant* ft_value_real_to_variant (FtValue* self);
static GVariant* ft_value_real_format (FtValue* self,
                                const gchar* name,
                                GError** error);
static FtValue* ft_value_real_apply_eq (FtValue* self,
                                 FtValue* other,
                                 GError** error);
static FtValue* ft_value_real_apply_gt (FtValue* self,
                                 FtValue* other,
                                 GError** error);
static FtValue* ft_value_real_apply_lt (FtValue* self,
                                 FtValue* other,
                                 GError** error);
static void ft_value_finalize (FtValue * obj);
static GType ft_value_get_type_once (void);
static GType ft_boolean_value_real_get_value_type (FtValue* base);
static gchar* ft_boolean_value_real_get_type_name (FtValue* base);
static gboolean ft_boolean_value_real_to_boolean (FtValue* base);
static gchar* ft_boolean_value_real_to_representation (FtValue* base);
static GVariant* ft_boolean_value_real_to_variant (FtValue* base);
static FtValue* ft_boolean_value_real_apply_eq (FtValue* base,
                                         FtValue* other,
                                         GError** error);
static void ft_boolean_value_finalize (FtValue * obj);
static GType ft_boolean_value_get_type_once (void);
static GType ft_timestamp_value_real_get_value_type (FtValue* base);
static gchar* ft_timestamp_value_real_get_type_name (FtValue* base);
static gboolean ft_timestamp_value_real_to_boolean (FtValue* base);
static gchar* ft_timestamp_value_real_to_representation (FtValue* base);
static inline gchar* ft_timestamp_value_to_string (FtTimestampValue* self);
static GVariant* ft_timestamp_value_real_to_variant (FtValue* base);
static GVariant* ft_timestamp_value_real_format (FtValue* base,
                                          const gchar* name,
                                          GError** error);
static FtValue* ft_timestamp_value_real_apply_eq (FtValue* base,
                                           FtValue* other,
                                           GError** error);
static FtValue* ft_timestamp_value_real_apply_lt (FtValue* base,
                                           FtValue* other,
                                           GError** error);
static FtValue* ft_timestamp_value_real_apply_gt (FtValue* base,
                                           FtValue* other,
                                           GError** error);
static void ft_timestamp_value_finalize (FtValue * obj);
static GType ft_timestamp_value_get_type_once (void);
static GType ft_interval_value_real_get_value_type (FtValue* base);
static gchar* ft_interval_value_real_get_type_name (FtValue* base);
static gboolean ft_interval_value_real_to_boolean (FtValue* base);
static gchar* ft_interval_value_real_to_representation (FtValue* base);
static GVariant* ft_interval_value_real_to_variant (FtValue* base);
static GVariant* ft_interval_value_real_format (FtValue* base,
                                         const gchar* name,
                                         GError** error);
static FtValue* ft_interval_value_real_apply_eq (FtValue* base,
                                          FtValue* other,
                                          GError** error);
static FtValue* ft_interval_value_real_apply_lt (FtValue* base,
                                          FtValue* other,
                                          GError** error);
static FtValue* ft_interval_value_real_apply_gt (FtValue* base,
                                          FtValue* other,
                                          GError** error);
static void ft_interval_value_finalize (FtValue * obj);
static GType ft_interval_value_get_type_once (void);
static GType ft_string_value_real_get_value_type (FtValue* base);
static gchar* ft_string_value_real_get_type_name (FtValue* base);
static gboolean ft_string_value_real_to_boolean (FtValue* base);
static gchar* ft_string_value_real_to_representation (FtValue* base);
static GVariant* ft_string_value_real_to_variant (FtValue* base);
static FtValue* ft_string_value_real_apply_eq (FtValue* base,
                                        FtValue* other,
                                        GError** error);
static FtValue* ft_string_value_real_apply_lt (FtValue* base,
                                        FtValue* other,
                                        GError** error);
static FtValue* ft_string_value_real_apply_gt (FtValue* base,
                                        FtValue* other,
                                        GError** error);
static void ft_string_value_finalize (FtValue * obj);
static GType ft_string_value_get_type_once (void);
static GType ft_state_value_real_get_value_type (FtValue* base);
static gchar* ft_state_value_real_get_type_name (FtValue* base);
static gboolean ft_state_value_real_to_boolean (FtValue* base);
static gchar* ft_state_value_real_to_representation (FtValue* base);
static GVariant* ft_state_value_real_to_variant (FtValue* base);
static GVariant* ft_state_value_real_format (FtValue* base,
                                      const gchar* name,
                                      GError** error);
static FtValue* ft_state_value_real_apply_eq (FtValue* base,
                                       FtValue* other,
                                       GError** error);
static void ft_state_value_finalize (FtValue * obj);
static GType ft_state_value_get_type_once (void);
static GType ft_status_value_real_get_value_type (FtValue* base);
static gchar* ft_status_value_real_get_type_name (FtValue* base);
static gboolean ft_status_value_real_to_boolean (FtValue* base);
static gchar* ft_status_value_real_to_representation (FtValue* base);
static GVariant* ft_status_value_real_to_variant (FtValue* base);
static FtValue* ft_status_value_real_apply_eq (FtValue* base,
                                        FtValue* other,
                                        GError** error);
static void ft_status_value_finalize (FtValue * obj);
static GType ft_status_value_get_type_once (void);
VALA_EXTERN gboolean ft_get_inner_operator (FtExpression* expression,
                                FtOperator* inner_operator);
VALA_EXTERN gchar* ft_wrap_argument (const gchar* argument_string,
                         FtOperator inner_operator,
                         FtOperator outer_operator);
static GType ft_expression_real_get_result_type (FtExpression* self);
static FtValue* ft_expression_real_evaluate (FtExpression* self,
                                      FtContext* context,
                                      GError** error);
static gchar* ft_expression_real_to_string (FtExpression* self);
VALA_EXTERN void ft_expression_parser_free (FtExpressionParser * self);
VALA_EXTERN FtExpressionParser* ft_expression_parser_new (void);
VALA_EXTERN FtExpression* ft_expression_parser_parse (FtExpressionParser* self,
                                          const gchar* text,
                                          GError** error);
static void ft_expression_finalize (FtExpression * obj);
static GType ft_expression_get_type_once (void);
static GType ft_constant_real_get_result_type (FtExpression* base);
static FtValue* ft_constant_real_evaluate (FtExpression* base,
                                    FtContext* context,
                                    GError** error);
static gchar* ft_constant_real_to_string (FtExpression* base);
static void ft_constant_finalize (FtExpression * obj);
static GType ft_constant_get_type_once (void);
static GType ft_variable_real_get_result_type (FtExpression* base);
static GType* _g_type_dup (GType* self);
static FtValue* ft_variable_real_evaluate (FtExpression* base,
                                    FtContext* context,
                                    GError** error);
static gchar* ft_variable_real_to_string (FtExpression* base);
static void ft_variable_finalize (FtExpression * obj);
static GType ft_variable_get_type_once (void);
static void _vala_array_add16 (FtExpression** * array,
                        gint* length,
                        gint* size,
                        FtExpression* value);
static FtExpression** _vala_array_dup9 (FtExpression** self,
                                 gssize length);
static FtExpression** _vala_array_dup10 (FtExpression** self,
                                  gssize length);
static GType ft_operation_real_get_result_type (FtExpression* base);
static FtValue* ft_operation_real_evaluate (FtExpression* base,
                                     FtContext* context,
                                     GError** error);
static gchar* ft_operation_argument_to_string (FtOperation* self,
                                        FtExpression* expression);
static gchar* ft_operation_real_to_string (FtExpression* base);
static void ft_operation_finalize (FtExpression * obj);
static GType ft_operation_get_type_once (void);
static GType ft_comparison_real_get_result_type (FtExpression* base);
static FtValue* ft_comparison_real_evaluate (FtExpression* base,
                                      FtContext* context,
                                      GError** error);
static gchar* ft_comparison_argument_to_string (FtComparison* self,
                                         FtExpression* expression);
static gboolean ft_comparison_argument_is_true (FtComparison* self,
                                         FtExpression* expression);
static gchar* ft_comparison_real_to_string (FtExpression* base);
static void ft_comparison_finalize (FtExpression * obj);
static GType ft_comparison_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

inline gchar*
ft_quote_string (const gchar* text)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (text != NULL, NULL);
	_tmp0_ = string_to_string (text);
	_tmp1_ = g_strconcat ("\"", _tmp0_, "\"", NULL);
	result = _tmp1_;
	return result;
}

GQuark
ft_expression_error_quark (void)
{
	return g_quark_from_static_string ("ft-expression-error-quark");
}

static GType
ft_expression_error_get_type_once (void)
{
	static const GEnumValue values[] = {{FT_EXPRESSION_ERROR_EMPTY, "FT_EXPRESSION_ERROR_EMPTY", "empty"}, {FT_EXPRESSION_ERROR_VALUE, "FT_EXPRESSION_ERROR_VALUE", "value"}, {FT_EXPRESSION_ERROR_TYPE, "FT_EXPRESSION_ERROR_TYPE", "type"}, {FT_EXPRESSION_ERROR_INVALID, "FT_EXPRESSION_ERROR_INVALID", "invalid"}, {0, NULL, NULL}};
	GType ft_expression_error_type_id;
	ft_expression_error_type_id = g_enum_register_static ("FtExpressionError", values);
	return ft_expression_error_type_id;
}

GType
ft_expression_error_get_type (void)
{
	static volatile gsize ft_expression_error_type_id__once = 0;
	if (g_once_init_enter (&ft_expression_error_type_id__once)) {
		GType ft_expression_error_type_id;
		ft_expression_error_type_id = ft_expression_error_get_type_once ();
		g_once_init_leave (&ft_expression_error_type_id__once, ft_expression_error_type_id);
	}
	return ft_expression_error_type_id__once;
}

static GType
ft_operator_category_get_type_once (void)
{
	static const GEnumValue values[] = {{FT_OPERATOR_CATEGORY_LOGICAL, "FT_OPERATOR_CATEGORY_LOGICAL", "logical"}, {FT_OPERATOR_CATEGORY_COMPARISON, "FT_OPERATOR_CATEGORY_COMPARISON", "comparison"}, {0, NULL, NULL}};
	GType ft_operator_category_type_id;
	ft_operator_category_type_id = g_enum_register_static ("FtOperatorCategory", values);
	return ft_operator_category_type_id;
}

GType
ft_operator_category_get_type (void)
{
	static volatile gsize ft_operator_category_type_id__once = 0;
	if (g_once_init_enter (&ft_operator_category_type_id__once)) {
		GType ft_operator_category_type_id;
		ft_operator_category_type_id = ft_operator_category_get_type_once ();
		g_once_init_leave (&ft_operator_category_type_id__once, ft_operator_category_type_id);
	}
	return ft_operator_category_type_id__once;
}

/**
     * Operator takes two inputs and produces one output.
     *
     * By this definition a "NOT" operation would not be an operator, but a function.
     */
FtOperatorCategory
ft_operator_get_category (FtOperator self)
{
	FtOperatorCategory result;
	switch (self) {
		case FT_OPERATOR_AND:
		case FT_OPERATOR_OR:
		{
			result = FT_OPERATOR_CATEGORY_LOGICAL;
			return result;
		}
		case FT_OPERATOR_EQ:
		case FT_OPERATOR_LT:
		case FT_OPERATOR_LTE:
		case FT_OPERATOR_GT:
		case FT_OPERATOR_GTE:
		case FT_OPERATOR_NOT_EQ:
		{
			result = FT_OPERATOR_CATEGORY_COMPARISON;
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}

guint
ft_operator_get_precedence (FtOperator self)
{
	guint result;
	switch (self) {
		case FT_OPERATOR_OR:
		{
			result = (guint) 1;
			return result;
		}
		case FT_OPERATOR_AND:
		{
			result = (guint) 2;
			return result;
		}
		case FT_OPERATOR_EQ:
		case FT_OPERATOR_LT:
		case FT_OPERATOR_LTE:
		case FT_OPERATOR_GT:
		case FT_OPERATOR_GTE:
		case FT_OPERATOR_NOT_EQ:
		{
			result = (guint) 3;
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}

void
ft_operator_foreach (GFunc func,
                     gpointer func_target)
{
	FtOperator* operators = NULL;
	FtOperator* _tmp0_;
	gint operators_length1;
	gint _operators_size_;
	FtOperator* _tmp1_;
	gint _tmp1__length1;
	_tmp0_ = g_new0 (FtOperator, 8);
	_tmp0_[0] = FT_OPERATOR_AND;
	_tmp0_[1] = FT_OPERATOR_OR;
	_tmp0_[2] = FT_OPERATOR_EQ;
	_tmp0_[3] = FT_OPERATOR_LT;
	_tmp0_[4] = FT_OPERATOR_LTE;
	_tmp0_[5] = FT_OPERATOR_GT;
	_tmp0_[6] = FT_OPERATOR_GTE;
	_tmp0_[7] = FT_OPERATOR_NOT_EQ;
	operators = _tmp0_;
	operators_length1 = 8;
	_operators_size_ = operators_length1;
	_tmp1_ = operators;
	_tmp1__length1 = operators_length1;
	{
		FtOperator* operator_collection = NULL;
		gint operator_collection_length1 = 0;
		gint _operator_collection_size_ = 0;
		gint operator_it = 0;
		operator_collection = _tmp1_;
		operator_collection_length1 = _tmp1__length1;
		for (operator_it = 0; operator_it < operator_collection_length1; operator_it = operator_it + 1) {
			FtOperator operator = 0;
			operator = operator_collection[operator_it];
			{
				func ((gpointer) ((gintptr) operator), func_target);
			}
		}
	}
	operators = (g_free (operators), NULL);
}

static inline FtValue*
ft_operator_apply_and (FtValue* value_1,
                       FtValue* value_2)
{
	gboolean _tmp0_ = FALSE;
	FtBooleanValue* _tmp1_;
	FtValue* result;
	g_return_val_if_fail (value_1 != NULL, NULL);
	g_return_val_if_fail (value_2 != NULL, NULL);
	if (ft_value_to_boolean (value_1)) {
		_tmp0_ = ft_value_to_boolean (value_2);
	} else {
		_tmp0_ = FALSE;
	}
	_tmp1_ = ft_boolean_value_new (_tmp0_);
	result = (FtValue*) _tmp1_;
	return result;
}

static inline FtValue*
ft_operator_apply_or (FtValue* value_1,
                      FtValue* value_2)
{
	gboolean _tmp0_ = FALSE;
	FtBooleanValue* _tmp1_;
	FtValue* result;
	g_return_val_if_fail (value_1 != NULL, NULL);
	g_return_val_if_fail (value_2 != NULL, NULL);
	if (ft_value_to_boolean (value_1)) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = ft_value_to_boolean (value_2);
	}
	_tmp1_ = ft_boolean_value_new (_tmp0_);
	result = (FtValue*) _tmp1_;
	return result;
}

FtValue*
ft_operator_apply (FtOperator self,
                   FtValue* value_1,
                   FtValue* value_2,
                   GError** error)
{
	GError* _inner_error0_ = NULL;
	FtValue* result;
	g_return_val_if_fail (value_1 != NULL, NULL);
	g_return_val_if_fail (value_2 != NULL, NULL);
	switch (self) {
		case FT_OPERATOR_AND:
		{
			FtValue* _tmp0_;
			_tmp0_ = ft_operator_apply_and (value_1, value_2);
			result = _tmp0_;
			return result;
		}
		case FT_OPERATOR_OR:
		{
			FtValue* _tmp1_;
			_tmp1_ = ft_operator_apply_or (value_1, value_2);
			result = _tmp1_;
			return result;
		}
		case FT_OPERATOR_EQ:
		{
			FtValue* _tmp2_ = NULL;
			FtValue* _tmp3_;
			FtValue* _tmp4_;
			_tmp3_ = ft_value_apply_eq (value_1, value_2, &_inner_error0_);
			_tmp2_ = _tmp3_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
					g_propagate_error (error, _inner_error0_);
					return NULL;
				} else {
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return NULL;
				}
			}
			_tmp4_ = _tmp2_;
			_tmp2_ = NULL;
			result = _tmp4_;
			_ft_value_unref0 (_tmp2_);
			return result;
		}
		case FT_OPERATOR_LT:
		{
			FtValue* _tmp5_ = NULL;
			FtValue* _tmp6_;
			FtValue* _tmp7_;
			_tmp6_ = ft_value_apply_lt (value_1, value_2, &_inner_error0_);
			_tmp5_ = _tmp6_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
					g_propagate_error (error, _inner_error0_);
					return NULL;
				} else {
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return NULL;
				}
			}
			_tmp7_ = _tmp5_;
			_tmp5_ = NULL;
			result = _tmp7_;
			_ft_value_unref0 (_tmp5_);
			return result;
		}
		case FT_OPERATOR_LTE:
		{
			FtValue* _tmp8_ = NULL;
			FtValue* _tmp9_;
			FtValue* _tmp10_ = NULL;
			FtValue* _tmp11_;
			FtValue* _tmp12_;
			_tmp9_ = ft_value_apply_lt (value_1, value_2, &_inner_error0_);
			_tmp8_ = _tmp9_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
					g_propagate_error (error, _inner_error0_);
					return NULL;
				} else {
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return NULL;
				}
			}
			_tmp11_ = ft_value_apply_eq (value_1, value_2, &_inner_error0_);
			_tmp10_ = _tmp11_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
					g_propagate_error (error, _inner_error0_);
					_ft_value_unref0 (_tmp8_);
					return NULL;
				} else {
					_ft_value_unref0 (_tmp8_);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return NULL;
				}
			}
			_tmp12_ = ft_operator_apply_or (_tmp8_, _tmp10_);
			result = _tmp12_;
			_ft_value_unref0 (_tmp10_);
			_ft_value_unref0 (_tmp8_);
			return result;
		}
		case FT_OPERATOR_GT:
		{
			FtValue* _tmp13_ = NULL;
			FtValue* _tmp14_;
			FtValue* _tmp15_;
			_tmp14_ = ft_value_apply_gt (value_1, value_2, &_inner_error0_);
			_tmp13_ = _tmp14_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
					g_propagate_error (error, _inner_error0_);
					return NULL;
				} else {
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return NULL;
				}
			}
			_tmp15_ = _tmp13_;
			_tmp13_ = NULL;
			result = _tmp15_;
			_ft_value_unref0 (_tmp13_);
			return result;
		}
		case FT_OPERATOR_GTE:
		{
			FtValue* _tmp16_ = NULL;
			FtValue* _tmp17_;
			FtValue* _tmp18_ = NULL;
			FtValue* _tmp19_;
			FtValue* _tmp20_;
			_tmp17_ = ft_value_apply_gt (value_1, value_2, &_inner_error0_);
			_tmp16_ = _tmp17_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
					g_propagate_error (error, _inner_error0_);
					return NULL;
				} else {
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return NULL;
				}
			}
			_tmp19_ = ft_value_apply_eq (value_1, value_2, &_inner_error0_);
			_tmp18_ = _tmp19_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
					g_propagate_error (error, _inner_error0_);
					_ft_value_unref0 (_tmp16_);
					return NULL;
				} else {
					_ft_value_unref0 (_tmp16_);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return NULL;
				}
			}
			_tmp20_ = ft_operator_apply_or (_tmp16_, _tmp18_);
			result = _tmp20_;
			_ft_value_unref0 (_tmp18_);
			_ft_value_unref0 (_tmp16_);
			return result;
		}
		case FT_OPERATOR_NOT_EQ:
		{
			FtValue* _tmp21_ = NULL;
			FtValue* _tmp22_;
			FtBooleanValue* _tmp23_;
			_tmp22_ = ft_value_apply_eq (value_1, value_2, &_inner_error0_);
			_tmp21_ = _tmp22_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
					g_propagate_error (error, _inner_error0_);
					return NULL;
				} else {
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return NULL;
				}
			}
			_tmp23_ = ft_boolean_value_new (!ft_value_to_boolean (_tmp21_));
			result = (FtValue*) _tmp23_;
			_ft_value_unref0 (_tmp21_);
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}

GType
ft_operator_get_result_type (FtOperator self,
                             GType value_type_1,
                             GType value_type_2)
{
	GType result;
	switch (ft_operator_get_category (self)) {
		case FT_OPERATOR_CATEGORY_COMPARISON:
		{
			result = FT_TYPE_BOOLEAN_VALUE;
			return result;
		}
		case FT_OPERATOR_CATEGORY_LOGICAL:
		{
			result = FT_TYPE_BOOLEAN_VALUE;
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}

gchar*
ft_operator_to_string (FtOperator self)
{
	gchar* result;
	switch (self) {
		case FT_OPERATOR_AND:
		{
			gchar* _tmp0_;
			_tmp0_ = g_strdup ("&&");
			result = _tmp0_;
			return result;
		}
		case FT_OPERATOR_OR:
		{
			gchar* _tmp1_;
			_tmp1_ = g_strdup ("||");
			result = _tmp1_;
			return result;
		}
		case FT_OPERATOR_EQ:
		{
			gchar* _tmp2_;
			_tmp2_ = g_strdup ("==");
			result = _tmp2_;
			return result;
		}
		case FT_OPERATOR_LT:
		{
			gchar* _tmp3_;
			_tmp3_ = g_strdup ("<");
			result = _tmp3_;
			return result;
		}
		case FT_OPERATOR_LTE:
		{
			gchar* _tmp4_;
			_tmp4_ = g_strdup ("<=");
			result = _tmp4_;
			return result;
		}
		case FT_OPERATOR_GT:
		{
			gchar* _tmp5_;
			_tmp5_ = g_strdup (">");
			result = _tmp5_;
			return result;
		}
		case FT_OPERATOR_GTE:
		{
			gchar* _tmp6_;
			_tmp6_ = g_strdup (">=");
			result = _tmp6_;
			return result;
		}
		case FT_OPERATOR_NOT_EQ:
		{
			gchar* _tmp7_;
			_tmp7_ = g_strdup ("!=");
			result = _tmp7_;
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}

static GType
ft_operator_get_type_once (void)
{
	static const GEnumValue values[] = {{FT_OPERATOR_INVALID, "FT_OPERATOR_INVALID", "invalid"}, {FT_OPERATOR_AND, "FT_OPERATOR_AND", "and"}, {FT_OPERATOR_OR, "FT_OPERATOR_OR", "or"}, {FT_OPERATOR_EQ, "FT_OPERATOR_EQ", "eq"}, {FT_OPERATOR_LT, "FT_OPERATOR_LT", "lt"}, {FT_OPERATOR_LTE, "FT_OPERATOR_LTE", "lte"}, {FT_OPERATOR_GT, "FT_OPERATOR_GT", "gt"}, {FT_OPERATOR_GTE, "FT_OPERATOR_GTE", "gte"}, {FT_OPERATOR_NOT_EQ, "FT_OPERATOR_NOT_EQ", "not-eq"}, {0, NULL, NULL}};
	GType ft_operator_type_id;
	ft_operator_type_id = g_enum_register_static ("FtOperator", values);
	return ft_operator_type_id;
}

GType
ft_operator_get_type (void)
{
	static volatile gsize ft_operator_type_id__once = 0;
	if (g_once_init_enter (&ft_operator_type_id__once)) {
		GType ft_operator_type_id;
		ft_operator_type_id = ft_operator_get_type_once ();
		g_once_init_leave (&ft_operator_type_id__once, ft_operator_type_id);
	}
	return ft_operator_type_id__once;
}

static GType
ft_value_real_get_value_type (FtValue* self)
{
	GType _tmp0_ = G_TYPE_NONE;
	g_critical ("Type `%s' does not implement abstract method `ft_value_get_value_type'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return _tmp0_;
}

GType
ft_value_get_value_type (FtValue* self)
{
	FtValueClass* _klass_;
	g_return_val_if_fail (self != NULL, G_TYPE_INVALID);
	_klass_ = FT_VALUE_GET_CLASS (self);
	if (_klass_->get_value_type) {
		return _klass_->get_value_type (self);
	}
	return G_TYPE_INVALID;
}

static gchar*
ft_value_real_get_type_name (FtValue* self)
{
	g_critical ("Type `%s' does not implement abstract method `ft_value_get_type_name'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

gchar*
ft_value_get_type_name (FtValue* self)
{
	FtValueClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = FT_VALUE_GET_CLASS (self);
	if (_klass_->get_type_name) {
		return _klass_->get_type_name (self);
	}
	return NULL;
}

static gboolean
ft_value_real_to_boolean (FtValue* self)
{
	gboolean _tmp0_ = FALSE;
	g_critical ("Type `%s' does not implement abstract method `ft_value_to_boolean'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return _tmp0_;
}

gboolean
ft_value_to_boolean (FtValue* self)
{
	FtValueClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = FT_VALUE_GET_CLASS (self);
	if (_klass_->to_boolean) {
		return _klass_->to_boolean (self);
	}
	return FALSE;
}

static gchar*
ft_value_real_to_representation (FtValue* self)
{
	g_critical ("Type `%s' does not implement abstract method `ft_value_to_representation'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

gchar*
ft_value_to_representation (FtValue* self)
{
	FtValueClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = FT_VALUE_GET_CLASS (self);
	if (_klass_->to_representation) {
		return _klass_->to_representation (self);
	}
	return NULL;
}

static GVariant*
ft_value_real_to_variant (FtValue* self)
{
	g_critical ("Type `%s' does not implement abstract method `ft_value_to_variant'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

GVariant*
ft_value_to_variant (FtValue* self)
{
	FtValueClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = FT_VALUE_GET_CLASS (self);
	if (_klass_->to_variant) {
		return _klass_->to_variant (self);
	}
	return NULL;
}

static GVariant*
ft_value_real_format (FtValue* self,
                      const gchar* name,
                      GError** error)
{
	GVariant* _tmp1_;
	GError* _inner_error0_ = NULL;
	GVariant* result;
	g_return_val_if_fail (name != NULL, NULL);
	if (g_strcmp0 (name, "") != 0) {
		GError* _tmp0_;
		_tmp0_ = g_error_new (FT_EXPRESSION_ERROR, FT_EXPRESSION_ERROR_INVALID, _ ("Unknown format \"%s\""), name);
		_inner_error0_ = _tmp0_;
		if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
			g_propagate_error (error, _inner_error0_);
			return NULL;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp1_ = ft_value_to_variant (self);
	result = _tmp1_;
	return result;
}

GVariant*
ft_value_format (FtValue* self,
                 const gchar* name,
                 GError** error)
{
	FtValueClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = FT_VALUE_GET_CLASS (self);
	if (_klass_->format) {
		return _klass_->format (self, name, error);
	}
	return NULL;
}

static FtValue*
ft_value_real_apply_eq (FtValue* self,
                        FtValue* other,
                        GError** error)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	GError* _tmp4_;
	GError* _tmp5_;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (other != NULL, NULL);
	_tmp0_ = ft_value_get_type_name (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = ft_value_get_type_name (other);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_error_new (FT_EXPRESSION_ERROR, FT_EXPRESSION_ERROR_INVALID, "Comparison operation not supported for types '%s' and '%s'", _tmp1_, _tmp3_);
	_tmp5_ = _tmp4_;
	_g_free0 (_tmp3_);
	_g_free0 (_tmp1_);
	_inner_error0_ = _tmp5_;
	if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
		g_propagate_error (error, _inner_error0_);
		return NULL;
	} else {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
}

FtValue*
ft_value_apply_eq (FtValue* self,
                   FtValue* other,
                   GError** error)
{
	FtValueClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = FT_VALUE_GET_CLASS (self);
	if (_klass_->apply_eq) {
		return _klass_->apply_eq (self, other, error);
	}
	return NULL;
}

static FtValue*
ft_value_real_apply_gt (FtValue* self,
                        FtValue* other,
                        GError** error)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	GError* _tmp4_;
	GError* _tmp5_;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (other != NULL, NULL);
	_tmp0_ = ft_value_get_type_name (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = ft_value_get_type_name (other);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_error_new (FT_EXPRESSION_ERROR, FT_EXPRESSION_ERROR_INVALID, "Relational operation not supported for types '%s' and '%s'", _tmp1_, _tmp3_);
	_tmp5_ = _tmp4_;
	_g_free0 (_tmp3_);
	_g_free0 (_tmp1_);
	_inner_error0_ = _tmp5_;
	if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
		g_propagate_error (error, _inner_error0_);
		return NULL;
	} else {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
}

FtValue*
ft_value_apply_gt (FtValue* self,
                   FtValue* other,
                   GError** error)
{
	FtValueClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = FT_VALUE_GET_CLASS (self);
	if (_klass_->apply_gt) {
		return _klass_->apply_gt (self, other, error);
	}
	return NULL;
}

static FtValue*
ft_value_real_apply_lt (FtValue* self,
                        FtValue* other,
                        GError** error)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	GError* _tmp4_;
	GError* _tmp5_;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (other != NULL, NULL);
	_tmp0_ = ft_value_get_type_name (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = ft_value_get_type_name (other);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_error_new (FT_EXPRESSION_ERROR, FT_EXPRESSION_ERROR_INVALID, "Relational operation not supported for types '%s' and '%s'", _tmp1_, _tmp3_);
	_tmp5_ = _tmp4_;
	_g_free0 (_tmp3_);
	_g_free0 (_tmp1_);
	_inner_error0_ = _tmp5_;
	if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
		g_propagate_error (error, _inner_error0_);
		return NULL;
	} else {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
}

FtValue*
ft_value_apply_lt (FtValue* self,
                   FtValue* other,
                   GError** error)
{
	FtValueClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = FT_VALUE_GET_CLASS (self);
	if (_klass_->apply_lt) {
		return _klass_->apply_lt (self, other, error);
	}
	return NULL;
}

FtValue*
ft_value_construct (GType object_type)
{
	FtValue* self = NULL;
	self = (FtValue*) g_type_create_instance (object_type);
	return self;
}

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

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

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

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

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

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

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

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

void
ft_value_set_value (GValue* value,
                    gpointer v_object)
{
	FtValue * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, FT_TYPE_VALUE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, FT_TYPE_VALUE));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		ft_value_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		ft_value_unref (old);
	}
}

void
ft_value_take_value (GValue* value,
                     gpointer v_object)
{
	FtValue * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, FT_TYPE_VALUE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, FT_TYPE_VALUE));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		ft_value_unref (old);
	}
}

static void
ft_value_class_init (FtValueClass * klass,
                     gpointer klass_data)
{
	ft_value_parent_class = g_type_class_peek_parent (klass);
	((FtValueClass *) klass)->finalize = ft_value_finalize;
	((FtValueClass *) klass)->get_value_type = (GType (*) (FtValue*)) ft_value_real_get_value_type;
	((FtValueClass *) klass)->get_type_name = (gchar* (*) (FtValue*)) ft_value_real_get_type_name;
	((FtValueClass *) klass)->to_boolean = (gboolean (*) (FtValue*)) ft_value_real_to_boolean;
	((FtValueClass *) klass)->to_representation = (gchar* (*) (FtValue*)) ft_value_real_to_representation;
	((FtValueClass *) klass)->to_variant = (GVariant* (*) (FtValue*)) ft_value_real_to_variant;
	((FtValueClass *) klass)->format = (GVariant* (*) (FtValue*, const gchar*, GError**)) ft_value_real_format;
	((FtValueClass *) klass)->apply_eq = (FtValue* (*) (FtValue*, FtValue*, GError**)) ft_value_real_apply_eq;
	((FtValueClass *) klass)->apply_gt = (FtValue* (*) (FtValue*, FtValue*, GError**)) ft_value_real_apply_gt;
	((FtValueClass *) klass)->apply_lt = (FtValue* (*) (FtValue*, FtValue*, GError**)) ft_value_real_apply_lt;
}

static void
ft_value_instance_init (FtValue * self,
                        gpointer klass)
{
	self->ref_count = 1;
}

static void
ft_value_finalize (FtValue * obj)
{
	FtValue * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_VALUE, FtValue);
	g_signal_handlers_destroy (self);
}

static GType
ft_value_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { ft_value_value_init, ft_value_value_free_value, ft_value_value_copy_value, ft_value_value_peek_pointer, "p", ft_value_value_collect_value, "p", ft_value_value_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (FtValueClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_value_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtValue), 0, (GInstanceInitFunc) ft_value_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType ft_value_type_id;
	ft_value_type_id = g_type_register_fundamental (g_type_fundamental_next (), "FtValue", &g_define_type_info, &g_define_type_fundamental_info, G_TYPE_FLAG_ABSTRACT);
	return ft_value_type_id;
}

GType
ft_value_get_type (void)
{
	static volatile gsize ft_value_type_id__once = 0;
	if (g_once_init_enter (&ft_value_type_id__once)) {
		GType ft_value_type_id;
		ft_value_type_id = ft_value_get_type_once ();
		g_once_init_leave (&ft_value_type_id__once, ft_value_type_id);
	}
	return ft_value_type_id__once;
}

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

void
ft_value_unref (gpointer instance)
{
	FtValue * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		FT_VALUE_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

FtBooleanValue*
ft_boolean_value_construct (GType object_type,
                            gboolean value)
{
	FtBooleanValue* self = NULL;
	self = (FtBooleanValue*) ft_value_construct (object_type);
	self->data = value;
	return self;
}

FtBooleanValue*
ft_boolean_value_new (gboolean value)
{
	return ft_boolean_value_construct (FT_TYPE_BOOLEAN_VALUE, value);
}

static GType
ft_boolean_value_real_get_value_type (FtValue* base)
{
	FtBooleanValue * self;
	GType result;
	self = (FtBooleanValue*) base;
	result = FT_TYPE_BOOLEAN_VALUE;
	return result;
}

static gchar*
ft_boolean_value_real_get_type_name (FtValue* base)
{
	FtBooleanValue * self;
	gchar* _tmp0_;
	gchar* result;
	self = (FtBooleanValue*) base;
	_tmp0_ = g_strdup ("boolean");
	result = _tmp0_;
	return result;
}

static gboolean
ft_boolean_value_real_to_boolean (FtValue* base)
{
	FtBooleanValue * self;
	gboolean result;
	self = (FtBooleanValue*) base;
	result = self->data;
	return result;
}

static gchar*
bool_to_string (gboolean self)
{
	gchar* result;
	if (self) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("true");
		result = _tmp0_;
		return result;
	} else {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("false");
		result = _tmp1_;
		return result;
	}
}

static gchar*
ft_boolean_value_real_to_representation (FtValue* base)
{
	FtBooleanValue * self;
	gchar* _tmp0_;
	gchar* result;
	self = (FtBooleanValue*) base;
	_tmp0_ = bool_to_string (self->data);
	result = _tmp0_;
	return result;
}

static GVariant*
ft_boolean_value_real_to_variant (FtValue* base)
{
	FtBooleanValue * self;
	GVariant* _tmp0_;
	GVariant* result;
	self = (FtBooleanValue*) base;
	_tmp0_ = g_variant_new_boolean (self->data);
	g_variant_ref_sink (_tmp0_);
	result = _tmp0_;
	return result;
}

static gpointer
_ft_value_ref0 (gpointer self)
{
	return self ? ft_value_ref (self) : NULL;
}

static FtValue*
ft_boolean_value_real_apply_eq (FtValue* base,
                                FtValue* other,
                                GError** error)
{
	FtBooleanValue * self;
	FtBooleanValue* other_boolean = NULL;
	FtBooleanValue* _tmp0_;
	FtBooleanValue* _tmp1_;
	FtValue* _tmp4_ = NULL;
	FtValue* _tmp5_;
	FtValue* _tmp6_;
	GError* _inner_error0_ = NULL;
	FtValue* result;
	self = (FtBooleanValue*) base;
	g_return_val_if_fail (other != NULL, NULL);
	_tmp0_ = _ft_value_ref0 (FT_IS_BOOLEAN_VALUE (other) ? ((FtBooleanValue*) other) : NULL);
	other_boolean = _tmp0_;
	_tmp1_ = other_boolean;
	if (_tmp1_ != NULL) {
		FtBooleanValue* _tmp2_;
		FtBooleanValue* _tmp3_;
		_tmp2_ = other_boolean;
		_tmp3_ = ft_boolean_value_new (self->data == _tmp2_->data);
		result = (FtValue*) _tmp3_;
		_ft_value_unref0 (other_boolean);
		return result;
	}
	_tmp5_ = FT_VALUE_CLASS (ft_boolean_value_parent_class)->apply_eq (G_TYPE_CHECK_INSTANCE_CAST (self, FT_TYPE_VALUE, FtValue), other, &_inner_error0_);
	_tmp4_ = _tmp5_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_ft_value_unref0 (other_boolean);
			return NULL;
		} else {
			_ft_value_unref0 (other_boolean);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp6_ = _tmp4_;
	_tmp4_ = NULL;
	result = _tmp6_;
	_ft_value_unref0 (_tmp4_);
	_ft_value_unref0 (other_boolean);
	return result;
}

static void
ft_boolean_value_class_init (FtBooleanValueClass * klass,
                             gpointer klass_data)
{
	ft_boolean_value_parent_class = g_type_class_peek_parent (klass);
	((FtValueClass *) klass)->finalize = ft_boolean_value_finalize;
	((FtValueClass *) klass)->get_value_type = (GType (*) (FtValue*)) ft_boolean_value_real_get_value_type;
	((FtValueClass *) klass)->get_type_name = (gchar* (*) (FtValue*)) ft_boolean_value_real_get_type_name;
	((FtValueClass *) klass)->to_boolean = (gboolean (*) (FtValue*)) ft_boolean_value_real_to_boolean;
	((FtValueClass *) klass)->to_representation = (gchar* (*) (FtValue*)) ft_boolean_value_real_to_representation;
	((FtValueClass *) klass)->to_variant = (GVariant* (*) (FtValue*)) ft_boolean_value_real_to_variant;
	((FtValueClass *) klass)->apply_eq = (FtValue* (*) (FtValue*, FtValue*, GError**)) ft_boolean_value_real_apply_eq;
}

static void
ft_boolean_value_instance_init (FtBooleanValue * self,
                                gpointer klass)
{
}

static void
ft_boolean_value_finalize (FtValue * obj)
{
	FtBooleanValue * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_BOOLEAN_VALUE, FtBooleanValue);
	FT_VALUE_CLASS (ft_boolean_value_parent_class)->finalize (obj);
}

static GType
ft_boolean_value_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtBooleanValueClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_boolean_value_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtBooleanValue), 0, (GInstanceInitFunc) ft_boolean_value_instance_init, NULL };
	GType ft_boolean_value_type_id;
	ft_boolean_value_type_id = g_type_register_static (FT_TYPE_VALUE, "FtBooleanValue", &g_define_type_info, 0);
	return ft_boolean_value_type_id;
}

GType
ft_boolean_value_get_type (void)
{
	static volatile gsize ft_boolean_value_type_id__once = 0;
	if (g_once_init_enter (&ft_boolean_value_type_id__once)) {
		GType ft_boolean_value_type_id;
		ft_boolean_value_type_id = ft_boolean_value_get_type_once ();
		g_once_init_leave (&ft_boolean_value_type_id__once, ft_boolean_value_type_id);
	}
	return ft_boolean_value_type_id__once;
}

FtTimestampValue*
ft_timestamp_value_construct (GType object_type,
                              gint64 timestamp)
{
	FtTimestampValue* self = NULL;
	self = (FtTimestampValue*) ft_value_construct (object_type);
	self->data = timestamp;
	return self;
}

FtTimestampValue*
ft_timestamp_value_new (gint64 timestamp)
{
	return ft_timestamp_value_construct (FT_TYPE_TIMESTAMP_VALUE, timestamp);
}

static GType
ft_timestamp_value_real_get_value_type (FtValue* base)
{
	FtTimestampValue * self;
	GType result;
	self = (FtTimestampValue*) base;
	result = FT_TYPE_TIMESTAMP_VALUE;
	return result;
}

static gchar*
ft_timestamp_value_real_get_type_name (FtValue* base)
{
	FtTimestampValue * self;
	gchar* _tmp0_;
	gchar* result;
	self = (FtTimestampValue*) base;
	_tmp0_ = g_strdup ("timestamp");
	result = _tmp0_;
	return result;
}

static gboolean
ft_timestamp_value_real_to_boolean (FtValue* base)
{
	FtTimestampValue * self;
	gboolean result;
	self = (FtTimestampValue*) base;
	result = ft_timestamp_is_defined (self->data);
	return result;
}

static gchar*
ft_timestamp_value_real_to_representation (FtValue* base)
{
	FtTimestampValue * self;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	self = (FtTimestampValue*) base;
	_tmp0_ = ft_timestamp_value_to_string (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = ft_quote_string (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	result = _tmp3_;
	return result;
}

static GVariant*
ft_timestamp_value_real_to_variant (FtValue* base)
{
	FtTimestampValue * self;
	GVariant* _tmp0_;
	GVariant* result;
	self = (FtTimestampValue*) base;
	_tmp0_ = g_variant_new_int64 (self->data);
	g_variant_ref_sink (_tmp0_);
	result = _tmp0_;
	return result;
}

static GVariant*
ft_timestamp_value_real_format (FtValue* base,
                                const gchar* name,
                                GError** error)
{
	FtTimestampValue * self;
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
	static GQuark _tmp1_label0 = 0;
	static GQuark _tmp1_label1 = 0;
	static GQuark _tmp1_label2 = 0;
	GError* _inner_error0_ = NULL;
	GVariant* result;
	self = (FtTimestampValue*) base;
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = name;
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("iso8601")))) {
		switch (0) {
			default:
			{
				gchar* _tmp3_;
				gchar* _tmp4_;
				GVariant* _tmp5_;
				GVariant* _tmp6_;
				_tmp3_ = ft_timestamp_to_iso8601 (self->data);
				_tmp4_ = _tmp3_;
				_tmp5_ = g_variant_new_string (_tmp4_);
				g_variant_ref_sink (_tmp5_);
				_tmp6_ = _tmp5_;
				_g_free0 (_tmp4_);
				result = _tmp6_;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("seconds")))) {
		switch (0) {
			default:
			{
				GVariant* _tmp7_;
				_tmp7_ = g_variant_new_double (ft_timestamp_to_seconds (self->data));
				g_variant_ref_sink (_tmp7_);
				result = _tmp7_;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label2) ? _tmp1_label2 : (_tmp1_label2 = g_quark_from_static_string ("microseconds")))) {
		switch (0) {
			default:
			{
				GVariant* _tmp8_;
				_tmp8_ = ft_value_to_variant ((FtValue*) self);
				result = _tmp8_;
				return result;
			}
		}
	} else {
		switch (0) {
			default:
			{
				GVariant* _tmp9_ = NULL;
				GVariant* _tmp10_;
				GVariant* _tmp11_;
				_tmp10_ = FT_VALUE_CLASS (ft_timestamp_value_parent_class)->format (G_TYPE_CHECK_INSTANCE_CAST (self, FT_TYPE_VALUE, FtValue), name, &_inner_error0_);
				_tmp9_ = _tmp10_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
						g_propagate_error (error, _inner_error0_);
						return NULL;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
						g_clear_error (&_inner_error0_);
						return NULL;
					}
				}
				_tmp11_ = _tmp9_;
				_tmp9_ = NULL;
				result = _tmp11_;
				_g_variant_unref0 (_tmp9_);
				return result;
			}
		}
	}
}

static inline gchar*
ft_timestamp_value_to_string (FtTimestampValue* self)
{
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = ft_timestamp_to_iso8601 (self->data);
	result = _tmp0_;
	return result;
}

static FtValue*
ft_timestamp_value_real_apply_eq (FtValue* base,
                                  FtValue* other,
                                  GError** error)
{
	FtTimestampValue * self;
	FtTimestampValue* other_timestamp = NULL;
	FtTimestampValue* _tmp0_;
	FtTimestampValue* _tmp1_;
	FtStringValue* other_string = NULL;
	FtStringValue* _tmp4_;
	FtStringValue* _tmp5_;
	FtValue* _tmp12_ = NULL;
	FtValue* _tmp13_;
	FtValue* _tmp14_;
	GError* _inner_error0_ = NULL;
	FtValue* result;
	self = (FtTimestampValue*) base;
	g_return_val_if_fail (other != NULL, NULL);
	_tmp0_ = _ft_value_ref0 (FT_IS_TIMESTAMP_VALUE (other) ? ((FtTimestampValue*) other) : NULL);
	other_timestamp = _tmp0_;
	_tmp1_ = other_timestamp;
	if (_tmp1_ != NULL) {
		FtTimestampValue* _tmp2_;
		FtBooleanValue* _tmp3_;
		_tmp2_ = other_timestamp;
		_tmp3_ = ft_boolean_value_new (self->data == _tmp2_->data);
		result = (FtValue*) _tmp3_;
		_ft_value_unref0 (other_timestamp);
		return result;
	}
	_tmp4_ = _ft_value_ref0 (FT_IS_STRING_VALUE (other) ? ((FtStringValue*) other) : NULL);
	other_string = _tmp4_;
	_tmp5_ = other_string;
	if (_tmp5_ != NULL) {
		gchar* _tmp6_;
		gchar* _tmp7_;
		FtStringValue* _tmp8_;
		const gchar* _tmp9_;
		FtBooleanValue* _tmp10_;
		FtValue* _tmp11_;
		_tmp6_ = ft_timestamp_value_to_string (self);
		_tmp7_ = _tmp6_;
		_tmp8_ = other_string;
		_tmp9_ = _tmp8_->data;
		_tmp10_ = ft_boolean_value_new (g_strcmp0 (_tmp7_, _tmp9_) == 0);
		_tmp11_ = (FtValue*) _tmp10_;
		_g_free0 (_tmp7_);
		result = _tmp11_;
		_ft_value_unref0 (other_string);
		_ft_value_unref0 (other_timestamp);
		return result;
	}
	_tmp13_ = FT_VALUE_CLASS (ft_timestamp_value_parent_class)->apply_eq (G_TYPE_CHECK_INSTANCE_CAST (self, FT_TYPE_VALUE, FtValue), other, &_inner_error0_);
	_tmp12_ = _tmp13_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_ft_value_unref0 (other_string);
			_ft_value_unref0 (other_timestamp);
			return NULL;
		} else {
			_ft_value_unref0 (other_string);
			_ft_value_unref0 (other_timestamp);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp14_ = _tmp12_;
	_tmp12_ = NULL;
	result = _tmp14_;
	_ft_value_unref0 (_tmp12_);
	_ft_value_unref0 (other_string);
	_ft_value_unref0 (other_timestamp);
	return result;
}

static FtValue*
ft_timestamp_value_real_apply_lt (FtValue* base,
                                  FtValue* other,
                                  GError** error)
{
	FtTimestampValue * self;
	FtTimestampValue* other_timestamp = NULL;
	FtTimestampValue* _tmp0_;
	FtTimestampValue* _tmp1_;
	FtValue* _tmp4_ = NULL;
	FtValue* _tmp5_;
	FtValue* _tmp6_;
	GError* _inner_error0_ = NULL;
	FtValue* result;
	self = (FtTimestampValue*) base;
	g_return_val_if_fail (other != NULL, NULL);
	_tmp0_ = _ft_value_ref0 (FT_IS_TIMESTAMP_VALUE (other) ? ((FtTimestampValue*) other) : NULL);
	other_timestamp = _tmp0_;
	_tmp1_ = other_timestamp;
	if (_tmp1_ != NULL) {
		FtTimestampValue* _tmp2_;
		FtBooleanValue* _tmp3_;
		_tmp2_ = other_timestamp;
		_tmp3_ = ft_boolean_value_new (self->data < _tmp2_->data);
		result = (FtValue*) _tmp3_;
		_ft_value_unref0 (other_timestamp);
		return result;
	}
	_tmp5_ = FT_VALUE_CLASS (ft_timestamp_value_parent_class)->apply_lt (G_TYPE_CHECK_INSTANCE_CAST (self, FT_TYPE_VALUE, FtValue), other, &_inner_error0_);
	_tmp4_ = _tmp5_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_ft_value_unref0 (other_timestamp);
			return NULL;
		} else {
			_ft_value_unref0 (other_timestamp);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp6_ = _tmp4_;
	_tmp4_ = NULL;
	result = _tmp6_;
	_ft_value_unref0 (_tmp4_);
	_ft_value_unref0 (other_timestamp);
	return result;
}

static FtValue*
ft_timestamp_value_real_apply_gt (FtValue* base,
                                  FtValue* other,
                                  GError** error)
{
	FtTimestampValue * self;
	FtTimestampValue* other_timestamp = NULL;
	FtTimestampValue* _tmp0_;
	FtTimestampValue* _tmp1_;
	FtValue* _tmp4_ = NULL;
	FtValue* _tmp5_;
	FtValue* _tmp6_;
	GError* _inner_error0_ = NULL;
	FtValue* result;
	self = (FtTimestampValue*) base;
	g_return_val_if_fail (other != NULL, NULL);
	_tmp0_ = _ft_value_ref0 (FT_IS_TIMESTAMP_VALUE (other) ? ((FtTimestampValue*) other) : NULL);
	other_timestamp = _tmp0_;
	_tmp1_ = other_timestamp;
	if (_tmp1_ != NULL) {
		FtTimestampValue* _tmp2_;
		FtBooleanValue* _tmp3_;
		_tmp2_ = other_timestamp;
		_tmp3_ = ft_boolean_value_new (self->data > _tmp2_->data);
		result = (FtValue*) _tmp3_;
		_ft_value_unref0 (other_timestamp);
		return result;
	}
	_tmp5_ = FT_VALUE_CLASS (ft_timestamp_value_parent_class)->apply_gt (G_TYPE_CHECK_INSTANCE_CAST (self, FT_TYPE_VALUE, FtValue), other, &_inner_error0_);
	_tmp4_ = _tmp5_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_ft_value_unref0 (other_timestamp);
			return NULL;
		} else {
			_ft_value_unref0 (other_timestamp);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp6_ = _tmp4_;
	_tmp4_ = NULL;
	result = _tmp6_;
	_ft_value_unref0 (_tmp4_);
	_ft_value_unref0 (other_timestamp);
	return result;
}

static void
ft_timestamp_value_class_init (FtTimestampValueClass * klass,
                               gpointer klass_data)
{
	ft_timestamp_value_parent_class = g_type_class_peek_parent (klass);
	((FtValueClass *) klass)->finalize = ft_timestamp_value_finalize;
	((FtValueClass *) klass)->get_value_type = (GType (*) (FtValue*)) ft_timestamp_value_real_get_value_type;
	((FtValueClass *) klass)->get_type_name = (gchar* (*) (FtValue*)) ft_timestamp_value_real_get_type_name;
	((FtValueClass *) klass)->to_boolean = (gboolean (*) (FtValue*)) ft_timestamp_value_real_to_boolean;
	((FtValueClass *) klass)->to_representation = (gchar* (*) (FtValue*)) ft_timestamp_value_real_to_representation;
	((FtValueClass *) klass)->to_variant = (GVariant* (*) (FtValue*)) ft_timestamp_value_real_to_variant;
	((FtValueClass *) klass)->format = (GVariant* (*) (FtValue*, const gchar*, GError**)) ft_timestamp_value_real_format;
	((FtValueClass *) klass)->apply_eq = (FtValue* (*) (FtValue*, FtValue*, GError**)) ft_timestamp_value_real_apply_eq;
	((FtValueClass *) klass)->apply_lt = (FtValue* (*) (FtValue*, FtValue*, GError**)) ft_timestamp_value_real_apply_lt;
	((FtValueClass *) klass)->apply_gt = (FtValue* (*) (FtValue*, FtValue*, GError**)) ft_timestamp_value_real_apply_gt;
}

static void
ft_timestamp_value_instance_init (FtTimestampValue * self,
                                  gpointer klass)
{
}

static void
ft_timestamp_value_finalize (FtValue * obj)
{
	FtTimestampValue * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_TIMESTAMP_VALUE, FtTimestampValue);
	FT_VALUE_CLASS (ft_timestamp_value_parent_class)->finalize (obj);
}

static GType
ft_timestamp_value_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtTimestampValueClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_timestamp_value_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtTimestampValue), 0, (GInstanceInitFunc) ft_timestamp_value_instance_init, NULL };
	GType ft_timestamp_value_type_id;
	ft_timestamp_value_type_id = g_type_register_static (FT_TYPE_VALUE, "FtTimestampValue", &g_define_type_info, 0);
	return ft_timestamp_value_type_id;
}

GType
ft_timestamp_value_get_type (void)
{
	static volatile gsize ft_timestamp_value_type_id__once = 0;
	if (g_once_init_enter (&ft_timestamp_value_type_id__once)) {
		GType ft_timestamp_value_type_id;
		ft_timestamp_value_type_id = ft_timestamp_value_get_type_once ();
		g_once_init_leave (&ft_timestamp_value_type_id__once, ft_timestamp_value_type_id);
	}
	return ft_timestamp_value_type_id__once;
}

FtIntervalValue*
ft_interval_value_construct (GType object_type,
                             gint64 interval)
{
	FtIntervalValue* self = NULL;
	self = (FtIntervalValue*) ft_value_construct (object_type);
	self->data = interval;
	return self;
}

FtIntervalValue*
ft_interval_value_new (gint64 interval)
{
	return ft_interval_value_construct (FT_TYPE_INTERVAL_VALUE, interval);
}

static GType
ft_interval_value_real_get_value_type (FtValue* base)
{
	FtIntervalValue * self;
	GType result;
	self = (FtIntervalValue*) base;
	result = FT_TYPE_INTERVAL_VALUE;
	return result;
}

static gchar*
ft_interval_value_real_get_type_name (FtValue* base)
{
	FtIntervalValue * self;
	gchar* _tmp0_;
	gchar* result;
	self = (FtIntervalValue*) base;
	_tmp0_ = g_strdup ("interval");
	result = _tmp0_;
	return result;
}

static gboolean
ft_interval_value_real_to_boolean (FtValue* base)
{
	FtIntervalValue * self;
	gboolean result;
	self = (FtIntervalValue*) base;
	result = self->data != ((gint64) 0);
	return result;
}

static gchar*
ft_interval_value_real_to_representation (FtValue* base)
{
	FtIntervalValue * self;
	gchar* _tmp0_;
	gchar* result;
	self = (FtIntervalValue*) base;
	_tmp0_ = g_strdup_printf ("%" G_GINT64_FORMAT, self->data);
	result = _tmp0_;
	return result;
}

static GVariant*
ft_interval_value_real_to_variant (FtValue* base)
{
	FtIntervalValue * self;
	GVariant* _tmp0_;
	GVariant* result;
	self = (FtIntervalValue*) base;
	_tmp0_ = g_variant_new_int64 (self->data);
	g_variant_ref_sink (_tmp0_);
	result = _tmp0_;
	return result;
}

static GVariant*
ft_interval_value_real_format (FtValue* base,
                               const gchar* name,
                               GError** error)
{
	FtIntervalValue * self;
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
	static GQuark _tmp1_label0 = 0;
	static GQuark _tmp1_label1 = 0;
	static GQuark _tmp1_label2 = 0;
	GError* _inner_error0_ = NULL;
	GVariant* result;
	self = (FtIntervalValue*) base;
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = name;
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("minutes")))) {
		switch (0) {
			default:
			{
				GVariant* _tmp3_;
				_tmp3_ = g_variant_new_double (ft_timestamp_to_seconds (self->data) / 60.0);
				g_variant_ref_sink (_tmp3_);
				result = _tmp3_;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("seconds")))) {
		switch (0) {
			default:
			{
				GVariant* _tmp4_;
				_tmp4_ = g_variant_new_double (ft_timestamp_to_seconds (self->data));
				g_variant_ref_sink (_tmp4_);
				result = _tmp4_;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label2) ? _tmp1_label2 : (_tmp1_label2 = g_quark_from_static_string ("microseconds")))) {
		switch (0) {
			default:
			{
				GVariant* _tmp5_;
				_tmp5_ = ft_value_to_variant ((FtValue*) self);
				result = _tmp5_;
				return result;
			}
		}
	} else {
		switch (0) {
			default:
			{
				GVariant* _tmp6_ = NULL;
				GVariant* _tmp7_;
				GVariant* _tmp8_;
				_tmp7_ = FT_VALUE_CLASS (ft_interval_value_parent_class)->format (G_TYPE_CHECK_INSTANCE_CAST (self, FT_TYPE_VALUE, FtValue), name, &_inner_error0_);
				_tmp6_ = _tmp7_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
						g_propagate_error (error, _inner_error0_);
						return NULL;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
						g_clear_error (&_inner_error0_);
						return NULL;
					}
				}
				_tmp8_ = _tmp6_;
				_tmp6_ = NULL;
				result = _tmp8_;
				_g_variant_unref0 (_tmp6_);
				return result;
			}
		}
	}
}

static FtValue*
ft_interval_value_real_apply_eq (FtValue* base,
                                 FtValue* other,
                                 GError** error)
{
	FtIntervalValue * self;
	FtIntervalValue* other_interval = NULL;
	FtIntervalValue* _tmp0_;
	FtIntervalValue* _tmp1_;
	FtValue* _tmp4_ = NULL;
	FtValue* _tmp5_;
	FtValue* _tmp6_;
	GError* _inner_error0_ = NULL;
	FtValue* result;
	self = (FtIntervalValue*) base;
	g_return_val_if_fail (other != NULL, NULL);
	_tmp0_ = _ft_value_ref0 (FT_IS_INTERVAL_VALUE (other) ? ((FtIntervalValue*) other) : NULL);
	other_interval = _tmp0_;
	_tmp1_ = other_interval;
	if (_tmp1_ != NULL) {
		FtIntervalValue* _tmp2_;
		FtBooleanValue* _tmp3_;
		_tmp2_ = other_interval;
		_tmp3_ = ft_boolean_value_new (self->data == _tmp2_->data);
		result = (FtValue*) _tmp3_;
		_ft_value_unref0 (other_interval);
		return result;
	}
	_tmp5_ = FT_VALUE_CLASS (ft_interval_value_parent_class)->apply_eq (G_TYPE_CHECK_INSTANCE_CAST (self, FT_TYPE_VALUE, FtValue), other, &_inner_error0_);
	_tmp4_ = _tmp5_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_ft_value_unref0 (other_interval);
			return NULL;
		} else {
			_ft_value_unref0 (other_interval);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp6_ = _tmp4_;
	_tmp4_ = NULL;
	result = _tmp6_;
	_ft_value_unref0 (_tmp4_);
	_ft_value_unref0 (other_interval);
	return result;
}

static FtValue*
ft_interval_value_real_apply_lt (FtValue* base,
                                 FtValue* other,
                                 GError** error)
{
	FtIntervalValue * self;
	FtIntervalValue* other_interval = NULL;
	FtIntervalValue* _tmp0_;
	FtIntervalValue* _tmp1_;
	FtValue* _tmp4_ = NULL;
	FtValue* _tmp5_;
	FtValue* _tmp6_;
	GError* _inner_error0_ = NULL;
	FtValue* result;
	self = (FtIntervalValue*) base;
	g_return_val_if_fail (other != NULL, NULL);
	_tmp0_ = _ft_value_ref0 (FT_IS_INTERVAL_VALUE (other) ? ((FtIntervalValue*) other) : NULL);
	other_interval = _tmp0_;
	_tmp1_ = other_interval;
	if (_tmp1_ != NULL) {
		FtIntervalValue* _tmp2_;
		FtBooleanValue* _tmp3_;
		_tmp2_ = other_interval;
		_tmp3_ = ft_boolean_value_new (self->data < _tmp2_->data);
		result = (FtValue*) _tmp3_;
		_ft_value_unref0 (other_interval);
		return result;
	}
	_tmp5_ = FT_VALUE_CLASS (ft_interval_value_parent_class)->apply_lt (G_TYPE_CHECK_INSTANCE_CAST (self, FT_TYPE_VALUE, FtValue), other, &_inner_error0_);
	_tmp4_ = _tmp5_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_ft_value_unref0 (other_interval);
			return NULL;
		} else {
			_ft_value_unref0 (other_interval);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp6_ = _tmp4_;
	_tmp4_ = NULL;
	result = _tmp6_;
	_ft_value_unref0 (_tmp4_);
	_ft_value_unref0 (other_interval);
	return result;
}

static FtValue*
ft_interval_value_real_apply_gt (FtValue* base,
                                 FtValue* other,
                                 GError** error)
{
	FtIntervalValue * self;
	FtIntervalValue* other_interval = NULL;
	FtIntervalValue* _tmp0_;
	FtIntervalValue* _tmp1_;
	FtValue* _tmp4_ = NULL;
	FtValue* _tmp5_;
	FtValue* _tmp6_;
	GError* _inner_error0_ = NULL;
	FtValue* result;
	self = (FtIntervalValue*) base;
	g_return_val_if_fail (other != NULL, NULL);
	_tmp0_ = _ft_value_ref0 (FT_IS_INTERVAL_VALUE (other) ? ((FtIntervalValue*) other) : NULL);
	other_interval = _tmp0_;
	_tmp1_ = other_interval;
	if (_tmp1_ != NULL) {
		FtIntervalValue* _tmp2_;
		FtBooleanValue* _tmp3_;
		_tmp2_ = other_interval;
		_tmp3_ = ft_boolean_value_new (self->data > _tmp2_->data);
		result = (FtValue*) _tmp3_;
		_ft_value_unref0 (other_interval);
		return result;
	}
	_tmp5_ = FT_VALUE_CLASS (ft_interval_value_parent_class)->apply_gt (G_TYPE_CHECK_INSTANCE_CAST (self, FT_TYPE_VALUE, FtValue), other, &_inner_error0_);
	_tmp4_ = _tmp5_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_ft_value_unref0 (other_interval);
			return NULL;
		} else {
			_ft_value_unref0 (other_interval);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp6_ = _tmp4_;
	_tmp4_ = NULL;
	result = _tmp6_;
	_ft_value_unref0 (_tmp4_);
	_ft_value_unref0 (other_interval);
	return result;
}

static void
ft_interval_value_class_init (FtIntervalValueClass * klass,
                              gpointer klass_data)
{
	ft_interval_value_parent_class = g_type_class_peek_parent (klass);
	((FtValueClass *) klass)->finalize = ft_interval_value_finalize;
	((FtValueClass *) klass)->get_value_type = (GType (*) (FtValue*)) ft_interval_value_real_get_value_type;
	((FtValueClass *) klass)->get_type_name = (gchar* (*) (FtValue*)) ft_interval_value_real_get_type_name;
	((FtValueClass *) klass)->to_boolean = (gboolean (*) (FtValue*)) ft_interval_value_real_to_boolean;
	((FtValueClass *) klass)->to_representation = (gchar* (*) (FtValue*)) ft_interval_value_real_to_representation;
	((FtValueClass *) klass)->to_variant = (GVariant* (*) (FtValue*)) ft_interval_value_real_to_variant;
	((FtValueClass *) klass)->format = (GVariant* (*) (FtValue*, const gchar*, GError**)) ft_interval_value_real_format;
	((FtValueClass *) klass)->apply_eq = (FtValue* (*) (FtValue*, FtValue*, GError**)) ft_interval_value_real_apply_eq;
	((FtValueClass *) klass)->apply_lt = (FtValue* (*) (FtValue*, FtValue*, GError**)) ft_interval_value_real_apply_lt;
	((FtValueClass *) klass)->apply_gt = (FtValue* (*) (FtValue*, FtValue*, GError**)) ft_interval_value_real_apply_gt;
}

static void
ft_interval_value_instance_init (FtIntervalValue * self,
                                 gpointer klass)
{
}

static void
ft_interval_value_finalize (FtValue * obj)
{
	FtIntervalValue * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_INTERVAL_VALUE, FtIntervalValue);
	FT_VALUE_CLASS (ft_interval_value_parent_class)->finalize (obj);
}

static GType
ft_interval_value_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtIntervalValueClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_interval_value_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtIntervalValue), 0, (GInstanceInitFunc) ft_interval_value_instance_init, NULL };
	GType ft_interval_value_type_id;
	ft_interval_value_type_id = g_type_register_static (FT_TYPE_VALUE, "FtIntervalValue", &g_define_type_info, 0);
	return ft_interval_value_type_id;
}

GType
ft_interval_value_get_type (void)
{
	static volatile gsize ft_interval_value_type_id__once = 0;
	if (g_once_init_enter (&ft_interval_value_type_id__once)) {
		GType ft_interval_value_type_id;
		ft_interval_value_type_id = ft_interval_value_get_type_once ();
		g_once_init_leave (&ft_interval_value_type_id__once, ft_interval_value_type_id);
	}
	return ft_interval_value_type_id__once;
}

FtStringValue*
ft_string_value_construct (GType object_type,
                           const gchar* data)
{
	FtStringValue* self = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (data != NULL, NULL);
	self = (FtStringValue*) ft_value_construct (object_type);
	_tmp0_ = g_strdup (data);
	_g_free0 (self->data);
	self->data = _tmp0_;
	return self;
}

FtStringValue*
ft_string_value_new (const gchar* data)
{
	return ft_string_value_construct (FT_TYPE_STRING_VALUE, data);
}

static GType
ft_string_value_real_get_value_type (FtValue* base)
{
	FtStringValue * self;
	GType result;
	self = (FtStringValue*) base;
	result = FT_TYPE_STRING_VALUE;
	return result;
}

static gchar*
ft_string_value_real_get_type_name (FtValue* base)
{
	FtStringValue * self;
	gchar* _tmp0_;
	gchar* result;
	self = (FtStringValue*) base;
	_tmp0_ = g_strdup ("string");
	result = _tmp0_;
	return result;
}

static gboolean
ft_string_value_real_to_boolean (FtValue* base)
{
	FtStringValue * self;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	gboolean result;
	self = (FtStringValue*) base;
	_tmp1_ = self->data;
	if (_tmp1_ != NULL) {
		const gchar* _tmp2_;
		_tmp2_ = self->data;
		_tmp0_ = g_strcmp0 (_tmp2_, "") != 0;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static gchar*
ft_string_value_real_to_representation (FtValue* base)
{
	FtStringValue * self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	self = (FtStringValue*) base;
	_tmp0_ = self->data;
	_tmp1_ = ft_quote_string (_tmp0_);
	result = _tmp1_;
	return result;
}

static GVariant*
ft_string_value_real_to_variant (FtValue* base)
{
	FtStringValue * self;
	const gchar* _tmp0_;
	GVariant* _tmp1_;
	GVariant* result;
	self = (FtStringValue*) base;
	_tmp0_ = self->data;
	_tmp1_ = g_variant_new_string (_tmp0_);
	g_variant_ref_sink (_tmp1_);
	result = _tmp1_;
	return result;
}

static FtValue*
ft_string_value_real_apply_eq (FtValue* base,
                               FtValue* other,
                               GError** error)
{
	FtStringValue * self;
	FtStringValue* other_string = NULL;
	FtStringValue* _tmp0_;
	FtStringValue* _tmp1_;
	FtValue* _tmp6_ = NULL;
	FtValue* _tmp7_;
	FtValue* _tmp8_;
	GError* _inner_error0_ = NULL;
	FtValue* result;
	self = (FtStringValue*) base;
	g_return_val_if_fail (other != NULL, NULL);
	_tmp0_ = _ft_value_ref0 (FT_IS_STRING_VALUE (other) ? ((FtStringValue*) other) : NULL);
	other_string = _tmp0_;
	_tmp1_ = other_string;
	if (_tmp1_ != NULL) {
		const gchar* _tmp2_;
		FtStringValue* _tmp3_;
		const gchar* _tmp4_;
		FtBooleanValue* _tmp5_;
		_tmp2_ = self->data;
		_tmp3_ = other_string;
		_tmp4_ = _tmp3_->data;
		_tmp5_ = ft_boolean_value_new (g_strcmp0 (_tmp2_, _tmp4_) == 0);
		result = (FtValue*) _tmp5_;
		_ft_value_unref0 (other_string);
		return result;
	}
	_tmp7_ = ft_value_apply_eq (other, (FtValue*) self, &_inner_error0_);
	_tmp6_ = _tmp7_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_ft_value_unref0 (other_string);
			return NULL;
		} else {
			_ft_value_unref0 (other_string);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp8_ = _tmp6_;
	_tmp6_ = NULL;
	result = _tmp8_;
	_ft_value_unref0 (_tmp6_);
	_ft_value_unref0 (other_string);
	return result;
}

static FtValue*
ft_string_value_real_apply_lt (FtValue* base,
                               FtValue* other,
                               GError** error)
{
	FtStringValue * self;
	FtStringValue* other_string = NULL;
	FtStringValue* _tmp0_;
	FtStringValue* _tmp1_;
	FtValue* _tmp6_ = NULL;
	FtValue* _tmp7_;
	FtValue* _tmp8_;
	GError* _inner_error0_ = NULL;
	FtValue* result;
	self = (FtStringValue*) base;
	g_return_val_if_fail (other != NULL, NULL);
	_tmp0_ = _ft_value_ref0 (FT_IS_STRING_VALUE (other) ? ((FtStringValue*) other) : NULL);
	other_string = _tmp0_;
	_tmp1_ = other_string;
	if (_tmp1_ != NULL) {
		const gchar* _tmp2_;
		FtStringValue* _tmp3_;
		const gchar* _tmp4_;
		FtBooleanValue* _tmp5_;
		_tmp2_ = self->data;
		_tmp3_ = other_string;
		_tmp4_ = _tmp3_->data;
		_tmp5_ = ft_boolean_value_new (g_strcmp0 (_tmp2_, _tmp4_) < 0);
		result = (FtValue*) _tmp5_;
		_ft_value_unref0 (other_string);
		return result;
	}
	_tmp7_ = ft_value_apply_gt (other, (FtValue*) self, &_inner_error0_);
	_tmp6_ = _tmp7_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_ft_value_unref0 (other_string);
			return NULL;
		} else {
			_ft_value_unref0 (other_string);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp8_ = _tmp6_;
	_tmp6_ = NULL;
	result = _tmp8_;
	_ft_value_unref0 (_tmp6_);
	_ft_value_unref0 (other_string);
	return result;
}

static FtValue*
ft_string_value_real_apply_gt (FtValue* base,
                               FtValue* other,
                               GError** error)
{
	FtStringValue * self;
	FtStringValue* other_string = NULL;
	FtStringValue* _tmp0_;
	FtStringValue* _tmp1_;
	FtValue* _tmp6_ = NULL;
	FtValue* _tmp7_;
	FtValue* _tmp8_;
	GError* _inner_error0_ = NULL;
	FtValue* result;
	self = (FtStringValue*) base;
	g_return_val_if_fail (other != NULL, NULL);
	_tmp0_ = _ft_value_ref0 (FT_IS_STRING_VALUE (other) ? ((FtStringValue*) other) : NULL);
	other_string = _tmp0_;
	_tmp1_ = other_string;
	if (_tmp1_ != NULL) {
		const gchar* _tmp2_;
		FtStringValue* _tmp3_;
		const gchar* _tmp4_;
		FtBooleanValue* _tmp5_;
		_tmp2_ = self->data;
		_tmp3_ = other_string;
		_tmp4_ = _tmp3_->data;
		_tmp5_ = ft_boolean_value_new (g_strcmp0 (_tmp2_, _tmp4_) > 0);
		result = (FtValue*) _tmp5_;
		_ft_value_unref0 (other_string);
		return result;
	}
	_tmp7_ = ft_value_apply_lt (other, (FtValue*) self, &_inner_error0_);
	_tmp6_ = _tmp7_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_ft_value_unref0 (other_string);
			return NULL;
		} else {
			_ft_value_unref0 (other_string);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp8_ = _tmp6_;
	_tmp6_ = NULL;
	result = _tmp8_;
	_ft_value_unref0 (_tmp6_);
	_ft_value_unref0 (other_string);
	return result;
}

static void
ft_string_value_class_init (FtStringValueClass * klass,
                            gpointer klass_data)
{
	ft_string_value_parent_class = g_type_class_peek_parent (klass);
	((FtValueClass *) klass)->finalize = ft_string_value_finalize;
	((FtValueClass *) klass)->get_value_type = (GType (*) (FtValue*)) ft_string_value_real_get_value_type;
	((FtValueClass *) klass)->get_type_name = (gchar* (*) (FtValue*)) ft_string_value_real_get_type_name;
	((FtValueClass *) klass)->to_boolean = (gboolean (*) (FtValue*)) ft_string_value_real_to_boolean;
	((FtValueClass *) klass)->to_representation = (gchar* (*) (FtValue*)) ft_string_value_real_to_representation;
	((FtValueClass *) klass)->to_variant = (GVariant* (*) (FtValue*)) ft_string_value_real_to_variant;
	((FtValueClass *) klass)->apply_eq = (FtValue* (*) (FtValue*, FtValue*, GError**)) ft_string_value_real_apply_eq;
	((FtValueClass *) klass)->apply_lt = (FtValue* (*) (FtValue*, FtValue*, GError**)) ft_string_value_real_apply_lt;
	((FtValueClass *) klass)->apply_gt = (FtValue* (*) (FtValue*, FtValue*, GError**)) ft_string_value_real_apply_gt;
}

static void
ft_string_value_instance_init (FtStringValue * self,
                               gpointer klass)
{
}

static void
ft_string_value_finalize (FtValue * obj)
{
	FtStringValue * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_STRING_VALUE, FtStringValue);
	_g_free0 (self->data);
	FT_VALUE_CLASS (ft_string_value_parent_class)->finalize (obj);
}

static GType
ft_string_value_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtStringValueClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_string_value_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtStringValue), 0, (GInstanceInitFunc) ft_string_value_instance_init, NULL };
	GType ft_string_value_type_id;
	ft_string_value_type_id = g_type_register_static (FT_TYPE_VALUE, "FtStringValue", &g_define_type_info, 0);
	return ft_string_value_type_id;
}

GType
ft_string_value_get_type (void)
{
	static volatile gsize ft_string_value_type_id__once = 0;
	if (g_once_init_enter (&ft_string_value_type_id__once)) {
		GType ft_string_value_type_id;
		ft_string_value_type_id = ft_string_value_get_type_once ();
		g_once_init_leave (&ft_string_value_type_id__once, ft_string_value_type_id);
	}
	return ft_string_value_type_id__once;
}

FtStateValue*
ft_state_value_construct (GType object_type,
                          FtState state)
{
	FtStateValue* self = NULL;
	self = (FtStateValue*) ft_value_construct (object_type);
	self->data = state;
	return self;
}

FtStateValue*
ft_state_value_new (FtState state)
{
	return ft_state_value_construct (FT_TYPE_STATE_VALUE, state);
}

static GType
ft_state_value_real_get_value_type (FtValue* base)
{
	FtStateValue * self;
	GType result;
	self = (FtStateValue*) base;
	result = FT_TYPE_STATE_VALUE;
	return result;
}

static gchar*
ft_state_value_real_get_type_name (FtValue* base)
{
	FtStateValue * self;
	gchar* _tmp0_;
	gchar* result;
	self = (FtStateValue*) base;
	_tmp0_ = g_strdup ("state");
	result = _tmp0_;
	return result;
}

static gboolean
ft_state_value_real_to_boolean (FtValue* base)
{
	FtStateValue * self;
	gboolean result;
	self = (FtStateValue*) base;
	result = self->data != FT_STATE_STOPPED;
	return result;
}

static gchar*
ft_state_value_real_to_representation (FtValue* base)
{
	FtStateValue * self;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	self = (FtStateValue*) base;
	_tmp0_ = ft_state_to_string (self->data);
	_tmp1_ = _tmp0_;
	_tmp2_ = ft_quote_string (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	result = _tmp3_;
	return result;
}

static GVariant*
ft_state_value_real_to_variant (FtValue* base)
{
	FtStateValue * self;
	gchar* _tmp0_;
	gchar* _tmp1_;
	GVariant* _tmp2_;
	GVariant* _tmp3_;
	GVariant* result;
	self = (FtStateValue*) base;
	_tmp0_ = ft_state_to_string (self->data);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_variant_new_string (_tmp1_);
	g_variant_ref_sink (_tmp2_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	result = _tmp3_;
	return result;
}

static GVariant*
ft_state_value_real_format (FtValue* base,
                            const gchar* name,
                            GError** error)
{
	FtStateValue * self;
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
	static GQuark _tmp1_label0 = 0;
	static GQuark _tmp1_label1 = 0;
	GError* _inner_error0_ = NULL;
	GVariant* result;
	self = (FtStateValue*) base;
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = name;
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("base")))) {
		switch (0) {
			default:
			{
				gchar* _tmp3_ = NULL;
				GVariant* _tmp6_;
				if (ft_state_is_break (self->data)) {
					gchar* _tmp4_;
					_tmp4_ = g_strdup ("break");
					_g_free0 (_tmp3_);
					_tmp3_ = _tmp4_;
				} else {
					gchar* _tmp5_;
					_tmp5_ = ft_state_to_string (self->data);
					_g_free0 (_tmp3_);
					_tmp3_ = _tmp5_;
				}
				_tmp6_ = g_variant_new_string (_tmp3_);
				g_variant_ref_sink (_tmp6_);
				result = _tmp6_;
				_g_free0 (_tmp3_);
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("full")))) {
		switch (0) {
			default:
			{
				GVariant* _tmp7_;
				_tmp7_ = ft_value_to_variant ((FtValue*) self);
				result = _tmp7_;
				return result;
			}
		}
	} else {
		switch (0) {
			default:
			{
				GVariant* _tmp8_ = NULL;
				GVariant* _tmp9_;
				GVariant* _tmp10_;
				_tmp9_ = FT_VALUE_CLASS (ft_state_value_parent_class)->format (G_TYPE_CHECK_INSTANCE_CAST (self, FT_TYPE_VALUE, FtValue), name, &_inner_error0_);
				_tmp8_ = _tmp9_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
						g_propagate_error (error, _inner_error0_);
						return NULL;
					} else {
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
						g_clear_error (&_inner_error0_);
						return NULL;
					}
				}
				_tmp10_ = _tmp8_;
				_tmp8_ = NULL;
				result = _tmp10_;
				_g_variant_unref0 (_tmp8_);
				return result;
			}
		}
	}
}

static FtValue*
ft_state_value_real_apply_eq (FtValue* base,
                              FtValue* other,
                              GError** error)
{
	FtStateValue * self;
	FtStateValue* other_state = NULL;
	FtStateValue* _tmp0_;
	FtStateValue* _tmp1_;
	FtStringValue* other_string = NULL;
	FtStringValue* _tmp4_;
	FtStringValue* _tmp5_;
	FtValue* _tmp13_ = NULL;
	FtValue* _tmp14_;
	FtValue* _tmp15_;
	GError* _inner_error0_ = NULL;
	FtValue* result;
	self = (FtStateValue*) base;
	g_return_val_if_fail (other != NULL, NULL);
	_tmp0_ = _ft_value_ref0 (FT_IS_STATE_VALUE (other) ? ((FtStateValue*) other) : NULL);
	other_state = _tmp0_;
	_tmp1_ = other_state;
	if (_tmp1_ != NULL) {
		FtStateValue* _tmp2_;
		FtBooleanValue* _tmp3_;
		_tmp2_ = other_state;
		_tmp3_ = ft_boolean_value_new (ft_state_is_a (self->data, _tmp2_->data));
		result = (FtValue*) _tmp3_;
		_ft_value_unref0 (other_state);
		return result;
	}
	_tmp4_ = _ft_value_ref0 (FT_IS_STRING_VALUE (other) ? ((FtStringValue*) other) : NULL);
	other_string = _tmp4_;
	_tmp5_ = other_string;
	if (_tmp5_ != NULL) {
		FtState other_data = 0;
		FtStringValue* _tmp6_;
		const gchar* _tmp7_;
		gboolean _tmp8_ = FALSE;
		FtBooleanValue* _tmp12_;
		_tmp6_ = other_string;
		_tmp7_ = _tmp6_->data;
		other_data = ft_state_from_string (_tmp7_);
		if (other_data == FT_STATE_STOPPED) {
			FtStringValue* _tmp9_;
			const gchar* _tmp10_;
			_tmp9_ = other_string;
			_tmp10_ = _tmp9_->data;
			_tmp8_ = g_strcmp0 (_tmp10_, "stopped") != 0;
		} else {
			_tmp8_ = FALSE;
		}
		if (_tmp8_) {
			FtBooleanValue* _tmp11_;
			_tmp11_ = ft_boolean_value_new (FALSE);
			result = (FtValue*) _tmp11_;
			_ft_value_unref0 (other_string);
			_ft_value_unref0 (other_state);
			return result;
		}
		_tmp12_ = ft_boolean_value_new (ft_state_is_a (self->data, other_data));
		result = (FtValue*) _tmp12_;
		_ft_value_unref0 (other_string);
		_ft_value_unref0 (other_state);
		return result;
	}
	_tmp14_ = FT_VALUE_CLASS (ft_state_value_parent_class)->apply_eq (G_TYPE_CHECK_INSTANCE_CAST (self, FT_TYPE_VALUE, FtValue), other, &_inner_error0_);
	_tmp13_ = _tmp14_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_ft_value_unref0 (other_string);
			_ft_value_unref0 (other_state);
			return NULL;
		} else {
			_ft_value_unref0 (other_string);
			_ft_value_unref0 (other_state);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp15_ = _tmp13_;
	_tmp13_ = NULL;
	result = _tmp15_;
	_ft_value_unref0 (_tmp13_);
	_ft_value_unref0 (other_string);
	_ft_value_unref0 (other_state);
	return result;
}

static void
ft_state_value_class_init (FtStateValueClass * klass,
                           gpointer klass_data)
{
	ft_state_value_parent_class = g_type_class_peek_parent (klass);
	((FtValueClass *) klass)->finalize = ft_state_value_finalize;
	((FtValueClass *) klass)->get_value_type = (GType (*) (FtValue*)) ft_state_value_real_get_value_type;
	((FtValueClass *) klass)->get_type_name = (gchar* (*) (FtValue*)) ft_state_value_real_get_type_name;
	((FtValueClass *) klass)->to_boolean = (gboolean (*) (FtValue*)) ft_state_value_real_to_boolean;
	((FtValueClass *) klass)->to_representation = (gchar* (*) (FtValue*)) ft_state_value_real_to_representation;
	((FtValueClass *) klass)->to_variant = (GVariant* (*) (FtValue*)) ft_state_value_real_to_variant;
	((FtValueClass *) klass)->format = (GVariant* (*) (FtValue*, const gchar*, GError**)) ft_state_value_real_format;
	((FtValueClass *) klass)->apply_eq = (FtValue* (*) (FtValue*, FtValue*, GError**)) ft_state_value_real_apply_eq;
}

static void
ft_state_value_instance_init (FtStateValue * self,
                              gpointer klass)
{
}

static void
ft_state_value_finalize (FtValue * obj)
{
	FtStateValue * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_STATE_VALUE, FtStateValue);
	FT_VALUE_CLASS (ft_state_value_parent_class)->finalize (obj);
}

static GType
ft_state_value_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtStateValueClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_state_value_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtStateValue), 0, (GInstanceInitFunc) ft_state_value_instance_init, NULL };
	GType ft_state_value_type_id;
	ft_state_value_type_id = g_type_register_static (FT_TYPE_VALUE, "FtStateValue", &g_define_type_info, 0);
	return ft_state_value_type_id;
}

GType
ft_state_value_get_type (void)
{
	static volatile gsize ft_state_value_type_id__once = 0;
	if (g_once_init_enter (&ft_state_value_type_id__once)) {
		GType ft_state_value_type_id;
		ft_state_value_type_id = ft_state_value_get_type_once ();
		g_once_init_leave (&ft_state_value_type_id__once, ft_state_value_type_id);
	}
	return ft_state_value_type_id__once;
}

FtStatusValue*
ft_status_value_construct (GType object_type,
                           FtTimeBlockStatus status)
{
	FtStatusValue* self = NULL;
	self = (FtStatusValue*) ft_value_construct (object_type);
	self->data = status;
	return self;
}

FtStatusValue*
ft_status_value_new (FtTimeBlockStatus status)
{
	return ft_status_value_construct (FT_TYPE_STATUS_VALUE, status);
}

static GType
ft_status_value_real_get_value_type (FtValue* base)
{
	FtStatusValue * self;
	GType result;
	self = (FtStatusValue*) base;
	result = FT_TYPE_STATUS_VALUE;
	return result;
}

static gchar*
ft_status_value_real_get_type_name (FtValue* base)
{
	FtStatusValue * self;
	gchar* _tmp0_;
	gchar* result;
	self = (FtStatusValue*) base;
	_tmp0_ = g_strdup ("status");
	result = _tmp0_;
	return result;
}

static gboolean
ft_status_value_real_to_boolean (FtValue* base)
{
	FtStatusValue * self;
	gboolean result;
	self = (FtStatusValue*) base;
	result = self->data != FT_TIME_BLOCK_STATUS_SCHEDULED;
	return result;
}

static gchar*
ft_status_value_real_to_representation (FtValue* base)
{
	FtStatusValue * self;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	self = (FtStatusValue*) base;
	_tmp0_ = ft_time_block_status_to_string (self->data);
	_tmp1_ = _tmp0_;
	_tmp2_ = ft_quote_string (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	result = _tmp3_;
	return result;
}

static GVariant*
ft_status_value_real_to_variant (FtValue* base)
{
	FtStatusValue * self;
	gchar* _tmp0_;
	gchar* _tmp1_;
	GVariant* _tmp2_;
	GVariant* _tmp3_;
	GVariant* result;
	self = (FtStatusValue*) base;
	_tmp0_ = ft_time_block_status_to_string (self->data);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_variant_new_string (_tmp1_);
	g_variant_ref_sink (_tmp2_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	result = _tmp3_;
	return result;
}

static FtValue*
ft_status_value_real_apply_eq (FtValue* base,
                               FtValue* other,
                               GError** error)
{
	FtStatusValue * self;
	FtStatusValue* other_status = NULL;
	FtStatusValue* _tmp0_;
	FtStatusValue* _tmp1_;
	FtStringValue* other_string = NULL;
	FtStringValue* _tmp4_;
	FtStringValue* _tmp5_;
	FtValue* _tmp12_ = NULL;
	FtValue* _tmp13_;
	FtValue* _tmp14_;
	GError* _inner_error0_ = NULL;
	FtValue* result;
	self = (FtStatusValue*) base;
	g_return_val_if_fail (other != NULL, NULL);
	_tmp0_ = _ft_value_ref0 (FT_IS_STATUS_VALUE (other) ? ((FtStatusValue*) other) : NULL);
	other_status = _tmp0_;
	_tmp1_ = other_status;
	if (_tmp1_ != NULL) {
		FtStatusValue* _tmp2_;
		FtBooleanValue* _tmp3_;
		_tmp2_ = other_status;
		_tmp3_ = ft_boolean_value_new (self->data == _tmp2_->data);
		result = (FtValue*) _tmp3_;
		_ft_value_unref0 (other_status);
		return result;
	}
	_tmp4_ = _ft_value_ref0 (FT_IS_STRING_VALUE (other) ? ((FtStringValue*) other) : NULL);
	other_string = _tmp4_;
	_tmp5_ = other_string;
	if (_tmp5_ != NULL) {
		gchar* _tmp6_;
		gchar* _tmp7_;
		FtStringValue* _tmp8_;
		const gchar* _tmp9_;
		FtBooleanValue* _tmp10_;
		FtValue* _tmp11_;
		_tmp6_ = ft_time_block_status_to_string (self->data);
		_tmp7_ = _tmp6_;
		_tmp8_ = other_string;
		_tmp9_ = _tmp8_->data;
		_tmp10_ = ft_boolean_value_new (g_strcmp0 (_tmp7_, _tmp9_) == 0);
		_tmp11_ = (FtValue*) _tmp10_;
		_g_free0 (_tmp7_);
		result = _tmp11_;
		_ft_value_unref0 (other_string);
		_ft_value_unref0 (other_status);
		return result;
	}
	_tmp13_ = FT_VALUE_CLASS (ft_status_value_parent_class)->apply_eq (G_TYPE_CHECK_INSTANCE_CAST (self, FT_TYPE_VALUE, FtValue), other, &_inner_error0_);
	_tmp12_ = _tmp13_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_ft_value_unref0 (other_string);
			_ft_value_unref0 (other_status);
			return NULL;
		} else {
			_ft_value_unref0 (other_string);
			_ft_value_unref0 (other_status);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp14_ = _tmp12_;
	_tmp12_ = NULL;
	result = _tmp14_;
	_ft_value_unref0 (_tmp12_);
	_ft_value_unref0 (other_string);
	_ft_value_unref0 (other_status);
	return result;
}

static void
ft_status_value_class_init (FtStatusValueClass * klass,
                            gpointer klass_data)
{
	ft_status_value_parent_class = g_type_class_peek_parent (klass);
	((FtValueClass *) klass)->finalize = ft_status_value_finalize;
	((FtValueClass *) klass)->get_value_type = (GType (*) (FtValue*)) ft_status_value_real_get_value_type;
	((FtValueClass *) klass)->get_type_name = (gchar* (*) (FtValue*)) ft_status_value_real_get_type_name;
	((FtValueClass *) klass)->to_boolean = (gboolean (*) (FtValue*)) ft_status_value_real_to_boolean;
	((FtValueClass *) klass)->to_representation = (gchar* (*) (FtValue*)) ft_status_value_real_to_representation;
	((FtValueClass *) klass)->to_variant = (GVariant* (*) (FtValue*)) ft_status_value_real_to_variant;
	((FtValueClass *) klass)->apply_eq = (FtValue* (*) (FtValue*, FtValue*, GError**)) ft_status_value_real_apply_eq;
}

static void
ft_status_value_instance_init (FtStatusValue * self,
                               gpointer klass)
{
}

static void
ft_status_value_finalize (FtValue * obj)
{
	FtStatusValue * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_STATUS_VALUE, FtStatusValue);
	FT_VALUE_CLASS (ft_status_value_parent_class)->finalize (obj);
}

static GType
ft_status_value_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtStatusValueClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_status_value_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtStatusValue), 0, (GInstanceInitFunc) ft_status_value_instance_init, NULL };
	GType ft_status_value_type_id;
	ft_status_value_type_id = g_type_register_static (FT_TYPE_VALUE, "FtStatusValue", &g_define_type_info, 0);
	return ft_status_value_type_id;
}

GType
ft_status_value_get_type (void)
{
	static volatile gsize ft_status_value_type_id__once = 0;
	if (g_once_init_enter (&ft_status_value_type_id__once)) {
		GType ft_status_value_type_id;
		ft_status_value_type_id = ft_status_value_get_type_once ();
		g_once_init_leave (&ft_status_value_type_id__once, ft_status_value_type_id);
	}
	return ft_status_value_type_id__once;
}

gchar**
ft_list_value_formats (GType value_type,
                       gint* result_length1)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GQuark _tmp3_ = 0U;
	static GQuark _tmp2_label0 = 0;
	static GQuark _tmp2_label1 = 0;
	static GQuark _tmp2_label2 = 0;
	gchar** result;
	_tmp0_ = g_type_name (value_type);
	_tmp1_ = _tmp0_;
	_tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
	if (_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("FtTimestampValue")))) {
		switch (0) {
			default:
			{
				gchar* _tmp4_;
				gchar* _tmp5_;
				gchar* _tmp6_;
				gchar** _tmp7_;
				gchar** _tmp8_;
				gint _tmp8__length1;
				_tmp4_ = g_strdup ("iso8601");
				_tmp5_ = g_strdup ("seconds");
				_tmp6_ = g_strdup ("microseconds");
				_tmp7_ = g_new0 (gchar*, 3 + 1);
				_tmp7_[0] = _tmp4_;
				_tmp7_[1] = _tmp5_;
				_tmp7_[2] = _tmp6_;
				_tmp8_ = _tmp7_;
				_tmp8__length1 = 3;
				if (result_length1) {
					*result_length1 = _tmp8__length1;
				}
				result = _tmp8_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("FtIntervalValue")))) {
		switch (0) {
			default:
			{
				gchar* _tmp9_;
				gchar* _tmp10_;
				gchar* _tmp11_;
				gchar** _tmp12_;
				gchar** _tmp13_;
				gint _tmp13__length1;
				_tmp9_ = g_strdup ("minutes");
				_tmp10_ = g_strdup ("seconds");
				_tmp11_ = g_strdup ("microseconds");
				_tmp12_ = g_new0 (gchar*, 3 + 1);
				_tmp12_[0] = _tmp9_;
				_tmp12_[1] = _tmp10_;
				_tmp12_[2] = _tmp11_;
				_tmp13_ = _tmp12_;
				_tmp13__length1 = 3;
				if (result_length1) {
					*result_length1 = _tmp13__length1;
				}
				result = _tmp13_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label2) ? _tmp2_label2 : (_tmp2_label2 = g_quark_from_static_string ("FtStateValue")))) {
		switch (0) {
			default:
			{
				gchar* _tmp14_;
				gchar* _tmp15_;
				gchar** _tmp16_;
				gchar** _tmp17_;
				gint _tmp17__length1;
				_tmp14_ = g_strdup ("base");
				_tmp15_ = g_strdup ("full");
				_tmp16_ = g_new0 (gchar*, 2 + 1);
				_tmp16_[0] = _tmp14_;
				_tmp16_[1] = _tmp15_;
				_tmp17_ = _tmp16_;
				_tmp17__length1 = 2;
				if (result_length1) {
					*result_length1 = _tmp17__length1;
				}
				result = _tmp17_;
				return result;
			}
		}
	} else {
		switch (0) {
			default:
			{
				gchar** _tmp18_;
				gchar** _tmp19_;
				gint _tmp19__length1;
				_tmp18_ = g_new0 (gchar*, 0 + 1);
				_tmp19_ = _tmp18_;
				_tmp19__length1 = 0;
				if (result_length1) {
					*result_length1 = _tmp19__length1;
				}
				result = _tmp19_;
				return result;
			}
		}
	}
}

gchar*
ft_get_default_value_format (GType value_type)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GQuark _tmp3_ = 0U;
	static GQuark _tmp2_label0 = 0;
	static GQuark _tmp2_label1 = 0;
	static GQuark _tmp2_label2 = 0;
	gchar* result;
	_tmp0_ = g_type_name (value_type);
	_tmp1_ = _tmp0_;
	_tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
	if (_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("FtTimestampValue")))) {
		switch (0) {
			default:
			{
				gchar* _tmp4_;
				_tmp4_ = g_strdup ("microseconds");
				result = _tmp4_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("FtIntervalValue")))) {
		switch (0) {
			default:
			{
				gchar* _tmp5_;
				_tmp5_ = g_strdup ("microseconds");
				result = _tmp5_;
				return result;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label2) ? _tmp2_label2 : (_tmp2_label2 = g_quark_from_static_string ("FtStateValue")))) {
		switch (0) {
			default:
			{
				gchar* _tmp6_;
				_tmp6_ = g_strdup ("full");
				result = _tmp6_;
				return result;
			}
		}
	} else {
		switch (0) {
			default:
			{
				gchar* _tmp7_;
				_tmp7_ = g_strdup ("");
				result = _tmp7_;
				return result;
			}
		}
	}
}

gboolean
ft_get_inner_operator (FtExpression* expression,
                       FtOperator* inner_operator)
{
	FtOperator _vala_inner_operator = 0;
	gboolean result;
	g_return_val_if_fail (expression != NULL, FALSE);
	if (FT_IS_OPERATION (expression)) {
		_vala_inner_operator = G_TYPE_CHECK_INSTANCE_CAST (expression, FT_TYPE_OPERATION, FtOperation)->operator;
		result = TRUE;
		if (inner_operator) {
			*inner_operator = _vala_inner_operator;
		}
		return result;
	}
	if (FT_IS_COMPARISON (expression)) {
		_vala_inner_operator = G_TYPE_CHECK_INSTANCE_CAST (expression, FT_TYPE_COMPARISON, FtComparison)->operator;
		result = TRUE;
		if (inner_operator) {
			*inner_operator = _vala_inner_operator;
		}
		return result;
	}
	_vala_inner_operator = FT_OPERATOR_INVALID;
	result = FALSE;
	if (inner_operator) {
		*inner_operator = _vala_inner_operator;
	}
	return result;
}

/**
     * Wrap argument with parentheses if inner operator has higher priority
     */
inline gchar*
ft_wrap_argument (const gchar* argument_string,
                  FtOperator inner_operator,
                  FtOperator outer_operator)
{
	gchar* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	gchar* _tmp5_;
	gchar* result;
	g_return_val_if_fail (argument_string != NULL, NULL);
	if (inner_operator != outer_operator) {
		_tmp1_ = ft_operator_get_precedence (inner_operator) < ft_operator_get_precedence (outer_operator);
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		const gchar* _tmp2_;
		gchar* _tmp3_;
		_tmp2_ = string_to_string (argument_string);
		_tmp3_ = g_strconcat ("(", _tmp2_, ")", NULL);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp3_;
	} else {
		gchar* _tmp4_;
		_tmp4_ = g_strdup (argument_string);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp4_;
	}
	_tmp5_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp5_;
	_g_free0 (_tmp0_);
	return result;
}

static GType
ft_expression_real_get_result_type (FtExpression* self)
{
	GType _tmp0_ = G_TYPE_NONE;
	g_critical ("Type `%s' does not implement abstract method `ft_expression_get_result_type'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return _tmp0_;
}

GType
ft_expression_get_result_type (FtExpression* self)
{
	FtExpressionClass* _klass_;
	g_return_val_if_fail (self != NULL, G_TYPE_INVALID);
	_klass_ = FT_EXPRESSION_GET_CLASS (self);
	if (_klass_->get_result_type) {
		return _klass_->get_result_type (self);
	}
	return G_TYPE_INVALID;
}

static FtValue*
ft_expression_real_evaluate (FtExpression* self,
                             FtContext* context,
                             GError** error)
{
	g_critical ("Type `%s' does not implement abstract method `ft_expression_evaluate'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

FtValue*
ft_expression_evaluate (FtExpression* self,
                        FtContext* context,
                        GError** error)
{
	FtExpressionClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = FT_EXPRESSION_GET_CLASS (self);
	if (_klass_->evaluate) {
		return _klass_->evaluate (self, context, error);
	}
	return NULL;
}

static gchar*
ft_expression_real_to_string (FtExpression* self)
{
	g_critical ("Type `%s' does not implement abstract method `ft_expression_to_string'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

gchar*
ft_expression_to_string (FtExpression* self)
{
	FtExpressionClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = FT_EXPRESSION_GET_CLASS (self);
	if (_klass_->to_string) {
		return _klass_->to_string (self);
	}
	return NULL;
}

FtExpression*
ft_expression_parse (const gchar* text,
                     GError** error)
{
	FtExpressionParser* parser = NULL;
	FtExpressionParser* _tmp0_;
	FtExpression* _tmp1_ = NULL;
	FtExpression* _tmp2_;
	FtExpression* _tmp3_;
	GError* _inner_error0_ = NULL;
	FtExpression* result;
	g_return_val_if_fail (text != NULL, NULL);
	_tmp0_ = ft_expression_parser_new ();
	parser = _tmp0_;
	_tmp2_ = ft_expression_parser_parse (parser, text, &_inner_error0_);
	_tmp1_ = _tmp2_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == FT_EXPRESSION_PARSER_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_ft_expression_parser_free0 (parser);
			return NULL;
		} else {
			_ft_expression_parser_free0 (parser);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp3_ = _tmp1_;
	_tmp1_ = NULL;
	result = _tmp3_;
	_ft_expression_unref0 (_tmp1_);
	_ft_expression_parser_free0 (parser);
	return result;
}

FtExpression*
ft_expression_construct (GType object_type)
{
	FtExpression* self = NULL;
	self = (FtExpression*) g_type_create_instance (object_type);
	return self;
}

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

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

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

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

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

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

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

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

void
ft_value_set_expression (GValue* value,
                         gpointer v_object)
{
	FtExpression * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, FT_TYPE_EXPRESSION));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, FT_TYPE_EXPRESSION));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		ft_expression_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		ft_expression_unref (old);
	}
}

void
ft_value_take_expression (GValue* value,
                          gpointer v_object)
{
	FtExpression * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, FT_TYPE_EXPRESSION));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, FT_TYPE_EXPRESSION));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		ft_expression_unref (old);
	}
}

static void
ft_expression_class_init (FtExpressionClass * klass,
                          gpointer klass_data)
{
	ft_expression_parent_class = g_type_class_peek_parent (klass);
	((FtExpressionClass *) klass)->finalize = ft_expression_finalize;
	((FtExpressionClass *) klass)->get_result_type = (GType (*) (FtExpression*)) ft_expression_real_get_result_type;
	((FtExpressionClass *) klass)->evaluate = (FtValue* (*) (FtExpression*, FtContext*, GError**)) ft_expression_real_evaluate;
	((FtExpressionClass *) klass)->to_string = (gchar* (*) (FtExpression*)) ft_expression_real_to_string;
}

static void
ft_expression_instance_init (FtExpression * self,
                             gpointer klass)
{
	self->ref_count = 1;
}

static void
ft_expression_finalize (FtExpression * obj)
{
	FtExpression * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_EXPRESSION, FtExpression);
	g_signal_handlers_destroy (self);
}

static GType
ft_expression_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { ft_value_expression_init, ft_value_expression_free_value, ft_value_expression_copy_value, ft_value_expression_peek_pointer, "p", ft_value_expression_collect_value, "p", ft_value_expression_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (FtExpressionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_expression_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtExpression), 0, (GInstanceInitFunc) ft_expression_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType ft_expression_type_id;
	ft_expression_type_id = g_type_register_fundamental (g_type_fundamental_next (), "FtExpression", &g_define_type_info, &g_define_type_fundamental_info, G_TYPE_FLAG_ABSTRACT);
	return ft_expression_type_id;
}

GType
ft_expression_get_type (void)
{
	static volatile gsize ft_expression_type_id__once = 0;
	if (g_once_init_enter (&ft_expression_type_id__once)) {
		GType ft_expression_type_id;
		ft_expression_type_id = ft_expression_get_type_once ();
		g_once_init_leave (&ft_expression_type_id__once, ft_expression_type_id);
	}
	return ft_expression_type_id__once;
}

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

void
ft_expression_unref (gpointer instance)
{
	FtExpression * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		FT_EXPRESSION_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

FtConstant*
ft_constant_construct (GType object_type,
                       FtValue* value)
{
	FtConstant* self = NULL;
	FtValue* _tmp0_;
	g_return_val_if_fail (value != NULL, NULL);
	self = (FtConstant*) ft_expression_construct (object_type);
	_tmp0_ = _ft_value_ref0 (value);
	_ft_value_unref0 (self->value);
	self->value = _tmp0_;
	return self;
}

FtConstant*
ft_constant_new (FtValue* value)
{
	return ft_constant_construct (FT_TYPE_CONSTANT, value);
}

static GType
ft_constant_real_get_result_type (FtExpression* base)
{
	FtConstant * self;
	FtValue* _tmp0_;
	GType result;
	self = (FtConstant*) base;
	_tmp0_ = self->value;
	result = ft_value_get_value_type (_tmp0_);
	return result;
}

static FtValue*
ft_constant_real_evaluate (FtExpression* base,
                           FtContext* context,
                           GError** error)
{
	FtConstant * self;
	FtValue* _tmp0_;
	FtValue* _tmp1_;
	FtValue* result;
	self = (FtConstant*) base;
	g_return_val_if_fail (context != NULL, NULL);
	_tmp0_ = self->value;
	_tmp1_ = _ft_value_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static gchar*
ft_constant_real_to_string (FtExpression* base)
{
	FtConstant * self;
	FtValue* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	self = (FtConstant*) base;
	_tmp0_ = self->value;
	_tmp1_ = ft_value_to_representation (_tmp0_);
	result = _tmp1_;
	return result;
}

inline gchar*
ft_constant_get_string (FtConstant* self)
{
	FtStringValue* string_value = NULL;
	FtValue* _tmp0_;
	FtStringValue* _tmp1_;
	const gchar* _tmp2_ = NULL;
	FtStringValue* _tmp3_;
	gchar* _tmp6_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->value;
	_tmp1_ = _ft_value_ref0 (FT_IS_STRING_VALUE (_tmp0_) ? ((FtStringValue*) _tmp0_) : NULL);
	string_value = _tmp1_;
	_tmp3_ = string_value;
	if (_tmp3_ != NULL) {
		FtStringValue* _tmp4_;
		const gchar* _tmp5_;
		_tmp4_ = string_value;
		_tmp5_ = _tmp4_->data;
		_tmp2_ = _tmp5_;
	} else {
		_tmp2_ = "";
	}
	_tmp6_ = g_strdup (_tmp2_);
	result = _tmp6_;
	_ft_value_unref0 (string_value);
	return result;
}

static void
ft_constant_class_init (FtConstantClass * klass,
                        gpointer klass_data)
{
	ft_constant_parent_class = g_type_class_peek_parent (klass);
	((FtExpressionClass *) klass)->finalize = ft_constant_finalize;
	((FtExpressionClass *) klass)->get_result_type = (GType (*) (FtExpression*)) ft_constant_real_get_result_type;
	((FtExpressionClass *) klass)->evaluate = (FtValue* (*) (FtExpression*, FtContext*, GError**)) ft_constant_real_evaluate;
	((FtExpressionClass *) klass)->to_string = (gchar* (*) (FtExpression*)) ft_constant_real_to_string;
}

static void
ft_constant_instance_init (FtConstant * self,
                           gpointer klass)
{
}

static void
ft_constant_finalize (FtExpression * obj)
{
	FtConstant * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_CONSTANT, FtConstant);
	_ft_value_unref0 (self->value);
	FT_EXPRESSION_CLASS (ft_constant_parent_class)->finalize (obj);
}

static GType
ft_constant_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtConstantClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_constant_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtConstant), 0, (GInstanceInitFunc) ft_constant_instance_init, NULL };
	GType ft_constant_type_id;
	ft_constant_type_id = g_type_register_static (FT_TYPE_EXPRESSION, "FtConstant", &g_define_type_info, 0);
	return ft_constant_type_id;
}

GType
ft_constant_get_type (void)
{
	static volatile gsize ft_constant_type_id__once = 0;
	if (g_once_init_enter (&ft_constant_type_id__once)) {
		GType ft_constant_type_id;
		ft_constant_type_id = ft_constant_get_type_once ();
		g_once_init_leave (&ft_constant_type_id__once, ft_constant_type_id);
	}
	return ft_constant_type_id__once;
}

FtVariable*
ft_variable_construct (GType object_type,
                       const gchar* name)
{
	FtVariable* self = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (name != NULL, NULL);
	self = (FtVariable*) ft_expression_construct (object_type);
	_tmp0_ = g_strdup (name);
	_g_free0 (self->name);
	self->name = _tmp0_;
	return self;
}

FtVariable*
ft_variable_new (const gchar* name)
{
	return ft_variable_construct (FT_TYPE_VARIABLE, name);
}

static gpointer
_ft_variable_spec_ref0 (gpointer self)
{
	return self ? ft_variable_spec_ref (self) : NULL;
}

static GType*
_g_type_dup (GType* self)
{
	GType* dup;
	dup = g_new0 (GType, 1);
	memcpy (dup, self, sizeof (GType));
	return dup;
}

static gpointer
__g_type_dup0 (gpointer self)
{
	return self ? _g_type_dup (self) : NULL;
}

static GType
ft_variable_real_get_result_type (FtExpression* base)
{
	FtVariable * self;
	FtVariableSpec* variable_spec = NULL;
	const gchar* _tmp0_;
	FtVariableSpec* _tmp1_;
	FtVariableSpec* _tmp2_;
	FtVariableSpec* _tmp3_ = NULL;
	FtVariableSpec* _tmp4_;
	GType* _tmp5_ = NULL;
	GType* _tmp7_;
	GType* _tmp8_;
	GType _tmp9_;
	GType result;
	self = (FtVariable*) base;
	_tmp0_ = self->name;
	_tmp1_ = ft_find_variable (_tmp0_);
	_tmp2_ = _ft_variable_spec_ref0 (_tmp1_);
	variable_spec = _tmp2_;
	_tmp4_ = variable_spec;
	_tmp3_ = _tmp4_;
	_tmp5_ = NULL;
	if (_tmp3_ != NULL) {
		GType* _tmp6_;
		_tmp6_ = __g_type_dup0 (&_tmp3_->value_type);
		_g_free0 (_tmp5_);
		_tmp5_ = _tmp6_;
	}
	_tmp7_ = _tmp5_;
	_tmp5_ = NULL;
	_tmp8_ = _tmp7_;
	_tmp9_ = *_tmp8_;
	_g_free0 (_tmp8_);
	result = _tmp9_;
	_g_free0 (_tmp5_);
	_ft_variable_spec_unref0 (variable_spec);
	return result;
}

static FtValue*
ft_variable_real_evaluate (FtExpression* base,
                           FtContext* context,
                           GError** error)
{
	FtVariable * self;
	FtValue* value = NULL;
	const gchar* _tmp0_;
	FtValue* _tmp1_;
	FtValue* _tmp2_;
	GError* _inner_error0_ = NULL;
	FtValue* result;
	self = (FtVariable*) base;
	g_return_val_if_fail (context != NULL, NULL);
	_tmp0_ = self->name;
	_tmp1_ = ft_context_evaluate_variable (context, _tmp0_);
	value = _tmp1_;
	_tmp2_ = value;
	if (_tmp2_ == NULL) {
		const gchar* _tmp3_;
		GError* _tmp4_;
		_tmp3_ = self->name;
		_tmp4_ = g_error_new (FT_EXPRESSION_ERROR, FT_EXPRESSION_ERROR_INVALID, _ ("Unknown variable \"%s\""), _tmp3_);
		_inner_error0_ = _tmp4_;
		if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_ft_value_unref0 (value);
			return NULL;
		} else {
			_ft_value_unref0 (value);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	result = value;
	return result;
}

static gchar*
ft_variable_real_to_string (FtExpression* base)
{
	FtVariable * self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	self = (FtVariable*) base;
	_tmp0_ = self->name;
	_tmp1_ = ft_to_camel_case (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
ft_variable_class_init (FtVariableClass * klass,
                        gpointer klass_data)
{
	ft_variable_parent_class = g_type_class_peek_parent (klass);
	((FtExpressionClass *) klass)->finalize = ft_variable_finalize;
	((FtExpressionClass *) klass)->get_result_type = (GType (*) (FtExpression*)) ft_variable_real_get_result_type;
	((FtExpressionClass *) klass)->evaluate = (FtValue* (*) (FtExpression*, FtContext*, GError**)) ft_variable_real_evaluate;
	((FtExpressionClass *) klass)->to_string = (gchar* (*) (FtExpression*)) ft_variable_real_to_string;
}

static void
ft_variable_instance_init (FtVariable * self,
                           gpointer klass)
{
}

static void
ft_variable_finalize (FtExpression * obj)
{
	FtVariable * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_VARIABLE, FtVariable);
	_g_free0 (self->name);
	FT_EXPRESSION_CLASS (ft_variable_parent_class)->finalize (obj);
}

static GType
ft_variable_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtVariableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_variable_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtVariable), 0, (GInstanceInitFunc) ft_variable_instance_init, NULL };
	GType ft_variable_type_id;
	ft_variable_type_id = g_type_register_static (FT_TYPE_EXPRESSION, "FtVariable", &g_define_type_info, 0);
	return ft_variable_type_id;
}

GType
ft_variable_get_type (void)
{
	static volatile gsize ft_variable_type_id__once = 0;
	if (g_once_init_enter (&ft_variable_type_id__once)) {
		GType ft_variable_type_id;
		ft_variable_type_id = ft_variable_get_type_once ();
		g_once_init_leave (&ft_variable_type_id__once, ft_variable_type_id);
	}
	return ft_variable_type_id__once;
}

static gpointer
_ft_expression_ref0 (gpointer self)
{
	return self ? ft_expression_ref (self) : NULL;
}

static void
_vala_array_add16 (FtExpression** * array,
                   gint* length,
                   gint* size,
                   FtExpression* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (FtExpression*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static FtExpression**
_vala_array_dup9 (FtExpression** self,
                  gssize length)
{
	if (length >= 0) {
		FtExpression** result;
		gssize i;
		result = g_new0 (FtExpression*, length + 1);
		for (i = 0; i < length; i++) {
			FtExpression* _tmp0_;
			_tmp0_ = _ft_expression_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

FtOperation*
ft_operation_constructv (GType object_type,
                         FtOperator operator,
                         va_list _vala_va_list)
{
	FtOperation* self = NULL;
	va_list arguments_list = {0};
	FtExpression** arguments = NULL;
	FtExpression** _tmp0_;
	gint arguments_length1;
	gint _arguments_size_;
	FtExpression** _tmp6_;
	gint _tmp6__length1;
	FtExpression** _tmp7_;
	gint _tmp7__length1;
	self = (FtOperation*) ft_expression_construct (object_type);
	va_copy (arguments_list, _vala_va_list);
	_tmp0_ = g_new0 (FtExpression*, 0 + 1);
	arguments = _tmp0_;
	arguments_length1 = 0;
	_arguments_size_ = arguments_length1;
	while (TRUE) {
		FtExpression* argument = NULL;
		FtExpression* _tmp1_;
		FtExpression* _tmp2_;
		FtExpression* _tmp3_;
		_tmp1_ = va_arg (arguments_list, FtExpression*);
		_tmp2_ = _ft_expression_ref0 (_tmp1_);
		argument = _tmp2_;
		_tmp3_ = argument;
		if (_tmp3_ != NULL) {
			FtExpression* _tmp4_;
			FtExpression* _tmp5_;
			_tmp4_ = argument;
			_tmp5_ = _ft_expression_ref0 (_tmp4_);
			_vala_array_add16 (&arguments, &arguments_length1, &_arguments_size_, _tmp5_);
		} else {
			_ft_expression_unref0 (argument);
			break;
		}
		_ft_expression_unref0 (argument);
	}
	self->operator = operator;
	_tmp6_ = arguments;
	_tmp6__length1 = arguments_length1;
	_tmp7_ = (_tmp6_ != NULL) ? _vala_array_dup9 (_tmp6_, _tmp6__length1) : _tmp6_;
	_tmp7__length1 = _tmp6__length1;
	self->arguments = (_vala_array_free (self->arguments, self->arguments_length1, (GDestroyNotify) ft_expression_unref), NULL);
	self->arguments = _tmp7_;
	self->arguments_length1 = _tmp7__length1;
	arguments = (_vala_array_free (arguments, arguments_length1, (GDestroyNotify) ft_expression_unref), NULL);
	va_end (arguments_list);
	return self;
}

FtOperation*
ft_operation_new (FtOperator operator,
                  ...)
{
	va_list _vala_va_list_obj;
	va_start (_vala_va_list_obj, operator);
	return ft_operation_constructv (FT_TYPE_OPERATION, operator, _vala_va_list_obj);
}

FtOperation*
ft_operation_construct (GType object_type,
                        FtOperator operator,
                        ...)
{
	va_list _vala_va_list_obj;
	va_start (_vala_va_list_obj, operator);
	return ft_operation_constructv (object_type, operator, _vala_va_list_obj);
}

static FtExpression**
_vala_array_dup10 (FtExpression** self,
                   gssize length)
{
	if (length >= 0) {
		FtExpression** result;
		gssize i;
		result = g_new0 (FtExpression*, length + 1);
		for (i = 0; i < length; i++) {
			FtExpression* _tmp0_;
			_tmp0_ = _ft_expression_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

FtOperation*
ft_operation_construct_with_argv (GType object_type,
                                  FtOperator operator,
                                  FtExpression** arguments,
                                  gint arguments_length1)
{
	FtOperation* self = NULL;
	FtExpression** _tmp0_;
	gint _tmp0__length1;
	self = (FtOperation*) ft_expression_construct (object_type);
	self->operator = operator;
	_tmp0_ = (arguments != NULL) ? _vala_array_dup10 (arguments, arguments_length1) : arguments;
	_tmp0__length1 = arguments_length1;
	self->arguments = (_vala_array_free (self->arguments, self->arguments_length1, (GDestroyNotify) ft_expression_unref), NULL);
	self->arguments = _tmp0_;
	self->arguments_length1 = _tmp0__length1;
	arguments = (_vala_array_free (arguments, arguments_length1, (GDestroyNotify) ft_expression_unref), NULL);
	return self;
}

FtOperation*
ft_operation_new_with_argv (FtOperator operator,
                            FtExpression** arguments,
                            gint arguments_length1)
{
	return ft_operation_construct_with_argv (FT_TYPE_OPERATION, operator, arguments, arguments_length1);
}

static GType
ft_operation_real_get_result_type (FtExpression* base)
{
	FtOperation * self;
	GType* result_type = NULL;
	FtExpression** _tmp0_;
	gint _tmp0__length1;
	GType* _tmp10_;
	GType _tmp11_;
	GType result;
	self = (FtOperation*) base;
	result_type = NULL;
	_tmp0_ = self->arguments;
	_tmp0__length1 = self->arguments_length1;
	{
		FtExpression** expression_collection = NULL;
		gint expression_collection_length1 = 0;
		gint _expression_collection_size_ = 0;
		gint expression_it = 0;
		expression_collection = _tmp0_;
		expression_collection_length1 = _tmp0__length1;
		for (expression_it = 0; expression_it < expression_collection_length1; expression_it = expression_it + 1) {
			FtExpression* _tmp1_;
			FtExpression* expression = NULL;
			_tmp1_ = _ft_expression_ref0 (expression_collection[expression_it]);
			expression = _tmp1_;
			{
				GType* _tmp2_;
				_tmp2_ = result_type;
				if (_tmp2_ == NULL) {
					FtExpression* _tmp3_;
					GType _tmp4_;
					GType* _tmp5_;
					_tmp3_ = expression;
					_tmp4_ = ft_expression_get_result_type (_tmp3_);
					_tmp5_ = __g_type_dup0 (&_tmp4_);
					_g_free0 (result_type);
					result_type = _tmp5_;
				} else {
					GType* _tmp6_;
					FtExpression* _tmp7_;
					GType _tmp8_;
					GType* _tmp9_;
					_tmp6_ = result_type;
					_tmp7_ = expression;
					_tmp8_ = ft_operator_get_result_type (self->operator, *_tmp6_, ft_expression_get_result_type (_tmp7_));
					_tmp9_ = __g_type_dup0 (&_tmp8_);
					_g_free0 (result_type);
					result_type = _tmp9_;
				}
				_ft_expression_unref0 (expression);
			}
		}
	}
	_tmp10_ = result_type;
	_tmp11_ = *_tmp10_;
	_g_free0 (_tmp10_);
	result = _tmp11_;
	return result;
}

static FtValue*
ft_operation_real_evaluate (FtExpression* base,
                            FtContext* context,
                            GError** error)
{
	FtOperation * self;
	FtExpression** _tmp0_;
	gint _tmp0__length1;
	FtValue* _result_ = NULL;
	FtExpression** _tmp5_;
	gint _tmp5__length1;
	GError* _inner_error0_ = NULL;
	FtValue* result;
	self = (FtOperation*) base;
	g_return_val_if_fail (context != NULL, NULL);
	_tmp0_ = self->arguments;
	_tmp0__length1 = self->arguments_length1;
	if (_tmp0__length1 == 0) {
		gchar* _tmp1_;
		gchar* _tmp2_;
		GError* _tmp3_;
		GError* _tmp4_;
		_tmp1_ = ft_operator_to_string (self->operator);
		_tmp2_ = _tmp1_;
		_tmp3_ = g_error_new (FT_EXPRESSION_ERROR, FT_EXPRESSION_ERROR_EMPTY, "No arguments to perform '%s' operation", _tmp2_);
		_tmp4_ = _tmp3_;
		_g_free0 (_tmp2_);
		_inner_error0_ = _tmp4_;
		if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
			g_propagate_error (error, _inner_error0_);
			return NULL;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_result_ = NULL;
	_tmp5_ = self->arguments;
	_tmp5__length1 = self->arguments_length1;
	{
		FtExpression** expression_collection = NULL;
		gint expression_collection_length1 = 0;
		gint _expression_collection_size_ = 0;
		gint expression_it = 0;
		expression_collection = _tmp5_;
		expression_collection_length1 = _tmp5__length1;
		for (expression_it = 0; expression_it < expression_collection_length1; expression_it = expression_it + 1) {
			FtExpression* _tmp6_;
			FtExpression* expression = NULL;
			_tmp6_ = _ft_expression_ref0 (expression_collection[expression_it]);
			expression = _tmp6_;
			{
				FtValue* expression_result = NULL;
				FtExpression* _tmp7_;
				FtValue* _tmp8_;
				FtValue* _tmp9_;
				_tmp7_ = expression;
				_tmp8_ = ft_expression_evaluate (_tmp7_, context, &_inner_error0_);
				expression_result = _tmp8_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
						g_propagate_error (error, _inner_error0_);
						_ft_expression_unref0 (expression);
						_ft_value_unref0 (_result_);
						return NULL;
					} else {
						_ft_expression_unref0 (expression);
						_ft_value_unref0 (_result_);
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
						g_clear_error (&_inner_error0_);
						return NULL;
					}
				}
				_tmp9_ = _result_;
				if (_tmp9_ == NULL) {
					FtValue* _tmp10_;
					FtValue* _tmp11_;
					_tmp10_ = expression_result;
					_tmp11_ = _ft_value_ref0 (_tmp10_);
					_ft_value_unref0 (_result_);
					_result_ = _tmp11_;
				} else {
					FtValue* _tmp12_ = NULL;
					FtValue* _tmp13_;
					FtValue* _tmp14_;
					FtValue* _tmp15_;
					FtValue* _tmp16_;
					_tmp13_ = _result_;
					_tmp14_ = expression_result;
					_tmp15_ = ft_operator_apply (self->operator, _tmp13_, _tmp14_, &_inner_error0_);
					_tmp12_ = _tmp15_;
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
							g_propagate_error (error, _inner_error0_);
							_ft_value_unref0 (expression_result);
							_ft_expression_unref0 (expression);
							_ft_value_unref0 (_result_);
							return NULL;
						} else {
							_ft_value_unref0 (expression_result);
							_ft_expression_unref0 (expression);
							_ft_value_unref0 (_result_);
							g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
							g_clear_error (&_inner_error0_);
							return NULL;
						}
					}
					_tmp16_ = _tmp12_;
					_tmp12_ = NULL;
					_ft_value_unref0 (_result_);
					_result_ = _tmp16_;
					_ft_value_unref0 (_tmp12_);
				}
				_ft_value_unref0 (expression_result);
				_ft_expression_unref0 (expression);
			}
		}
	}
	result = _result_;
	return result;
}

static gchar*
ft_operation_argument_to_string (FtOperation* self,
                                 FtExpression* expression)
{
	gchar* expression_string = NULL;
	gchar* _tmp0_;
	FtOperator expression_operator = 0;
	gchar* _tmp1_ = NULL;
	FtOperator _tmp2_ = 0;
	gboolean _tmp3_;
	gchar* _tmp8_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (expression != NULL, NULL);
	_tmp0_ = ft_expression_to_string (expression);
	expression_string = _tmp0_;
	_tmp3_ = ft_get_inner_operator (expression, &_tmp2_);
	expression_operator = _tmp2_;
	if (_tmp3_) {
		const gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp4_ = expression_string;
		_tmp5_ = ft_wrap_argument (_tmp4_, expression_operator, self->operator);
		_g_free0 (_tmp1_);
		_tmp1_ = _tmp5_;
	} else {
		const gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp6_ = expression_string;
		_tmp7_ = g_strdup (_tmp6_);
		_g_free0 (_tmp1_);
		_tmp1_ = _tmp7_;
	}
	_tmp8_ = _tmp1_;
	_tmp1_ = NULL;
	result = _tmp8_;
	_g_free0 (_tmp1_);
	_g_free0 (expression_string);
	return result;
}

static gchar*
ft_operation_real_to_string (FtExpression* base)
{
	FtOperation * self;
	FtExpression** _tmp0_;
	gint _tmp0__length1;
	gchar* result;
	self = (FtOperation*) base;
	_tmp0_ = self->arguments;
	_tmp0__length1 = self->arguments_length1;
	if (_tmp0__length1 != 1) {
		GString* string_builder = NULL;
		GString* _tmp1_;
		gchar* operator_string = NULL;
		gchar* _tmp2_;
		gchar* _tmp3_;
		const gchar* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		GString* _tmp17_;
		const gchar* _tmp18_;
		gchar* _tmp19_;
		_tmp1_ = g_string_new ("");
		string_builder = _tmp1_;
		_tmp2_ = ft_operator_to_string (self->operator);
		_tmp3_ = _tmp2_;
		_tmp4_ = string_to_string (_tmp3_);
		_tmp5_ = g_strconcat (" ", _tmp4_, " ", NULL);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp3_);
		operator_string = _tmp6_;
		{
			gint index = 0;
			index = 0;
			{
				gboolean _tmp7_ = FALSE;
				_tmp7_ = TRUE;
				while (TRUE) {
					FtExpression** _tmp9_;
					gint _tmp9__length1;
					GString* _tmp12_;
					FtExpression** _tmp13_;
					gint _tmp13__length1;
					FtExpression* _tmp14_;
					gchar* _tmp15_;
					gchar* _tmp16_;
					if (!_tmp7_) {
						gint _tmp8_;
						_tmp8_ = index;
						index = _tmp8_ + 1;
					}
					_tmp7_ = FALSE;
					_tmp9_ = self->arguments;
					_tmp9__length1 = self->arguments_length1;
					if (!(index < _tmp9__length1)) {
						break;
					}
					if (index > 0) {
						GString* _tmp10_;
						const gchar* _tmp11_;
						_tmp10_ = string_builder;
						_tmp11_ = operator_string;
						g_string_append (_tmp10_, _tmp11_);
					}
					_tmp12_ = string_builder;
					_tmp13_ = self->arguments;
					_tmp13__length1 = self->arguments_length1;
					_tmp14_ = _tmp13_[index];
					_tmp15_ = ft_operation_argument_to_string (self, _tmp14_);
					_tmp16_ = _tmp15_;
					g_string_append (_tmp12_, _tmp16_);
					_g_free0 (_tmp16_);
				}
			}
		}
		_tmp17_ = string_builder;
		_tmp18_ = _tmp17_->str;
		_tmp19_ = g_strdup (_tmp18_);
		result = _tmp19_;
		_g_free0 (operator_string);
		_g_string_free0 (string_builder);
		return result;
	} else {
		FtExpression** _tmp20_;
		gint _tmp20__length1;
		FtExpression* _tmp21_;
		gchar* _tmp22_;
		_tmp20_ = self->arguments;
		_tmp20__length1 = self->arguments_length1;
		_tmp21_ = _tmp20_[0];
		_tmp22_ = ft_expression_to_string (_tmp21_);
		result = _tmp22_;
		return result;
	}
}

static void
ft_operation_class_init (FtOperationClass * klass,
                         gpointer klass_data)
{
	ft_operation_parent_class = g_type_class_peek_parent (klass);
	((FtExpressionClass *) klass)->finalize = ft_operation_finalize;
	((FtExpressionClass *) klass)->get_result_type = (GType (*) (FtExpression*)) ft_operation_real_get_result_type;
	((FtExpressionClass *) klass)->evaluate = (FtValue* (*) (FtExpression*, FtContext*, GError**)) ft_operation_real_evaluate;
	((FtExpressionClass *) klass)->to_string = (gchar* (*) (FtExpression*)) ft_operation_real_to_string;
}

static void
ft_operation_instance_init (FtOperation * self,
                            gpointer klass)
{
}

static void
ft_operation_finalize (FtExpression * obj)
{
	FtOperation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_OPERATION, FtOperation);
	self->arguments = (_vala_array_free (self->arguments, self->arguments_length1, (GDestroyNotify) ft_expression_unref), NULL);
	FT_EXPRESSION_CLASS (ft_operation_parent_class)->finalize (obj);
}

static GType
ft_operation_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtOperationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_operation_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtOperation), 0, (GInstanceInitFunc) ft_operation_instance_init, NULL };
	GType ft_operation_type_id;
	ft_operation_type_id = g_type_register_static (FT_TYPE_EXPRESSION, "FtOperation", &g_define_type_info, 0);
	return ft_operation_type_id;
}

GType
ft_operation_get_type (void)
{
	static volatile gsize ft_operation_type_id__once = 0;
	if (g_once_init_enter (&ft_operation_type_id__once)) {
		GType ft_operation_type_id;
		ft_operation_type_id = ft_operation_get_type_once ();
		g_once_init_leave (&ft_operation_type_id__once, ft_operation_type_id);
	}
	return ft_operation_type_id__once;
}

FtComparison*
ft_comparison_construct (GType object_type,
                         FtExpression* argument_lhs,
                         FtOperator operator,
                         FtExpression* argument_rhs)
{
	FtComparison* self = NULL;
	FtExpression* _tmp0_;
	FtExpression* _tmp1_;
	g_return_val_if_fail (argument_lhs != NULL, NULL);
	self = (FtComparison*) ft_expression_construct (object_type);
	_tmp0_ = _ft_expression_ref0 (argument_lhs);
	_ft_expression_unref0 (self->argument_lhs);
	self->argument_lhs = _tmp0_;
	self->operator = operator;
	_tmp1_ = _ft_expression_ref0 (argument_rhs);
	_ft_expression_unref0 (self->argument_rhs);
	self->argument_rhs = _tmp1_;
	return self;
}

FtComparison*
ft_comparison_new (FtExpression* argument_lhs,
                   FtOperator operator,
                   FtExpression* argument_rhs)
{
	return ft_comparison_construct (FT_TYPE_COMPARISON, argument_lhs, operator, argument_rhs);
}

FtComparison*
ft_comparison_construct_is_true (GType object_type,
                                 FtExpression* expression)
{
	FtComparison* self = NULL;
	FtExpression* _tmp0_;
	FtBooleanValue* _tmp1_;
	FtBooleanValue* _tmp2_;
	FtConstant* _tmp3_;
	g_return_val_if_fail (expression != NULL, NULL);
	self = (FtComparison*) ft_expression_construct (object_type);
	_tmp0_ = _ft_expression_ref0 (expression);
	_ft_expression_unref0 (self->argument_lhs);
	self->argument_lhs = _tmp0_;
	self->operator = FT_OPERATOR_EQ;
	_tmp1_ = ft_boolean_value_new (TRUE);
	_tmp2_ = _tmp1_;
	_tmp3_ = ft_constant_new ((FtValue*) _tmp2_);
	_ft_expression_unref0 (self->argument_rhs);
	self->argument_rhs = (FtExpression*) _tmp3_;
	_ft_value_unref0 (_tmp2_);
	return self;
}

FtComparison*
ft_comparison_new_is_true (FtExpression* expression)
{
	return ft_comparison_construct_is_true (FT_TYPE_COMPARISON, expression);
}

static GType
ft_comparison_real_get_result_type (FtExpression* base)
{
	FtComparison * self;
	GType result;
	self = (FtComparison*) base;
	result = FT_TYPE_BOOLEAN_VALUE;
	return result;
}

static FtValue*
ft_comparison_real_evaluate (FtExpression* base,
                             FtContext* context,
                             GError** error)
{
	FtComparison * self;
	gboolean _tmp4_ = FALSE;
	FtExpression* _tmp5_;
	FtValue* result_lhs = NULL;
	FtExpression* _tmp8_;
	FtValue* _tmp9_;
	FtValue* result_rhs = NULL;
	FtExpression* _tmp10_;
	FtValue* _tmp11_;
	FtValue* _tmp12_ = NULL;
	FtValue* _tmp13_;
	FtValue* _tmp14_;
	FtValue* _tmp15_;
	FtValue* _tmp16_;
	GError* _inner_error0_ = NULL;
	FtValue* result;
	self = (FtComparison*) base;
	g_return_val_if_fail (context != NULL, NULL);
	if (ft_operator_get_category (self->operator) != FT_OPERATOR_CATEGORY_COMPARISON) {
		gchar* _tmp0_;
		gchar* _tmp1_;
		GError* _tmp2_;
		GError* _tmp3_;
		_tmp0_ = ft_operator_to_string (self->operator);
		_tmp1_ = _tmp0_;
		_tmp2_ = g_error_new (FT_EXPRESSION_ERROR, FT_EXPRESSION_ERROR_INVALID, "Expecting comparison operator, not %s", _tmp1_);
		_tmp3_ = _tmp2_;
		_g_free0 (_tmp1_);
		_inner_error0_ = _tmp3_;
		if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
			g_propagate_error (error, _inner_error0_);
			return NULL;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp5_ = self->argument_lhs;
	if (_tmp5_ == NULL) {
		_tmp4_ = TRUE;
	} else {
		FtExpression* _tmp6_;
		_tmp6_ = self->argument_rhs;
		_tmp4_ = _tmp6_ == NULL;
	}
	if (_tmp4_) {
		GError* _tmp7_;
		_tmp7_ = g_error_new_literal (FT_EXPRESSION_ERROR, FT_EXPRESSION_ERROR_EMPTY, "Missing an argument for a comparison");
		_inner_error0_ = _tmp7_;
		if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
			g_propagate_error (error, _inner_error0_);
			return NULL;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp8_ = self->argument_lhs;
	_tmp9_ = ft_expression_evaluate (_tmp8_, context, &_inner_error0_);
	result_lhs = _tmp9_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
			g_propagate_error (error, _inner_error0_);
			return NULL;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp10_ = self->argument_rhs;
	_tmp11_ = ft_expression_evaluate (_tmp10_, context, &_inner_error0_);
	result_rhs = _tmp11_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_ft_value_unref0 (result_lhs);
			return NULL;
		} else {
			_ft_value_unref0 (result_lhs);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp13_ = result_lhs;
	_tmp14_ = result_rhs;
	_tmp15_ = ft_operator_apply (self->operator, _tmp13_, _tmp14_, &_inner_error0_);
	_tmp12_ = _tmp15_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == FT_EXPRESSION_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_ft_value_unref0 (result_rhs);
			_ft_value_unref0 (result_lhs);
			return NULL;
		} else {
			_ft_value_unref0 (result_rhs);
			_ft_value_unref0 (result_lhs);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp16_ = _tmp12_;
	_tmp12_ = NULL;
	result = _tmp16_;
	_ft_value_unref0 (_tmp12_);
	_ft_value_unref0 (result_rhs);
	_ft_value_unref0 (result_lhs);
	return result;
}

static gchar*
ft_comparison_argument_to_string (FtComparison* self,
                                  FtExpression* expression)
{
	gchar* expression_string = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_ = NULL;
	gchar* _tmp7_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (expression != NULL, NULL);
	_tmp0_ = ft_expression_to_string (expression);
	expression_string = _tmp0_;
	if (ft_get_inner_operator (expression, NULL)) {
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		gchar* _tmp4_;
		_tmp2_ = expression_string;
		_tmp3_ = string_to_string (_tmp2_);
		_tmp4_ = g_strconcat ("(", _tmp3_, ")", NULL);
		_g_free0 (_tmp1_);
		_tmp1_ = _tmp4_;
	} else {
		const gchar* _tmp5_;
		gchar* _tmp6_;
		_tmp5_ = expression_string;
		_tmp6_ = g_strdup (_tmp5_);
		_g_free0 (_tmp1_);
		_tmp1_ = _tmp6_;
	}
	_tmp7_ = _tmp1_;
	_tmp1_ = NULL;
	result = _tmp7_;
	_g_free0 (_tmp1_);
	_g_free0 (expression_string);
	return result;
}

static gboolean
ft_comparison_argument_is_true (FtComparison* self,
                                FtExpression* expression)
{
	FtConstant* constant = NULL;
	FtConstant* _tmp0_;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_ = FALSE;
	FtConstant* _tmp5_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (expression != NULL, FALSE);
	_tmp0_ = _ft_expression_ref0 (FT_IS_CONSTANT (expression) ? ((FtConstant*) expression) : NULL);
	constant = _tmp0_;
	if (self->operator != FT_OPERATOR_EQ) {
		_tmp1_ = TRUE;
	} else {
		FtConstant* _tmp2_;
		_tmp2_ = constant;
		_tmp1_ = _tmp2_ == NULL;
	}
	if (_tmp1_) {
		result = FALSE;
		_ft_expression_unref0 (constant);
		return result;
	}
	_tmp5_ = constant;
	if (_tmp5_ != NULL) {
		FtConstant* _tmp6_;
		FtValue* _tmp7_;
		_tmp6_ = constant;
		_tmp7_ = _tmp6_->value;
		_tmp4_ = FT_IS_BOOLEAN_VALUE (_tmp7_);
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		FtConstant* _tmp8_;
		FtValue* _tmp9_;
		_tmp8_ = constant;
		_tmp9_ = _tmp8_->value;
		_tmp3_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, FT_TYPE_BOOLEAN_VALUE, FtBooleanValue)->data;
	} else {
		_tmp3_ = FALSE;
	}
	result = _tmp3_;
	_ft_expression_unref0 (constant);
	return result;
}

static gchar*
ft_comparison_real_to_string (FtExpression* base)
{
	FtComparison * self;
	FtExpression* _tmp0_;
	FtExpression* _tmp3_;
	gchar* argument_lhs_string = NULL;
	FtExpression* _tmp6_;
	gchar* _tmp7_;
	gchar* argument_rhs_string = NULL;
	FtExpression* _tmp8_;
	gchar* _tmp9_;
	gchar* operator_string = NULL;
	gchar* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* result;
	self = (FtComparison*) base;
	_tmp0_ = self->argument_rhs;
	if (ft_comparison_argument_is_true (self, _tmp0_)) {
		FtExpression* _tmp1_;
		gchar* _tmp2_;
		_tmp1_ = self->argument_lhs;
		_tmp2_ = ft_expression_to_string (_tmp1_);
		result = _tmp2_;
		return result;
	}
	_tmp3_ = self->argument_lhs;
	if (ft_comparison_argument_is_true (self, _tmp3_)) {
		FtExpression* _tmp4_;
		gchar* _tmp5_;
		_tmp4_ = self->argument_rhs;
		_tmp5_ = ft_expression_to_string (_tmp4_);
		result = _tmp5_;
		return result;
	}
	_tmp6_ = self->argument_lhs;
	_tmp7_ = ft_comparison_argument_to_string (self, _tmp6_);
	argument_lhs_string = _tmp7_;
	_tmp8_ = self->argument_rhs;
	_tmp9_ = ft_comparison_argument_to_string (self, _tmp8_);
	argument_rhs_string = _tmp9_;
	_tmp10_ = ft_operator_to_string (self->operator);
	operator_string = _tmp10_;
	_tmp11_ = argument_lhs_string;
	_tmp12_ = string_to_string (_tmp11_);
	_tmp13_ = operator_string;
	_tmp14_ = string_to_string (_tmp13_);
	_tmp15_ = argument_rhs_string;
	_tmp16_ = string_to_string (_tmp15_);
	_tmp17_ = g_strconcat (_tmp12_, " ", _tmp14_, " ", _tmp16_, NULL);
	result = _tmp17_;
	_g_free0 (operator_string);
	_g_free0 (argument_rhs_string);
	_g_free0 (argument_lhs_string);
	return result;
}

static void
ft_comparison_class_init (FtComparisonClass * klass,
                          gpointer klass_data)
{
	ft_comparison_parent_class = g_type_class_peek_parent (klass);
	((FtExpressionClass *) klass)->finalize = ft_comparison_finalize;
	((FtExpressionClass *) klass)->get_result_type = (GType (*) (FtExpression*)) ft_comparison_real_get_result_type;
	((FtExpressionClass *) klass)->evaluate = (FtValue* (*) (FtExpression*, FtContext*, GError**)) ft_comparison_real_evaluate;
	((FtExpressionClass *) klass)->to_string = (gchar* (*) (FtExpression*)) ft_comparison_real_to_string;
}

static void
ft_comparison_instance_init (FtComparison * self,
                             gpointer klass)
{
}

static void
ft_comparison_finalize (FtExpression * obj)
{
	FtComparison * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_COMPARISON, FtComparison);
	_ft_expression_unref0 (self->argument_lhs);
	_ft_expression_unref0 (self->argument_rhs);
	FT_EXPRESSION_CLASS (ft_comparison_parent_class)->finalize (obj);
}

static GType
ft_comparison_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtComparisonClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_comparison_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtComparison), 0, (GInstanceInitFunc) ft_comparison_instance_init, NULL };
	GType ft_comparison_type_id;
	ft_comparison_type_id = g_type_register_static (FT_TYPE_EXPRESSION, "FtComparison", &g_define_type_info, 0);
	return ft_comparison_type_id;
}

GType
ft_comparison_get_type (void)
{
	static volatile gsize ft_comparison_type_id__once = 0;
	if (g_once_init_enter (&ft_comparison_type_id__once)) {
		GType ft_comparison_type_id;
		ft_comparison_type_id = ft_comparison_get_type_once ();
		g_once_init_leave (&ft_comparison_type_id__once, ft_comparison_type_id);
	}
	return ft_comparison_type_id__once;
}

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

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

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

