From: Michael Andreen Date: Mon, 27 Feb 2006 21:11:24 +0000 (+0000) Subject: minor stuff X-Git-Url: https://ruin.nu/git/?p=proglang.git;a=commitdiff_plain;h=de34a0eeb75a54ce9ae058797327cd5ddc853ecc minor stuff --- diff --git a/Makefile b/Makefile index fe345b4..5a3fb4e 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,20 @@ -all: - happy -gca -idebug Parsyntax.y - alex -g Lexsyntax.x +all: Docsyntax.dvi Testsyntax Typechecker + +Docsyntax.dvi: Docsyntax.tex latex Docsyntax.tex; dvips Docsyntax.dvi -o Docsyntax.ps + +Testsyntax: Testsyntax.hs Parsyntax.hs Lexsyntax.hs Abssyntax.hs ghc --make Testsyntax.hs -o Testsyntax + +Typechecker: Typechecker.hs Typecheck.hs Parsyntax.hs Lexsyntax.hs Abssyntax.hs ghc -fglasgow-exts --make Typechecker.hs -o Typechecker + +Parsyntax.hs: Parsyntax.y + happy -gca -idebug Parsyntax.y + +Lexsyntax.hs: Lexsyntax.x + alex -g Lexsyntax.x + clean: -rm -f *.log *.aux *.hi *.o *.dvi -rm -f Docsyntax.ps diff --git a/Typecheck.hs b/Typecheck.hs index 2414203..38ee8fe 100644 --- a/Typecheck.hs +++ b/Typecheck.hs @@ -5,7 +5,6 @@ import Control.Monad.State import Data.Map as Map import Prelude hiding (lookup) - type Types = Map Ident Type inList :: Eq a => a -> [a] -> Bool @@ -42,7 +41,6 @@ typeCheckExp (ENeg e) = do TInt <- typeCheckExp e return TInt - typeCheckVar :: (MonadState Types m) => Ident -> m Type typeCheckVar i = do e <- get @@ -77,4 +75,3 @@ typeCheckStm (SDecl t i e) = do typeCheckStm (SPrint e) = do typeCheckExp e return NoType - diff --git a/Typechecker.hs b/Typechecker.hs index fb6986c..2e205b7 100644 --- a/Typechecker.hs +++ b/Typechecker.hs @@ -15,9 +15,6 @@ import Typecheck import Control.Monad.State import Data.Map as Map hiding (showTree) - - - import ErrM type ParseFun a = [Token] -> Err a