示例#1
0
 def dump_tree(self, heading):
     if not self.verbose:
         return
     ast.Node._verbose_desc = self.verbose_nodes
     printer = astprint.BracePrinter()
     print "========\n{}\n========".format(heading)
     printer.process(self.root)
示例#2
0
apply src, snk : simple

'''
    else:
        script = sys.argv[1]
        script = os.path.expanduser(script)
        try:
            with open(script, 'r') as source:
                source_text = source.read()
        except:
            print "Error: Could not read file: '%s'" % script
            sys.exit(1)

    parser = CalvinParser()
    ir, it = parser.parse(source_text, logger=log)
    if it.issue_count == 0:
        print "No issues"
    for i in it.formatted_issues(custom_format="{type!c}: {reason} {filename}:{line}:{col}", filename=script):
        print i

    print "CalvinScript:"
    bp = astprint.BracePrinter()
    bp.process(ir)
    # print
    # print "DeployScript:"
    # bp = astprint.BracePrinter()
    # bp.process(deploy_ir)