Advertisement
Merxlc

astro.py

May 25th, 2021
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import lexer
  2. import bf
  3. import sys
  4.  
  5. def make(file_name, new_file_name):
  6. f1cont = lexer.read(file_name)
  7. with open(new_file_name, 'w') as file:
  8. file.write(lexer.from_brain(f1cont))
  9.  
  10. def parse(file_name):
  11. lexed = lexer.lex_all(file_name)
  12. bf.evaluate(lexed)
  13.  
  14. if __name__ == '__main__':
  15. if sys.argv[1] == 'make':
  16. make(sys.argv[2], sys.argv[3])
  17. else:
  18. parse(sys.argv[1])
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement