X-Git-Url: https://ruin.nu/git/?p=proglang.git;a=blobdiff_plain;f=Skelsyntax.hs;h=9f3feab046e4624d3c594fad502219d14a04f1a6;hp=07898ef6d2aa24e4e2ff417f75af2b21268368cb;hb=d553df8dfdffca78342d6fae142ceded9cd64415;hpb=9d0e3c89b286456549c68a816d0729f193498f6a diff --git a/Skelsyntax.hs b/Skelsyntax.hs index 07898ef..9f3feab 100644 --- a/Skelsyntax.hs +++ b/Skelsyntax.hs @@ -20,13 +20,25 @@ transBool x = case x of False -> failure x +transType :: Type -> Result +transType x = case x of + TInt -> failure x + TBool -> failure x + + +transStms :: Stms -> Result +transStms x = case x of + Program stms -> failure x + + transStm :: Stm -> Result transStm x = case x of - SDecl type' id exp -> failure x SExp exp -> failure x SBlock stms -> failure x - SIf exp stm0 stm -> failure x + SDecl type' id exp -> failure x + SDeclD type' id -> failure x SWhile exp stm -> failure x + SIf exp stm0 stm -> failure x SPrint exp -> failure x SNoop -> failure x @@ -36,22 +48,15 @@ transExp x = case x of EAss id exp -> failure x EVar id -> failure x EInt n -> failure x + EBool bool -> failure x ENeg exp -> failure x ENot exp -> failure x - EBool bool -> failure x EReadI -> failure x EReadB -> failure x - ExpT type' exp -> failure x - EDefault -> failure x BiOpExp exp0 op exp -> failure x EPost id op -> failure x -transStms :: Stms -> Result -transStms x = case x of - Program stms -> failure x - - transOp :: Op -> Result transOp x = case x of Lt -> failure x @@ -66,11 +71,4 @@ transOp x = case x of Div -> failure x -transType :: Type -> Result -transType x = case x of - TInt -> failure x - TBool -> failure x - NoType -> failure x - -