Esempio n. 1
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;
}
Esempio n. 2
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;
}