Collect function declaration symbols
This commit is contained in:
14
src/Main.hs
14
src/Main.hs
@ -25,11 +25,13 @@ main = execParser commandLine >>= withCommandLine
|
||||
>>= withParsedInput defaultOutput
|
||||
. runParser programP input
|
||||
withParsedInput output (Right program) =
|
||||
let symbolTable = nameAnalysis program
|
||||
_ = typeAnalysis symbolTable program
|
||||
intermediate' = intermediate symbolTable program
|
||||
in elfObject output
|
||||
$ riscv32Elf
|
||||
$ generateCode symbolTable intermediate'
|
||||
either print (withSymbolTable output program)
|
||||
$ nameAnalysis program
|
||||
withParsedInput _ (Left errorBundle) = putStrLn
|
||||
$ errorBundlePretty errorBundle
|
||||
withSymbolTable output program symbolTable =
|
||||
let _ = typeAnalysis symbolTable program
|
||||
intermediate' = intermediate symbolTable program
|
||||
instructions = generateCode symbolTable intermediate'
|
||||
in elfObject output
|
||||
$ riscv32Elf instructions
|
||||
|
Reference in New Issue
Block a user