1# * Copyright 2016, NICTA 2# * 3# * This software may be distributed and modified according to the terms 4# of 5# * the BSD 2-Clause license. Note that NO WARRANTY is provided. 6# * See "LICENSE_BSD2.txt" for details. 7# * 8# * @TAG(NICTA_BSD) 9 10''' 11temporary work around for under-specified functions 12''' 13 14import re 15import sys 16 17if len(sys.argv) != 3: 18 print "usage: %s original_file output_name" % sys.argv[0] 19 sys.exit(-1) 20original_name = sys.argv[1] 21output_name = sys.argv[2] 22original = open(original_name) 23 24output = open(output_name, 'w') 25while True: 26 line = original.readline() 27 if not line: 28 break 29 if 'instruction' in line: 30 #print line 31 x = line.split() 32 if x[0] == "Function": 33 next_line = original.readline() 34 #drop these two lines 35 else: 36 output.write("%s Cond %s Err Op UnspecifiedPrecond Bool 0\n" % (x[0], x[2])) 37 else: 38 output.write(line) 39output.close() 40original.close() 41