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

/* valaarraycreationexpression.vala
 *
 * Copyright (C) 2006-2010  Jürg Billeter
 * Copyright (C) 2006-2008  Raffaele Sandrini
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Raffaele Sandrini <raffaele@sandrini.ch>
 * 	Jürg Billeter <j@bitron.ch>
 */

#include <glib.h>
#include <glib-object.h>
#include "vala.h"
#include <valagee.h>

#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
#define _vala_code_node_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_node_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _ValaArrayCreationExpressionPrivate {
	gint _rank;
	ValaList* sizes;
	ValaDataType* _element_type;
	ValaInitializerList* _initializer_list;
};


static gpointer vala_array_creation_expression_parent_class = NULL;

#define VALA_ARRAY_CREATION_EXPRESSION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VALA_TYPE_ARRAY_CREATION_EXPRESSION, ValaArrayCreationExpressionPrivate))
static void vala_array_creation_expression_real_accept_children (ValaCodeNode* base, ValaCodeVisitor* visitor);
static void vala_array_creation_expression_real_accept (ValaCodeNode* base, ValaCodeVisitor* visitor);
static gboolean vala_array_creation_expression_real_is_pure (ValaExpression* base);
static gboolean vala_array_creation_expression_real_is_accessible (ValaExpression* base, ValaSymbol* sym);
static void vala_array_creation_expression_real_replace_expression (ValaCodeNode* base, ValaExpression* old_node, ValaExpression* new_node);
static void vala_array_creation_expression_real_replace_type (ValaCodeNode* base, ValaDataType* old_type, ValaDataType* new_type);
static gint vala_array_creation_expression_create_sizes_from_initializer_list (ValaArrayCreationExpression* self, ValaCodeContext* context, ValaInitializerList* il, gint rank, ValaList* sl);
static gboolean vala_array_creation_expression_real_check (ValaCodeNode* base, ValaCodeContext* context);
static void vala_array_creation_expression_real_emit (ValaCodeNode* base, ValaCodeGenerator* codegen);
static void vala_array_creation_expression_real_get_used_variables (ValaCodeNode* base, ValaCollection* collection);
static void vala_array_creation_expression_finalize (ValaCodeNode * obj);


/**
 * Add a size expression.
 */
void vala_array_creation_expression_append_size (ValaArrayCreationExpression* self, ValaExpression* size) {
	ValaList* _tmp0_;
	ValaExpression* _tmp1_;
	ValaExpression* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (size != NULL);
	_tmp0_ = self->priv->sizes;
	_tmp1_ = size;
	vala_collection_add ((ValaCollection*) _tmp0_, _tmp1_);
	_tmp2_ = size;
	if (_tmp2_ != NULL) {
		ValaExpression* _tmp3_;
		_tmp3_ = size;
		vala_code_node_set_parent_node ((ValaCodeNode*) _tmp3_, (ValaCodeNode*) self);
	}
}


/**
 * Get the sizes for all dimensions ascending from left to right.
 */
static gpointer _vala_iterable_ref0 (gpointer self) {
	return self ? vala_iterable_ref (self) : NULL;
}


ValaList* vala_array_creation_expression_get_sizes (ValaArrayCreationExpression* self) {
	ValaList* result = NULL;
	ValaList* _tmp0_;
	ValaList* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->sizes;
	_tmp1_ = _vala_iterable_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}


ValaArrayCreationExpression* vala_array_creation_expression_construct (GType object_type, ValaDataType* element_type, gint rank, ValaInitializerList* initializer_list, ValaSourceReference* source_reference) {
	ValaArrayCreationExpression* self = NULL;
	ValaDataType* _tmp0_;
	gint _tmp1_;
	ValaInitializerList* _tmp2_;
	ValaSourceReference* _tmp3_;
	g_return_val_if_fail (element_type != NULL, NULL);
	g_return_val_if_fail (source_reference != NULL, NULL);
	self = (ValaArrayCreationExpression*) vala_expression_construct (object_type);
	_tmp0_ = element_type;
	vala_array_creation_expression_set_element_type (self, _tmp0_);
	_tmp1_ = rank;
	vala_array_creation_expression_set_rank (self, _tmp1_);
	_tmp2_ = initializer_list;
	vala_array_creation_expression_set_initializer_list (self, _tmp2_);
	_tmp3_ = source_reference;
	vala_code_node_set_source_reference ((ValaCodeNode*) self, _tmp3_);
	return self;
}


ValaArrayCreationExpression* vala_array_creation_expression_new (ValaDataType* element_type, gint rank, ValaInitializerList* initializer_list, ValaSourceReference* source_reference) {
	return vala_array_creation_expression_construct (VALA_TYPE_ARRAY_CREATION_EXPRESSION, element_type, rank, initializer_list, source_reference);
}


static void vala_array_creation_expression_real_accept_children (ValaCodeNode* base, ValaCodeVisitor* visitor) {
	ValaArrayCreationExpression * self;
	ValaDataType* _tmp0_;
	ValaDataType* _tmp1_;
	ValaInitializerList* _tmp18_;
	ValaInitializerList* _tmp19_;
	self = (ValaArrayCreationExpression*) base;
	g_return_if_fail (visitor != NULL);
	_tmp0_ = vala_array_creation_expression_get_element_type (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		ValaDataType* _tmp2_;
		ValaDataType* _tmp3_;
		ValaCodeVisitor* _tmp4_;
		_tmp2_ = vala_array_creation_expression_get_element_type (self);
		_tmp3_ = _tmp2_;
		_tmp4_ = visitor;
		vala_code_node_accept ((ValaCodeNode*) _tmp3_, _tmp4_);
	}
	{
		ValaList* _e_list = NULL;
		ValaList* _tmp5_;
		ValaList* _tmp6_;
		gint _e_size = 0;
		ValaList* _tmp7_;
		gint _tmp8_;
		gint _tmp9_;
		gint _e_index = 0;
		_tmp5_ = self->priv->sizes;
		_tmp6_ = _vala_iterable_ref0 (_tmp5_);
		_e_list = _tmp6_;
		_tmp7_ = _e_list;
		_tmp8_ = vala_collection_get_size ((ValaCollection*) _tmp7_);
		_tmp9_ = _tmp8_;
		_e_size = _tmp9_;
		_e_index = -1;
		while (TRUE) {
			gint _tmp10_;
			gint _tmp11_;
			gint _tmp12_;
			ValaExpression* e = NULL;
			ValaList* _tmp13_;
			gint _tmp14_;
			gpointer _tmp15_;
			ValaExpression* _tmp16_;
			ValaCodeVisitor* _tmp17_;
			_tmp10_ = _e_index;
			_e_index = _tmp10_ + 1;
			_tmp11_ = _e_index;
			_tmp12_ = _e_size;
			if (!(_tmp11_ < _tmp12_)) {
				break;
			}
			_tmp13_ = _e_list;
			_tmp14_ = _e_index;
			_tmp15_ = vala_list_get (_tmp13_, _tmp14_);
			e = (ValaExpression*) _tmp15_;
			_tmp16_ = e;
			_tmp17_ = visitor;
			vala_code_node_accept ((ValaCodeNode*) _tmp16_, _tmp17_);
			_vala_code_node_unref0 (e);
		}
		_vala_iterable_unref0 (_e_list);
	}
	_tmp18_ = vala_array_creation_expression_get_initializer_list (self);
	_tmp19_ = _tmp18_;
	if (_tmp19_ != NULL) {
		ValaInitializerList* _tmp20_;
		ValaInitializerList* _tmp21_;
		ValaCodeVisitor* _tmp22_;
		_tmp20_ = vala_array_creation_expression_get_initializer_list (self);
		_tmp21_ = _tmp20_;
		_tmp22_ = visitor;
		vala_code_node_accept ((ValaCodeNode*) _tmp21_, _tmp22_);
	}
}


static void vala_array_creation_expression_real_accept (ValaCodeNode* base, ValaCodeVisitor* visitor) {
	ValaArrayCreationExpression * self;
	ValaCodeVisitor* _tmp0_;
	ValaCodeVisitor* _tmp1_;
	self = (ValaArrayCreationExpression*) base;
	g_return_if_fail (visitor != NULL);
	_tmp0_ = visitor;
	vala_code_visitor_visit_array_creation_expression (_tmp0_, self);
	_tmp1_ = visitor;
	vala_code_visitor_visit_expression (_tmp1_, (ValaExpression*) self);
}


static gboolean vala_array_creation_expression_real_is_pure (ValaExpression* base) {
	ValaArrayCreationExpression * self;
	gboolean result = FALSE;
	self = (ValaArrayCreationExpression*) base;
	result = FALSE;
	return result;
}


static gboolean vala_array_creation_expression_real_is_accessible (ValaExpression* base, ValaSymbol* sym) {
	ValaArrayCreationExpression * self;
	gboolean result = FALSE;
	ValaInitializerList* _tmp14_;
	ValaInitializerList* _tmp15_;
	self = (ValaArrayCreationExpression*) base;
	g_return_val_if_fail (sym != NULL, FALSE);
	{
		ValaList* _e_list = NULL;
		ValaList* _tmp0_;
		ValaList* _tmp1_;
		gint _e_size = 0;
		ValaList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _e_index = 0;
		_tmp0_ = self->priv->sizes;
		_tmp1_ = _vala_iterable_ref0 (_tmp0_);
		_e_list = _tmp1_;
		_tmp2_ = _e_list;
		_tmp3_ = vala_collection_get_size ((ValaCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_e_size = _tmp4_;
		_e_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			gint _tmp7_;
			ValaExpression* e = NULL;
			ValaList* _tmp8_;
			gint _tmp9_;
			gpointer _tmp10_;
			ValaExpression* _tmp11_;
			ValaSymbol* _tmp12_;
			gboolean _tmp13_;
			_tmp5_ = _e_index;
			_e_index = _tmp5_ + 1;
			_tmp6_ = _e_index;
			_tmp7_ = _e_size;
			if (!(_tmp6_ < _tmp7_)) {
				break;
			}
			_tmp8_ = _e_list;
			_tmp9_ = _e_index;
			_tmp10_ = vala_list_get (_tmp8_, _tmp9_);
			e = (ValaExpression*) _tmp10_;
			_tmp11_ = e;
			_tmp12_ = sym;
			_tmp13_ = vala_expression_is_accessible (_tmp11_, _tmp12_);
			if (!_tmp13_) {
				result = FALSE;
				_vala_code_node_unref0 (e);
				_vala_iterable_unref0 (_e_list);
				return result;
			}
			_vala_code_node_unref0 (e);
		}
		_vala_iterable_unref0 (_e_list);
	}
	_tmp14_ = vala_array_creation_expression_get_initializer_list (self);
	_tmp15_ = _tmp14_;
	if (_tmp15_ != NULL) {
		ValaInitializerList* _tmp16_;
		ValaInitializerList* _tmp17_;
		ValaSymbol* _tmp18_;
		gboolean _tmp19_;
		_tmp16_ = vala_array_creation_expression_get_initializer_list (self);
		_tmp17_ = _tmp16_;
		_tmp18_ = sym;
		_tmp19_ = vala_expression_is_accessible ((ValaExpression*) _tmp17_, _tmp18_);
		result = _tmp19_;
		return result;
	}
	result = TRUE;
	return result;
}


static void vala_array_creation_expression_real_replace_expression (ValaCodeNode* base, ValaExpression* old_node, ValaExpression* new_node) {
	ValaArrayCreationExpression * self;
	self = (ValaArrayCreationExpression*) base;
	g_return_if_fail (old_node != NULL);
	g_return_if_fail (new_node != NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				gint _tmp2_;
				ValaList* _tmp3_;
				gint _tmp4_;
				gint _tmp5_;
				ValaList* _tmp6_;
				gint _tmp7_;
				gpointer _tmp8_;
				ValaExpression* _tmp9_;
				ValaExpression* _tmp10_;
				gboolean _tmp11_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = i;
				_tmp3_ = self->priv->sizes;
				_tmp4_ = vala_collection_get_size ((ValaCollection*) _tmp3_);
				_tmp5_ = _tmp4_;
				if (!(_tmp2_ < _tmp5_)) {
					break;
				}
				_tmp6_ = self->priv->sizes;
				_tmp7_ = i;
				_tmp8_ = vala_list_get (_tmp6_, _tmp7_);
				_tmp9_ = (ValaExpression*) _tmp8_;
				_tmp10_ = old_node;
				_tmp11_ = _tmp9_ == _tmp10_;
				_vala_code_node_unref0 (_tmp9_);
				if (_tmp11_) {
					ValaList* _tmp12_;
					gint _tmp13_;
					ValaExpression* _tmp14_;
					_tmp12_ = self->priv->sizes;
					_tmp13_ = i;
					_tmp14_ = new_node;
					vala_list_set (_tmp12_, _tmp13_, _tmp14_);
					return;
				}
			}
		}
	}
}


static void vala_array_creation_expression_real_replace_type (ValaCodeNode* base, ValaDataType* old_type, ValaDataType* new_type) {
	ValaArrayCreationExpression * self;
	ValaDataType* _tmp0_;
	ValaDataType* _tmp1_;
	ValaDataType* _tmp2_;
	self = (ValaArrayCreationExpression*) base;
	g_return_if_fail (old_type != NULL);
	g_return_if_fail (new_type != NULL);
	_tmp0_ = vala_array_creation_expression_get_element_type (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = old_type;
	if (_tmp1_ == _tmp2_) {
		ValaDataType* _tmp3_;
		_tmp3_ = new_type;
		vala_array_creation_expression_set_element_type (self, _tmp3_);
	}
}


static gint vala_array_creation_expression_create_sizes_from_initializer_list (ValaArrayCreationExpression* self, ValaCodeContext* context, ValaInitializerList* il, gint rank, ValaList* sl) {
	gint result = 0;
	ValaList* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gint subsize = 0;
	ValaInitializerList* _tmp62_;
	gint _tmp63_;
	gint _tmp64_;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (context != NULL, 0);
	g_return_val_if_fail (il != NULL, 0);
	g_return_val_if_fail (sl != NULL, 0);
	_tmp0_ = sl;
	_tmp1_ = vala_collection_get_size ((ValaCollection*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->_rank;
	_tmp4_ = rank;
	if (_tmp2_ == (_tmp3_ - _tmp4_)) {
		ValaIntegerLiteral* init = NULL;
		ValaInitializerList* _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		ValaInitializerList* _tmp10_;
		ValaSourceReference* _tmp11_;
		ValaSourceReference* _tmp12_;
		ValaIntegerLiteral* _tmp13_;
		ValaIntegerLiteral* _tmp14_;
		ValaIntegerLiteral* _tmp15_;
		ValaCodeContext* _tmp16_;
		ValaList* _tmp17_;
		ValaIntegerLiteral* _tmp18_;
		_tmp5_ = il;
		_tmp6_ = vala_initializer_list_get_size (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = g_strdup_printf ("%i", _tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = il;
		_tmp11_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp10_);
		_tmp12_ = _tmp11_;
		_tmp13_ = vala_integer_literal_new (_tmp9_, _tmp12_);
		_tmp14_ = _tmp13_;
		_g_free0 (_tmp9_);
		init = _tmp14_;
		_tmp15_ = init;
		_tmp16_ = context;
		vala_code_node_check ((ValaCodeNode*) _tmp15_, _tmp16_);
		_tmp17_ = sl;
		_tmp18_ = init;
		vala_collection_add ((ValaCollection*) _tmp17_, (ValaLiteral*) _tmp18_);
		_vala_code_node_unref0 (init);
	}
	subsize = -1;
	{
		ValaList* _e_list = NULL;
		ValaInitializerList* _tmp19_;
		ValaList* _tmp20_;
		gint _e_size = 0;
		ValaList* _tmp21_;
		gint _tmp22_;
		gint _tmp23_;
		gint _e_index = 0;
		_tmp19_ = il;
		_tmp20_ = vala_initializer_list_get_initializers (_tmp19_);
		_e_list = _tmp20_;
		_tmp21_ = _e_list;
		_tmp22_ = vala_collection_get_size ((ValaCollection*) _tmp21_);
		_tmp23_ = _tmp22_;
		_e_size = _tmp23_;
		_e_index = -1;
		while (TRUE) {
			gint _tmp24_;
			gint _tmp25_;
			gint _tmp26_;
			ValaExpression* e = NULL;
			ValaList* _tmp27_;
			gint _tmp28_;
			gpointer _tmp29_;
			ValaExpression* _tmp30_;
			_tmp24_ = _e_index;
			_e_index = _tmp24_ + 1;
			_tmp25_ = _e_index;
			_tmp26_ = _e_size;
			if (!(_tmp25_ < _tmp26_)) {
				break;
			}
			_tmp27_ = _e_list;
			_tmp28_ = _e_index;
			_tmp29_ = vala_list_get (_tmp27_, _tmp28_);
			e = (ValaExpression*) _tmp29_;
			_tmp30_ = e;
			if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp30_, VALA_TYPE_INITIALIZER_LIST)) {
				gint _tmp31_;
				gint size = 0;
				ValaCodeContext* _tmp37_;
				ValaExpression* _tmp38_;
				gint _tmp39_;
				ValaList* _tmp40_;
				gint _tmp41_;
				gint _tmp42_;
				gboolean _tmp43_ = FALSE;
				gint _tmp44_;
				_tmp31_ = rank;
				if (_tmp31_ == 1) {
					ValaInitializerList* _tmp32_;
					ValaExpression* _tmp33_;
					ValaExpression* _tmp34_;
					ValaSourceReference* _tmp35_;
					ValaSourceReference* _tmp36_;
					_tmp32_ = il;
					vala_code_node_set_error ((ValaCodeNode*) _tmp32_, TRUE);
					_tmp33_ = e;
					vala_code_node_set_error ((ValaCodeNode*) _tmp33_, TRUE);
					_tmp34_ = e;
					_tmp35_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp34_);
					_tmp36_ = _tmp35_;
					vala_report_error (_tmp36_, "Expected array element, got array initializer list");
					result = -1;
					_vala_code_node_unref0 (e);
					_vala_iterable_unref0 (_e_list);
					return result;
				}
				_tmp37_ = context;
				_tmp38_ = e;
				_tmp39_ = rank;
				_tmp40_ = sl;
				_tmp41_ = vala_array_creation_expression_create_sizes_from_initializer_list (self, _tmp37_, G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, VALA_TYPE_INITIALIZER_LIST, ValaInitializerList), _tmp39_ - 1, _tmp40_);
				size = _tmp41_;
				_tmp42_ = size;
				if (_tmp42_ == -1) {
					result = -1;
					_vala_code_node_unref0 (e);
					_vala_iterable_unref0 (_e_list);
					return result;
				}
				_tmp44_ = subsize;
				if (_tmp44_ >= 0) {
					gint _tmp45_;
					gint _tmp46_;
					_tmp45_ = subsize;
					_tmp46_ = size;
					_tmp43_ = _tmp45_ != _tmp46_;
				} else {
					_tmp43_ = FALSE;
				}
				if (_tmp43_) {
					ValaInitializerList* _tmp47_;
					ValaInitializerList* _tmp48_;
					ValaSourceReference* _tmp49_;
					ValaSourceReference* _tmp50_;
					gint _tmp51_;
					gint _tmp52_;
					gchar* _tmp53_;
					gchar* _tmp54_;
					_tmp47_ = il;
					vala_code_node_set_error ((ValaCodeNode*) _tmp47_, TRUE);
					_tmp48_ = il;
					_tmp49_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp48_);
					_tmp50_ = _tmp49_;
					_tmp51_ = subsize;
					_tmp52_ = size;
					_tmp53_ = g_strdup_printf ("Expected initializer list of size %d, got size %d", _tmp51_, _tmp52_);
					_tmp54_ = _tmp53_;
					vala_report_error (_tmp50_, _tmp54_);
					_g_free0 (_tmp54_);
					result = -1;
					_vala_code_node_unref0 (e);
					_vala_iterable_unref0 (_e_list);
					return result;
				} else {
					gint _tmp55_;
					_tmp55_ = size;
					subsize = _tmp55_;
				}
			} else {
				gint _tmp56_;
				_tmp56_ = rank;
				if (_tmp56_ != 1) {
					ValaInitializerList* _tmp57_;
					ValaExpression* _tmp58_;
					ValaExpression* _tmp59_;
					ValaSourceReference* _tmp60_;
					ValaSourceReference* _tmp61_;
					_tmp57_ = il;
					vala_code_node_set_error ((ValaCodeNode*) _tmp57_, TRUE);
					_tmp58_ = e;
					vala_code_node_set_error ((ValaCodeNode*) _tmp58_, TRUE);
					_tmp59_ = e;
					_tmp60_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp59_);
					_tmp61_ = _tmp60_;
					vala_report_error (_tmp61_, "Expected array initializer list, got array element");
					result = -1;
					_vala_code_node_unref0 (e);
					_vala_iterable_unref0 (_e_list);
					return result;
				}
			}
			_vala_code_node_unref0 (e);
		}
		_vala_iterable_unref0 (_e_list);
	}
	_tmp62_ = il;
	_tmp63_ = vala_initializer_list_get_size (_tmp62_);
	_tmp64_ = _tmp63_;
	result = _tmp64_;
	return result;
}


static gpointer _vala_code_node_ref0 (gpointer self) {
	return self ? vala_code_node_ref (self) : NULL;
}


static gboolean vala_array_creation_expression_real_check (ValaCodeNode* base, ValaCodeContext* context) {
	ValaArrayCreationExpression * self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	gboolean _tmp1_;
	ValaList* sizes = NULL;
	ValaList* _tmp4_;
	ValaInitializerList* initlist = NULL;
	ValaInitializerList* _tmp5_;
	ValaInitializerList* _tmp6_;
	ValaInitializerList* _tmp7_;
	ValaDataType* _tmp8_;
	ValaDataType* _tmp9_;
	ValaArrayList* calc_sizes = NULL;
	GEqualFunc _tmp26_;
	ValaArrayList* _tmp27_;
	ValaInitializerList* _tmp28_;
	ValaList* _tmp46_;
	gint _tmp47_;
	gint _tmp48_;
	gboolean _tmp88_;
	gboolean _tmp89_;
	gboolean _tmp90_ = FALSE;
	ValaInitializerList* _tmp91_;
	ValaInitializerList* _tmp92_;
	ValaDataType* _tmp97_;
	ValaDataType* _tmp98_;
	ValaDataType* _tmp101_;
	ValaDataType* _tmp102_;
	gint _tmp103_;
	ValaSourceReference* _tmp104_;
	ValaSourceReference* _tmp105_;
	ValaArrayType* _tmp106_;
	ValaArrayType* _tmp107_;
	ValaDataType* _tmp108_;
	ValaDataType* _tmp109_;
	gboolean _tmp110_;
	gboolean _tmp111_;
	self = (ValaArrayCreationExpression*) base;
	g_return_val_if_fail (context != NULL, FALSE);
	_tmp0_ = vala_code_node_get_checked ((ValaCodeNode*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		gboolean _tmp2_;
		gboolean _tmp3_;
		_tmp2_ = vala_code_node_get_error ((ValaCodeNode*) self);
		_tmp3_ = _tmp2_;
		result = !_tmp3_;
		return result;
	}
	vala_code_node_set_checked ((ValaCodeNode*) self, TRUE);
	_tmp4_ = vala_array_creation_expression_get_sizes (self);
	sizes = _tmp4_;
	_tmp5_ = vala_array_creation_expression_get_initializer_list (self);
	_tmp6_ = _tmp5_;
	_tmp7_ = _vala_code_node_ref0 (_tmp6_);
	initlist = _tmp7_;
	_tmp8_ = vala_array_creation_expression_get_element_type (self);
	_tmp9_ = _tmp8_;
	if (_tmp9_ != NULL) {
		ValaDataType* _tmp10_;
		ValaDataType* _tmp11_;
		ValaCodeContext* _tmp12_;
		_tmp10_ = vala_array_creation_expression_get_element_type (self);
		_tmp11_ = _tmp10_;
		_tmp12_ = context;
		vala_code_node_check ((ValaCodeNode*) _tmp11_, _tmp12_);
	}
	{
		ValaList* _e_list = NULL;
		ValaList* _tmp13_;
		ValaList* _tmp14_;
		gint _e_size = 0;
		ValaList* _tmp15_;
		gint _tmp16_;
		gint _tmp17_;
		gint _e_index = 0;
		_tmp13_ = sizes;
		_tmp14_ = _vala_iterable_ref0 (_tmp13_);
		_e_list = _tmp14_;
		_tmp15_ = _e_list;
		_tmp16_ = vala_collection_get_size ((ValaCollection*) _tmp15_);
		_tmp17_ = _tmp16_;
		_e_size = _tmp17_;
		_e_index = -1;
		while (TRUE) {
			gint _tmp18_;
			gint _tmp19_;
			gint _tmp20_;
			ValaExpression* e = NULL;
			ValaList* _tmp21_;
			gint _tmp22_;
			gpointer _tmp23_;
			ValaExpression* _tmp24_;
			ValaCodeContext* _tmp25_;
			_tmp18_ = _e_index;
			_e_index = _tmp18_ + 1;
			_tmp19_ = _e_index;
			_tmp20_ = _e_size;
			if (!(_tmp19_ < _tmp20_)) {
				break;
			}
			_tmp21_ = _e_list;
			_tmp22_ = _e_index;
			_tmp23_ = vala_list_get (_tmp21_, _tmp22_);
			e = (ValaExpression*) _tmp23_;
			_tmp24_ = e;
			_tmp25_ = context;
			vala_code_node_check ((ValaCodeNode*) _tmp24_, _tmp25_);
			_vala_code_node_unref0 (e);
		}
		_vala_iterable_unref0 (_e_list);
	}
	_tmp26_ = g_direct_equal;
	_tmp27_ = vala_array_list_new (VALA_TYPE_LITERAL, (GBoxedCopyFunc) vala_code_node_ref, (GDestroyNotify) vala_code_node_unref, _tmp26_);
	calc_sizes = _tmp27_;
	_tmp28_ = initlist;
	if (_tmp28_ != NULL) {
		ValaInitializerList* _tmp29_;
		ValaDataType* _tmp30_;
		ValaDataType* _tmp31_;
		gint _tmp32_;
		ValaSourceReference* _tmp33_;
		ValaSourceReference* _tmp34_;
		ValaArrayType* _tmp35_;
		ValaArrayType* _tmp36_;
		ValaInitializerList* _tmp37_;
		ValaCodeContext* _tmp38_;
		gboolean _tmp39_;
		gint ret = 0;
		ValaCodeContext* _tmp40_;
		ValaInitializerList* _tmp41_;
		gint _tmp42_;
		ValaArrayList* _tmp43_;
		gint _tmp44_;
		gint _tmp45_;
		_tmp29_ = initlist;
		_tmp30_ = vala_array_creation_expression_get_element_type (self);
		_tmp31_ = _tmp30_;
		_tmp32_ = self->priv->_rank;
		_tmp33_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
		_tmp34_ = _tmp33_;
		_tmp35_ = vala_array_type_new (_tmp31_, _tmp32_, _tmp34_);
		_tmp36_ = _tmp35_;
		vala_expression_set_target_type ((ValaExpression*) _tmp29_, (ValaDataType*) _tmp36_);
		_vala_code_node_unref0 (_tmp36_);
		_tmp37_ = initlist;
		_tmp38_ = context;
		_tmp39_ = vala_code_node_check ((ValaCodeNode*) _tmp37_, _tmp38_);
		if (!_tmp39_) {
			vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		}
		_tmp40_ = context;
		_tmp41_ = initlist;
		_tmp42_ = self->priv->_rank;
		_tmp43_ = calc_sizes;
		_tmp44_ = vala_array_creation_expression_create_sizes_from_initializer_list (self, _tmp40_, _tmp41_, _tmp42_, (ValaList*) _tmp43_);
		ret = _tmp44_;
		_tmp45_ = ret;
		if (_tmp45_ == -1) {
			vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		}
	}
	_tmp46_ = sizes;
	_tmp47_ = vala_collection_get_size ((ValaCollection*) _tmp46_);
	_tmp48_ = _tmp47_;
	if (_tmp48_ > 0) {
		{
			ValaList* _e_list = NULL;
			ValaList* _tmp49_;
			ValaList* _tmp50_;
			gint _e_size = 0;
			ValaList* _tmp51_;
			gint _tmp52_;
			gint _tmp53_;
			gint _e_index = 0;
			_tmp49_ = sizes;
			_tmp50_ = _vala_iterable_ref0 (_tmp49_);
			_e_list = _tmp50_;
			_tmp51_ = _e_list;
			_tmp52_ = vala_collection_get_size ((ValaCollection*) _tmp51_);
			_tmp53_ = _tmp52_;
			_e_size = _tmp53_;
			_e_index = -1;
			while (TRUE) {
				gint _tmp54_;
				gint _tmp55_;
				gint _tmp56_;
				ValaExpression* e = NULL;
				ValaList* _tmp57_;
				gint _tmp58_;
				gpointer _tmp59_;
				ValaExpression* _tmp60_;
				ValaDataType* _tmp61_;
				ValaDataType* _tmp62_;
				_tmp54_ = _e_index;
				_e_index = _tmp54_ + 1;
				_tmp55_ = _e_index;
				_tmp56_ = _e_size;
				if (!(_tmp55_ < _tmp56_)) {
					break;
				}
				_tmp57_ = _e_list;
				_tmp58_ = _e_index;
				_tmp59_ = vala_list_get (_tmp57_, _tmp58_);
				e = (ValaExpression*) _tmp59_;
				_tmp60_ = e;
				_tmp61_ = vala_expression_get_value_type (_tmp60_);
				_tmp62_ = _tmp61_;
				if (_tmp62_ == NULL) {
					result = FALSE;
					_vala_code_node_unref0 (e);
					_vala_iterable_unref0 (_e_list);
					_vala_iterable_unref0 (calc_sizes);
					_vala_code_node_unref0 (initlist);
					_vala_iterable_unref0 (sizes);
					return result;
				} else {
					gboolean _tmp63_ = FALSE;
					ValaExpression* _tmp64_;
					ValaDataType* _tmp65_;
					ValaDataType* _tmp66_;
					_tmp64_ = e;
					_tmp65_ = vala_expression_get_value_type (_tmp64_);
					_tmp66_ = _tmp65_;
					if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp66_, VALA_TYPE_INTEGER_TYPE)) {
						_tmp63_ = TRUE;
					} else {
						ValaExpression* _tmp67_;
						ValaDataType* _tmp68_;
						ValaDataType* _tmp69_;
						_tmp67_ = e;
						_tmp68_ = vala_expression_get_value_type (_tmp67_);
						_tmp69_ = _tmp68_;
						_tmp63_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp69_, VALA_TYPE_ENUM_VALUE_TYPE);
					}
					if (!_tmp63_) {
						ValaExpression* _tmp70_;
						ValaSourceReference* _tmp71_;
						ValaSourceReference* _tmp72_;
						vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
						_tmp70_ = e;
						_tmp71_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp70_);
						_tmp72_ = _tmp71_;
						vala_report_error (_tmp72_, "Expression of integer type expected");
					}
				}
				_vala_code_node_unref0 (e);
			}
			_vala_iterable_unref0 (_e_list);
		}
	} else {
		ValaInitializerList* _tmp73_;
		_tmp73_ = initlist;
		if (_tmp73_ == NULL) {
			ValaSourceReference* _tmp74_;
			ValaSourceReference* _tmp75_;
			vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
			_tmp74_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
			_tmp75_ = _tmp74_;
			vala_report_error (_tmp75_, "internal error: initializer list expected");
		} else {
			{
				ValaArrayList* _size_list = NULL;
				ValaArrayList* _tmp76_;
				ValaArrayList* _tmp77_;
				gint _size_size = 0;
				ValaArrayList* _tmp78_;
				gint _tmp79_;
				gint _tmp80_;
				gint _size_index = 0;
				_tmp76_ = calc_sizes;
				_tmp77_ = _vala_iterable_ref0 (_tmp76_);
				_size_list = _tmp77_;
				_tmp78_ = _size_list;
				_tmp79_ = vala_collection_get_size ((ValaCollection*) _tmp78_);
				_tmp80_ = _tmp79_;
				_size_size = _tmp80_;
				_size_index = -1;
				while (TRUE) {
					gint _tmp81_;
					gint _tmp82_;
					gint _tmp83_;
					ValaExpression* size = NULL;
					ValaArrayList* _tmp84_;
					gint _tmp85_;
					gpointer _tmp86_;
					ValaExpression* _tmp87_;
					_tmp81_ = _size_index;
					_size_index = _tmp81_ + 1;
					_tmp82_ = _size_index;
					_tmp83_ = _size_size;
					if (!(_tmp82_ < _tmp83_)) {
						break;
					}
					_tmp84_ = _size_list;
					_tmp85_ = _size_index;
					_tmp86_ = vala_list_get ((ValaList*) _tmp84_, _tmp85_);
					size = (ValaExpression*) ((ValaLiteral*) _tmp86_);
					_tmp87_ = size;
					vala_array_creation_expression_append_size (self, _tmp87_);
					_vala_code_node_unref0 (size);
				}
				_vala_iterable_unref0 (_size_list);
			}
		}
	}
	_tmp88_ = vala_code_node_get_error ((ValaCodeNode*) self);
	_tmp89_ = _tmp88_;
	if (_tmp89_) {
		result = FALSE;
		_vala_iterable_unref0 (calc_sizes);
		_vala_code_node_unref0 (initlist);
		_vala_iterable_unref0 (sizes);
		return result;
	}
	_tmp91_ = vala_array_creation_expression_get_initializer_list (self);
	_tmp92_ = _tmp91_;
	if (_tmp92_ != NULL) {
		ValaInitializerList* _tmp93_;
		ValaInitializerList* _tmp94_;
		ValaDataType* _tmp95_;
		ValaDataType* _tmp96_;
		_tmp93_ = vala_array_creation_expression_get_initializer_list (self);
		_tmp94_ = _tmp93_;
		_tmp95_ = vala_expression_get_value_type ((ValaExpression*) _tmp94_);
		_tmp96_ = _tmp95_;
		_tmp90_ = _tmp96_ == NULL;
	} else {
		_tmp90_ = FALSE;
	}
	if (_tmp90_) {
		result = FALSE;
		_vala_iterable_unref0 (calc_sizes);
		_vala_code_node_unref0 (initlist);
		_vala_iterable_unref0 (sizes);
		return result;
	}
	_tmp97_ = vala_array_creation_expression_get_element_type (self);
	_tmp98_ = _tmp97_;
	if (_tmp98_ == NULL) {
		ValaSourceReference* _tmp99_;
		ValaSourceReference* _tmp100_;
		vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		_tmp99_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
		_tmp100_ = _tmp99_;
		vala_report_error (_tmp100_, "Cannot determine the element type of the created array");
		result = FALSE;
		_vala_iterable_unref0 (calc_sizes);
		_vala_code_node_unref0 (initlist);
		_vala_iterable_unref0 (sizes);
		return result;
	}
	_tmp101_ = vala_array_creation_expression_get_element_type (self);
	_tmp102_ = _tmp101_;
	_tmp103_ = self->priv->_rank;
	_tmp104_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
	_tmp105_ = _tmp104_;
	_tmp106_ = vala_array_type_new (_tmp102_, _tmp103_, _tmp105_);
	_tmp107_ = _tmp106_;
	vala_expression_set_value_type ((ValaExpression*) self, (ValaDataType*) _tmp107_);
	_vala_code_node_unref0 (_tmp107_);
	_tmp108_ = vala_expression_get_value_type ((ValaExpression*) self);
	_tmp109_ = _tmp108_;
	vala_data_type_set_value_owned (_tmp109_, TRUE);
	_tmp110_ = vala_code_node_get_error ((ValaCodeNode*) self);
	_tmp111_ = _tmp110_;
	result = !_tmp111_;
	_vala_iterable_unref0 (calc_sizes);
	_vala_code_node_unref0 (initlist);
	_vala_iterable_unref0 (sizes);
	return result;
}


static void vala_array_creation_expression_real_emit (ValaCodeNode* base, ValaCodeGenerator* codegen) {
	ValaArrayCreationExpression * self;
	ValaInitializerList* _tmp13_;
	ValaInitializerList* _tmp14_;
	ValaCodeGenerator* _tmp18_;
	ValaCodeGenerator* _tmp19_;
	self = (ValaArrayCreationExpression*) base;
	g_return_if_fail (codegen != NULL);
	{
		ValaList* _e_list = NULL;
		ValaList* _tmp0_;
		ValaList* _tmp1_;
		gint _e_size = 0;
		ValaList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _e_index = 0;
		_tmp0_ = self->priv->sizes;
		_tmp1_ = _vala_iterable_ref0 (_tmp0_);
		_e_list = _tmp1_;
		_tmp2_ = _e_list;
		_tmp3_ = vala_collection_get_size ((ValaCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_e_size = _tmp4_;
		_e_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			gint _tmp7_;
			ValaExpression* e = NULL;
			ValaList* _tmp8_;
			gint _tmp9_;
			gpointer _tmp10_;
			ValaExpression* _tmp11_;
			ValaCodeGenerator* _tmp12_;
			_tmp5_ = _e_index;
			_e_index = _tmp5_ + 1;
			_tmp6_ = _e_index;
			_tmp7_ = _e_size;
			if (!(_tmp6_ < _tmp7_)) {
				break;
			}
			_tmp8_ = _e_list;
			_tmp9_ = _e_index;
			_tmp10_ = vala_list_get (_tmp8_, _tmp9_);
			e = (ValaExpression*) _tmp10_;
			_tmp11_ = e;
			_tmp12_ = codegen;
			vala_code_node_emit ((ValaCodeNode*) _tmp11_, _tmp12_);
			_vala_code_node_unref0 (e);
		}
		_vala_iterable_unref0 (_e_list);
	}
	_tmp13_ = vala_array_creation_expression_get_initializer_list (self);
	_tmp14_ = _tmp13_;
	if (_tmp14_ != NULL) {
		ValaInitializerList* _tmp15_;
		ValaInitializerList* _tmp16_;
		ValaCodeGenerator* _tmp17_;
		_tmp15_ = vala_array_creation_expression_get_initializer_list (self);
		_tmp16_ = _tmp15_;
		_tmp17_ = codegen;
		vala_code_node_emit ((ValaCodeNode*) _tmp16_, _tmp17_);
	}
	_tmp18_ = codegen;
	vala_code_visitor_visit_array_creation_expression ((ValaCodeVisitor*) _tmp18_, self);
	_tmp19_ = codegen;
	vala_code_visitor_visit_expression ((ValaCodeVisitor*) _tmp19_, (ValaExpression*) self);
}


static void vala_array_creation_expression_real_get_used_variables (ValaCodeNode* base, ValaCollection* collection) {
	ValaArrayCreationExpression * self;
	ValaInitializerList* _tmp13_;
	ValaInitializerList* _tmp14_;
	self = (ValaArrayCreationExpression*) base;
	g_return_if_fail (collection != NULL);
	{
		ValaList* _e_list = NULL;
		ValaList* _tmp0_;
		ValaList* _tmp1_;
		gint _e_size = 0;
		ValaList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _e_index = 0;
		_tmp0_ = self->priv->sizes;
		_tmp1_ = _vala_iterable_ref0 (_tmp0_);
		_e_list = _tmp1_;
		_tmp2_ = _e_list;
		_tmp3_ = vala_collection_get_size ((ValaCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_e_size = _tmp4_;
		_e_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			gint _tmp7_;
			ValaExpression* e = NULL;
			ValaList* _tmp8_;
			gint _tmp9_;
			gpointer _tmp10_;
			ValaExpression* _tmp11_;
			ValaCollection* _tmp12_;
			_tmp5_ = _e_index;
			_e_index = _tmp5_ + 1;
			_tmp6_ = _e_index;
			_tmp7_ = _e_size;
			if (!(_tmp6_ < _tmp7_)) {
				break;
			}
			_tmp8_ = _e_list;
			_tmp9_ = _e_index;
			_tmp10_ = vala_list_get (_tmp8_, _tmp9_);
			e = (ValaExpression*) _tmp10_;
			_tmp11_ = e;
			_tmp12_ = collection;
			vala_code_node_get_used_variables ((ValaCodeNode*) _tmp11_, _tmp12_);
			_vala_code_node_unref0 (e);
		}
		_vala_iterable_unref0 (_e_list);
	}
	_tmp13_ = vala_array_creation_expression_get_initializer_list (self);
	_tmp14_ = _tmp13_;
	if (_tmp14_ != NULL) {
		ValaInitializerList* _tmp15_;
		ValaInitializerList* _tmp16_;
		ValaCollection* _tmp17_;
		_tmp15_ = vala_array_creation_expression_get_initializer_list (self);
		_tmp16_ = _tmp15_;
		_tmp17_ = collection;
		vala_code_node_get_used_variables ((ValaCodeNode*) _tmp16_, _tmp17_);
	}
}


ValaDataType* vala_array_creation_expression_get_element_type (ValaArrayCreationExpression* self) {
	ValaDataType* result;
	ValaDataType* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_element_type;
	result = _tmp0_;
	return result;
}


void vala_array_creation_expression_set_element_type (ValaArrayCreationExpression* self, ValaDataType* value) {
	ValaDataType* _tmp0_;
	ValaDataType* _tmp1_;
	ValaDataType* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _vala_code_node_ref0 (_tmp0_);
	_vala_code_node_unref0 (self->priv->_element_type);
	self->priv->_element_type = _tmp1_;
	_tmp2_ = self->priv->_element_type;
	vala_code_node_set_parent_node ((ValaCodeNode*) _tmp2_, (ValaCodeNode*) self);
}


gint vala_array_creation_expression_get_rank (ValaArrayCreationExpression* self) {
	gint result;
	gint _tmp0_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->_rank;
	result = _tmp0_;
	return result;
}


void vala_array_creation_expression_set_rank (ValaArrayCreationExpression* self, gint value) {
	gint _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_rank = _tmp0_;
}


ValaInitializerList* vala_array_creation_expression_get_initializer_list (ValaArrayCreationExpression* self) {
	ValaInitializerList* result;
	ValaInitializerList* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_initializer_list;
	result = _tmp0_;
	return result;
}


void vala_array_creation_expression_set_initializer_list (ValaArrayCreationExpression* self, ValaInitializerList* value) {
	ValaInitializerList* _tmp0_;
	ValaInitializerList* _tmp1_;
	ValaInitializerList* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _vala_code_node_ref0 (_tmp0_);
	_vala_code_node_unref0 (self->priv->_initializer_list);
	self->priv->_initializer_list = _tmp1_;
	_tmp2_ = self->priv->_initializer_list;
	if (_tmp2_ != NULL) {
		ValaInitializerList* _tmp3_;
		_tmp3_ = self->priv->_initializer_list;
		vala_code_node_set_parent_node ((ValaCodeNode*) _tmp3_, (ValaCodeNode*) self);
	}
}


static void vala_array_creation_expression_class_init (ValaArrayCreationExpressionClass * klass) {
	vala_array_creation_expression_parent_class = g_type_class_peek_parent (klass);
	((ValaCodeNodeClass *) klass)->finalize = vala_array_creation_expression_finalize;
	g_type_class_add_private (klass, sizeof (ValaArrayCreationExpressionPrivate));
	((ValaCodeNodeClass *) klass)->accept_children = (void (*) (ValaCodeNode *, ValaCodeVisitor*)) vala_array_creation_expression_real_accept_children;
	((ValaCodeNodeClass *) klass)->accept = (void (*) (ValaCodeNode *, ValaCodeVisitor*)) vala_array_creation_expression_real_accept;
	((ValaExpressionClass *) klass)->is_pure = (gboolean (*) (ValaExpression *)) vala_array_creation_expression_real_is_pure;
	((ValaExpressionClass *) klass)->is_accessible = (gboolean (*) (ValaExpression *, ValaSymbol*)) vala_array_creation_expression_real_is_accessible;
	((ValaCodeNodeClass *) klass)->replace_expression = (void (*) (ValaCodeNode *, ValaExpression*, ValaExpression*)) vala_array_creation_expression_real_replace_expression;
	((ValaCodeNodeClass *) klass)->replace_type = (void (*) (ValaCodeNode *, ValaDataType*, ValaDataType*)) vala_array_creation_expression_real_replace_type;
	((ValaCodeNodeClass *) klass)->check = (gboolean (*) (ValaCodeNode *, ValaCodeContext*)) vala_array_creation_expression_real_check;
	((ValaCodeNodeClass *) klass)->emit = (void (*) (ValaCodeNode *, ValaCodeGenerator*)) vala_array_creation_expression_real_emit;
	((ValaCodeNodeClass *) klass)->get_used_variables = (void (*) (ValaCodeNode *, ValaCollection*)) vala_array_creation_expression_real_get_used_variables;
}


static void vala_array_creation_expression_instance_init (ValaArrayCreationExpression * self) {
	GEqualFunc _tmp0_;
	ValaArrayList* _tmp1_;
	self->priv = VALA_ARRAY_CREATION_EXPRESSION_GET_PRIVATE (self);
	_tmp0_ = g_direct_equal;
	_tmp1_ = vala_array_list_new (VALA_TYPE_EXPRESSION, (GBoxedCopyFunc) vala_code_node_ref, (GDestroyNotify) vala_code_node_unref, _tmp0_);
	self->priv->sizes = (ValaList*) _tmp1_;
}


static void vala_array_creation_expression_finalize (ValaCodeNode * obj) {
	ValaArrayCreationExpression * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALA_TYPE_ARRAY_CREATION_EXPRESSION, ValaArrayCreationExpression);
	_vala_iterable_unref0 (self->priv->sizes);
	_vala_code_node_unref0 (self->priv->_element_type);
	_vala_code_node_unref0 (self->priv->_initializer_list);
	VALA_CODE_NODE_CLASS (vala_array_creation_expression_parent_class)->finalize (obj);
}


/**
 * Represents an array creation expression e.g. {{{ new int[] {1,2,3} }}}.
 */
GType vala_array_creation_expression_get_type (void) {
	static volatile gsize vala_array_creation_expression_type_id__volatile = 0;
	if (g_once_init_enter (&vala_array_creation_expression_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ValaArrayCreationExpressionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_array_creation_expression_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaArrayCreationExpression), 0, (GInstanceInitFunc) vala_array_creation_expression_instance_init, NULL };
		GType vala_array_creation_expression_type_id;
		vala_array_creation_expression_type_id = g_type_register_static (VALA_TYPE_EXPRESSION, "ValaArrayCreationExpression", &g_define_type_info, 0);
		g_once_init_leave (&vala_array_creation_expression_type_id__volatile, vala_array_creation_expression_type_id);
	}
	return vala_array_creation_expression_type_id__volatile;
}



