X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=sem.icl;h=02d01174b1734a3731e3c6d8520eaf7f8a3632ba;hb=6c23d03e21a84452701b742cb3582f02c1efc28c;hp=2003038ad94c1ab32d3bd398abdc79fd62a65502;hpb=022b8166504765b2c84138fc83dfdfaa23fe5774;p=cc1516.git diff --git a/sem.icl b/sem.icl index 2003038..02d0117 100644 --- a/sem.icl +++ b/sem.icl @@ -1,6 +1,27 @@ implementation module sem +import qualified Data.Map as Map +from Data.Func import $ +import Data.Either +import Control.Monad.State import StdMisc -semanticAnalysis :: AST -> Either Error AST -semanticAnalysis a = +import AST +from parse import :: ParserOutput +from yard import :: Error + +:: Gamma :== 'Map'.Map String Type +:: Env a :== State Gamma a + +sem :: ParserOutput -> SemOutput +sem (Left p) = Left p +sem (Right (AST vd fd)) = Right $ AST vd fd +// foldM semVarDecl vd +// >>= \gamma ->foldM typecheck gamma fd + +semVarDecl :: VarDecl -> Env VarDecl +semVarDecl (Vardecl pos type ident expr) = undef + + + +