~ubuntu-branches/ubuntu/vivid/vala/vivid

« back to all changes in this revision

Viewing changes to vala/valacodevisitor.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2010-07-28 07:58:01 UTC
  • mfrom: (1.5.5 upstream) (7.3.14 experimental)
  • Revision ID: james.westby@ubuntu.com-20100728075801-18u9cg5hv5oety6m
Tags: 0.9.4-1
New upstream development release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
/* valacodevisitor.vala
5
5
 *
6
 
 * Copyright (C) 2006-2009  Jürg Billeter
 
6
 * Copyright (C) 2006-2010  Jürg Billeter
7
7
 * Copyright (C) 2006-2008  Raffaele Sandrini
8
8
 *
9
9
 * This library is free software; you can redistribute it and/or
141
141
typedef struct _ValaEnum ValaEnum;
142
142
typedef struct _ValaEnumClass ValaEnumClass;
143
143
 
 
144
#define VALA_TYPE_CONSTANT (vala_constant_get_type ())
 
145
#define VALA_CONSTANT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CONSTANT, ValaConstant))
 
146
#define VALA_CONSTANT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CONSTANT, ValaConstantClass))
 
147
#define VALA_IS_CONSTANT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CONSTANT))
 
148
#define VALA_IS_CONSTANT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CONSTANT))
 
149
#define VALA_CONSTANT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CONSTANT, ValaConstantClass))
 
150
 
 
151
typedef struct _ValaConstant ValaConstant;
 
152
typedef struct _ValaConstantClass ValaConstantClass;
 
153
 
144
154
#define VALA_TYPE_ENUM_VALUE (vala_enum_value_get_type ())
145
155
#define VALA_ENUM_VALUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_ENUM_VALUE, ValaEnumValue))
146
156
#define VALA_ENUM_VALUE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_ENUM_VALUE, ValaEnumValueClass))
181
191
typedef struct _ValaDelegate ValaDelegate;
182
192
typedef struct _ValaDelegateClass ValaDelegateClass;
183
193
 
184
 
#define VALA_TYPE_MEMBER (vala_member_get_type ())
185
 
#define VALA_MEMBER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_MEMBER, ValaMember))
186
 
#define VALA_MEMBER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_MEMBER, ValaMemberClass))
187
 
#define VALA_IS_MEMBER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_MEMBER))
188
 
#define VALA_IS_MEMBER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_MEMBER))
189
 
#define VALA_MEMBER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_MEMBER, ValaMemberClass))
190
 
 
191
 
typedef struct _ValaMember ValaMember;
192
 
typedef struct _ValaMemberClass ValaMemberClass;
193
 
 
194
 
#define VALA_TYPE_CONSTANT (vala_constant_get_type ())
195
 
#define VALA_CONSTANT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CONSTANT, ValaConstant))
196
 
#define VALA_CONSTANT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CONSTANT, ValaConstantClass))
197
 
#define VALA_IS_CONSTANT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CONSTANT))
198
 
#define VALA_IS_CONSTANT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CONSTANT))
199
 
#define VALA_CONSTANT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CONSTANT, ValaConstantClass))
200
 
 
201
 
typedef struct _ValaConstant ValaConstant;
202
 
typedef struct _ValaConstantClass ValaConstantClass;
 
194
#define VALA_TYPE_VARIABLE (vala_variable_get_type ())
 
195
#define VALA_VARIABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_VARIABLE, ValaVariable))
 
196
#define VALA_VARIABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_VARIABLE, ValaVariableClass))
 
197
#define VALA_IS_VARIABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_VARIABLE))
 
198
#define VALA_IS_VARIABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_VARIABLE))
 
199
#define VALA_VARIABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_VARIABLE, ValaVariableClass))
 
200
 
 
201
typedef struct _ValaVariable ValaVariable;
 
202
typedef struct _ValaVariableClass ValaVariableClass;
203
203
 
204
204
#define VALA_TYPE_FIELD (vala_field_get_type ())
205
205
#define VALA_FIELD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_FIELD, ValaField))
941
941
        void (*visit_error_domain) (ValaCodeVisitor* self, ValaErrorDomain* edomain);
942
942
        void (*visit_error_code) (ValaCodeVisitor* self, ValaErrorCode* ecode);
943
943
        void (*visit_delegate) (ValaCodeVisitor* self, ValaDelegate* d);
944
 
        void (*visit_member) (ValaCodeVisitor* self, ValaMember* m);
945
944
        void (*visit_constant) (ValaCodeVisitor* self, ValaConstant* c);
946
945
        void (*visit_field) (ValaCodeVisitor* self, ValaField* f);
947
946
        void (*visit_method) (ValaCodeVisitor* self, ValaMethod* m);
1053
1052
GType vala_struct_get_type (void) G_GNUC_CONST;
1054
1053
GType vala_interface_get_type (void) G_GNUC_CONST;
1055
1054
GType vala_enum_get_type (void) G_GNUC_CONST;
 
1055
GType vala_constant_get_type (void) G_GNUC_CONST;
1056
1056
GType vala_enum_value_get_type (void) G_GNUC_CONST;
1057
1057
GType vala_error_domain_get_type (void) G_GNUC_CONST;
1058
1058
GType vala_error_code_get_type (void) G_GNUC_CONST;
1059
1059
GType vala_delegate_get_type (void) G_GNUC_CONST;
1060
 
GType vala_member_get_type (void) G_GNUC_CONST;
1061
 
GType vala_constant_get_type (void) G_GNUC_CONST;
 
1060
GType vala_variable_get_type (void) G_GNUC_CONST;
1062
1061
GType vala_field_get_type (void) G_GNUC_CONST;
1063
1062
GType vala_method_get_type (void) G_GNUC_CONST;
1064
1063
GType vala_creation_method_get_type (void) G_GNUC_CONST;
1154
1153
static void vala_code_visitor_real_visit_error_code (ValaCodeVisitor* self, ValaErrorCode* ecode);
1155
1154
void vala_code_visitor_visit_delegate (ValaCodeVisitor* self, ValaDelegate* d);
1156
1155
static void vala_code_visitor_real_visit_delegate (ValaCodeVisitor* self, ValaDelegate* d);
1157
 
void vala_code_visitor_visit_member (ValaCodeVisitor* self, ValaMember* m);
1158
 
static void vala_code_visitor_real_visit_member (ValaCodeVisitor* self, ValaMember* m);
1159
1156
void vala_code_visitor_visit_constant (ValaCodeVisitor* self, ValaConstant* c);
1160
1157
static void vala_code_visitor_real_visit_constant (ValaCodeVisitor* self, ValaConstant* c);
1161
1158
void vala_code_visitor_visit_field (ValaCodeVisitor* self, ValaField* f);
1307
1304
 
1308
1305
 
1309
1306
 
 
1307
/**
 
1308
 * Visit operation called for source files.
 
1309
 *
 
1310
 * @param source_file a source file
 
1311
 */
1310
1312
static void vala_code_visitor_real_visit_source_file (ValaCodeVisitor* self, ValaSourceFile* source_file) {
1311
1313
        g_return_if_fail (self != NULL);
1312
1314
        g_return_if_fail (source_file != NULL);
1318
1320
}
1319
1321
 
1320
1322
 
 
1323
/**
 
1324
 * Visit operation called for namespaces.
 
1325
 *
 
1326
 * @param ns a namespace
 
1327
 */
1321
1328
static void vala_code_visitor_real_visit_namespace (ValaCodeVisitor* self, ValaNamespace* ns) {
1322
1329
        g_return_if_fail (self != NULL);
1323
1330
        g_return_if_fail (ns != NULL);
1329
1336
}
1330
1337
 
1331
1338
 
 
1339
/**
 
1340
 * Visit operation called for classes.
 
1341
 *
 
1342
 * @param cl a class
 
1343
 */
1332
1344
static void vala_code_visitor_real_visit_class (ValaCodeVisitor* self, ValaClass* cl) {
1333
1345
        g_return_if_fail (self != NULL);
1334
1346
        g_return_if_fail (cl != NULL);
1340
1352
}
1341
1353
 
1342
1354
 
 
1355
/**
 
1356
 * Visit operation called for structs.
 
1357
 *
 
1358
 * @param st a struct
 
1359
 */
1343
1360
static void vala_code_visitor_real_visit_struct (ValaCodeVisitor* self, ValaStruct* st) {
1344
1361
        g_return_if_fail (self != NULL);
1345
1362
        g_return_if_fail (st != NULL);
1351
1368
}
1352
1369
 
1353
1370
 
 
1371
/**
 
1372
 * Visit operation called for interfaces.
 
1373
 *
 
1374
 * @param iface an interface
 
1375
 */
1354
1376
static void vala_code_visitor_real_visit_interface (ValaCodeVisitor* self, ValaInterface* iface) {
1355
1377
        g_return_if_fail (self != NULL);
1356
1378
        g_return_if_fail (iface != NULL);
1362
1384
}
1363
1385
 
1364
1386
 
 
1387
/**
 
1388
 * Visit operation called for enums.
 
1389
 *
 
1390
 * @param en an enum
 
1391
 */
1365
1392
static void vala_code_visitor_real_visit_enum (ValaCodeVisitor* self, ValaEnum* en) {
1366
1393
        g_return_if_fail (self != NULL);
1367
1394
        g_return_if_fail (en != NULL);
1373
1400
}
1374
1401
 
1375
1402
 
 
1403
/**
 
1404
 * Visit operation called for enum values.
 
1405
 *
 
1406
 * @param ev an enum value
 
1407
 */
1376
1408
static void vala_code_visitor_real_visit_enum_value (ValaCodeVisitor* self, ValaEnumValue* ev) {
1377
1409
        g_return_if_fail (self != NULL);
1378
1410
        g_return_if_fail (ev != NULL);
1384
1416
}
1385
1417
 
1386
1418
 
 
1419
/**
 
1420
 * Visit operation called for error domains.
 
1421
 *
 
1422
 * @param edomain an error domain
 
1423
 */
1387
1424
static void vala_code_visitor_real_visit_error_domain (ValaCodeVisitor* self, ValaErrorDomain* edomain) {
1388
1425
        g_return_if_fail (self != NULL);
1389
1426
        g_return_if_fail (edomain != NULL);
1395
1432
}
1396
1433
 
1397
1434
 
 
1435
/**
 
1436
 * Visit operation called for error codes.
 
1437
 *
 
1438
 * @param ecode an error code
 
1439
 */
1398
1440
static void vala_code_visitor_real_visit_error_code (ValaCodeVisitor* self, ValaErrorCode* ecode) {
1399
1441
        g_return_if_fail (self != NULL);
1400
1442
        g_return_if_fail (ecode != NULL);
1406
1448
}
1407
1449
 
1408
1450
 
 
1451
/**
 
1452
 * Visit operation called for delegates.
 
1453
 *
 
1454
 * @param d a delegate
 
1455
 */
1409
1456
static void vala_code_visitor_real_visit_delegate (ValaCodeVisitor* self, ValaDelegate* d) {
1410
1457
        g_return_if_fail (self != NULL);
1411
1458
        g_return_if_fail (d != NULL);
1417
1464
}
1418
1465
 
1419
1466
 
1420
 
static void vala_code_visitor_real_visit_member (ValaCodeVisitor* self, ValaMember* m) {
1421
 
        g_return_if_fail (self != NULL);
1422
 
        g_return_if_fail (m != NULL);
1423
 
}
1424
 
 
1425
 
 
1426
 
void vala_code_visitor_visit_member (ValaCodeVisitor* self, ValaMember* m) {
1427
 
        VALA_CODE_VISITOR_GET_CLASS (self)->visit_member (self, m);
1428
 
}
1429
 
 
1430
 
 
 
1467
/**
 
1468
 * Visit operation called for constants.
 
1469
 *
 
1470
 * @param c a constant
 
1471
 */
1431
1472
static void vala_code_visitor_real_visit_constant (ValaCodeVisitor* self, ValaConstant* c) {
1432
1473
        g_return_if_fail (self != NULL);
1433
1474
        g_return_if_fail (c != NULL);
1439
1480
}
1440
1481
 
1441
1482
 
 
1483
/**
 
1484
 * Visit operation called for fields.
 
1485
 *
 
1486
 * @param f a field
 
1487
 */
1442
1488
static void vala_code_visitor_real_visit_field (ValaCodeVisitor* self, ValaField* f) {
1443
1489
        g_return_if_fail (self != NULL);
1444
1490
        g_return_if_fail (f != NULL);
1450
1496
}
1451
1497
 
1452
1498
 
 
1499
/**
 
1500
 * Visit operation called for methods.
 
1501
 *
 
1502
 * @param m a method
 
1503
 */
1453
1504
static void vala_code_visitor_real_visit_method (ValaCodeVisitor* self, ValaMethod* m) {
1454
1505
        g_return_if_fail (self != NULL);
1455
1506
        g_return_if_fail (m != NULL);
1461
1512
}
1462
1513
 
1463
1514
 
 
1515
/**
 
1516
 * Visit operation called for creation methods.
 
1517
 *
 
1518
 * @param m a method
 
1519
 */
1464
1520
static void vala_code_visitor_real_visit_creation_method (ValaCodeVisitor* self, ValaCreationMethod* m) {
1465
1521
        g_return_if_fail (self != NULL);
1466
1522
        g_return_if_fail (m != NULL);
1472
1528
}
1473
1529
 
1474
1530
 
 
1531
/**
 
1532
 * Visit operation called for formal parameters.
 
1533
 *
 
1534
 * @param p a formal parameter
 
1535
 */
1475
1536
static void vala_code_visitor_real_visit_formal_parameter (ValaCodeVisitor* self, ValaFormalParameter* p) {
1476
1537
        g_return_if_fail (self != NULL);
1477
1538
        g_return_if_fail (p != NULL);
1483
1544
}
1484
1545
 
1485
1546
 
 
1547
/**
 
1548
 * Visit operation called for properties.
 
1549
 *
 
1550
 * @param prop a property
 
1551
 */
1486
1552
static void vala_code_visitor_real_visit_property (ValaCodeVisitor* self, ValaProperty* prop) {
1487
1553
        g_return_if_fail (self != NULL);
1488
1554
        g_return_if_fail (prop != NULL);
1494
1560
}
1495
1561
 
1496
1562
 
 
1563
/**
 
1564
 * Visit operation called for property accessors.
 
1565
 *
 
1566
 * @param acc a property accessor
 
1567
 */
1497
1568
static void vala_code_visitor_real_visit_property_accessor (ValaCodeVisitor* self, ValaPropertyAccessor* acc) {
1498
1569
        g_return_if_fail (self != NULL);
1499
1570
        g_return_if_fail (acc != NULL);
1505
1576
}
1506
1577
 
1507
1578
 
 
1579
/**
 
1580
 * Visit operation called for signals.
 
1581
 *
 
1582
 * @param sig a signal
 
1583
 */
1508
1584
static void vala_code_visitor_real_visit_signal (ValaCodeVisitor* self, ValaSignal* sig) {
1509
1585
        g_return_if_fail (self != NULL);
1510
1586
        g_return_if_fail (sig != NULL);
1516
1592
}
1517
1593
 
1518
1594
 
 
1595
/**
 
1596
 * Visit operation called for constructors.
 
1597
 *
 
1598
 * @param c a constructor
 
1599
 */
1519
1600
static void vala_code_visitor_real_visit_constructor (ValaCodeVisitor* self, ValaConstructor* c) {
1520
1601
        g_return_if_fail (self != NULL);
1521
1602
        g_return_if_fail (c != NULL);
1527
1608
}
1528
1609
 
1529
1610
 
 
1611
/**
 
1612
 * Visit operation called for destructors.
 
1613
 *
 
1614
 * @param d a destructor
 
1615
 */
1530
1616
static void vala_code_visitor_real_visit_destructor (ValaCodeVisitor* self, ValaDestructor* d) {
1531
1617
        g_return_if_fail (self != NULL);
1532
1618
        g_return_if_fail (d != NULL);
1538
1624
}
1539
1625
 
1540
1626
 
 
1627
/**
 
1628
 * Visit operation called for type parameters.
 
1629
 *
 
1630
 * @param p a type parameter
 
1631
 */
1541
1632
static void vala_code_visitor_real_visit_type_parameter (ValaCodeVisitor* self, ValaTypeParameter* p) {
1542
1633
        g_return_if_fail (self != NULL);
1543
1634
        g_return_if_fail (p != NULL);
1549
1640
}
1550
1641
 
1551
1642
 
 
1643
/**
 
1644
 * Visit operation called for using directives.
 
1645
 *
 
1646
 * @param ns a using directive
 
1647
 */
1552
1648
static void vala_code_visitor_real_visit_using_directive (ValaCodeVisitor* self, ValaUsingDirective* ns) {
1553
1649
        g_return_if_fail (self != NULL);
1554
1650
        g_return_if_fail (ns != NULL);
1560
1656
}
1561
1657
 
1562
1658
 
 
1659
/**
 
1660
 * Visit operation called for type references.
 
1661
 *
 
1662
 * @param type a type reference
 
1663
 */
1563
1664
static void vala_code_visitor_real_visit_data_type (ValaCodeVisitor* self, ValaDataType* type) {
1564
1665
        g_return_if_fail (self != NULL);
1565
1666
        g_return_if_fail (type != NULL);
1571
1672
}
1572
1673
 
1573
1674
 
 
1675
/**
 
1676
 * Visit operation called for blocks.
 
1677
 *
 
1678
 * @param b a block
 
1679
 */
1574
1680
static void vala_code_visitor_real_visit_block (ValaCodeVisitor* self, ValaBlock* b) {
1575
1681
        g_return_if_fail (self != NULL);
1576
1682
        g_return_if_fail (b != NULL);
1582
1688
}
1583
1689
 
1584
1690
 
 
1691
/**
 
1692
 * Visit operation called for empty statements.
 
1693
 *
 
1694
 * @param stmt an empty statement
 
1695
 */
1585
1696
static void vala_code_visitor_real_visit_empty_statement (ValaCodeVisitor* self, ValaEmptyStatement* stmt) {
1586
1697
        g_return_if_fail (self != NULL);
1587
1698
        g_return_if_fail (stmt != NULL);
1593
1704
}
1594
1705
 
1595
1706
 
 
1707
/**
 
1708
 * Visit operation called for declaration statements.
 
1709
 *
 
1710
 * @param stmt a declaration statement
 
1711
 */
1596
1712
static void vala_code_visitor_real_visit_declaration_statement (ValaCodeVisitor* self, ValaDeclarationStatement* stmt) {
1597
1713
        g_return_if_fail (self != NULL);
1598
1714
        g_return_if_fail (stmt != NULL);
1604
1720
}
1605
1721
 
1606
1722
 
 
1723
/**
 
1724
 * Visit operation called for local variables.
 
1725
 *
 
1726
 * @param local a local variable
 
1727
 */
1607
1728
static void vala_code_visitor_real_visit_local_variable (ValaCodeVisitor* self, ValaLocalVariable* local) {
1608
1729
        g_return_if_fail (self != NULL);
1609
1730
        g_return_if_fail (local != NULL);
1615
1736
}
1616
1737
 
1617
1738
 
 
1739
/**
 
1740
 * Visit operation called for initializer lists
 
1741
 *
 
1742
 * @param list an initializer list
 
1743
 */
1618
1744
static void vala_code_visitor_real_visit_initializer_list (ValaCodeVisitor* self, ValaInitializerList* list) {
1619
1745
        g_return_if_fail (self != NULL);
1620
1746
        g_return_if_fail (list != NULL);
1626
1752
}
1627
1753
 
1628
1754
 
 
1755
/**
 
1756
 * Visit operation called for expression statements.
 
1757
 *
 
1758
 * @param stmt an expression statement
 
1759
 */
1629
1760
static void vala_code_visitor_real_visit_expression_statement (ValaCodeVisitor* self, ValaExpressionStatement* stmt) {
1630
1761
        g_return_if_fail (self != NULL);
1631
1762
        g_return_if_fail (stmt != NULL);
1637
1768
}
1638
1769
 
1639
1770
 
 
1771
/**
 
1772
 * Visit operation called for if statements.
 
1773
 *
 
1774
 * @param stmt an if statement
 
1775
 */
1640
1776
static void vala_code_visitor_real_visit_if_statement (ValaCodeVisitor* self, ValaIfStatement* stmt) {
1641
1777
        g_return_if_fail (self != NULL);
1642
1778
        g_return_if_fail (stmt != NULL);
1648
1784
}
1649
1785
 
1650
1786
 
 
1787
/**
 
1788
 * Visit operation called for switch statements.
 
1789
 *
 
1790
 * @param stmt a switch statement
 
1791
 */
1651
1792
static void vala_code_visitor_real_visit_switch_statement (ValaCodeVisitor* self, ValaSwitchStatement* stmt) {
1652
1793
        g_return_if_fail (self != NULL);
1653
1794
        g_return_if_fail (stmt != NULL);
1659
1800
}
1660
1801
 
1661
1802
 
 
1803
/**
 
1804
 * Visit operation called for switch sections.
 
1805
 *
 
1806
 * @param section a switch section
 
1807
 */
1662
1808
static void vala_code_visitor_real_visit_switch_section (ValaCodeVisitor* self, ValaSwitchSection* section) {
1663
1809
        g_return_if_fail (self != NULL);
1664
1810
        g_return_if_fail (section != NULL);
1670
1816
}
1671
1817
 
1672
1818
 
 
1819
/**
 
1820
 * Visit operation called for switch label.
 
1821
 *
 
1822
 * @param label a switch label
 
1823
 */
1673
1824
static void vala_code_visitor_real_visit_switch_label (ValaCodeVisitor* self, ValaSwitchLabel* label) {
1674
1825
        g_return_if_fail (self != NULL);
1675
1826
        g_return_if_fail (label != NULL);
1681
1832
}
1682
1833
 
1683
1834
 
 
1835
/**
 
1836
 * Visit operation called for loops.
 
1837
 *
 
1838
 * @param stmt a loop
 
1839
 */
1684
1840
static void vala_code_visitor_real_visit_loop (ValaCodeVisitor* self, ValaLoop* stmt) {
1685
1841
        g_return_if_fail (self != NULL);
1686
1842
        g_return_if_fail (stmt != NULL);
1692
1848
}
1693
1849
 
1694
1850
 
 
1851
/**
 
1852
 * Visit operation called for while statements.
 
1853
 *
 
1854
 * @param stmt an while statement
 
1855
 */
1695
1856
static void vala_code_visitor_real_visit_while_statement (ValaCodeVisitor* self, ValaWhileStatement* stmt) {
1696
1857
        g_return_if_fail (self != NULL);
1697
1858
        g_return_if_fail (stmt != NULL);
1703
1864
}
1704
1865
 
1705
1866
 
 
1867
/**
 
1868
 * Visit operation called for do statements.
 
1869
 *
 
1870
 * @param stmt a do statement
 
1871
 */
1706
1872
static void vala_code_visitor_real_visit_do_statement (ValaCodeVisitor* self, ValaDoStatement* stmt) {
1707
1873
        g_return_if_fail (self != NULL);
1708
1874
        g_return_if_fail (stmt != NULL);
1714
1880
}
1715
1881
 
1716
1882
 
 
1883
/**
 
1884
 * Visit operation called for for statements.
 
1885
 *
 
1886
 * @param stmt a for statement
 
1887
 */
1717
1888
static void vala_code_visitor_real_visit_for_statement (ValaCodeVisitor* self, ValaForStatement* stmt) {
1718
1889
        g_return_if_fail (self != NULL);
1719
1890
        g_return_if_fail (stmt != NULL);
1725
1896
}
1726
1897
 
1727
1898
 
 
1899
/**
 
1900
 * Visit operation called for foreach statements.
 
1901
 *
 
1902
 * @param stmt a foreach statement
 
1903
 */
1728
1904
static void vala_code_visitor_real_visit_foreach_statement (ValaCodeVisitor* self, ValaForeachStatement* stmt) {
1729
1905
        g_return_if_fail (self != NULL);
1730
1906
        g_return_if_fail (stmt != NULL);
1736
1912
}
1737
1913
 
1738
1914
 
 
1915
/**
 
1916
 * Visit operation called for break statements.
 
1917
 *
 
1918
 * @param stmt a break statement
 
1919
 */
1739
1920
static void vala_code_visitor_real_visit_break_statement (ValaCodeVisitor* self, ValaBreakStatement* stmt) {
1740
1921
        g_return_if_fail (self != NULL);
1741
1922
        g_return_if_fail (stmt != NULL);
1747
1928
}
1748
1929
 
1749
1930
 
 
1931
/**
 
1932
 * Visit operation called for continue statements.
 
1933
 *
 
1934
 * @param stmt a continue statement
 
1935
 */
1750
1936
static void vala_code_visitor_real_visit_continue_statement (ValaCodeVisitor* self, ValaContinueStatement* stmt) {
1751
1937
        g_return_if_fail (self != NULL);
1752
1938
        g_return_if_fail (stmt != NULL);
1758
1944
}
1759
1945
 
1760
1946
 
 
1947
/**
 
1948
 * Visit operation called for return statements.
 
1949
 *
 
1950
 * @param stmt a return statement
 
1951
 */
1761
1952
static void vala_code_visitor_real_visit_return_statement (ValaCodeVisitor* self, ValaReturnStatement* stmt) {
1762
1953
        g_return_if_fail (self != NULL);
1763
1954
        g_return_if_fail (stmt != NULL);
1769
1960
}
1770
1961
 
1771
1962
 
 
1963
/**
 
1964
 * Visit operation called for yield statement.
 
1965
 *
 
1966
 * @param y a yield statement
 
1967
 */
1772
1968
static void vala_code_visitor_real_visit_yield_statement (ValaCodeVisitor* self, ValaYieldStatement* y) {
1773
1969
        g_return_if_fail (self != NULL);
1774
1970
        g_return_if_fail (y != NULL);
1780
1976
}
1781
1977
 
1782
1978
 
 
1979
/**
 
1980
 * Visit operation called for throw statements.
 
1981
 *
 
1982
 * @param stmt a throw statement
 
1983
 */
1783
1984
static void vala_code_visitor_real_visit_throw_statement (ValaCodeVisitor* self, ValaThrowStatement* stmt) {
1784
1985
        g_return_if_fail (self != NULL);
1785
1986
        g_return_if_fail (stmt != NULL);
1791
1992
}
1792
1993
 
1793
1994
 
 
1995
/**
 
1996
 * Visit operation called for try statements.
 
1997
 *
 
1998
 * @param stmt a try statement
 
1999
 */
1794
2000
static void vala_code_visitor_real_visit_try_statement (ValaCodeVisitor* self, ValaTryStatement* stmt) {
1795
2001
        g_return_if_fail (self != NULL);
1796
2002
        g_return_if_fail (stmt != NULL);
1802
2008
}
1803
2009
 
1804
2010
 
 
2011
/**
 
2012
 * Visit operation called for catch clauses.
 
2013
 *
 
2014
 * @param clause a catch cluase
 
2015
 */
1805
2016
static void vala_code_visitor_real_visit_catch_clause (ValaCodeVisitor* self, ValaCatchClause* clause) {
1806
2017
        g_return_if_fail (self != NULL);
1807
2018
        g_return_if_fail (clause != NULL);
1813
2024
}
1814
2025
 
1815
2026
 
 
2027
/**
 
2028
 * Visit operation called for lock statements before the body has been visited.
 
2029
 *
 
2030
 * @param stmt a lock statement
 
2031
 */
1816
2032
static void vala_code_visitor_real_visit_lock_statement (ValaCodeVisitor* self, ValaLockStatement* stmt) {
1817
2033
        g_return_if_fail (self != NULL);
1818
2034
        g_return_if_fail (stmt != NULL);
1824
2040
}
1825
2041
 
1826
2042
 
 
2043
/**
 
2044
 * Visit operation called for unlock statements.
 
2045
 *
 
2046
 * @param stmt an unlock statement
 
2047
 */
1827
2048
static void vala_code_visitor_real_visit_unlock_statement (ValaCodeVisitor* self, ValaUnlockStatement* stmt) {
1828
2049
        g_return_if_fail (self != NULL);
1829
2050
        g_return_if_fail (stmt != NULL);
1835
2056
}
1836
2057
 
1837
2058
 
 
2059
/**
 
2060
 * Visit operation called for delete statements.
 
2061
 *
 
2062
 * @param stmt a delete statement
 
2063
 */
1838
2064
static void vala_code_visitor_real_visit_delete_statement (ValaCodeVisitor* self, ValaDeleteStatement* stmt) {
1839
2065
        g_return_if_fail (self != NULL);
1840
2066
        g_return_if_fail (stmt != NULL);
1846
2072
}
1847
2073
 
1848
2074
 
 
2075
/**
 
2076
 * Visit operations called for expresions.
 
2077
 *
 
2078
 * @param expr an expression
 
2079
 */
1849
2080
static void vala_code_visitor_real_visit_expression (ValaCodeVisitor* self, ValaExpression* expr) {
1850
2081
        g_return_if_fail (self != NULL);
1851
2082
        g_return_if_fail (expr != NULL);
1857
2088
}
1858
2089
 
1859
2090
 
 
2091
/**
 
2092
 * Visit operations called for array creation expresions.
 
2093
 *
 
2094
 * @param expr an array creation expression
 
2095
 */
1860
2096
static void vala_code_visitor_real_visit_array_creation_expression (ValaCodeVisitor* self, ValaArrayCreationExpression* expr) {
1861
2097
        g_return_if_fail (self != NULL);
1862
2098
        g_return_if_fail (expr != NULL);
1868
2104
}
1869
2105
 
1870
2106
 
 
2107
/**
 
2108
 * Visit operation called for boolean literals.
 
2109
 *
 
2110
 * @param lit a boolean literal
 
2111
 */
1871
2112
static void vala_code_visitor_real_visit_boolean_literal (ValaCodeVisitor* self, ValaBooleanLiteral* lit) {
1872
2113
        g_return_if_fail (self != NULL);
1873
2114
        g_return_if_fail (lit != NULL);
1879
2120
}
1880
2121
 
1881
2122
 
 
2123
/**
 
2124
 * Visit operation called for character literals.
 
2125
 *
 
2126
 * @param lit a character literal
 
2127
 */
1882
2128
static void vala_code_visitor_real_visit_character_literal (ValaCodeVisitor* self, ValaCharacterLiteral* lit) {
1883
2129
        g_return_if_fail (self != NULL);
1884
2130
        g_return_if_fail (lit != NULL);
1890
2136
}
1891
2137
 
1892
2138
 
 
2139
/**
 
2140
 * Visit operation called for integer literals.
 
2141
 *
 
2142
 * @param lit an integer literal
 
2143
 */
1893
2144
static void vala_code_visitor_real_visit_integer_literal (ValaCodeVisitor* self, ValaIntegerLiteral* lit) {
1894
2145
        g_return_if_fail (self != NULL);
1895
2146
        g_return_if_fail (lit != NULL);
1901
2152
}
1902
2153
 
1903
2154
 
 
2155
/**
 
2156
 * Visit operation called for real literals.
 
2157
 *
 
2158
 * @param lit a real literal
 
2159
 */
1904
2160
static void vala_code_visitor_real_visit_real_literal (ValaCodeVisitor* self, ValaRealLiteral* lit) {
1905
2161
        g_return_if_fail (self != NULL);
1906
2162
        g_return_if_fail (lit != NULL);
1912
2168
}
1913
2169
 
1914
2170
 
 
2171
/**
 
2172
 * Visit operation called for regex literals.
 
2173
 *
 
2174
 * @param lit a regex literal
 
2175
 */
1915
2176
static void vala_code_visitor_real_visit_regex_literal (ValaCodeVisitor* self, ValaRegexLiteral* lit) {
1916
2177
        g_return_if_fail (self != NULL);
1917
2178
        g_return_if_fail (lit != NULL);
1923
2184
}
1924
2185
 
1925
2186
 
 
2187
/**
 
2188
 * Visit operation called for string literals.
 
2189
 *
 
2190
 * @param lit a string literal
 
2191
 */
1926
2192
static void vala_code_visitor_real_visit_string_literal (ValaCodeVisitor* self, ValaStringLiteral* lit) {
1927
2193
        g_return_if_fail (self != NULL);
1928
2194
        g_return_if_fail (lit != NULL);
1934
2200
}
1935
2201
 
1936
2202
 
 
2203
/**
 
2204
 * Visit operation called for string templates.
 
2205
 *
 
2206
 * @param tmpl a string template
 
2207
 */
1937
2208
static void vala_code_visitor_real_visit_template (ValaCodeVisitor* self, ValaTemplate* tmpl) {
1938
2209
        g_return_if_fail (self != NULL);
1939
2210
        g_return_if_fail (tmpl != NULL);
1945
2216
}
1946
2217
 
1947
2218
 
 
2219
/**
 
2220
 * Visit operation called for list literals.
 
2221
 *
 
2222
 * @param lit a list literal
 
2223
 */
1948
2224
static void vala_code_visitor_real_visit_list_literal (ValaCodeVisitor* self, ValaListLiteral* lit) {
1949
2225
        g_return_if_fail (self != NULL);
1950
2226
        g_return_if_fail (lit != NULL);
1956
2232
}
1957
2233
 
1958
2234
 
 
2235
/**
 
2236
 * Visit operation called for set literals.
 
2237
 *
 
2238
 * @param lit a set literal
 
2239
 */
1959
2240
static void vala_code_visitor_real_visit_set_literal (ValaCodeVisitor* self, ValaSetLiteral* lit) {
1960
2241
        g_return_if_fail (self != NULL);
1961
2242
        g_return_if_fail (lit != NULL);
1967
2248
}
1968
2249
 
1969
2250
 
 
2251
/**
 
2252
 * Visit operation called for map literals.
 
2253
 *
 
2254
 * @param lit a map literal
 
2255
 */
1970
2256
static void vala_code_visitor_real_visit_map_literal (ValaCodeVisitor* self, ValaMapLiteral* lit) {
1971
2257
        g_return_if_fail (self != NULL);
1972
2258
        g_return_if_fail (lit != NULL);
1978
2264
}
1979
2265
 
1980
2266
 
 
2267
/**
 
2268
 * Visit operation called for tuples.
 
2269
 *
 
2270
 * @param tuple a tuple
 
2271
 */
1981
2272
static void vala_code_visitor_real_visit_tuple (ValaCodeVisitor* self, ValaTuple* tuple) {
1982
2273
        g_return_if_fail (self != NULL);
1983
2274
        g_return_if_fail (tuple != NULL);
1989
2280
}
1990
2281
 
1991
2282
 
 
2283
/**
 
2284
 * Visit operation called for null literals.
 
2285
 *
 
2286
 * @param lit a null literal
 
2287
 */
1992
2288
static void vala_code_visitor_real_visit_null_literal (ValaCodeVisitor* self, ValaNullLiteral* lit) {
1993
2289
        g_return_if_fail (self != NULL);
1994
2290
        g_return_if_fail (lit != NULL);
2000
2296
}
2001
2297
 
2002
2298
 
 
2299
/**
 
2300
 * Visit operation called for member access expressions.
 
2301
 *
 
2302
 * @param expr a member access expression
 
2303
 */
2003
2304
static void vala_code_visitor_real_visit_member_access (ValaCodeVisitor* self, ValaMemberAccess* expr) {
2004
2305
        g_return_if_fail (self != NULL);
2005
2306
        g_return_if_fail (expr != NULL);
2011
2312
}
2012
2313
 
2013
2314
 
 
2315
/**
 
2316
 * Visit operation called for invocation expressions.
 
2317
 *
 
2318
 * @param expr an invocation expression
 
2319
 */
2014
2320
static void vala_code_visitor_real_visit_method_call (ValaCodeVisitor* self, ValaMethodCall* expr) {
2015
2321
        g_return_if_fail (self != NULL);
2016
2322
        g_return_if_fail (expr != NULL);
2022
2328
}
2023
2329
 
2024
2330
 
 
2331
/**
 
2332
 * Visit operation called for element access expressions.
 
2333
 *
 
2334
 * @param expr an element access expression
 
2335
 */
2025
2336
static void vala_code_visitor_real_visit_element_access (ValaCodeVisitor* self, ValaElementAccess* expr) {
2026
2337
        g_return_if_fail (self != NULL);
2027
2338
        g_return_if_fail (expr != NULL);
2033
2344
}
2034
2345
 
2035
2346
 
 
2347
/**
 
2348
 * Visit operation called for array slice expressions.
 
2349
 *
 
2350
 * @param expr an array slice expression
 
2351
 */
2036
2352
static void vala_code_visitor_real_visit_slice_expression (ValaCodeVisitor* self, ValaSliceExpression* expr) {
2037
2353
        g_return_if_fail (self != NULL);
2038
2354
        g_return_if_fail (expr != NULL);
2044
2360
}
2045
2361
 
2046
2362
 
 
2363
/**
 
2364
 * Visit operation called for base access expressions.
 
2365
 *
 
2366
 * @param expr a base access expression
 
2367
 */
2047
2368
static void vala_code_visitor_real_visit_base_access (ValaCodeVisitor* self, ValaBaseAccess* expr) {
2048
2369
        g_return_if_fail (self != NULL);
2049
2370
        g_return_if_fail (expr != NULL);
2055
2376
}
2056
2377
 
2057
2378
 
 
2379
/**
 
2380
 * Visit operation called for postfix expressions.
 
2381
 *
 
2382
 * @param expr a postfix expression
 
2383
 */
2058
2384
static void vala_code_visitor_real_visit_postfix_expression (ValaCodeVisitor* self, ValaPostfixExpression* expr) {
2059
2385
        g_return_if_fail (self != NULL);
2060
2386
        g_return_if_fail (expr != NULL);
2066
2392
}
2067
2393
 
2068
2394
 
 
2395
/**
 
2396
 * Visit operation called for object creation expressions.
 
2397
 *
 
2398
 * @param expr an object creation expression
 
2399
 */
2069
2400
static void vala_code_visitor_real_visit_object_creation_expression (ValaCodeVisitor* self, ValaObjectCreationExpression* expr) {
2070
2401
        g_return_if_fail (self != NULL);
2071
2402
        g_return_if_fail (expr != NULL);
2077
2408
}
2078
2409
 
2079
2410
 
 
2411
/**
 
2412
 * Visit operation called for sizeof expressions.
 
2413
 *
 
2414
 * @param expr a sizeof expression
 
2415
 */
2080
2416
static void vala_code_visitor_real_visit_sizeof_expression (ValaCodeVisitor* self, ValaSizeofExpression* expr) {
2081
2417
        g_return_if_fail (self != NULL);
2082
2418
        g_return_if_fail (expr != NULL);
2088
2424
}
2089
2425
 
2090
2426
 
 
2427
/**
 
2428
 * Visit operation called for typeof expressions.
 
2429
 *
 
2430
 * @param expr a typeof expression
 
2431
 */
2091
2432
static void vala_code_visitor_real_visit_typeof_expression (ValaCodeVisitor* self, ValaTypeofExpression* expr) {
2092
2433
        g_return_if_fail (self != NULL);
2093
2434
        g_return_if_fail (expr != NULL);
2099
2440
}
2100
2441
 
2101
2442
 
 
2443
/**
 
2444
 * Visit operation called for unary expressions.
 
2445
 *
 
2446
 * @param expr an unary expression
 
2447
 */
2102
2448
static void vala_code_visitor_real_visit_unary_expression (ValaCodeVisitor* self, ValaUnaryExpression* expr) {
2103
2449
        g_return_if_fail (self != NULL);
2104
2450
        g_return_if_fail (expr != NULL);
2110
2456
}
2111
2457
 
2112
2458
 
 
2459
/**
 
2460
 * Visit operation called for call expressions.
 
2461
 *
 
2462
 * @param expr a call expression
 
2463
 */
2113
2464
static void vala_code_visitor_real_visit_cast_expression (ValaCodeVisitor* self, ValaCastExpression* expr) {
2114
2465
        g_return_if_fail (self != NULL);
2115
2466
        g_return_if_fail (expr != NULL);
2121
2472
}
2122
2473
 
2123
2474
 
 
2475
/**
 
2476
 * Visit operation called for named arguments.
 
2477
 *
 
2478
 * @param expr a named argument
 
2479
 */
2124
2480
static void vala_code_visitor_real_visit_named_argument (ValaCodeVisitor* self, ValaNamedArgument* expr) {
2125
2481
        g_return_if_fail (self != NULL);
2126
2482
        g_return_if_fail (expr != NULL);
2132
2488
}
2133
2489
 
2134
2490
 
 
2491
/**
 
2492
 * Visit operation called for pointer indirections.
 
2493
 *
 
2494
 * @param expr a pointer indirection
 
2495
 */
2135
2496
static void vala_code_visitor_real_visit_pointer_indirection (ValaCodeVisitor* self, ValaPointerIndirection* expr) {
2136
2497
        g_return_if_fail (self != NULL);
2137
2498
        g_return_if_fail (expr != NULL);
2143
2504
}
2144
2505
 
2145
2506
 
 
2507
/**
 
2508
 * Visit operation called for address-of expressions.
 
2509
 *
 
2510
 * @param expr an address-of expression
 
2511
 */
2146
2512
static void vala_code_visitor_real_visit_addressof_expression (ValaCodeVisitor* self, ValaAddressofExpression* expr) {
2147
2513
        g_return_if_fail (self != NULL);
2148
2514
        g_return_if_fail (expr != NULL);
2154
2520
}
2155
2521
 
2156
2522
 
 
2523
/**
 
2524
 * Visit operation called for reference transfer expressions.
 
2525
 *
 
2526
 * @param expr a reference transfer expression
 
2527
 */
2157
2528
static void vala_code_visitor_real_visit_reference_transfer_expression (ValaCodeVisitor* self, ValaReferenceTransferExpression* expr) {
2158
2529
        g_return_if_fail (self != NULL);
2159
2530
        g_return_if_fail (expr != NULL);
2165
2536
}
2166
2537
 
2167
2538
 
 
2539
/**
 
2540
 * Visit operation called for binary expressions.
 
2541
 *
 
2542
 * @param expr a binary expression
 
2543
 */
2168
2544
static void vala_code_visitor_real_visit_binary_expression (ValaCodeVisitor* self, ValaBinaryExpression* expr) {
2169
2545
        g_return_if_fail (self != NULL);
2170
2546
        g_return_if_fail (expr != NULL);
2176
2552
}
2177
2553
 
2178
2554
 
 
2555
/**
 
2556
 * Visit operation called for type checks.
 
2557
 *
 
2558
 * @param expr a type check expression
 
2559
 */
2179
2560
static void vala_code_visitor_real_visit_type_check (ValaCodeVisitor* self, ValaTypeCheck* expr) {
2180
2561
        g_return_if_fail (self != NULL);
2181
2562
        g_return_if_fail (expr != NULL);
2187
2568
}
2188
2569
 
2189
2570
 
 
2571
/**
 
2572
 * Visit operation called for conditional expressions.
 
2573
 *
 
2574
 * @param expr a conditional expression
 
2575
 */
2190
2576
static void vala_code_visitor_real_visit_conditional_expression (ValaCodeVisitor* self, ValaConditionalExpression* expr) {
2191
2577
        g_return_if_fail (self != NULL);
2192
2578
        g_return_if_fail (expr != NULL);
2198
2584
}
2199
2585
 
2200
2586
 
 
2587
/**
 
2588
 * Visit operation called for lambda expressions.
 
2589
 *
 
2590
 * @param expr a lambda expression
 
2591
 */
2201
2592
static void vala_code_visitor_real_visit_lambda_expression (ValaCodeVisitor* self, ValaLambdaExpression* expr) {
2202
2593
        g_return_if_fail (self != NULL);
2203
2594
        g_return_if_fail (expr != NULL);
2209
2600
}
2210
2601
 
2211
2602
 
 
2603
/**
 
2604
 * Visit operation called for assignments.
 
2605
 *
 
2606
 * @param a an assignment
 
2607
 */
2212
2608
static void vala_code_visitor_real_visit_assignment (ValaCodeVisitor* self, ValaAssignment* a) {
2213
2609
        g_return_if_fail (self != NULL);
2214
2610
        g_return_if_fail (a != NULL);
2220
2616
}
2221
2617
 
2222
2618
 
 
2619
/**
 
2620
 * Visit operation called at end of full expressions.
 
2621
 *
 
2622
 * @param expr a full expression
 
2623
 */
2223
2624
static void vala_code_visitor_real_visit_end_full_expression (ValaCodeVisitor* self, ValaExpression* expr) {
2224
2625
        g_return_if_fail (self != NULL);
2225
2626
        g_return_if_fail (expr != NULL);
2361
2762
        VALA_CODE_VISITOR_CLASS (klass)->visit_error_domain = vala_code_visitor_real_visit_error_domain;
2362
2763
        VALA_CODE_VISITOR_CLASS (klass)->visit_error_code = vala_code_visitor_real_visit_error_code;
2363
2764
        VALA_CODE_VISITOR_CLASS (klass)->visit_delegate = vala_code_visitor_real_visit_delegate;
2364
 
        VALA_CODE_VISITOR_CLASS (klass)->visit_member = vala_code_visitor_real_visit_member;
2365
2765
        VALA_CODE_VISITOR_CLASS (klass)->visit_constant = vala_code_visitor_real_visit_constant;
2366
2766
        VALA_CODE_VISITOR_CLASS (klass)->visit_field = vala_code_visitor_real_visit_field;
2367
2767
        VALA_CODE_VISITOR_CLASS (klass)->visit_method = vala_code_visitor_real_visit_method;
2449
2849
}
2450
2850
 
2451
2851
 
 
2852
/**
 
2853
 * Abstract code node visitor for traversing source code tree.
 
2854
 */
2452
2855
GType vala_code_visitor_get_type (void) {
2453
2856
        static volatile gsize vala_code_visitor_type_id__volatile = 0;
2454
2857
        if (g_once_init_enter (&vala_code_visitor_type_id__volatile)) {