示例#1
0
def run(args):
    ctx = lal2basic.ExtractionContext()

    progs = ctx.extract_programs_from_file("test.adb")

    output = PrettyPrinter.pretty_print(
        test_helper.find_test_program(progs, args.test_subprogram),
        PrettyPrinter.Opts(print_ids=True))

    print(output)
示例#2
0
    def run(self, **irs):
        for i, f in enumerate(self.files):
            ir_f = irs[str(i)]
            print("--- IR FOR FILE {} ---\n\n".format(f))
            for j, fun_ir in enumerate(ir_f):
                fun_name = fun_ir.data.fun_id.f_subp_spec.f_subp_name.text
                print("    {}. {}:\n".format(j, fun_name))
                print(PrettyPrinter.pretty_print(fun_ir))
                print("\n")

        return {'res': []}
示例#3
0
def html_render_node(node):
    return escape(PrettyPrinter.pretty_print(node))