from CPP import * from Function import * def process(FILE_IN): # Read file. lines_in = [] with open(FILE_IN) as file: for line in file: lines_in.append(line.rstrip()) f = Function() # Parse. for ln in lines_in: ln = ln.rstrip() f.parseLine(ln) if f.isComplete: print("Function ready! Here it is in C++:") cpp = CPP(f) print(cpp.translate()) # Create new function instance. f = Function()