nand2tetris/compiler/engine.py

16 lines
340 B
Python
Raw Normal View History

2020-06-24 12:42:36 +00:00
from tokenizer import JackTokenizer
2020-07-06 09:06:41 +00:00
from keywords import *
from grammar import CLASS
2020-06-24 12:42:36 +00:00
"""
New Compilation Engine
"""
class Engine:
def __init__(self, input_file):
self.i = 0
self.jt = JackTokenizer(input_file, False)
self.file = open(input_file + ".xml", 'w')
2020-07-06 09:06:41 +00:00
def xml_file(self, input_file):
return input_file + ".xml"