Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import lexer
- import bf
- import sys
- def make(file_name, new_file_name):
- f1cont = lexer.read(file_name)
- with open(new_file_name, 'w') as file:
- file.write(lexer.from_brain(f1cont))
- def parse(file_name):
- lexed = lexer.lex_all(file_name)
- bf.evaluate(lexed)
- if __name__ == '__main__':
- if sys.argv[1] == 'make':
- make(sys.argv[2], sys.argv[3])
- else:
- parse(sys.argv[1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement