static void vala_class_register_function_real_get_type_interface_init_statements (ValaTypeRegisterFunction* base, ValaCCodeBlock* block, gboolean plugin) {
	ValaClassRegisterFunction * self;
	ValaCodeContext* _tmp83_;
	ValaCodeContext* _tmp84_;
	ValaCodeGenerator* _tmp85_;
	ValaCodeGenerator* _tmp86_;
	ValaCCodeBlock* _tmp87_;
	ValaClass* _tmp88_;
	self = (ValaClassRegisterFunction*) base;
	g_return_if_fail (block != NULL);
	{
		ValaClass* _tmp0_;
		ValaList* _tmp1_ = NULL;
		ValaList* _base_type_list;
		ValaList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _base_type_size;
		gint _base_type_index;
		_tmp0_ = self->priv->_class_reference;
		_tmp1_ = vala_class_get_base_types (_tmp0_);
		_base_type_list = _tmp1_;
		_tmp2_ = _base_type_list;
		_tmp3_ = vala_collection_get_size ((ValaCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_base_type_size = _tmp4_;
		_base_type_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			gint _tmp7_;
			ValaList* _tmp8_;
			gint _tmp9_;
			gpointer _tmp10_ = NULL;
			ValaDataType* base_type;
			ValaDataType* _tmp11_;
			ValaTypeSymbol* _tmp12_;
			ValaTypeSymbol* _tmp13_;
			ValaDataType* _tmp14_;
			ValaTypeSymbol* _tmp15_;
			ValaTypeSymbol* _tmp16_;
			ValaInterface* _tmp17_;
			ValaInterface* iface;
			ValaInterface* _tmp18_;
			gchar* _tmp19_ = NULL;
			gchar* _tmp20_;
			gchar* _tmp21_ = NULL;
			gchar* _tmp22_;
			gchar* iface_info_name;
			gboolean _tmp23_;
			_tmp5_ = _base_type_index;
			_base_type_index = _tmp5_ + 1;
			_tmp6_ = _base_type_index;
			_tmp7_ = _base_type_size;
			if (!(_tmp6_ < _tmp7_)) {
				break;
			}
			_tmp8_ = _base_type_list;
			_tmp9_ = _base_type_index;
			_tmp10_ = vala_list_get (_tmp8_, _tmp9_);
			base_type = (ValaDataType*) _tmp10_;
			_tmp11_ = base_type;
			_tmp12_ = vala_data_type_get_data_type (_tmp11_);
			_tmp13_ = _tmp12_;
			if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp13_, VALA_TYPE_INTERFACE)) {
				_vala_code_node_unref0 (base_type);
				continue;
			}
			_tmp14_ = base_type;
			_tmp15_ = vala_data_type_get_data_type (_tmp14_);
			_tmp16_ = _tmp15_;
			_tmp17_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, VALA_TYPE_INTERFACE, ValaInterface));
			iface = _tmp17_;
			_tmp18_ = iface;
			_tmp19_ = vala_ccode_base_module_get_ccode_lower_case_name ((ValaCodeNode*) _tmp18_, NULL);
			_tmp20_ = _tmp19_;
			_tmp21_ = g_strdup_printf ("%s_info", _tmp20_);
			_tmp22_ = _tmp21_;
			_g_free0 (_tmp20_);
			iface_info_name = _tmp22_;
			_tmp23_ = plugin;
			if (!_tmp23_) {
				ValaCCodeIdentifier* _tmp24_;
				ValaCCodeIdentifier* _tmp25_;
				ValaCCodeFunctionCall* _tmp26_;
				ValaCCodeFunctionCall* _tmp27_;
				ValaCCodeFunctionCall* reg_call;
				ValaCCodeFunctionCall* _tmp28_;
				ValaClass* _tmp29_;
				gchar* _tmp30_ = NULL;
				gchar* _tmp31_;
				gchar* _tmp32_ = NULL;
				gchar* _tmp33_;
				ValaCCodeIdentifier* _tmp34_;
				ValaCCodeIdentifier* _tmp35_;
				ValaCCodeFunctionCall* _tmp36_;
				ValaInterface* _tmp37_;
				gchar* _tmp38_ = NULL;
				gchar* _tmp39_;
				ValaCCodeIdentifier* _tmp40_;
				ValaCCodeIdentifier* _tmp41_;
				ValaCCodeFunctionCall* _tmp42_;
				const gchar* _tmp43_;
				gchar* _tmp44_ = NULL;
				gchar* _tmp45_;
				ValaCCodeIdentifier* _tmp46_;
				ValaCCodeIdentifier* _tmp47_;
				ValaCCodeBlock* _tmp48_;
				ValaCCodeFunctionCall* _tmp49_;
				ValaCCodeExpressionStatement* _tmp50_;
				ValaCCodeExpressionStatement* _tmp51_;
				_tmp24_ = vala_ccode_identifier_new ("g_type_add_interface_static");
				_tmp25_ = _tmp24_;
				_tmp26_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp25_);
				_tmp27_ = _tmp26_;
				_vala_ccode_node_unref0 (_tmp25_);
				reg_call = _tmp27_;
				_tmp28_ = reg_call;
				_tmp29_ = self->priv->_class_reference;
				_tmp30_ = vala_ccode_base_module_get_ccode_lower_case_name ((ValaCodeNode*) _tmp29_, NULL);
				_tmp31_ = _tmp30_;
				_tmp32_ = g_strdup_printf ("%s_type_id", _tmp31_);
				_tmp33_ = _tmp32_;
				_tmp34_ = vala_ccode_identifier_new (_tmp33_);
				_tmp35_ = _tmp34_;
				vala_ccode_function_call_add_argument (_tmp28_, (ValaCCodeExpression*) _tmp35_);
				_vala_ccode_node_unref0 (_tmp35_);
				_g_free0 (_tmp33_);
				_g_free0 (_tmp31_);
				_tmp36_ = reg_call;
				_tmp37_ = iface;
				_tmp38_ = vala_ccode_base_module_get_ccode_type_id ((ValaCodeNode*) _tmp37_);
				_tmp39_ = _tmp38_;
				_tmp40_ = vala_ccode_identifier_new (_tmp39_);
				_tmp41_ = _tmp40_;
				vala_ccode_function_call_add_argument (_tmp36_, (ValaCCodeExpression*) _tmp41_);
				_vala_ccode_node_unref0 (_tmp41_);
				_g_free0 (_tmp39_);
				_tmp42_ = reg_call;
				_tmp43_ = iface_info_name;
				_tmp44_ = g_strdup_printf ("&%s", _tmp43_);
				_tmp45_ = _tmp44_;
				_tmp46_ = vala_ccode_identifier_new (_tmp45_);
				_tmp47_ = _tmp46_;
				vala_ccode_function_call_add_argument (_tmp42_, (ValaCCodeExpression*) _tmp47_);
				_vala_ccode_node_unref0 (_tmp47_);
				_g_free0 (_tmp45_);
				_tmp48_ = block;
				_tmp49_ = reg_call;
				_tmp50_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) _tmp49_);
				_tmp51_ = _tmp50_;
				vala_ccode_block_add_statement (_tmp48_, (ValaCCodeNode*) _tmp51_);
				_vala_ccode_node_unref0 (_tmp51_);
				_vala_ccode_node_unref0 (reg_call);
			} else {
				ValaCCodeIdentifier* _tmp52_;
				ValaCCodeIdentifier* _tmp53_;
				ValaCCodeFunctionCall* _tmp54_;
				ValaCCodeFunctionCall* _tmp55_;
				ValaCCodeFunctionCall* reg_call;
				ValaCCodeFunctionCall* _tmp56_;
				ValaCCodeIdentifier* _tmp57_;
				ValaCCodeIdentifier* _tmp58_;
				ValaCCodeFunctionCall* _tmp59_;
				ValaClass* _tmp60_;
				gchar* _tmp61_ = NULL;
				gchar* _tmp62_;
				gchar* _tmp63_ = NULL;
				gchar* _tmp64_;
				ValaCCodeIdentifier* _tmp65_;
				ValaCCodeIdentifier* _tmp66_;
				ValaCCodeFunctionCall* _tmp67_;
				ValaInterface* _tmp68_;
				gchar* _tmp69_ = NULL;
				gchar* _tmp70_;
				ValaCCodeIdentifier* _tmp71_;
				ValaCCodeIdentifier* _tmp72_;
				ValaCCodeFunctionCall* _tmp73_;
				const gchar* _tmp74_;
				gchar* _tmp75_ = NULL;
				gchar* _tmp76_;
				ValaCCodeIdentifier* _tmp77_;
				ValaCCodeIdentifier* _tmp78_;
				ValaCCodeBlock* _tmp79_;
				ValaCCodeFunctionCall* _tmp80_;
				ValaCCodeExpressionStatement* _tmp81_;
				ValaCCodeExpressionStatement* _tmp82_;
				_tmp52_ = vala_ccode_identifier_new ("g_type_module_add_interface");
				_tmp53_ = _tmp52_;
				_tmp54_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp53_);
				_tmp55_ = _tmp54_;
				_vala_ccode_node_unref0 (_tmp53_);
				reg_call = _tmp55_;
				_tmp56_ = reg_call;
				_tmp57_ = vala_ccode_identifier_new ("module");
				_tmp58_ = _tmp57_;
				vala_ccode_function_call_add_argument (_tmp56_, (ValaCCodeExpression*) _tmp58_);
				_vala_ccode_node_unref0 (_tmp58_);
				_tmp59_ = reg_call;
				_tmp60_ = self->priv->_class_reference;
				_tmp61_ = vala_ccode_base_module_get_ccode_lower_case_name ((ValaCodeNode*) _tmp60_, NULL);
				_tmp62_ = _tmp61_;
				_tmp63_ = g_strdup_printf ("%s_type_id", _tmp62_);
				_tmp64_ = _tmp63_;
				_tmp65_ = vala_ccode_identifier_new (_tmp64_);
				_tmp66_ = _tmp65_;
				vala_ccode_function_call_add_argument (_tmp59_, (ValaCCodeExpression*) _tmp66_);
				_vala_ccode_node_unref0 (_tmp66_);
				_g_free0 (_tmp64_);
				_g_free0 (_tmp62_);
				_tmp67_ = reg_call;
				_tmp68_ = iface;
				_tmp69_ = vala_ccode_base_module_get_ccode_type_id ((ValaCodeNode*) _tmp68_);
				_tmp70_ = _tmp69_;
				_tmp71_ = vala_ccode_identifier_new (_tmp70_);
				_tmp72_ = _tmp71_;
				vala_ccode_function_call_add_argument (_tmp67_, (ValaCCodeExpression*) _tmp72_);
				_vala_ccode_node_unref0 (_tmp72_);
				_g_free0 (_tmp70_);
				_tmp73_ = reg_call;
				_tmp74_ = iface_info_name;
				_tmp75_ = g_strdup_printf ("&%s", _tmp74_);
				_tmp76_ = _tmp75_;
				_tmp77_ = vala_ccode_identifier_new (_tmp76_);
				_tmp78_ = _tmp77_;
				vala_ccode_function_call_add_argument (_tmp73_, (ValaCCodeExpression*) _tmp78_);
				_vala_ccode_node_unref0 (_tmp78_);
				_g_free0 (_tmp76_);
				_tmp79_ = block;
				_tmp80_ = reg_call;
				_tmp81_ = vala_ccode_expression_statement_new ((ValaCCodeExpression*) _tmp80_);
				_tmp82_ = _tmp81_;
				vala_ccode_block_add_statement (_tmp79_, (ValaCCodeNode*) _tmp82_);
				_vala_ccode_node_unref0 (_tmp82_);
				_vala_ccode_node_unref0 (reg_call);
			}
			_g_free0 (iface_info_name);
			_vala_code_node_unref0 (iface);
			_vala_code_node_unref0 (base_type);
		}
		_vala_iterable_unref0 (_base_type_list);
	}
	_tmp83_ = vala_typeregister_function_get_context ((ValaTypeRegisterFunction*) self);
	_tmp84_ = _tmp83_;
	_tmp85_ = vala_code_context_get_codegen (_tmp84_);
	_tmp86_ = _tmp85_;
	_tmp87_ = block;
	_tmp88_ = self->priv->_class_reference;
	vala_ccode_base_module_register_dbus_info (G_TYPE_CHECK_INSTANCE_CAST (_tmp86_, VALA_TYPE_CCODE_BASE_MODULE, ValaCCodeBaseModule), _tmp87_, (ValaObjectTypeSymbol*) _tmp88_);
}
Esempio n. 2
0
static void vala_dova_array_module_real_visit_slice_expression (ValaCodeVisitor* base, ValaSliceExpression* expr) {
	ValaDovaArrayModule * self;
	ValaSliceExpression* _tmp0_;
	ValaExpression* _tmp1_;
	ValaExpression* _tmp2_;
	ValaCCodeExpression* _tmp3_ = NULL;
	ValaCCodeExpression* ccontainer;
	ValaSliceExpression* _tmp4_;
	ValaExpression* _tmp5_;
	ValaExpression* _tmp6_;
	ValaCCodeExpression* _tmp7_ = NULL;
	ValaCCodeExpression* cstart;
	ValaSliceExpression* _tmp8_;
	ValaExpression* _tmp9_;
	ValaExpression* _tmp10_;
	ValaCCodeExpression* _tmp11_ = NULL;
	ValaCCodeExpression* cstop;
	ValaSliceExpression* _tmp12_;
	ValaExpression* _tmp13_;
	ValaExpression* _tmp14_;
	ValaDataType* _tmp15_;
	ValaDataType* _tmp16_;
	ValaArrayType* _tmp17_;
	ValaArrayType* array_type;
	ValaCCodeIdentifier* _tmp18_;
	ValaCCodeIdentifier* _tmp19_;
	ValaCCodeFunctionCall* _tmp20_;
	ValaCCodeFunctionCall* _tmp21_;
	ValaCCodeFunctionCall* array;
	ValaCCodeMemberAccess* _tmp22_;
	ValaCCodeMemberAccess* _tmp23_;
	ValaDataType* _tmp24_;
	ValaDataType* _tmp25_;
	gchar* _tmp26_ = NULL;
	gchar* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	ValaCCodeCastExpression* _tmp30_;
	ValaCCodeCastExpression* _tmp31_;
	ValaCCodeBinaryExpression* _tmp32_;
	ValaCCodeBinaryExpression* _tmp33_;
	ValaCCodeBinaryExpression* _tmp34_;
	ValaCCodeBinaryExpression* _tmp35_;
	ValaSliceExpression* _tmp36_;
	self = (ValaDovaArrayModule*) base;
	g_return_if_fail (expr != NULL);
	_tmp0_ = expr;
	_tmp1_ = vala_slice_expression_get_container (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = vala_dova_base_module_get_cvalue ((ValaDovaBaseModule*) self, _tmp2_);
	ccontainer = _tmp3_;
	_tmp4_ = expr;
	_tmp5_ = vala_slice_expression_get_start (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = vala_dova_base_module_get_cvalue ((ValaDovaBaseModule*) self, _tmp6_);
	cstart = _tmp7_;
	_tmp8_ = expr;
	_tmp9_ = vala_slice_expression_get_stop (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = vala_dova_base_module_get_cvalue ((ValaDovaBaseModule*) self, _tmp10_);
	cstop = _tmp11_;
	_tmp12_ = expr;
	_tmp13_ = vala_slice_expression_get_container (_tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = vala_expression_get_value_type (_tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = _vala_code_node_ref0 (VALA_ARRAY_TYPE (_tmp16_));
	array_type = _tmp17_;
	_tmp18_ = vala_ccode_identifier_new ("dova_array");
	_tmp19_ = _tmp18_;
	_tmp20_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp19_);
	_tmp21_ = _tmp20_;
	_vala_ccode_node_unref0 (_tmp19_);
	array = _tmp21_;
	_tmp22_ = vala_ccode_member_access_new (ccontainer, "data", FALSE);
	_tmp23_ = _tmp22_;
	_tmp24_ = vala_array_type_get_element_type (array_type);
	_tmp25_ = _tmp24_;
	_tmp26_ = vala_dova_base_module_get_ccode_name ((ValaDovaBaseModule*) self, (ValaCodeNode*) _tmp25_);
	_tmp27_ = _tmp26_;
	_tmp28_ = g_strconcat (_tmp27_, "*", NULL);
	_tmp29_ = _tmp28_;
	_tmp30_ = vala_ccode_cast_expression_new ((ValaCCodeExpression*) _tmp23_, _tmp29_);
	_tmp31_ = _tmp30_;
	_tmp32_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_PLUS, (ValaCCodeExpression*) _tmp31_, cstart);
	_tmp33_ = _tmp32_;
	vala_ccode_function_call_add_argument (array, (ValaCCodeExpression*) _tmp33_);
	_vala_ccode_node_unref0 (_tmp33_);
	_vala_ccode_node_unref0 (_tmp31_);
	_g_free0 (_tmp29_);
	_g_free0 (_tmp27_);
	_vala_ccode_node_unref0 (_tmp23_);
	_tmp34_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_MINUS, cstop, cstart);
	_tmp35_ = _tmp34_;
	vala_ccode_function_call_add_argument (array, (ValaCCodeExpression*) _tmp35_);
	_vala_ccode_node_unref0 (_tmp35_);
	_tmp36_ = expr;
	vala_dova_base_module_set_cvalue ((ValaDovaBaseModule*) self, (ValaExpression*) _tmp36_, (ValaCCodeExpression*) array);
	_vala_ccode_node_unref0 (array);
	_vala_code_node_unref0 (array_type);
	_vala_ccode_node_unref0 (cstop);
	_vala_ccode_node_unref0 (cstart);
	_vala_ccode_node_unref0 (ccontainer);
}
gboolean vala_ccode_file_store (ValaCCodeFile* self, const gchar* filename, const gchar* source_filename, gboolean write_version, gboolean line_directives, const gchar* begin_decls, const gchar* end_decls) {
	gboolean result = FALSE;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	ValaCCodeWriter* _tmp2_;
	ValaCCodeWriter* writer;
	ValaCCodeWriter* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_;
	ValaCCodeWriter* _tmp93_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (filename != NULL, FALSE);
	_tmp0_ = filename;
	_tmp1_ = source_filename;
	_tmp2_ = vala_ccode_writer_new (_tmp0_, _tmp1_);
	writer = _tmp2_;
	_tmp3_ = writer;
	_tmp4_ = write_version;
	_tmp5_ = vala_ccode_writer_open (_tmp3_, _tmp4_);
	if (!_tmp5_) {
		result = FALSE;
		_vala_ccode_writer_unref0 (writer);
		return result;
	}
	_tmp6_ = self->priv->_is_header;
	if (!_tmp6_) {
		ValaCCodeWriter* _tmp7_;
		gboolean _tmp8_;
		ValaCCodeFragment* _tmp9_;
		ValaCCodeWriter* _tmp10_;
		ValaCCodeWriter* _tmp11_;
		ValaCCodeFragment* _tmp12_;
		ValaCCodeWriter* _tmp13_;
		ValaCCodeWriter* _tmp14_;
		ValaCCodeFragment* _tmp15_;
		ValaCCodeWriter* _tmp16_;
		ValaCCodeWriter* _tmp17_;
		ValaCCodeFragment* _tmp18_;
		ValaCCodeWriter* _tmp19_;
		ValaCCodeWriter* _tmp20_;
		ValaCCodeFragment* _tmp21_;
		ValaCCodeWriter* _tmp22_;
		ValaCCodeWriter* _tmp23_;
		ValaCCodeFragment* _tmp24_;
		ValaCCodeWriter* _tmp25_;
		ValaCCodeWriter* _tmp26_;
		ValaCCodeFragment* _tmp27_;
		ValaCCodeWriter* _tmp28_;
		ValaCCodeWriter* _tmp29_;
		ValaCCodeFragment* _tmp30_;
		ValaCCodeWriter* _tmp31_;
		ValaCCodeWriter* _tmp32_;
		_tmp7_ = writer;
		_tmp8_ = line_directives;
		vala_ccode_writer_set_line_directives (_tmp7_, _tmp8_);
		_tmp9_ = self->priv->comments;
		_tmp10_ = writer;
		vala_ccode_node_write ((ValaCCodeNode*) _tmp9_, _tmp10_);
		_tmp11_ = writer;
		vala_ccode_writer_write_newline (_tmp11_);
		_tmp12_ = self->priv->include_directives;
		_tmp13_ = writer;
		vala_ccode_node_write ((ValaCCodeNode*) _tmp12_, _tmp13_);
		_tmp14_ = writer;
		vala_ccode_writer_write_newline (_tmp14_);
		_tmp15_ = self->priv->type_declaration;
		_tmp16_ = writer;
		vala_ccode_node_write_combined ((ValaCCodeNode*) _tmp15_, _tmp16_);
		_tmp17_ = writer;
		vala_ccode_writer_write_newline (_tmp17_);
		_tmp18_ = self->priv->type_definition;
		_tmp19_ = writer;
		vala_ccode_node_write_combined ((ValaCCodeNode*) _tmp18_, _tmp19_);
		_tmp20_ = writer;
		vala_ccode_writer_write_newline (_tmp20_);
		_tmp21_ = self->priv->type_member_declaration;
		_tmp22_ = writer;
		vala_ccode_node_write_declaration ((ValaCCodeNode*) _tmp21_, _tmp22_);
		_tmp23_ = writer;
		vala_ccode_writer_write_newline (_tmp23_);
		_tmp24_ = self->priv->type_member_declaration;
		_tmp25_ = writer;
		vala_ccode_node_write ((ValaCCodeNode*) _tmp24_, _tmp25_);
		_tmp26_ = writer;
		vala_ccode_writer_write_newline (_tmp26_);
		_tmp27_ = self->priv->constant_declaration;
		_tmp28_ = writer;
		vala_ccode_node_write_combined ((ValaCCodeNode*) _tmp27_, _tmp28_);
		_tmp29_ = writer;
		vala_ccode_writer_write_newline (_tmp29_);
		_tmp30_ = self->priv->type_member_definition;
		_tmp31_ = writer;
		vala_ccode_node_write ((ValaCCodeNode*) _tmp30_, _tmp31_);
		_tmp32_ = writer;
		vala_ccode_writer_write_newline (_tmp32_);
	} else {
		ValaCCodeWriter* _tmp33_;
		ValaCCodeWriter* _tmp34_;
		const gchar* _tmp35_;
		const gchar* _tmp36_;
		gchar* _tmp37_ = NULL;
		gchar* _tmp38_;
		ValaCCodeOnceSection* _tmp39_;
		ValaCCodeOnceSection* _tmp40_;
		ValaCCodeOnceSection* once;
		ValaCCodeOnceSection* _tmp41_;
		ValaCCodeNewline* _tmp42_;
		ValaCCodeNewline* _tmp43_;
		ValaCCodeOnceSection* _tmp44_;
		ValaCCodeFragment* _tmp45_;
		ValaCCodeOnceSection* _tmp46_;
		ValaCCodeNewline* _tmp47_;
		ValaCCodeNewline* _tmp48_;
		const gchar* _tmp49_;
		ValaCCodeOnceSection* _tmp57_;
		ValaCCodeNewline* _tmp58_;
		ValaCCodeNewline* _tmp59_;
		ValaCCodeOnceSection* _tmp60_;
		ValaCCodeFragment* _tmp61_;
		ValaCCodeOnceSection* _tmp62_;
		ValaCCodeNewline* _tmp63_;
		ValaCCodeNewline* _tmp64_;
		ValaCCodeOnceSection* _tmp65_;
		ValaCCodeFragment* _tmp66_;
		ValaCCodeOnceSection* _tmp67_;
		ValaCCodeNewline* _tmp68_;
		ValaCCodeNewline* _tmp69_;
		ValaCCodeOnceSection* _tmp70_;
		ValaCCodeFragment* _tmp71_;
		ValaCCodeOnceSection* _tmp72_;
		ValaCCodeNewline* _tmp73_;
		ValaCCodeNewline* _tmp74_;
		ValaCCodeOnceSection* _tmp75_;
		ValaCCodeFragment* _tmp76_;
		ValaCCodeOnceSection* _tmp77_;
		ValaCCodeNewline* _tmp78_;
		ValaCCodeNewline* _tmp79_;
		const gchar* _tmp80_;
		ValaCCodeOnceSection* _tmp88_;
		ValaCCodeNewline* _tmp89_;
		ValaCCodeNewline* _tmp90_;
		ValaCCodeOnceSection* _tmp91_;
		ValaCCodeWriter* _tmp92_;
		_tmp33_ = writer;
		vala_ccode_writer_write_newline (_tmp33_);
		_tmp34_ = writer;
		_tmp35_ = vala_ccode_writer_get_filename (_tmp34_);
		_tmp36_ = _tmp35_;
		_tmp37_ = vala_ccode_file_get_define_for_filename (_tmp36_);
		_tmp38_ = _tmp37_;
		_tmp39_ = vala_ccode_once_section_new (_tmp38_);
		_tmp40_ = _tmp39_;
		_g_free0 (_tmp38_);
		once = _tmp40_;
		_tmp41_ = once;
		_tmp42_ = vala_ccode_newline_new ();
		_tmp43_ = _tmp42_;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp41_, (ValaCCodeNode*) _tmp43_);
		_vala_ccode_node_unref0 (_tmp43_);
		_tmp44_ = once;
		_tmp45_ = self->priv->include_directives;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp44_, (ValaCCodeNode*) _tmp45_);
		_tmp46_ = once;
		_tmp47_ = vala_ccode_newline_new ();
		_tmp48_ = _tmp47_;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp46_, (ValaCCodeNode*) _tmp48_);
		_vala_ccode_node_unref0 (_tmp48_);
		_tmp49_ = begin_decls;
		if (_tmp49_ != NULL) {
			ValaCCodeOnceSection* _tmp50_;
			const gchar* _tmp51_;
			ValaCCodeIdentifier* _tmp52_;
			ValaCCodeIdentifier* _tmp53_;
			ValaCCodeOnceSection* _tmp54_;
			ValaCCodeNewline* _tmp55_;
			ValaCCodeNewline* _tmp56_;
			_tmp50_ = once;
			_tmp51_ = begin_decls;
			_tmp52_ = vala_ccode_identifier_new (_tmp51_);
			_tmp53_ = _tmp52_;
			vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp50_, (ValaCCodeNode*) _tmp53_);
			_vala_ccode_node_unref0 (_tmp53_);
			_tmp54_ = once;
			_tmp55_ = vala_ccode_newline_new ();
			_tmp56_ = _tmp55_;
			vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp54_, (ValaCCodeNode*) _tmp56_);
			_vala_ccode_node_unref0 (_tmp56_);
		}
		_tmp57_ = once;
		_tmp58_ = vala_ccode_newline_new ();
		_tmp59_ = _tmp58_;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp57_, (ValaCCodeNode*) _tmp59_);
		_vala_ccode_node_unref0 (_tmp59_);
		_tmp60_ = once;
		_tmp61_ = self->priv->type_declaration;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp60_, (ValaCCodeNode*) _tmp61_);
		_tmp62_ = once;
		_tmp63_ = vala_ccode_newline_new ();
		_tmp64_ = _tmp63_;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp62_, (ValaCCodeNode*) _tmp64_);
		_vala_ccode_node_unref0 (_tmp64_);
		_tmp65_ = once;
		_tmp66_ = self->priv->type_definition;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp65_, (ValaCCodeNode*) _tmp66_);
		_tmp67_ = once;
		_tmp68_ = vala_ccode_newline_new ();
		_tmp69_ = _tmp68_;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp67_, (ValaCCodeNode*) _tmp69_);
		_vala_ccode_node_unref0 (_tmp69_);
		_tmp70_ = once;
		_tmp71_ = self->priv->type_member_declaration;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp70_, (ValaCCodeNode*) _tmp71_);
		_tmp72_ = once;
		_tmp73_ = vala_ccode_newline_new ();
		_tmp74_ = _tmp73_;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp72_, (ValaCCodeNode*) _tmp74_);
		_vala_ccode_node_unref0 (_tmp74_);
		_tmp75_ = once;
		_tmp76_ = self->priv->constant_declaration;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp75_, (ValaCCodeNode*) _tmp76_);
		_tmp77_ = once;
		_tmp78_ = vala_ccode_newline_new ();
		_tmp79_ = _tmp78_;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp77_, (ValaCCodeNode*) _tmp79_);
		_vala_ccode_node_unref0 (_tmp79_);
		_tmp80_ = begin_decls;
		if (_tmp80_ != NULL) {
			ValaCCodeOnceSection* _tmp81_;
			const gchar* _tmp82_;
			ValaCCodeIdentifier* _tmp83_;
			ValaCCodeIdentifier* _tmp84_;
			ValaCCodeOnceSection* _tmp85_;
			ValaCCodeNewline* _tmp86_;
			ValaCCodeNewline* _tmp87_;
			_tmp81_ = once;
			_tmp82_ = end_decls;
			_tmp83_ = vala_ccode_identifier_new (_tmp82_);
			_tmp84_ = _tmp83_;
			vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp81_, (ValaCCodeNode*) _tmp84_);
			_vala_ccode_node_unref0 (_tmp84_);
			_tmp85_ = once;
			_tmp86_ = vala_ccode_newline_new ();
			_tmp87_ = _tmp86_;
			vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp85_, (ValaCCodeNode*) _tmp87_);
			_vala_ccode_node_unref0 (_tmp87_);
		}
		_tmp88_ = once;
		_tmp89_ = vala_ccode_newline_new ();
		_tmp90_ = _tmp89_;
		vala_ccode_fragment_append ((ValaCCodeFragment*) _tmp88_, (ValaCCodeNode*) _tmp90_);
		_vala_ccode_node_unref0 (_tmp90_);
		_tmp91_ = once;
		_tmp92_ = writer;
		vala_ccode_node_write ((ValaCCodeNode*) _tmp91_, _tmp92_);
		_vala_ccode_node_unref0 (once);
	}
	_tmp93_ = writer;
	vala_ccode_writer_close (_tmp93_);
	result = TRUE;
	_vala_ccode_writer_unref0 (writer);
	return result;
}
Esempio n. 4
0
static void vala_dova_array_module_real_visit_array_creation_expression (ValaCodeVisitor* base, ValaArrayCreationExpression* expr) {
	ValaDovaArrayModule * self;
	ValaArrayCreationExpression* _tmp0_;
	ValaDataType* _tmp1_;
	ValaDataType* _tmp2_;
	ValaArrayType* _tmp3_;
	ValaArrayType* array_type;
	gboolean _tmp4_ = FALSE;
	ValaArrayType* _tmp5_;
	gboolean _tmp9_;
	ValaStruct* _tmp24_;
	ValaScope* _tmp25_;
	ValaScope* _tmp26_;
	ValaSymbol* _tmp27_ = NULL;
	ValaMethod* _tmp28_;
	ValaCCodeFile* _tmp29_;
	ValaCCodeIdentifier* _tmp30_;
	ValaCCodeIdentifier* _tmp31_;
	ValaCCodeFunctionCall* _tmp32_;
	ValaCCodeFunctionCall* _tmp33_;
	ValaCCodeFunctionCall* array_new;
	ValaCCodeFunctionCall* _tmp34_;
	ValaArrayCreationExpression* _tmp35_;
	ValaDataType* _tmp36_;
	ValaDataType* _tmp37_;
	ValaCCodeExpression* _tmp38_ = NULL;
	ValaCCodeExpression* _tmp39_;
	ValaCCodeFunctionCall* _tmp40_;
	ValaArrayCreationExpression* _tmp41_;
	ValaList* _tmp42_ = NULL;
	ValaList* _tmp43_;
	gpointer _tmp44_ = NULL;
	ValaExpression* _tmp45_;
	ValaCCodeExpression* _tmp46_ = NULL;
	ValaCCodeExpression* _tmp47_;
	ValaArrayCreationExpression* _tmp48_;
	ValaDataType* _tmp49_;
	ValaDataType* _tmp50_;
	ValaArrayCreationExpression* _tmp51_;
	ValaLocalVariable* _tmp52_ = NULL;
	ValaLocalVariable* temp_var;
	ValaLocalVariable* _tmp53_;
	const gchar* _tmp54_;
	const gchar* _tmp55_;
	ValaCCodeExpression* _tmp56_ = NULL;
	ValaCCodeExpression* name_cnode;
	ValaLocalVariable* _tmp57_;
	ValaCCodeFunction* _tmp58_;
	ValaCCodeFunction* _tmp59_;
	ValaCCodeExpression* _tmp60_;
	ValaCCodeFunctionCall* _tmp61_;
	ValaArrayCreationExpression* _tmp62_;
	ValaCCodeExpression* _tmp63_;
	self = (ValaDovaArrayModule*) base;
	g_return_if_fail (expr != NULL);
	_tmp0_ = expr;
	_tmp1_ = vala_expression_get_target_type ((ValaExpression*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _vala_code_node_ref0 (VALA_IS_ARRAY_TYPE (_tmp2_) ? ((ValaArrayType*) _tmp2_) : NULL);
	array_type = _tmp3_;
	_tmp5_ = array_type;
	if (_tmp5_ != NULL) {
		ValaArrayType* _tmp6_;
		gboolean _tmp7_;
		gboolean _tmp8_;
		_tmp6_ = array_type;
		_tmp7_ = vala_array_type_get_fixed_length (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp4_ = _tmp8_;
	} else {
		_tmp4_ = FALSE;
	}
	_tmp9_ = _tmp4_;
	if (_tmp9_) {
		ValaArrayType* _tmp10_;
		ValaArrayCreationExpression* _tmp11_;
		ValaLocalVariable* _tmp12_ = NULL;
		ValaLocalVariable* temp_var;
		ValaLocalVariable* _tmp13_;
		const gchar* _tmp14_;
		const gchar* _tmp15_;
		ValaCCodeIdentifier* _tmp16_;
		ValaCCodeIdentifier* name_cnode;
		gint i;
		ValaLocalVariable* _tmp17_;
		ValaCCodeIdentifier* _tmp18_;
		ValaArrayCreationExpression* _tmp19_;
		ValaInitializerList* _tmp20_;
		ValaInitializerList* _tmp21_;
		ValaArrayCreationExpression* _tmp22_;
		ValaCCodeIdentifier* _tmp23_;
		_tmp10_ = array_type;
		_tmp11_ = expr;
		_tmp12_ = vala_dova_base_module_get_temp_variable ((ValaDovaBaseModule*) self, (ValaDataType*) _tmp10_, TRUE, (ValaCodeNode*) _tmp11_);
		temp_var = _tmp12_;
		_tmp13_ = temp_var;
		_tmp14_ = vala_symbol_get_name ((ValaSymbol*) _tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = vala_ccode_identifier_new (_tmp15_);
		name_cnode = _tmp16_;
		i = 0;
		_tmp17_ = temp_var;
		vala_dova_base_module_emit_temp_var ((ValaDovaBaseModule*) self, _tmp17_);
		_tmp18_ = name_cnode;
		_tmp19_ = expr;
		_tmp20_ = vala_array_creation_expression_get_initializer_list (_tmp19_);
		_tmp21_ = _tmp20_;
		vala_dova_array_module_append_initializer_list (self, (ValaCCodeExpression*) _tmp18_, _tmp21_, &i);
		_tmp22_ = expr;
		_tmp23_ = name_cnode;
		vala_dova_base_module_set_cvalue ((ValaDovaBaseModule*) self, (ValaExpression*) _tmp22_, (ValaCCodeExpression*) _tmp23_);
		_vala_ccode_node_unref0 (name_cnode);
		_vala_code_node_unref0 (temp_var);
		_vala_code_node_unref0 (array_type);
		return;
	}
	_tmp24_ = ((ValaDovaBaseModule*) self)->array_struct;
	_tmp25_ = vala_symbol_get_scope ((ValaSymbol*) _tmp24_);
	_tmp26_ = _tmp25_;
	_tmp27_ = vala_scope_lookup (_tmp26_, "create");
	_tmp28_ = VALA_METHOD (_tmp27_);
	_tmp29_ = ((ValaDovaBaseModule*) self)->cfile;
	vala_dova_base_module_generate_method_declaration ((ValaDovaBaseModule*) self, _tmp28_, _tmp29_);
	_vala_code_node_unref0 (_tmp28_);
	_tmp30_ = vala_ccode_identifier_new ("dova_array_create");
	_tmp31_ = _tmp30_;
	_tmp32_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp31_);
	_tmp33_ = _tmp32_;
	_vala_ccode_node_unref0 (_tmp31_);
	array_new = _tmp33_;
	_tmp34_ = array_new;
	_tmp35_ = expr;
	_tmp36_ = vala_array_creation_expression_get_element_type (_tmp35_);
	_tmp37_ = _tmp36_;
	_tmp38_ = vala_dova_base_module_get_type_id_expression ((ValaDovaBaseModule*) self, _tmp37_, FALSE);
	_tmp39_ = _tmp38_;
	vala_ccode_function_call_add_argument (_tmp34_, _tmp39_);
	_vala_ccode_node_unref0 (_tmp39_);
	_tmp40_ = array_new;
	_tmp41_ = expr;
	_tmp42_ = vala_array_creation_expression_get_sizes (_tmp41_);
	_tmp43_ = _tmp42_;
	_tmp44_ = vala_list_get (_tmp43_, 0);
	_tmp45_ = (ValaExpression*) _tmp44_;
	_tmp46_ = vala_dova_base_module_get_cvalue ((ValaDovaBaseModule*) self, _tmp45_);
	_tmp47_ = _tmp46_;
	vala_ccode_function_call_add_argument (_tmp40_, _tmp47_);
	_vala_ccode_node_unref0 (_tmp47_);
	_vala_code_node_unref0 (_tmp45_);
	_vala_iterable_unref0 (_tmp43_);
	_tmp48_ = expr;
	_tmp49_ = vala_expression_get_value_type ((ValaExpression*) _tmp48_);
	_tmp50_ = _tmp49_;
	_tmp51_ = expr;
	_tmp52_ = vala_dova_base_module_get_temp_variable ((ValaDovaBaseModule*) self, _tmp50_, TRUE, (ValaCodeNode*) _tmp51_);
	temp_var = _tmp52_;
	_tmp53_ = temp_var;
	_tmp54_ = vala_symbol_get_name ((ValaSymbol*) _tmp53_);
	_tmp55_ = _tmp54_;
	_tmp56_ = vala_dova_base_module_get_variable_cexpression ((ValaDovaBaseModule*) self, _tmp55_);
	name_cnode = _tmp56_;
	_tmp57_ = temp_var;
	vala_dova_base_module_emit_temp_var ((ValaDovaBaseModule*) self, _tmp57_);
	_tmp58_ = vala_dova_base_module_get_ccode ((ValaDovaBaseModule*) self);
	_tmp59_ = _tmp58_;
	_tmp60_ = name_cnode;
	_tmp61_ = array_new;
	vala_ccode_function_add_assignment (_tmp59_, _tmp60_, (ValaCCodeExpression*) _tmp61_);
	_tmp62_ = expr;
	_tmp63_ = name_cnode;
	vala_dova_base_module_set_cvalue ((ValaDovaBaseModule*) self, (ValaExpression*) _tmp62_, _tmp63_);
	_vala_ccode_node_unref0 (name_cnode);
	_vala_code_node_unref0 (temp_var);
	_vala_ccode_node_unref0 (array_new);
	_vala_code_node_unref0 (array_type);
}