21 lines
412 B
Python
21 lines
412 B
Python
from tokenizer import tokenize
|
|
from ground_ast import generate_ast
|
|
from rich import print
|
|
from time import time
|
|
|
|
|
|
def main():
|
|
start = time()
|
|
file = open("test2.grnd", "r")
|
|
code = file.read()
|
|
file.close()
|
|
|
|
tokens = tokenize(code)
|
|
ast = generate_ast(tokens, code)
|
|
compile_time = time()-start
|
|
print(ast)
|
|
print(f"Compiled in {compile_time} seconds.")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main() |