mirror of
https://github.com/Alvin-Zilverstand/femcode.git
synced 2026-11-21 21:53:03 +01:00
Initial commit: Basic interpreter structure
This commit is contained in:
commit
39789bd96a
9 files changed
+128
No files matched your search
+19
@@ -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