X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=Skelsyntax.hs;h=7efec8512f8ca8ea0c89e36a68268106dfd05fe4;hb=ff80cbdaf843e2745f59e6f5d3c8670cadbf68b2;hp=5f49a5b5a4d392571d9009e04c94d63961e34ff8;hpb=6103c0359b95557566aa9154efa5bcd4d9c996f6;p=proglang.git diff --git a/Skelsyntax.hs b/Skelsyntax.hs index 5f49a5b..7efec85 100644 --- a/Skelsyntax.hs +++ b/Skelsyntax.hs @@ -20,14 +20,27 @@ transBool x = case x of False -> failure x +transType :: Type -> Result +transType x = case x of + TInt -> failure x + TBool -> failure x + + +transProgram :: Program -> Result +transProgram x = case x of + Program funcstms -> 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 + SReturn exp -> failure x SNoop -> failure x @@ -36,19 +49,30 @@ transExp x = case x of EAss id exp -> failure x EVar id -> failure x EInt n -> failure x - ENeg exp -> failure x EBool bool -> failure x + ENeg exp -> failure x + ENot exp -> failure x EReadI -> failure x EReadB -> failure x - ExpT type' exp -> failure x - EDefault -> failure x + EFunc id exps -> 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 +transDecl :: Decl -> Result +transDecl x = case x of + Decl type' id -> failure x + + +transFunc :: Func -> Result +transFunc x = case x of + Func type' id decls stms -> failure x + + +transFuncStm :: FuncStm -> Result +transFuncStm x = case x of + S stm -> failure x + F func -> failure x transOp :: Op -> Result @@ -65,11 +89,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 - -