Exemplo n.º 1
0
static gboolean vala_null_literal_real_check (ValaCodeNode* base, ValaCodeContext* context) {
	ValaNullLiteral * self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	gboolean _tmp1_;
	ValaSourceReference* _tmp4_;
	ValaSourceReference* _tmp5_;
	ValaNullType* _tmp6_;
	ValaNullType* _tmp7_;
	gboolean _tmp8_;
	gboolean _tmp9_;
	self = (ValaNullLiteral*) 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_code_node_get_source_reference ((ValaCodeNode*) self);
	_tmp5_ = _tmp4_;
	_tmp6_ = vala_null_type_new (_tmp5_);
	_tmp7_ = _tmp6_;
	vala_expression_set_value_type ((ValaExpression*) self, (ValaDataType*) _tmp7_);
	_vala_code_node_unref0 (_tmp7_);
	_tmp8_ = vala_code_node_get_error ((ValaCodeNode*) self);
	_tmp9_ = _tmp8_;
	result = !_tmp9_;
	return result;
}
Exemplo n.º 2
0
static gboolean vala_enum_value_real_check (ValaCodeNode* base, ValaCodeContext* context) {
	ValaEnumValue * self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	gboolean _tmp1_;
	ValaExpression* _tmp4_;
	ValaExpression* _tmp5_;
	gboolean _tmp9_;
	gboolean _tmp10_;
	self = (ValaEnumValue*) 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_constant_get_value ((ValaConstant*) self);
	_tmp5_ = _tmp4_;
	if (_tmp5_ != NULL) {
		ValaExpression* _tmp6_;
		ValaExpression* _tmp7_;
		ValaCodeContext* _tmp8_;
		_tmp6_ = vala_constant_get_value ((ValaConstant*) self);
		_tmp7_ = _tmp6_;
		_tmp8_ = context;
		vala_code_node_check ((ValaCodeNode*) _tmp7_, _tmp8_);
	}
	_tmp9_ = vala_code_node_get_error ((ValaCodeNode*) self);
	_tmp10_ = _tmp9_;
	result = !_tmp10_;
	return result;
}
Exemplo n.º 3
0
static gboolean vala_addressof_expression_real_check (ValaCodeNode* base, ValaCodeContext* context) {
	ValaAddressofExpression * self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	gboolean _tmp1_;
	ValaExpression* _tmp4_;
	ValaExpression* _tmp5_;
	ValaExpression* _tmp6_;
	ValaExpression* _tmp7_;
	ValaCodeContext* _tmp8_;
	gboolean _tmp9_ = FALSE;
	ValaExpression* _tmp10_;
	ValaExpression* _tmp11_;
	ValaElementAccess* _tmp12_;
	ValaElementAccess* ea;
	gboolean _tmp13_ = FALSE;
	ValaExpression* _tmp14_;
	ValaExpression* _tmp15_;
	gboolean _tmp20_;
	ValaExpression* _tmp38_;
	ValaExpression* _tmp39_;
	ValaDataType* _tmp40_;
	ValaDataType* _tmp41_;
	gboolean _tmp42_ = FALSE;
	gboolean _tmp57_;
	gboolean _tmp58_;
	self = (ValaAddressofExpression*) 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_addressof_expression_get_inner (self);
	_tmp5_ = _tmp4_;
	vala_expression_set_lvalue (_tmp5_, TRUE);
	_tmp6_ = vala_addressof_expression_get_inner (self);
	_tmp7_ = _tmp6_;
	_tmp8_ = context;
	_tmp9_ = vala_code_node_check ((ValaCodeNode*) _tmp7_, _tmp8_);
	if (!_tmp9_) {
		vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		result = FALSE;
		return result;
	}
	_tmp10_ = vala_addressof_expression_get_inner (self);
	_tmp11_ = _tmp10_;
	_tmp12_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp11_, VALA_TYPE_ELEMENT_ACCESS) ? ((ValaElementAccess*) _tmp11_) : NULL);
	ea = _tmp12_;
	_tmp14_ = vala_addressof_expression_get_inner (self);
	_tmp15_ = _tmp14_;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, VALA_TYPE_MEMBER_ACCESS)) {
		ValaExpression* _tmp16_;
		ValaExpression* _tmp17_;
		ValaSymbol* _tmp18_;
		ValaSymbol* _tmp19_;
		_tmp16_ = vala_addressof_expression_get_inner (self);
		_tmp17_ = _tmp16_;
		_tmp18_ = vala_expression_get_symbol_reference (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp13_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp19_, VALA_TYPE_VARIABLE);
	} else {
		_tmp13_ = FALSE;
	}
	_tmp20_ = _tmp13_;
	if (_tmp20_) {
	} else {
		gboolean _tmp21_ = FALSE;
		ValaElementAccess* _tmp22_;
		gboolean _tmp35_;
		_tmp22_ = ea;
		if (_tmp22_ != NULL) {
			gboolean _tmp23_ = FALSE;
			ValaElementAccess* _tmp24_;
			ValaExpression* _tmp25_;
			ValaExpression* _tmp26_;
			ValaDataType* _tmp27_;
			ValaDataType* _tmp28_;
			gboolean _tmp34_;
			_tmp24_ = ea;
			_tmp25_ = vala_element_access_get_container (_tmp24_);
			_tmp26_ = _tmp25_;
			_tmp27_ = vala_expression_get_value_type (_tmp26_);
			_tmp28_ = _tmp27_;
			if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp28_, VALA_TYPE_ARRAY_TYPE)) {
				_tmp23_ = TRUE;
			} else {
				ValaElementAccess* _tmp29_;
				ValaExpression* _tmp30_;
				ValaExpression* _tmp31_;
				ValaDataType* _tmp32_;
				ValaDataType* _tmp33_;
				_tmp29_ = ea;
				_tmp30_ = vala_element_access_get_container (_tmp29_);
				_tmp31_ = _tmp30_;
				_tmp32_ = vala_expression_get_value_type (_tmp31_);
				_tmp33_ = _tmp32_;
				_tmp23_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp33_, VALA_TYPE_POINTER_TYPE);
			}
			_tmp34_ = _tmp23_;
			_tmp21_ = _tmp34_;
		} else {
			_tmp21_ = FALSE;
		}
		_tmp35_ = _tmp21_;
		if (_tmp35_) {
		} else {
			ValaSourceReference* _tmp36_;
			ValaSourceReference* _tmp37_;
			vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
			_tmp36_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
			_tmp37_ = _tmp36_;
			vala_report_error (_tmp37_, "Address-of operator not supported for this expression");
			result = FALSE;
			_vala_code_node_unref0 (ea);
			return result;
		}
	}
	_tmp38_ = vala_addressof_expression_get_inner (self);
	_tmp39_ = _tmp38_;
	_tmp40_ = vala_expression_get_value_type (_tmp39_);
	_tmp41_ = _tmp40_;
	_tmp42_ = vala_data_type_is_reference_type_or_type_parameter (_tmp41_);
	if (_tmp42_) {
		ValaExpression* _tmp43_;
		ValaExpression* _tmp44_;
		ValaDataType* _tmp45_;
		ValaDataType* _tmp46_;
		ValaPointerType* _tmp47_;
		ValaPointerType* _tmp48_;
		ValaPointerType* _tmp49_;
		ValaPointerType* _tmp50_;
		_tmp43_ = vala_addressof_expression_get_inner (self);
		_tmp44_ = _tmp43_;
		_tmp45_ = vala_expression_get_value_type (_tmp44_);
		_tmp46_ = _tmp45_;
		_tmp47_ = vala_pointer_type_new (_tmp46_, NULL);
		_tmp48_ = _tmp47_;
		_tmp49_ = vala_pointer_type_new ((ValaDataType*) _tmp48_, NULL);
		_tmp50_ = _tmp49_;
		vala_expression_set_value_type ((ValaExpression*) self, (ValaDataType*) _tmp50_);
		_vala_code_node_unref0 (_tmp50_);
		_vala_code_node_unref0 (_tmp48_);
	} else {
		ValaExpression* _tmp51_;
		ValaExpression* _tmp52_;
		ValaDataType* _tmp53_;
		ValaDataType* _tmp54_;
		ValaPointerType* _tmp55_;
		ValaPointerType* _tmp56_;
		_tmp51_ = vala_addressof_expression_get_inner (self);
		_tmp52_ = _tmp51_;
		_tmp53_ = vala_expression_get_value_type (_tmp52_);
		_tmp54_ = _tmp53_;
		_tmp55_ = vala_pointer_type_new (_tmp54_, NULL);
		_tmp56_ = _tmp55_;
		vala_expression_set_value_type ((ValaExpression*) self, (ValaDataType*) _tmp56_);
		_vala_code_node_unref0 (_tmp56_);
	}
	_tmp57_ = vala_code_node_get_error ((ValaCodeNode*) self);
	_tmp58_ = _tmp57_;
	result = !_tmp58_;
	_vala_code_node_unref0 (ea);
	return result;
}
Exemplo n.º 4
0
static gboolean vala_constructor_real_check (ValaCodeNode* base, ValaCodeContext* context) {
	ValaConstructor * self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	gboolean _tmp1_;
	ValaCodeContext* _tmp4_;
	ValaSemanticAnalyzer* _tmp5_;
	ValaSemanticAnalyzer* _tmp6_;
	ValaClass* _tmp7_;
	ValaClass* _tmp8_;
	ValaObjectType* _tmp9_;
	ValaObjectType* _tmp10_;
	ValaParameter* _tmp11_;
	ValaParameter* _tmp12_;
	ValaScope* _tmp13_;
	ValaScope* _tmp14_;
	ValaParameter* _tmp15_;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	ValaParameter* _tmp18_;
	ValaCodeContext* _tmp19_;
	ValaSemanticAnalyzer* _tmp20_;
	ValaSemanticAnalyzer* _tmp21_;
	ValaSymbol* _tmp22_;
	ValaSymbol* _tmp23_;
	ValaScope* _tmp24_;
	ValaScope* _tmp25_;
	ValaCodeContext* _tmp26_;
	ValaSemanticAnalyzer* _tmp27_;
	ValaSemanticAnalyzer* _tmp28_;
	ValaBlock* _tmp29_;
	ValaBlock* _tmp30_;
	ValaCodeContext* _tmp57_;
	ValaSemanticAnalyzer* _tmp58_;
	ValaSemanticAnalyzer* _tmp59_;
	ValaCodeContext* _tmp60_;
	ValaSemanticAnalyzer* _tmp61_;
	ValaSemanticAnalyzer* _tmp62_;
	ValaSymbol* _tmp63_;
	ValaSymbol* _tmp64_;
	ValaSymbol* _tmp65_;
	ValaSymbol* _tmp66_;
	gboolean _tmp67_;
	gboolean _tmp68_;
	self = (ValaConstructor*) 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_ = context;
	_tmp5_ = vala_code_context_get_analyzer (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = vala_semantic_analyzer_get_current_class (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = vala_object_type_new ((ValaObjectTypeSymbol*) _tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = vala_parameter_new ("this", (ValaDataType*) _tmp10_, NULL);
	_tmp12_ = _tmp11_;
	vala_constructor_set_this_parameter (self, _tmp12_);
	_vala_code_node_unref0 (_tmp12_);
	_vala_code_node_unref0 (_tmp10_);
	_tmp13_ = vala_symbol_get_scope ((ValaSymbol*) self);
	_tmp14_ = _tmp13_;
	_tmp15_ = self->priv->_this_parameter;
	_tmp16_ = vala_symbol_get_name ((ValaSymbol*) _tmp15_);
	_tmp17_ = _tmp16_;
	_tmp18_ = self->priv->_this_parameter;
	vala_scope_add (_tmp14_, _tmp17_, (ValaSymbol*) _tmp18_);
	_tmp19_ = context;
	_tmp20_ = vala_code_context_get_analyzer (_tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = vala_semantic_analyzer_get_current_symbol (_tmp21_);
	_tmp23_ = _tmp22_;
	_tmp24_ = vala_symbol_get_scope (_tmp23_);
	_tmp25_ = _tmp24_;
	vala_symbol_set_owner ((ValaSymbol*) self, _tmp25_);
	_tmp26_ = context;
	_tmp27_ = vala_code_context_get_analyzer (_tmp26_);
	_tmp28_ = _tmp27_;
	vala_semantic_analyzer_set_current_symbol (_tmp28_, (ValaSymbol*) self);
	_tmp29_ = vala_subroutine_get_body ((ValaSubroutine*) self);
	_tmp30_ = _tmp29_;
	if (_tmp30_ != NULL) {
		ValaBlock* _tmp31_;
		ValaBlock* _tmp32_;
		ValaCodeContext* _tmp33_;
		_tmp31_ = vala_subroutine_get_body ((ValaSubroutine*) self);
		_tmp32_ = _tmp31_;
		_tmp33_ = context;
		vala_code_node_check ((ValaCodeNode*) _tmp32_, _tmp33_);
	}
	{
		ValaBlock* _tmp34_;
		ValaBlock* _tmp35_;
		ValaList* _tmp36_ = NULL;
		ValaList* _body_error_type_list;
		ValaList* _tmp37_;
		gint _tmp38_;
		gint _tmp39_;
		gint _body_error_type_size;
		gint _body_error_type_index;
		_tmp34_ = vala_subroutine_get_body ((ValaSubroutine*) self);
		_tmp35_ = _tmp34_;
		_tmp36_ = vala_code_node_get_error_types ((ValaCodeNode*) _tmp35_);
		_body_error_type_list = _tmp36_;
		_tmp37_ = _body_error_type_list;
		_tmp38_ = vala_collection_get_size ((ValaCollection*) _tmp37_);
		_tmp39_ = _tmp38_;
		_body_error_type_size = _tmp39_;
		_body_error_type_index = -1;
		while (TRUE) {
			gint _tmp40_;
			gint _tmp41_;
			gint _tmp42_;
			ValaList* _tmp43_;
			gint _tmp44_;
			gpointer _tmp45_ = NULL;
			ValaDataType* body_error_type;
			ValaDataType* _tmp46_;
			gboolean _tmp47_;
			gboolean _tmp48_;
			_tmp40_ = _body_error_type_index;
			_body_error_type_index = _tmp40_ + 1;
			_tmp41_ = _body_error_type_index;
			_tmp42_ = _body_error_type_size;
			if (!(_tmp41_ < _tmp42_)) {
				break;
			}
			_tmp43_ = _body_error_type_list;
			_tmp44_ = _body_error_type_index;
			_tmp45_ = vala_list_get (_tmp43_, _tmp44_);
			body_error_type = (ValaDataType*) _tmp45_;
			_tmp46_ = body_error_type;
			_tmp47_ = vala_error_type_get_dynamic_error (VALA_ERROR_TYPE (_tmp46_));
			_tmp48_ = _tmp47_;
			if (!_tmp48_) {
				ValaDataType* _tmp49_;
				ValaSourceReference* _tmp50_;
				ValaSourceReference* _tmp51_;
				ValaDataType* _tmp52_;
				gchar* _tmp53_ = NULL;
				gchar* _tmp54_;
				gchar* _tmp55_ = NULL;
				gchar* _tmp56_;
				_tmp49_ = body_error_type;
				_tmp50_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp49_);
				_tmp51_ = _tmp50_;
				_tmp52_ = body_error_type;
				_tmp53_ = vala_code_node_to_string ((ValaCodeNode*) _tmp52_);
				_tmp54_ = _tmp53_;
				_tmp55_ = g_strdup_printf ("unhandled error `%s'", _tmp54_);
				_tmp56_ = _tmp55_;
				vala_report_warning (_tmp51_, _tmp56_);
				_g_free0 (_tmp56_);
				_g_free0 (_tmp54_);
			}
			_vala_code_node_unref0 (body_error_type);
		}
		_vala_iterable_unref0 (_body_error_type_list);
	}
	_tmp57_ = context;
	_tmp58_ = vala_code_context_get_analyzer (_tmp57_);
	_tmp59_ = _tmp58_;
	_tmp60_ = context;
	_tmp61_ = vala_code_context_get_analyzer (_tmp60_);
	_tmp62_ = _tmp61_;
	_tmp63_ = vala_semantic_analyzer_get_current_symbol (_tmp62_);
	_tmp64_ = _tmp63_;
	_tmp65_ = vala_symbol_get_parent_symbol (_tmp64_);
	_tmp66_ = _tmp65_;
	vala_semantic_analyzer_set_current_symbol (_tmp59_, _tmp66_);
	_tmp67_ = vala_code_node_get_error ((ValaCodeNode*) self);
	_tmp68_ = _tmp67_;
	result = !_tmp68_;
	return result;
}
Exemplo n.º 5
0
static gboolean vala_slice_expression_real_check (ValaCodeNode* base, ValaCodeContext* context) {
	ValaSliceExpression * self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	gboolean _tmp1_;
	ValaExpression* _tmp4_;
	ValaExpression* _tmp5_;
	ValaCodeContext* _tmp6_;
	gboolean _tmp7_ = FALSE;
	ValaExpression* _tmp8_;
	ValaExpression* _tmp9_;
	ValaCodeContext* _tmp10_;
	gboolean _tmp11_ = FALSE;
	ValaExpression* _tmp12_;
	ValaExpression* _tmp13_;
	ValaCodeContext* _tmp14_;
	gboolean _tmp15_ = FALSE;
	ValaExpression* _tmp16_;
	ValaExpression* _tmp17_;
	ValaDataType* _tmp18_;
	ValaDataType* _tmp19_;
	gboolean _tmp24_;
	gboolean _tmp25_;
	ValaExpression* _tmp30_;
	ValaExpression* _tmp31_;
	ValaDataType* _tmp32_;
	ValaDataType* _tmp33_;
	gboolean _tmp107_;
	gboolean _tmp108_;
	self = (ValaSliceExpression*) 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_slice_expression_get_container (self);
	_tmp5_ = _tmp4_;
	_tmp6_ = context;
	_tmp7_ = vala_code_node_check ((ValaCodeNode*) _tmp5_, _tmp6_);
	if (!_tmp7_) {
		vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		result = FALSE;
		return result;
	}
	_tmp8_ = vala_slice_expression_get_start (self);
	_tmp9_ = _tmp8_;
	_tmp10_ = context;
	_tmp11_ = vala_code_node_check ((ValaCodeNode*) _tmp9_, _tmp10_);
	if (!_tmp11_) {
		vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		result = FALSE;
		return result;
	}
	_tmp12_ = vala_slice_expression_get_stop (self);
	_tmp13_ = _tmp12_;
	_tmp14_ = context;
	_tmp15_ = vala_code_node_check ((ValaCodeNode*) _tmp13_, _tmp14_);
	if (!_tmp15_) {
		vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		result = FALSE;
		return result;
	}
	_tmp16_ = vala_slice_expression_get_container (self);
	_tmp17_ = _tmp16_;
	_tmp18_ = vala_expression_get_value_type (_tmp17_);
	_tmp19_ = _tmp18_;
	if (_tmp19_ == NULL) {
		ValaExpression* _tmp20_;
		ValaExpression* _tmp21_;
		ValaSourceReference* _tmp22_;
		ValaSourceReference* _tmp23_;
		vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		_tmp20_ = vala_slice_expression_get_container (self);
		_tmp21_ = _tmp20_;
		_tmp22_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp21_);
		_tmp23_ = _tmp22_;
		vala_report_error (_tmp23_, "Invalid container expression");
		result = FALSE;
		return result;
	}
	_tmp24_ = vala_expression_get_lvalue ((ValaExpression*) self);
	_tmp25_ = _tmp24_;
	if (_tmp25_) {
		ValaExpression* _tmp26_;
		ValaExpression* _tmp27_;
		ValaSourceReference* _tmp28_;
		ValaSourceReference* _tmp29_;
		vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		_tmp26_ = vala_slice_expression_get_container (self);
		_tmp27_ = _tmp26_;
		_tmp28_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp27_);
		_tmp29_ = _tmp28_;
		vala_report_error (_tmp29_, "Slice expressions cannot be used as lvalue");
		result = FALSE;
		return result;
	}
	_tmp30_ = vala_slice_expression_get_container (self);
	_tmp31_ = _tmp30_;
	_tmp32_ = vala_expression_get_value_type (_tmp31_);
	_tmp33_ = _tmp32_;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp33_, VALA_TYPE_ARRAY_TYPE)) {
		ValaExpression* _tmp34_;
		ValaExpression* _tmp35_;
		ValaDataType* _tmp36_;
		ValaDataType* _tmp37_;
		ValaDataType* _tmp38_ = NULL;
		ValaDataType* _tmp39_;
		ValaDataType* _tmp40_;
		ValaDataType* _tmp41_;
		gboolean _tmp42_ = FALSE;
		ValaExpression* _tmp43_;
		ValaExpression* _tmp44_;
		ValaDataType* _tmp45_;
		ValaDataType* _tmp46_;
		gboolean _tmp51_;
		gboolean _tmp56_ = FALSE;
		ValaExpression* _tmp57_;
		ValaExpression* _tmp58_;
		ValaDataType* _tmp59_;
		ValaDataType* _tmp60_;
		gboolean _tmp65_;
		_tmp34_ = vala_slice_expression_get_container (self);
		_tmp35_ = _tmp34_;
		_tmp36_ = vala_expression_get_value_type (_tmp35_);
		_tmp37_ = _tmp36_;
		_tmp38_ = vala_data_type_copy (_tmp37_);
		_tmp39_ = _tmp38_;
		vala_expression_set_value_type ((ValaExpression*) self, _tmp39_);
		_vala_code_node_unref0 (_tmp39_);
		_tmp40_ = vala_expression_get_value_type ((ValaExpression*) self);
		_tmp41_ = _tmp40_;
		vala_data_type_set_value_owned (_tmp41_, FALSE);
		_tmp43_ = vala_slice_expression_get_start (self);
		_tmp44_ = _tmp43_;
		_tmp45_ = vala_expression_get_value_type (_tmp44_);
		_tmp46_ = _tmp45_;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp46_, VALA_TYPE_INTEGER_TYPE)) {
			_tmp42_ = TRUE;
		} else {
			ValaExpression* _tmp47_;
			ValaExpression* _tmp48_;
			ValaDataType* _tmp49_;
			ValaDataType* _tmp50_;
			_tmp47_ = vala_slice_expression_get_start (self);
			_tmp48_ = _tmp47_;
			_tmp49_ = vala_expression_get_value_type (_tmp48_);
			_tmp50_ = _tmp49_;
			_tmp42_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp50_, VALA_TYPE_ENUM_VALUE_TYPE);
		}
		_tmp51_ = _tmp42_;
		if (!_tmp51_) {
			ValaExpression* _tmp52_;
			ValaExpression* _tmp53_;
			ValaSourceReference* _tmp54_;
			ValaSourceReference* _tmp55_;
			vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
			_tmp52_ = vala_slice_expression_get_start (self);
			_tmp53_ = _tmp52_;
			_tmp54_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp53_);
			_tmp55_ = _tmp54_;
			vala_report_error (_tmp55_, "Expression of integer type expected");
		}
		_tmp57_ = vala_slice_expression_get_stop (self);
		_tmp58_ = _tmp57_;
		_tmp59_ = vala_expression_get_value_type (_tmp58_);
		_tmp60_ = _tmp59_;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp60_, VALA_TYPE_INTEGER_TYPE)) {
			_tmp56_ = TRUE;
		} else {
			ValaExpression* _tmp61_;
			ValaExpression* _tmp62_;
			ValaDataType* _tmp63_;
			ValaDataType* _tmp64_;
			_tmp61_ = vala_slice_expression_get_stop (self);
			_tmp62_ = _tmp61_;
			_tmp63_ = vala_expression_get_value_type (_tmp62_);
			_tmp64_ = _tmp63_;
			_tmp56_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp64_, VALA_TYPE_ENUM_VALUE_TYPE);
		}
		_tmp65_ = _tmp56_;
		if (!_tmp65_) {
			ValaExpression* _tmp66_;
			ValaExpression* _tmp67_;
			ValaSourceReference* _tmp68_;
			ValaSourceReference* _tmp69_;
			vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
			_tmp66_ = vala_slice_expression_get_stop (self);
			_tmp67_ = _tmp66_;
			_tmp68_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp67_);
			_tmp69_ = _tmp68_;
			vala_report_error (_tmp69_, "Expression of integer type expected");
		}
	} else {
		ValaExpression* _tmp70_;
		ValaExpression* _tmp71_;
		ValaDataType* _tmp72_;
		ValaDataType* _tmp73_;
		ValaSymbol* _tmp74_ = NULL;
		ValaMethod* slice_method;
		ValaMethod* _tmp75_;
		ValaSourceReference* _tmp97_;
		ValaSourceReference* _tmp98_;
		ValaExpression* _tmp99_;
		ValaExpression* _tmp100_;
		ValaDataType* _tmp101_;
		ValaDataType* _tmp102_;
		gchar* _tmp103_ = NULL;
		gchar* _tmp104_;
		gchar* _tmp105_ = NULL;
		gchar* _tmp106_;
		_tmp70_ = vala_slice_expression_get_container (self);
		_tmp71_ = _tmp70_;
		_tmp72_ = vala_expression_get_value_type (_tmp71_);
		_tmp73_ = _tmp72_;
		_tmp74_ = vala_data_type_get_member (_tmp73_, "slice");
		slice_method = G_TYPE_CHECK_INSTANCE_TYPE (_tmp74_, VALA_TYPE_METHOD) ? ((ValaMethod*) _tmp74_) : NULL;
		_tmp75_ = slice_method;
		if (_tmp75_ != NULL) {
			ValaExpression* _tmp76_;
			ValaExpression* _tmp77_;
			ValaMemberAccess* _tmp78_;
			ValaMemberAccess* _tmp79_;
			ValaMethodCall* _tmp80_;
			ValaMethodCall* _tmp81_;
			ValaMethodCall* slice_call;
			ValaMethodCall* _tmp82_;
			ValaExpression* _tmp83_;
			ValaExpression* _tmp84_;
			ValaMethodCall* _tmp85_;
			ValaExpression* _tmp86_;
			ValaExpression* _tmp87_;
			ValaMethodCall* _tmp88_;
			ValaDataType* _tmp89_;
			ValaDataType* _tmp90_;
			ValaCodeNode* _tmp91_;
			ValaCodeNode* _tmp92_;
			ValaMethodCall* _tmp93_;
			ValaMethodCall* _tmp94_;
			ValaCodeContext* _tmp95_;
			gboolean _tmp96_ = FALSE;
			_tmp76_ = vala_slice_expression_get_container (self);
			_tmp77_ = _tmp76_;
			_tmp78_ = vala_member_access_new (_tmp77_, "slice", NULL);
			_tmp79_ = _tmp78_;
			_tmp80_ = vala_method_call_new ((ValaExpression*) _tmp79_, NULL);
			_tmp81_ = _tmp80_;
			_vala_code_node_unref0 (_tmp79_);
			slice_call = _tmp81_;
			_tmp82_ = slice_call;
			_tmp83_ = vala_slice_expression_get_start (self);
			_tmp84_ = _tmp83_;
			vala_method_call_add_argument (_tmp82_, _tmp84_);
			_tmp85_ = slice_call;
			_tmp86_ = vala_slice_expression_get_stop (self);
			_tmp87_ = _tmp86_;
			vala_method_call_add_argument (_tmp85_, _tmp87_);
			_tmp88_ = slice_call;
			_tmp89_ = vala_expression_get_target_type ((ValaExpression*) self);
			_tmp90_ = _tmp89_;
			vala_expression_set_target_type ((ValaExpression*) _tmp88_, _tmp90_);
			_tmp91_ = vala_code_node_get_parent_node ((ValaCodeNode*) self);
			_tmp92_ = _tmp91_;
			_tmp93_ = slice_call;
			vala_code_node_replace_expression (_tmp92_, (ValaExpression*) self, (ValaExpression*) _tmp93_);
			_tmp94_ = slice_call;
			_tmp95_ = context;
			_tmp96_ = vala_code_node_check ((ValaCodeNode*) _tmp94_, _tmp95_);
			result = _tmp96_;
			_vala_code_node_unref0 (slice_call);
			_vala_code_node_unref0 (slice_method);
			return result;
		}
		vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		_tmp97_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
		_tmp98_ = _tmp97_;
		_tmp99_ = vala_slice_expression_get_container (self);
		_tmp100_ = _tmp99_;
		_tmp101_ = vala_expression_get_value_type (_tmp100_);
		_tmp102_ = _tmp101_;
		_tmp103_ = vala_code_node_to_string ((ValaCodeNode*) _tmp102_);
		_tmp104_ = _tmp103_;
		_tmp105_ = g_strdup_printf ("The expression `%s' does not denote an array", _tmp104_);
		_tmp106_ = _tmp105_;
		vala_report_error (_tmp98_, _tmp106_);
		_g_free0 (_tmp106_);
		_g_free0 (_tmp104_);
		_vala_code_node_unref0 (slice_method);
	}
	_tmp107_ = vala_code_node_get_error ((ValaCodeNode*) self);
	_tmp108_ = _tmp107_;
	result = !_tmp108_;
	return result;
}
Exemplo n.º 6
0
static gboolean vala_tuple_real_check (ValaCodeNode* base, ValaCodeContext* context) {
	ValaTuple * self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	gboolean _tmp1_;
	ValaCodeContext* _tmp4_;
	ValaProfile _tmp5_;
	ValaProfile _tmp6_;
	ValaCodeContext* _tmp9_;
	ValaNamespace* _tmp10_;
	ValaNamespace* _tmp11_;
	ValaScope* _tmp12_;
	ValaScope* _tmp13_;
	ValaSymbol* _tmp14_ = NULL;
	ValaSymbol* _tmp15_;
	ValaScope* _tmp16_;
	ValaScope* _tmp17_;
	ValaSymbol* _tmp18_ = NULL;
	ValaClass* _tmp19_;
	ValaObjectType* _tmp20_;
	ValaObjectType* _tmp21_;
	ValaDataType* _tmp22_;
	ValaDataType* _tmp23_;
	gboolean _tmp45_;
	gboolean _tmp46_;
	self = (ValaTuple*) 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_ = context;
	_tmp5_ = vala_code_context_get_profile (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_ != VALA_PROFILE_DOVA) {
		ValaSourceReference* _tmp7_;
		ValaSourceReference* _tmp8_;
		_tmp7_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
		_tmp8_ = _tmp7_;
		vala_report_error (_tmp8_, "tuples are not supported");
		vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		result = FALSE;
		return result;
	}
	_tmp9_ = context;
	_tmp10_ = vala_code_context_get_root (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = vala_symbol_get_scope ((ValaSymbol*) _tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = vala_scope_lookup (_tmp13_, "Dova");
	_tmp15_ = _tmp14_;
	_tmp16_ = vala_symbol_get_scope (_tmp15_);
	_tmp17_ = _tmp16_;
	_tmp18_ = vala_scope_lookup (_tmp17_, "Tuple");
	_tmp19_ = VALA_CLASS (_tmp18_);
	_tmp20_ = vala_object_type_new ((ValaObjectTypeSymbol*) _tmp19_);
	_tmp21_ = _tmp20_;
	vala_expression_set_value_type ((ValaExpression*) self, (ValaDataType*) _tmp21_);
	_vala_code_node_unref0 (_tmp21_);
	_vala_code_node_unref0 (_tmp19_);
	_vala_code_node_unref0 (_tmp15_);
	_tmp22_ = vala_expression_get_value_type ((ValaExpression*) self);
	_tmp23_ = _tmp22_;
	vala_data_type_set_value_owned (_tmp23_, TRUE);
	{
		ValaList* _tmp24_;
		ValaList* _tmp25_;
		ValaList* _expr_list;
		ValaList* _tmp26_;
		gint _tmp27_;
		gint _tmp28_;
		gint _expr_size;
		gint _expr_index;
		_tmp24_ = self->priv->expression_list;
		_tmp25_ = _vala_iterable_ref0 (_tmp24_);
		_expr_list = _tmp25_;
		_tmp26_ = _expr_list;
		_tmp27_ = vala_collection_get_size ((ValaCollection*) _tmp26_);
		_tmp28_ = _tmp27_;
		_expr_size = _tmp28_;
		_expr_index = -1;
		while (TRUE) {
			gint _tmp29_;
			gint _tmp30_;
			gint _tmp31_;
			ValaList* _tmp32_;
			gint _tmp33_;
			gpointer _tmp34_ = NULL;
			ValaExpression* expr;
			ValaExpression* _tmp35_;
			ValaCodeContext* _tmp36_;
			gboolean _tmp37_ = FALSE;
			ValaDataType* _tmp38_;
			ValaDataType* _tmp39_;
			ValaExpression* _tmp40_;
			ValaDataType* _tmp41_;
			ValaDataType* _tmp42_;
			ValaDataType* _tmp43_ = NULL;
			ValaDataType* _tmp44_;
			_tmp29_ = _expr_index;
			_expr_index = _tmp29_ + 1;
			_tmp30_ = _expr_index;
			_tmp31_ = _expr_size;
			if (!(_tmp30_ < _tmp31_)) {
				break;
			}
			_tmp32_ = _expr_list;
			_tmp33_ = _expr_index;
			_tmp34_ = vala_list_get (_tmp32_, _tmp33_);
			expr = (ValaExpression*) _tmp34_;
			_tmp35_ = expr;
			_tmp36_ = context;
			_tmp37_ = vala_code_node_check ((ValaCodeNode*) _tmp35_, _tmp36_);
			if (!_tmp37_) {
				result = FALSE;
				_vala_code_node_unref0 (expr);
				_vala_iterable_unref0 (_expr_list);
				return result;
			}
			_tmp38_ = vala_expression_get_value_type ((ValaExpression*) self);
			_tmp39_ = _tmp38_;
			_tmp40_ = expr;
			_tmp41_ = vala_expression_get_value_type (_tmp40_);
			_tmp42_ = _tmp41_;
			_tmp43_ = vala_data_type_copy (_tmp42_);
			_tmp44_ = _tmp43_;
			vala_data_type_add_type_argument (_tmp39_, _tmp44_);
			_vala_code_node_unref0 (_tmp44_);
			_vala_code_node_unref0 (expr);
		}
		_vala_iterable_unref0 (_expr_list);
	}
	_tmp45_ = vala_code_node_get_error ((ValaCodeNode*) self);
	_tmp46_ = _tmp45_;
	result = !_tmp46_;
	return result;
}
Exemplo n.º 7
0
static gboolean vala_named_argument_real_check (ValaCodeNode* base, ValaCodeContext* context) {
	ValaNamedArgument * self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	gboolean _tmp1_;
	ValaExpression* _tmp4_;
	ValaExpression* _tmp5_;
	ValaDataType* _tmp6_;
	ValaDataType* _tmp7_;
	ValaExpression* _tmp8_;
	ValaExpression* _tmp9_;
	ValaCodeContext* _tmp10_;
	gboolean _tmp11_ = FALSE;
	ValaExpression* _tmp12_;
	ValaExpression* _tmp13_;
	ValaExpression* _tmp14_;
	ValaExpression* _tmp15_;
	ValaDataType* _tmp16_;
	ValaDataType* _tmp17_;
	ValaExpression* _tmp18_;
	ValaExpression* _tmp19_;
	ValaDataType* _tmp20_;
	ValaDataType* _tmp21_;
	gboolean _tmp22_;
	gboolean _tmp23_;
	self = (ValaNamedArgument*) 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_named_argument_get_inner (self);
	_tmp5_ = _tmp4_;
	_tmp6_ = vala_expression_get_target_type ((ValaExpression*) self);
	_tmp7_ = _tmp6_;
	vala_expression_set_target_type (_tmp5_, _tmp7_);
	_tmp8_ = vala_named_argument_get_inner (self);
	_tmp9_ = _tmp8_;
	_tmp10_ = context;
	_tmp11_ = vala_code_node_check ((ValaCodeNode*) _tmp9_, _tmp10_);
	if (!_tmp11_) {
		vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		result = FALSE;
		return result;
	}
	_tmp12_ = vala_named_argument_get_inner (self);
	_tmp13_ = _tmp12_;
	_tmp14_ = vala_named_argument_get_inner (self);
	_tmp15_ = _tmp14_;
	_tmp16_ = vala_expression_get_value_type (_tmp15_);
	_tmp17_ = _tmp16_;
	vala_expression_set_target_type (_tmp13_, _tmp17_);
	_tmp18_ = vala_named_argument_get_inner (self);
	_tmp19_ = _tmp18_;
	_tmp20_ = vala_expression_get_value_type (_tmp19_);
	_tmp21_ = _tmp20_;
	vala_expression_set_value_type ((ValaExpression*) self, _tmp21_);
	_tmp22_ = vala_code_node_get_error ((ValaCodeNode*) self);
	_tmp23_ = _tmp22_;
	result = !_tmp23_;
	return result;
}
Exemplo n.º 8
0
static gboolean vala_unlock_statement_real_check (ValaCodeNode* base, ValaCodeContext* context) {
	ValaUnlockStatement * self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	gboolean _tmp1_;
	ValaExpression* _tmp4_;
	ValaCodeContext* _tmp5_;
	gboolean _tmp6_ = FALSE;
	ValaExpression* _tmp7_;
	gboolean _tmp11_;
	ValaExpression* _tmp16_;
	ValaSymbol* _tmp17_;
	ValaSymbol* _tmp18_;
	ValaSymbol* _tmp19_;
	ValaSymbol* _tmp20_;
	ValaCodeContext* _tmp21_;
	ValaSemanticAnalyzer* _tmp22_;
	ValaSemanticAnalyzer* _tmp23_;
	ValaClass* _tmp24_;
	ValaClass* _tmp25_;
	ValaExpression* _tmp30_;
	ValaSymbol* _tmp31_;
	ValaSymbol* _tmp32_;
	gboolean _tmp33_;
	gboolean _tmp34_;
	self = (ValaUnlockStatement*) 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_ = self->priv->_resource;
	_tmp5_ = context;
	vala_code_node_check ((ValaCodeNode*) _tmp4_, _tmp5_);
	_tmp7_ = self->priv->_resource;
	if (VALA_IS_MEMBER_ACCESS (_tmp7_)) {
		ValaExpression* _tmp8_;
		ValaSymbol* _tmp9_;
		ValaSymbol* _tmp10_;
		_tmp8_ = self->priv->_resource;
		_tmp9_ = vala_expression_get_symbol_reference (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp6_ = VALA_IS_LOCKABLE (_tmp10_);
	} else {
		_tmp6_ = FALSE;
	}
	_tmp11_ = _tmp6_;
	if (!_tmp11_) {
		ValaExpression* _tmp12_;
		ValaExpression* _tmp13_;
		ValaSourceReference* _tmp14_;
		ValaSourceReference* _tmp15_;
		vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		_tmp12_ = self->priv->_resource;
		vala_code_node_set_error ((ValaCodeNode*) _tmp12_, TRUE);
		_tmp13_ = self->priv->_resource;
		_tmp14_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp13_);
		_tmp15_ = _tmp14_;
		vala_report_error (_tmp15_, "Expression is either not a member access or does not denote a lockable" \
" member");
		result = FALSE;
		return result;
	}
	_tmp16_ = self->priv->_resource;
	_tmp17_ = vala_expression_get_symbol_reference (_tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = vala_symbol_get_parent_symbol (_tmp18_);
	_tmp20_ = _tmp19_;
	_tmp21_ = context;
	_tmp22_ = vala_code_context_get_analyzer (_tmp21_);
	_tmp23_ = _tmp22_;
	_tmp24_ = vala_semantic_analyzer_get_current_class (_tmp23_);
	_tmp25_ = _tmp24_;
	if (_tmp20_ != VALA_SYMBOL (_tmp25_)) {
		ValaExpression* _tmp26_;
		ValaExpression* _tmp27_;
		ValaSourceReference* _tmp28_;
		ValaSourceReference* _tmp29_;
		vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		_tmp26_ = self->priv->_resource;
		vala_code_node_set_error ((ValaCodeNode*) _tmp26_, TRUE);
		_tmp27_ = self->priv->_resource;
		_tmp28_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp27_);
		_tmp29_ = _tmp28_;
		vala_report_error (_tmp29_, "Only members of the current class are lockable");
	}
	_tmp30_ = self->priv->_resource;
	_tmp31_ = vala_expression_get_symbol_reference (_tmp30_);
	_tmp32_ = _tmp31_;
	vala_lockable_set_lock_used (VALA_LOCKABLE (_tmp32_), TRUE);
	_tmp33_ = vala_code_node_get_error ((ValaCodeNode*) self);
	_tmp34_ = _tmp33_;
	result = !_tmp34_;
	return result;
}