Skip to content

Commit

Permalink
Ready for Release -v0.1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vijayphoenix committed Apr 26, 2019
1 parent a7ceb53 commit dc03e25
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 132 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.stack-work/
Haskull.cabal
*~
.vscode/
.vscode/
dist/
90 changes: 0 additions & 90 deletions Haskull.cabal

This file was deleted.

6 changes: 1 addition & 5 deletions src/CodeGen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ module CodeGen (
br,
phi,
cbr,
fcmp,
uitofp
fcmp

)where

Expand Down Expand Up @@ -321,6 +320,3 @@ phi ty incoming = instr $ ASTL.Phi ty incoming []

fcmp :: IP.IntegerPredicate -> ASTL.Operand -> ASTL.Operand -> Codegen ASTL.Operand
fcmp cond a b = instr $ ICmp cond a b []

uitofp :: ASTL.Type -> ASTL.Operand -> Codegen ASTL.Operand
uitofp ty a = instr $ ASTL.UIToFP a ty []
4 changes: 1 addition & 3 deletions src/Emit.hs
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ fdiv :: ASTL.Operand -> ASTL.Operand -> Codegen ASTL.Operand
fdiv a b = instr $ ASTL.UDiv False a b []

lesser :: ASTL.Operand -> ASTL.Operand -> Codegen ASTL.Operand
lesser a b = do
test <- fcmp IP.ULT a b
uitofp intL test
lesser a b = fcmp IP.ULT a b

externf :: ASTL.Name -> ASTL.Operand
externf = ConstantOperand . C.GlobalReference intL
Expand Down
9 changes: 7 additions & 2 deletions src/Parser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ opParser :: Parser Op
opParser = try plusParser
<|> try minusParser
<|> try mulParser
<|> divideParser
<|> try divideParser
<|> lessthanParser

plusParser = do
reservedOp "+"
Expand All @@ -103,6 +104,10 @@ divideParser = do
reservedOp "/"
return Divide

lessthanParser = do
reservedOp "<"
return LessThan

-- | Variable Names and identifier -----
-- NSS
nameParser :: Parser Name
Expand Down Expand Up @@ -212,7 +217,7 @@ singleParse :: Expr -> Parser BinOpCall
singleParse (BinOpCallStmt a) = return a
singleParse lhs = return $ BinOpCall Plus lhs (LiteralStmt (IntLiteral 0))

precedenceTable = Map.fromList[(Plus,10),(Minus,10),(Mul,20),(Divide,20)]
precedenceTable = Map.fromList[(Plus,10),(Minus,10),(Mul,20),(Divide,20),(LessThan,5)]

getTokPrec op = (Map.lookup op precedenceTable)

Expand Down
31 changes: 0 additions & 31 deletions src/Test.hs

This file was deleted.

0 comments on commit dc03e25

Please sign in to comment.