def __parse_declarations( self, files, gccxml_config, compilation_mode, cache, indexing_suite_version ): if None is gccxml_config: gccxml_config = parser.config_t() if None is compilation_mode: compilation_mode = parser.COMPILATION_MODE.FILE_BY_FILE start_time = time.clock() self.logger.debug( 'parsing files - started' ) reader = parser.project_reader_t( gccxml_config, cache, decl_wrappers.dwfactory_t() ) decls = reader.read_files( files, compilation_mode ) self.logger.debug( 'parsing files - done( %f seconds )' % ( time.clock() - start_time ) ) self.logger.debug( 'settings declarations defaults - started' ) global_ns = decls_package.matcher.get_single( decls_package.namespace_matcher_t( name='::' ) , decls ) if indexing_suite_version != 1: for cls in global_ns.classes(): cls.indexing_suite_version = indexing_suite_version for cls in global_ns.decls(decl_type=decls_package.class_declaration_t): cls.indexing_suite_version = indexing_suite_version start_time = time.clock() self.__apply_decls_defaults(decls) self.logger.debug( 'settings declarations defaults - done( %f seconds )' % ( time.clock() - start_time ) ) return global_ns
def __parse_declarations( self, files, gccxml_config, compilation_mode, cache, indexing_suite_version ): if None is gccxml_config: gccxml_config = parser.config_t() if None is compilation_mode: compilation_mode = parser.COMPILATION_MODE.FILE_BY_FILE start_time = time.clock() self.logger.debug( 'parsing files - started' ) reader = parser.project_reader_t( gccxml_config, cache, decl_wrappers.dwfactory_t() ) decls = reader.read_files( files, compilation_mode ) self.logger.debug( 'parsing files - done( %f seconds )' % ( time.clock() - start_time ) ) self.logger.debug( 'settings declarations defaults - started' ) global_ns = decls_package.matcher.get_single( decls_package.namespace_matcher_t( name='::' ) , decls ) if indexing_suite_version != 1: for cls in global_ns.classes(): cls.indexing_suite_version = indexing_suite_version try: for cls in global_ns.decls(decl_type=decls_package.class_declaration_t): cls.indexing_suite_version = indexing_suite_version except RuntimeError: pass start_time = time.clock() self.__apply_decls_defaults(decls) self.logger.debug( 'settings declarations defaults - done( %f seconds )' % ( time.clock() - start_time ) ) return global_ns
def __parse_declarations( self, files, gccxml_config, compilation_mode=None, cache=None ): if None is gccxml_config: gccxml_config = parser.config_t() if None is compilation_mode: compilation_mode = parser.COMPILATION_MODE.FILE_BY_FILE start_time = time.clock() self.logger.debug( 'parsing files - started' ) reader = parser.project_reader_t( gccxml_config, cache, decl_wrappers.dwfactory_t() ) decls = reader.read_files( files, compilation_mode ) self.logger.debug( 'parsing files - done( %f seconds )' % ( time.clock() - start_time ) ) return decls_package.matcher.get_single( decls_package.namespace_matcher_t( name='::' ) , decls )
def customize( self, mb ): matcher = ~declarations.namespace_matcher_t() matcher = matcher & declarations.regex_matcher_t( '.*skip.*' ) decls = mb.decls( matcher ) decls.ignore = True mb.build_code_creator( self.EXTENSION_NAME ) matcher = declarations.match_declaration_t( name='skip_a' ) found = code_creators.creator_finder.find_by_declaration( matcher , mb.code_creator.creators ) self.failUnless( not found, "'skip_a' declaration should not be exported" ) matcher = declarations.match_declaration_t( name='skip_b' ) found = code_creators.creator_finder.find_by_declaration( matcher , mb.code_creator.creators ) self.failUnless( not found, "'skip_b' declaration should not be exported" )
def customize(self, mb): matcher = ~declarations.namespace_matcher_t() matcher = matcher & declarations.regex_matcher_t('.*skip.*') decls = mb.decls(matcher) decls.ignore = True mb.build_code_creator(self.EXTENSION_NAME) matcher = declarations.match_declaration_t(name='skip_a') found = code_creators.creator_finder.find_by_declaration( matcher, mb.code_creator.creators) self.failUnless(not found, "'skip_a' declaration should not be exported") matcher = declarations.match_declaration_t(name='skip_b') found = code_creators.creator_finder.find_by_declaration( matcher, mb.code_creator.creators) self.failUnless(not found, "'skip_b' declaration should not be exported")
def test(self): declarations.matcher.get_single( declarations.namespace_matcher_t(name='::'), self.declarations)
def test(self): criteria = declarations.namespace_matcher_t(name='bit_fields') declarations.matcher.get_single(criteria, self.declarations) self.assertTrue( str(criteria) == '(decl type==namespace_t) and (name==bit_fields)')
def customize( self, mb ): matcher = ~declarations.namespace_matcher_t() matcher = matcher & declarations.declaration_matcher_t( name='get_a' ) decls = mb.decls( matcher ) decls.ignore = True
def customize(self, mb): matcher = ~declarations.namespace_matcher_t() matcher = matcher & declarations.declaration_matcher_t(name='get_a') decls = mb.decls(matcher) decls.ignore = True