module Main where import Example import Typecheck import Parser.Lexer (alexScanTokens) import Parser.JavaParser import ByteCode.Generator import ByteCode.ClassFile import Data.ByteString (pack, writeFile) main = do file <- readFile "Testklasse.java" let untypedAST = parse $ alexScanTokens file let typedAST = head (typeCheckCompilationUnit untypedAST) --print typedAST let abstractClassFile = classBuilder typedAST emptyClassFile let assembledClassFile = pack (serialize abstractClassFile) Data.ByteString.writeFile "Testklasse.class" assembledClassFile