151
153
typedef struct _ValaSourceReference ValaSourceReference;
152
154
typedef struct _ValaSourceReferenceClass ValaSourceReferenceClass;
156
#define VALA_TYPE_UNLOCK_STATEMENT (vala_unlock_statement_get_type ())
157
#define VALA_UNLOCK_STATEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_UNLOCK_STATEMENT, ValaUnlockStatement))
158
#define VALA_UNLOCK_STATEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_UNLOCK_STATEMENT, ValaUnlockStatementClass))
159
#define VALA_IS_UNLOCK_STATEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_UNLOCK_STATEMENT))
160
#define VALA_IS_UNLOCK_STATEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_UNLOCK_STATEMENT))
161
#define VALA_UNLOCK_STATEMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_UNLOCK_STATEMENT, ValaUnlockStatementClass))
163
typedef struct _ValaUnlockStatement ValaUnlockStatement;
164
typedef struct _ValaUnlockStatementClass ValaUnlockStatementClass;
166
#define VALA_TYPE_TRY_STATEMENT (vala_try_statement_get_type ())
167
#define VALA_TRY_STATEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_TRY_STATEMENT, ValaTryStatement))
168
#define VALA_TRY_STATEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_TRY_STATEMENT, ValaTryStatementClass))
169
#define VALA_IS_TRY_STATEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_TRY_STATEMENT))
170
#define VALA_IS_TRY_STATEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_TRY_STATEMENT))
171
#define VALA_TRY_STATEMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_TRY_STATEMENT, ValaTryStatementClass))
173
typedef struct _ValaTryStatement ValaTryStatement;
174
typedef struct _ValaTryStatementClass ValaTryStatementClass;
154
176
#define VALA_TYPE_MEMBER_ACCESS (vala_member_access_get_type ())
155
177
#define VALA_MEMBER_ACCESS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_MEMBER_ACCESS, ValaMemberAccess))
156
178
#define VALA_MEMBER_ACCESS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_MEMBER_ACCESS, ValaMemberAccessClass))
251
273
void vala_code_node_unref (gpointer instance);
252
274
GParamSpec* vala_param_spec_code_node (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
253
275
void vala_value_set_code_node (GValue* value, gpointer v_object);
276
void vala_value_take_code_node (GValue* value, gpointer v_object);
254
277
gpointer vala_value_get_code_node (const GValue* value);
255
278
GType vala_code_node_get_type (void);
256
279
gpointer vala_code_visitor_ref (gpointer instance);
257
280
void vala_code_visitor_unref (gpointer instance);
258
281
GParamSpec* vala_param_spec_code_visitor (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
259
282
void vala_value_set_code_visitor (GValue* value, gpointer v_object);
283
void vala_value_take_code_visitor (GValue* value, gpointer v_object);
260
284
gpointer vala_value_get_code_visitor (const GValue* value);
261
285
GType vala_code_visitor_get_type (void);
262
286
GType vala_semantic_analyzer_get_type (void);
278
302
void vala_source_reference_unref (gpointer instance);
279
303
GParamSpec* vala_param_spec_source_reference (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
280
304
void vala_value_set_source_reference (GValue* value, gpointer v_object);
305
void vala_value_take_source_reference (GValue* value, gpointer v_object);
281
306
gpointer vala_value_get_source_reference (const GValue* value);
282
307
GType vala_source_reference_get_type (void);
283
308
void vala_code_node_set_source_reference (ValaCodeNode* self, ValaSourceReference* value);
289
314
ValaBlock* vala_lock_statement_get_body (ValaLockStatement* self);
290
315
void vala_code_visitor_visit_lock_statement (ValaCodeVisitor* self, ValaLockStatement* stmt);
291
316
static void vala_lock_statement_real_accept (ValaCodeNode* base, ValaCodeVisitor* visitor);
317
ValaSourceReference* vala_code_node_get_source_reference (ValaCodeNode* self);
318
ValaBlock* vala_block_new (ValaSourceReference* source_reference);
319
ValaBlock* vala_block_construct (GType object_type, ValaSourceReference* source_reference);
320
void vala_block_add_statement (ValaBlock* self, ValaStatement* stmt);
321
ValaUnlockStatement* vala_unlock_statement_new (ValaExpression* resource, ValaSourceReference* source_reference);
322
ValaUnlockStatement* vala_unlock_statement_construct (GType object_type, ValaExpression* resource, ValaSourceReference* source_reference);
323
GType vala_unlock_statement_get_type (void);
324
ValaTryStatement* vala_try_statement_new (ValaBlock* body, ValaBlock* finally_body, ValaSourceReference* source_reference);
325
ValaTryStatement* vala_try_statement_construct (GType object_type, ValaBlock* body, ValaBlock* finally_body, ValaSourceReference* source_reference);
326
GType vala_try_statement_get_type (void);
327
ValaCodeNode* vala_code_node_get_parent_node (ValaCodeNode* self);
328
void vala_block_replace_statement (ValaBlock* self, ValaStatement* old_stmt, ValaStatement* new_stmt);
329
gboolean vala_code_node_check (ValaCodeNode* self, ValaSemanticAnalyzer* analyzer);
292
330
gboolean vala_code_node_get_checked (ValaCodeNode* self);
293
331
gboolean vala_code_node_get_error (ValaCodeNode* self);
294
332
void vala_code_node_set_checked (ValaCodeNode* self, gboolean value);
295
gboolean vala_code_node_check (ValaCodeNode* self, ValaSemanticAnalyzer* analyzer);
296
333
GType vala_member_access_get_type (void);
297
334
ValaSymbol* vala_expression_get_symbol_reference (ValaExpression* self);
298
335
GType vala_lockable_get_type (void);
299
336
void vala_code_node_set_error (ValaCodeNode* self, gboolean value);
300
337
void vala_report_error (ValaSourceReference* source, const char* message);
301
ValaSourceReference* vala_code_node_get_source_reference (ValaCodeNode* self);
302
338
ValaSymbol* vala_symbol_get_parent_symbol (ValaSymbol* self);
303
339
GType vala_typesymbol_get_type (void);
304
340
GType vala_object_type_symbol_get_type (void);
313
349
ValaLockStatement* vala_lock_statement_construct (GType object_type, ValaExpression* resource, ValaBlock* body, ValaSourceReference* source_reference) {
314
350
ValaLockStatement* self;
315
351
g_return_val_if_fail (resource != NULL, NULL);
316
g_return_val_if_fail (body != NULL, NULL);
317
352
self = (ValaLockStatement*) vala_code_node_construct (object_type);
318
353
vala_lock_statement_set_body (self, body);
319
354
vala_code_node_set_source_reference ((ValaCodeNode*) self, source_reference);
332
367
self = (ValaLockStatement*) base;
333
368
g_return_if_fail (visitor != NULL);
334
369
vala_code_node_accept ((ValaCodeNode*) self->priv->_resource, visitor);
335
vala_code_node_accept ((ValaCodeNode*) self->priv->_body, visitor);
370
if (self->priv->_body != NULL) {
371
vala_code_node_accept ((ValaCodeNode*) self->priv->_body, visitor);
336
373
vala_code_visitor_visit_lock_statement (visitor, self);
377
static gpointer _vala_code_node_ref0 (gpointer self) {
378
return self ? vala_code_node_ref (self) : NULL;
340
382
static gboolean vala_lock_statement_real_check (ValaCodeNode* base, ValaSemanticAnalyzer* analyzer) {
341
383
ValaLockStatement * self;
343
gboolean _tmp0_ = FALSE;
384
gboolean result = FALSE;
385
gboolean _tmp3_ = FALSE;
344
386
self = (ValaLockStatement*) base;
345
387
g_return_val_if_fail (analyzer != NULL, FALSE);
388
if (self->priv->_body != NULL) {
390
ValaUnlockStatement* _tmp0_;
392
ValaLockStatement* _tmp1_;
393
ValaTryStatement* _tmp2_;
394
ValaBlock* parent_block;
395
fin_body = vala_block_new (vala_code_node_get_source_reference ((ValaCodeNode*) self));
396
vala_block_add_statement (fin_body, (ValaStatement*) (_tmp0_ = vala_unlock_statement_new (self->priv->_resource, vala_code_node_get_source_reference ((ValaCodeNode*) self))));
397
_vala_code_node_unref0 (_tmp0_);
398
block = vala_block_new (vala_code_node_get_source_reference ((ValaCodeNode*) self));
399
vala_block_add_statement (block, (ValaStatement*) (_tmp1_ = vala_lock_statement_new (self->priv->_resource, NULL, vala_code_node_get_source_reference ((ValaCodeNode*) self))));
400
_vala_code_node_unref0 (_tmp1_);
401
vala_block_add_statement (block, (ValaStatement*) (_tmp2_ = vala_try_statement_new (self->priv->_body, fin_body, vala_code_node_get_source_reference ((ValaCodeNode*) self))));
402
_vala_code_node_unref0 (_tmp2_);
403
parent_block = _vala_code_node_ref0 (VALA_BLOCK (vala_code_node_get_parent_node ((ValaCodeNode*) self)));
404
vala_block_replace_statement (parent_block, (ValaStatement*) self, (ValaStatement*) block);
405
result = vala_code_node_check ((ValaCodeNode*) block, analyzer);
406
_vala_code_node_unref0 (fin_body);
407
_vala_code_node_unref0 (block);
408
_vala_code_node_unref0 (parent_block);
346
411
if (vala_code_node_get_checked ((ValaCodeNode*) self)) {
347
412
result = !vala_code_node_get_error ((ValaCodeNode*) self);
350
415
vala_code_node_set_checked ((ValaCodeNode*) self, TRUE);
351
416
vala_code_node_check ((ValaCodeNode*) self->priv->_resource, analyzer);
352
vala_code_node_check ((ValaCodeNode*) self->priv->_body, analyzer);
353
417
if (VALA_IS_MEMBER_ACCESS (self->priv->_resource)) {
354
_tmp0_ = VALA_IS_LOCKABLE (vala_expression_get_symbol_reference (self->priv->_resource));
418
_tmp3_ = VALA_IS_LOCKABLE (vala_expression_get_symbol_reference (self->priv->_resource));
359
423
vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
360
424
vala_code_node_set_error ((ValaCodeNode*) self->priv->_resource, TRUE);
361
vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) self->priv->_resource), "Expression is either not a member access or does not denote a lockable member");
425
vala_report_error (vala_code_node_get_source_reference ((ValaCodeNode*) self->priv->_resource), "Expression is either not a member access or does not denote a lockable" \
439
499
GType vala_lock_statement_get_type (void) {
440
static GType vala_lock_statement_type_id = 0;
441
if (vala_lock_statement_type_id == 0) {
500
static volatile gsize vala_lock_statement_type_id__volatile = 0;
501
if (g_once_init_enter (&vala_lock_statement_type_id__volatile)) {
442
502
static const GTypeInfo g_define_type_info = { sizeof (ValaLockStatementClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_lock_statement_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaLockStatement), 0, (GInstanceInitFunc) vala_lock_statement_instance_init, NULL };
443
503
static const GInterfaceInfo vala_statement_info = { (GInterfaceInitFunc) vala_lock_statement_vala_statement_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
504
GType vala_lock_statement_type_id;
444
505
vala_lock_statement_type_id = g_type_register_static (VALA_TYPE_CODE_NODE, "ValaLockStatement", &g_define_type_info, 0);
445
506
g_type_add_interface_static (vala_lock_statement_type_id, VALA_TYPE_STATEMENT, &vala_statement_info);
507
g_once_init_leave (&vala_lock_statement_type_id__volatile, vala_lock_statement_type_id);
447
return vala_lock_statement_type_id;
509
return vala_lock_statement_type_id__volatile;