Split the compiler into it's own module and added a file for the LLVM standard library.
This commit is contained in:
parent
5524e1ec3e
commit
213e47097e
3 changed files with 13 additions and 6 deletions
|
|
@ -30,7 +30,8 @@ executable language
|
||||||
Grammar.Par
|
Grammar.Par
|
||||||
Grammar.Print
|
Grammar.Print
|
||||||
Grammar.Skel
|
Grammar.Skel
|
||||||
Compiler
|
Compiler.Compiler
|
||||||
|
Compiler.StandardLLVMLibrary
|
||||||
Interpreter
|
Interpreter
|
||||||
|
|
||||||
hs-source-dirs: src
|
hs-source-dirs: src
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
module Compiler where
|
module Compiler.Compiler where
|
||||||
|
|
||||||
import Control.Applicative (Applicative)
|
import Control.Applicative (Applicative)
|
||||||
import Control.Monad.Except (Except, MonadError (throwError),
|
import Control.Monad.Except (Except, MonadError (throwError),
|
||||||
|
|
@ -23,10 +23,10 @@ compileFile file = do
|
||||||
putStrLn $ printTree cor
|
putStrLn $ printTree cor
|
||||||
compile cor
|
compile cor
|
||||||
|
|
||||||
data Compiler = Compiler
|
-- data Compiler = Compiler
|
||||||
{ data :: [LLVMIr] }
|
-- { data :: [LLVMIr] }
|
||||||
|
--
|
||||||
data LLVMIr =
|
-- data LLVMIr = LLVMIr
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
6
src/Compiler/StandardLLVMLibrary.hs
Normal file
6
src/Compiler/StandardLLVMLibrary.hs
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
module Compiler.StandardLLVMLibrary where
|
||||||
|
|
||||||
|
standardLLVMLibrary :: String
|
||||||
|
standardLLVMLibrary = "
|
||||||
|
|
||||||
|
"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue