def convert(self, filename): files = [File(filename)] config = Config('clang', files=files) asts = self.frontend.generate_asts(config) print '\n\n\nvmx: asts:\n', asts, '\n\n\n\n\n' ast_renderer = renderer.ASTRenderer() for ast_container in asts: mod_node = ast_container.module code = ast_renderer.render(mod_node) output = [] for line in code.splitlines(): if line.startswith('#') or not line.strip(): continue output.append(line.strip()) return output
from cwrap.config import Config, File import sys print(sys.argv) if len(sys.argv) > 1: files = [File(f) for f in sys.argv[1:]] else: files = [File('test.h')] if __name__ == '__main__': #config = Config('gccxml', files=files, save_dir = 'tests/result_gccxml') #config.generate() print('------------------------') print() config_clang = Config( 'clang', files=files, save_dir='tests/result_clang', #include_dirs = [], #/usr/include/c++/4.2.1 #extern_name = '', #implementation_name = '', #language = 'c++', ) config_clang.generate()
from cwrap.config import Config, File if __name__ == '__main__': config = Config('gccxml', files = [File('mvDeviceManager/Include/mvDeviceManager.h')], include_dirs = ['.',]) config.generate() config = Config('gccxml', files = [File('DriverBase/Include/mvDriverBaseEnums.h')], include_dirs = ['.',]) config.generate() config = Config('gccxml', files = [File('mvPropHandling/Include/mvPropHandlingDatatypes.h')], include_dirs = ['.',]) config.generate()
from cwrap.config import Config, File if __name__ == '__main__': config = Config('gccxml', files=[File('test.h')]) config.generate()
# -*- coding: utf-8 -*- # # pyflycapture2 - python bindings for libflycapture2_c # Copyright (C) 2012 Robert Jordens <*****@*****.**> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from cwrap.config import Config, File if __name__ == '__main__': config = Config('gccxml', files=[ File('FlyCapture2Defs_C.h'), File('FlyCapture2_C.h'), ]) config.generate()