Use TAst in CodeGen
This commit is contained in:
parent
d53362f882
commit
5a63229e74
@ -12,6 +12,7 @@ import Windows12.Parser (programP)
|
|||||||
import System.Environment (getArgs)
|
import System.Environment (getArgs)
|
||||||
import LLVM.Pretty
|
import LLVM.Pretty
|
||||||
import Windows12.Ast
|
import Windows12.Ast
|
||||||
|
import Windows12.Semant (convert)
|
||||||
import Windows12.CodeGen (codegen)
|
import Windows12.CodeGen (codegen)
|
||||||
|
|
||||||
|
|
||||||
@ -26,4 +27,7 @@ main = do
|
|||||||
test <- T.readFile inputFile
|
test <- T.readFile inputFile
|
||||||
case parse programP inputFile test of
|
case parse programP inputFile test of
|
||||||
Left err -> print err
|
Left err -> print err
|
||||||
Right ast -> TL.writeFile outputFile (ppllvm (codegen (cs inputFile) ast))
|
Right ast ->
|
||||||
|
case convert ast of
|
||||||
|
Left err -> putStrLn err
|
||||||
|
Right ast -> TL.writeFile outputFile (ppllvm (codegen (cs inputFile) ast))
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
module Windows12.CodeGen where
|
module Windows12.CodeGen where
|
||||||
|
|
||||||
import Data.Text (Text)
|
import Data.Text (Text)
|
||||||
import Windows12.Ast
|
import Windows12.TAst
|
||||||
import LLVM.AST (Module)
|
import LLVM.AST (Module)
|
||||||
|
|
||||||
codegen :: Text -> Program -> Module
|
codegen :: Text -> TProgram -> Module
|
||||||
codegen filename (Program structs enums funcs) = undefined
|
codegen filename (TProgram structs enums funcs) = undefined
|
||||||
|
Loading…
x
Reference in New Issue
Block a user