bytecode #3

Merged
mrab merged 21 commits from bytecode into master 2024-06-14 07:56:36 +00:00
3 changed files with 7 additions and 7 deletions
Showing only changes of commit 2c928ad69b - Show all commits

View File

@ -24,7 +24,7 @@ executable compiler
ByteCode.ByteUtil,
ByteCode.ClassFile,
ByteCode.Assembler,
ByteCode.Generator,
ByteCode.Builder,
ByteCode.Constants
test-suite tests
@ -47,5 +47,5 @@ test-suite tests
ByteCode.ByteUtil,
ByteCode.ClassFile,
ByteCode.Assembler,
ByteCode.Generator,
ByteCode.Builder,
ByteCode.Constants

View File

@ -1,4 +1,4 @@
module ByteCode.Generator where
module ByteCode.Builder where
import ByteCode.Constants
import ByteCode.ClassFile (ClassFile (..), ConstantInfo (..), MemberInfo(..), Operation(..), Attribute(..), opcodeEncodingLength)

View File

@ -4,7 +4,7 @@ import Example
import Typecheck
import Parser.Lexer (alexScanTokens)
import Parser.JavaParser
import ByteCode.Generator
import ByteCode.Builder
import ByteCode.ClassFile
import Data.ByteString (pack, writeFile)
import System.Environment
@ -12,9 +12,9 @@ import System.FilePath.Posix (takeDirectory)
main = do
args <- getArgs
let filename = if (length args) > 0
then args!!0
else error "Missing filename, I need to know what to compile"
let filename = if null args
then error "Missing filename, I need to know what to compile"
else args!!0
let outputDirectory = takeDirectory filename
print ("Compiling " ++ filename)
file <- readFile filename