@AriTelford1/

IncompleteGoldScans

Python

No description

fork
loading
Files
  • main.py
  • ast.py
  • ausgabe.ll
  • codegen.py
  • grammar.ebnf
  • input.dts
  • lexer.py
  • parser.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from lexer import Lexer
from parser import Parser
from codegen import CodeGen

fname = "input.dts"
with open(fname) as f:
    text_input = f.read()

lexer = Lexer().get_lexer()
tokens = lexer.lex(text_input)

codegen = CodeGen()

module = codegen.module
builder = codegen.builder
printf = codegen.printf

pg = Parser(module, builder, printf)
pg.parse()
parser = pg.get_parser()
parser.parse(tokens).eval()

codegen.create_ir()
codegen.save_ir("ausgabe.ll")