Package pygccxml :: Package declarations |

# Source Code for Package pygccxml.declarations

      1  # Copyright 2004-2008 Roman Yakovenko.
      2  # Distributed under the Boost Software License, Version 1.0. (See
      3  # accompanying file LICENSE_1_0.txt or copy at
      4  # http://www.boost.org/LICENSE_1_0.txt)
      5
      6  """
      7  contains classes that describe different C++ declarations
      8  """
      9
     10  import compilers
     11
     12  from dependencies import dependency_info_t
     13  from declaration import location_t
     14  from declaration import declaration_t
     15  from scopedef import scopedef_t
     16  from enumeration import enumeration_t
     17  from namespace import namespace_t
     18
     19  from class_declaration import class_t
     20  from class_declaration import CLASS_TYPES
     21  from class_declaration import ACCESS_TYPES
     22  from class_declaration import hierarchy_info_t
     23  from class_declaration import class_declaration_t
     24  from class_declaration import class_types
     25
     26  from typedef import typedef_t
     27
     28  from cpptypes import type_t
     29  from cpptypes import dummy_type_t
     30  from cpptypes import unknown_t
     31  from cpptypes import ellipsis_t
     32  from cpptypes import fundamental_t
     33  from cpptypes import void_t
     34  from cpptypes import char_t
     35  from cpptypes import signed_char_t
     36  from cpptypes import unsigned_char_t
     37  from cpptypes import wchar_t
     38  from cpptypes import short_int_t
     39  from cpptypes import short_unsigned_int_t
     40  from cpptypes import bool_t
     41  from cpptypes import int_t
     42  from cpptypes import unsigned_int_t
     43  from cpptypes import long_int_t
     44  from cpptypes import long_unsigned_int_t
     45  from cpptypes import long_long_int_t
     46  from cpptypes import long_long_unsigned_int_t
     47  from cpptypes import float_t
     48  from cpptypes import double_t
     49  from cpptypes import long_double_t
     50  from cpptypes import FUNDAMENTAL_TYPES
     51  from cpptypes import compound_t
     52  from cpptypes import volatile_t
     53  from cpptypes import const_t
     54  from cpptypes import pointer_t
     55  from cpptypes import reference_t
     56  from cpptypes import restrict_t
     57  from cpptypes import array_t
     58  from cpptypes import calldef_type_t
     59  from cpptypes import free_function_type_t
     60  from cpptypes import member_function_type_t
     61  from cpptypes import member_variable_type_t
     62  from cpptypes import declarated_t
     63  from cpptypes import type_qualifiers_t
     64  #java types
     65  from cpptypes import java_fundamental_t
     66  from cpptypes import jbyte_t
     67  from cpptypes import jshort_t
     68  from cpptypes import jint_t
     69  from cpptypes import jlong_t
     70  from cpptypes import jfloat_t
     71  from cpptypes import jdouble_t
     72  from cpptypes import jchar_t
     73  from cpptypes import jboolean_t
     74
     75
     76
     77  from variable import variable_t
     78
     79  from algorithm import full_name
     80  from algorithm import full_name_from_declaration_path
     81  from algorithm import make_flatten
     82  from algorithm import apply_visitor
     83  from algorithm import declaration_path
     84  from algorithm import get_named_parent
     85  from algorithm import find_declaration
     86  from algorithm import match_declaration_t
     87  from algorithm import find_all_declarations
     88  from algorithm import find_first_declaration
     89  from algorithm import declaration_files
     90  from algorithm import visit_function_has_not_been_found_t
     91  from algorithm import get_global_namespace
     92
     93  from calldef import VIRTUALITY_TYPES
     94  from calldef import FUNCTION_VIRTUALITY_TYPES
     95  from calldef import argument_t
     96  from calldef import calldef_t
     97  from calldef import member_calldef_t
     98  from calldef import free_calldef_t
     99  from calldef import operator_t
    100  from calldef import member_function_t
    101  from calldef import constructor_t
    102  from calldef import destructor_t
    103  from calldef import member_operator_t
    104  from calldef import casting_operator_t
    105  from calldef import free_function_t
    106  from calldef import free_operator_t
    107
    108  from decl_visitor import decl_visitor_t
    109  from type_visitor import type_visitor_t
    110
    111  from type_traits import decompose_type
    112  from type_traits import decompose_class
    113
    114
    115  from type_traits import is_enum
    116  from type_traits import enum_declaration
    117  from type_traits import enum_traits
    118
    119  from type_traits import is_class
    120  from type_traits import class_traits
    121  from type_traits import is_class_declaration
    122  from type_traits import class_declaration_traits
    123
    124
    125  from type_traits import is_bool
    126  from type_traits import is_same
    127  from type_traits import is_void
    128  from type_traits import is_void_pointer
    129  from type_traits import is_const
    130  from type_traits import base_type
    131  from type_traits import is_array
    132  from type_traits import is_pointer
    133  from type_traits import is_volatile
    134  from type_traits import is_integral
    135  from type_traits import is_reference
    136  from type_traits import is_arithmetic
    137  from type_traits import is_fundamental
    138  from type_traits import is_floating_point
    139  from type_traits import is_base_and_derived
    140  from type_traits import is_convertible
    141  from type_traits import is_noncopyable
    142  from type_traits import is_std_string
    143  from type_traits import is_std_wstring
    144  from type_traits import is_std_ostream
    145  from type_traits import is_std_wostream
    146  from type_traits import is_calldef_pointer
    147
    148  from type_traits import is_unary_operator
    149  from type_traits import is_binary_operator
    150
    151  from type_traits import array_size
    152  from type_traits import array_item_type
    153
    154  from type_traits import remove_cv
    155  from type_traits import remove_const
    156  from type_traits import remove_alias
    157  from type_traits import remove_pointer
    158  from type_traits import remove_volatile
    159  from type_traits import remove_reference
    160  from type_traits import remove_declarated
    161
    162  from type_traits import has_destructor
    163  from type_traits import has_public_less
    164  from type_traits import has_copy_constructor
    165  has_trivial_copy = has_copy_constructor #backward comp mode will be removed
    166  from type_traits import has_public_equal
    167  from type_traits import has_public_assign
    168  from type_traits import has_public_destructor
    169  from type_traits import has_public_constructor
    170  from type_traits import has_trivial_constructor
    171  from type_traits import find_trivial_constructor
    172  from type_traits import has_public_binary_operator
    173  from type_traits import has_any_non_copyconstructor
    174
    175  from type_traits import auto_ptr_traits
    176  from type_traits import smart_pointer_traits
    177
    178  from container_traits import list_traits
    179  from container_traits import deque_traits
    180  from container_traits import queue_traits
    181  from container_traits import priority_queue_traits
    182  from container_traits import vector_traits
    183  from container_traits import stack_traits
    184  from container_traits import map_traits
    185  from container_traits import multimap_traits
    186  from container_traits import hash_map_traits
    187  from container_traits import hash_multimap_traits
    188  from container_traits import set_traits
    189  from container_traits import hash_set_traits
    190  from container_traits import multiset_traits
    191  from container_traits import hash_multiset_traits
    192  from container_traits import find_container_traits
    193
    194  from function_traits import is_same_function
    195
    196  all_container_traits = container_traits.container_traits
    197  """tuple of all STD container traits classes"""
    198
    199  sequential_container_traits = \
    200  [
    201      list_traits
    202      , deque_traits
    203      , queue_traits
    204      , priority_queue_traits
    205      , vector_traits
    206      , stack_traits
    207      , set_traits
    208      , hash_set_traits
    209      , multiset_traits
    210      , hash_multiset_traits
    211  ]
    212  """list, that contains all STD container traits classes"""
    213
    214
    215  import templates
    216  import call_invocation
    217
    218  from filtering import filtering
    219
    220  from decl_factory import decl_factory_t
    221
    222  from matchers import matcher_base_t
    223  from matchers import or_matcher_t
    224  from matchers import and_matcher_t
    225  from matchers import not_matcher_t
    226  from matchers import declaration_matcher_t
    227  from matchers import calldef_matcher_t
    228  from matchers import namespace_matcher_t
    229  from matchers import variable_matcher_t
    230  from matchers import regex_matcher_t
    231  from matchers import access_type_matcher_t
    232  from matchers import operator_matcher_t
    233  from matchers import custom_matcher_t
    234  from matchers import virtuality_type_matcher_t
    235
    236  #make matchers to look more like functors
    237  or_matcher = or_matcher_t
    238  """see L{or_matcher} for documentation"""
    239  and_matcher = and_matcher_t
    240  """see L{and_matcher} for documentation"""
    241  not_matcher = not_matcher_t
    242  """see L{not_matcher} for documentation"""
    243  declaration_matcher = declaration_matcher_t
    244  """see L{declaration_matcher} for documentation"""
    245  calldef_matcher = calldef_matcher_t
    246  """see L{calldef_matcher} for documentation"""
    247  namespace_matcher = namespace_matcher_t
    248  """see L{namespace_matcher} for documentation"""
    249  variable_matcher = variable_matcher_t
    250  """see L{variable_matcher} for documentation"""
    251  regex_matcher = regex_matcher_t
    252  """see L{regex_matcher} for documentation"""
    253  access_type_matcher = access_type_matcher_t
    254  """see L{access_type_matcher} for documentation"""
    255  operator_matcher = operator_matcher_t
    256  """see L{operator_matcher} for documentation"""
    257  custom_matcher = custom_matcher_t
    258  """see L{custom_matcher} for documentation"""
    259  virtuality_type_matcher = virtuality_type_matcher_t
    260  """see L{virtuality_type_matcher} for documentation"""
    261
    262  from matcher import matcher
    263
    264  from mdecl_wrapper import mdecl_wrapper_t
    265
    266  from decl_printer import decl_printer_t
    267  from decl_printer import print_declarations
    268
    269
    270  import scopedef
    271
    272  scopedef.scopedef_t._impl_all_decl_types = \
    273  [
    274      scopedef.scopedef_t
    275      , enumeration_t
    276      , namespace_t
    277      , class_t
    278      , class_declaration_t
    279      , typedef_t
    280      , variable_t
    281      , calldef_t
    282      , member_calldef_t
    283      , free_calldef_t
    284      , operator_t
    285      , member_function_t
    286      , constructor_t
    287      , destructor_t
    288      , member_operator_t
    289      , casting_operator_t
    290      , free_function_t
    291      , free_operator_t
    292  ]
    293
    294  __impl_matchers = scopedef.scopedef_t._impl_matchers
    295  __impl_decl_types = scopedef.scopedef_t._impl_decl_types
    296
    297  __impl_matchers[ scopedef.scopedef_t.decl ] = declaration_matcher_t
    298
    299  __impl_matchers[ scopedef.scopedef_t.class_ ] = declaration_matcher_t
    300  __impl_decl_types[ scopedef.scopedef_t.class_ ] = class_t
    301
    302  __impl_matchers[ scopedef.scopedef_t.variable ] = variable_matcher_t
    303
    304  __impl_matchers[ scopedef.scopedef_t.calldef ] = calldef_matcher_t
    305  __impl_decl_types[ scopedef.scopedef_t.calldef ] = calldef_t
    306
    307  __impl_matchers[ scopedef.scopedef_t.operator ] = operator_matcher_t
    308  __impl_decl_types[ scopedef.scopedef_t.operator ] = operator_t
    309
    310  __impl_matchers[ scopedef.scopedef_t.member_function ] = calldef_matcher_t
    311  __impl_decl_types[ scopedef.scopedef_t.member_function ] = member_function_t
    312
    313  __impl_matchers[ scopedef.scopedef_t.constructor ] = calldef_matcher_t
    314  __impl_decl_types[ scopedef.scopedef_t.constructor ] = constructor_t
    315
    316  __impl_matchers[ scopedef.scopedef_t.member_operator ] = operator_matcher_t
    317  __impl_decl_types[ scopedef.scopedef_t.member_operator ] = member_operator_t
    318
    319  __impl_matchers[ scopedef.scopedef_t.member_operator ] = operator_matcher_t
    320  __impl_decl_types[ scopedef.scopedef_t.member_operator ] = member_operator_t
    321
    322  __impl_matchers[ scopedef.scopedef_t.casting_operator ] = calldef_matcher_t
    323  __impl_decl_types[ scopedef.scopedef_t.casting_operator ] = casting_operator_t
    324
    325  __impl_matchers[ scopedef.scopedef_t.enumeration ] = declaration_matcher_t
    326  __impl_decl_types[ scopedef.scopedef_t.enumeration ] = enumeration_t
    327
    328  __impl_matchers[ scopedef.scopedef_t.typedef ] = declaration_matcher_t
    329  __impl_decl_types[ scopedef.scopedef_t.typedef ] = typedef_t
    330
    331  __impl_matchers[ namespace_t.namespace ] = namespace_matcher_t
    332
    333  __impl_matchers[ namespace_t.free_function ] = calldef_matcher_t
    334  __impl_decl_types[ namespace_t.free_function ] = free_function_t
    335
    336  __impl_matchers[ namespace_t.free_operator ] = operator_matcher_t
    337  __impl_decl_types[ namespace_t.free_operator ] = free_operator_t
    338