示例#1
0
文件: tester.py 项目: BruceYi/okl4
	def run(self):
		from targets.shared.inputparser import ImportingASTGenerator as ASTGenerator

		options = {'c_preprocessor': 'cpp',
				'cpp_options': [],
				'c_include_dirs': sys.argv[3:]}

		generator = ASTGenerator(options, gimme_a_registry())

		ast_info = generator.produce_ast(sys.argv[2]) # FIXME: Inconsistent with C importer
		print_tree(ast_info.ast)
示例#2
0
文件: tester.py 项目: BruceYi/okl4
	def run(self):
		from parsers.cplusplus.parser import parse
		from targets.shared.inputparser import CASTImporter

		data = file(sys.argv[2]).read()

		options = {'c_preprocessor': 'cpp',
				'cpp_options': [],
				'c_include_dirs': []}

		importer = CASTImporter(sys.argv[2], gimme_a_registry(), options)

		ast = importer.run()
		print_tree(ast)
示例#3
0
    def run(self):
        from targets.shared.inputparser import ImportingASTGenerator as ASTGenerator

        options = {
            'c_preprocessor': 'cpp',
            'cpp_options': [],
            'c_include_dirs': sys.argv[3:]
        }

        generator = ASTGenerator(options, gimme_a_registry())

        ast_info = generator.produce_ast(
            sys.argv[2])  # FIXME: Inconsistent with C importer
        print_tree(ast_info.ast)
示例#4
0
    def run(self):
        from parsers.cplusplus.parser import parse
        from targets.shared.inputparser import CASTImporter

        data = file(sys.argv[2]).read()

        options = {
            'c_preprocessor': 'cpp',
            'cpp_options': [],
            'c_include_dirs': []
        }

        importer = CASTImporter(sys.argv[2], gimme_a_registry(), options)

        ast = importer.run()
        print_tree(ast)