„compile.py“ löschen

master
Justus Jan Nico Wolff 2022-06-06 12:02:02 +02:00
parent 34c4e65af1
commit f2789e097f
1 changed files with 0 additions and 26 deletions

View File

@ -1,26 +0,0 @@
import ast
import binarytools
code = []
class notinlibrary(Exception):
pass
def tobinary(function):
if function in library:
temp = library[function[0]]
function.remove(function[0])
for i in function:
temp += binarytools.thing2b(i)
return temp
else:
raise notinlibrary("error: the function {} is not in the library".format(function))
library = open("library", 'r')
library = library.read()
library = ast.literal_eval(library)
target = open("target", 'r')
target = target.read()
code = target.splitlines()
for line in code:
line = line.split()
code.append(tobinary(line))
output = open("output.jc", 'w')
output.writelines(code)
output.close()