21 lines
425 B
Python
21 lines
425 B
Python
from lexer import Lexer
|
|
from parser import Parser
|
|
from evaluator import Evaluator
|
|
|
|
|
|
def main() -> None:
|
|
text = "\"hello\""
|
|
lexer = Lexer(text)
|
|
parser = Parser(text, lexer)
|
|
print("parsing...")
|
|
parsed = parser.parse()
|
|
print("ast = ")
|
|
for node in parsed:
|
|
print(node)
|
|
evaluator = Evaluator()
|
|
print("evaluating...")
|
|
evaluator.evaluate(parsed)
|
|
|
|
if __name__ == "__main__":
|
|
main()
|