mirror of
https://github.com/Alvin-Zilverstand/femcode.git
synced 2026-03-07 05:47:49 +01:00
Initial commit: Basic interpreter structure
This commit is contained in:
19
src/main.py
Normal file
19
src/main.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from lexer import Lexer
|
||||
from parser import Parser
|
||||
from interpreter import Interpreter
|
||||
|
||||
def main():
|
||||
with open('../examples/hello_world.fem', 'r') as f:
|
||||
text = f.read()
|
||||
|
||||
lexer = Lexer(text)
|
||||
tokens = lexer.tokenize()
|
||||
|
||||
parser = Parser(tokens)
|
||||
ast = parser.parse()
|
||||
|
||||
interpreter = Interpreter(ast)
|
||||
interpreter.interpret()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user