def __init__(self, config, cache=None, decl_factory=None): """Constructor. config is a configuration object that contains the parameters for invoking gccxml. cache specifies the cache to use for caching declarations between separate runs. By default, no cache is used. decl_factory is an object that must provide the same interface than L{decl_factory_t<declarations.decl_factory_t>}, i.e. there must be a set of C{create_*} methods that return an instance of an appropriate declaration class. By default, the declaration classes defined in the L{declarations} package are used. @param config: Configuration object @type config: L{config_t} @param cache: Declaration cache (None=no cache) @type cache: L{cache_base_t} or str @param decl_factory: Custom declaration factory object or None @type decl_factory: decl_factory_t """ self.__config = config self.__dcache = None if isinstance(cache, declarations_cache.cache_base_t): self.__dcache = cache elif isinstance(cache, types.StringTypes): self.__dcache = declarations_cache.file_cache_t(cache) else: self.__dcache = declarations_cache.dummy_cache_t() self.__decl_factory = decl_factory if not decl_factory: self.__decl_factory = pygccxml.declarations.decl_factory_t() self.logger = utils.loggers.gccxml
def __init__( self, config, cache=None, decl_factory=None): """Constructor. config is a configuration object that contains the parameters for invoking gccxml. cache specifies the cache to use for caching declarations between separate runs. By default, no cache is used. decl_factory is an object that must provide the same interface than L{decl_factory_t<declarations.decl_factory_t>}, i.e. there must be a set of C{create_*} methods that return an instance of an appropriate declaration class. By default, the declaration classes defined in the L{declarations} package are used. @param config: Configuration object @type config: L{config_t} @param cache: Declaration cache (None=no cache) @type cache: L{cache_base_t} or str @param decl_factory: Custom declaration factory object or None @type decl_factory: decl_factory_t """ self.__config = config self.__dcache = None if isinstance( cache, declarations_cache.cache_base_t ): self.__dcache = cache elif isinstance( cache, types.StringTypes ): self.__dcache = declarations_cache.file_cache_t(cache) else: self.__dcache = declarations_cache.dummy_cache_t() self.__decl_factory = decl_factory if not decl_factory: self.__decl_factory = pygccxml.declarations.decl_factory_t() self.logger = utils.loggers.gccxml
def __init__( self, config, cache=None, decl_factory=None ): """ @param config: instance of L{config_t} class, that contains GCC-XML configuration @type config: L{config_t} @param cache: reference to cache object, that will be updated after file has been parsed. @param cache: instance of class, that derives from {cache_base_t} @param decl_factory: declarations factory, if not given default declarations factory L{decl_factory_t} will be used """ self.logger = utils.loggers.gccxml self.__search_directories = [] self.__config = config self.__search_directories.append( config.working_directory ) self.__search_directories.extend( config.include_paths ) if not cache: cache = declarations_cache.dummy_cache_t() self.__dcache = cache self.__raise_on_wrong_settings() self.__decl_factory = decl_factory if not decl_factory: self.__decl_factory = decl_factory_t()
def __init__(self, config, cache=None, decl_factory=None): """ @param config: instance of L{config_t} class, that contains GCC-XML configuration @type config: L{config_t} @param cache: reference to cache object, that will be updated after file has been parsed. @param cache: instance of class, that derives from {cache_base_t} @param decl_factory: declarations factory, if not given default declarations factory L{decl_factory_t} will be used """ self.logger = utils.loggers.cxx_parser self.__search_directories = [] self.__config = config self.__search_directories.append(config.working_directory) self.__search_directories.extend(config.include_paths) if not cache: cache = declarations_cache.dummy_cache_t() self.__dcache = cache self.__config.raise_on_wrong_settings() self.__decl_factory = decl_factory if not decl_factory: self.__decl_factory = decl_factory_t()
def __init__( self, config, cache=None, decl_factory=None ): """ :param config: instance of :class:`config_t` class, that contains GCC-XML configuration :param cache: reference to cache object, that will be updated after file has been parsed. :type cache: instance of :class:`cache_base_t` class :param decl_factory: declarations factory, if not given default declarations factory( :class:`decl_factory_t` ) will be used """ self.logger = utils.loggers.cxx_parser self.__search_directories = [] self.__config = config self.__search_directories.append( config.working_directory ) self.__search_directories.extend( config.include_paths ) if not cache: cache = declarations_cache.dummy_cache_t() self.__dcache = cache self.__config.raise_on_wrong_settings() self.__decl_factory = decl_factory if not decl_factory: self.__decl_factory = decl_factory_t()
def __init__( self, config, cache=None, decl_factory=None): """ :param config: GCCXML configuration :type config: :class:config_t :param cache: declaration cache, by default a cache functionality will not be used :type cache: :class:`cache_base_t` instance or `str` :param decl_factory: declaration factory :type decl_factory: :class:`decl_factory_t` """ self.__config = config self.__dcache = None if isinstance( cache, declarations_cache.cache_base_t ): self.__dcache = cache elif isinstance( cache, types.StringTypes ): self.__dcache = declarations_cache.file_cache_t(cache) else: self.__dcache = declarations_cache.dummy_cache_t() self.__decl_factory = decl_factory if not decl_factory: self.__decl_factory = pygccxml.declarations.decl_factory_t() self.logger = utils.loggers.gccxml