X-Git-Url: https://ruin.nu/git/?p=proglang.git;a=blobdiff_plain;f=Abssyntax.hs;h=ec85c8d619730b34e85d5e00a39f4a562e995d06;hp=d8ef904d06766fd3ccab71ee41d1ed9e9ceb319b;hb=565fbd61dca527c23888e08783d0d91cee458524;hpb=3cee522d1f54b39a1efa654da364c6c939cbcf1f diff --git a/Abssyntax.hs b/Abssyntax.hs index d8ef904..ec85c8d 100644 --- a/Abssyntax.hs +++ b/Abssyntax.hs @@ -4,35 +4,38 @@ module Abssyntax where newtype Ident = Ident String deriving (Eq,Ord,Show) +data Type = + TInt + | TBool + deriving (Eq,Ord,Show) + +data Stms = + Program [Stm] + deriving (Eq,Ord,Show) + data Stm = - SDecl Type Ident Exp - | SExp Exp + SExp Exp | SBlock [Stm] - | SIf Exp Stm Stm | SWhile Exp Stm + | SIf Exp Stm Stm | SPrint Exp | SNoop + | SDecl Type Ident Exp deriving (Eq,Ord,Show) data Exp = EAss Ident Exp | EVar Ident | EInt Integer + | EBool Bool | ENeg Exp | ENot Exp - | EBool Bool | EReadI | EReadB - | ExpT Type Exp - | EDefault | BiOpExp Exp Op Exp | EPost Ident Op deriving (Eq,Ord,Show) -data Stms = - Program [Stm] - deriving (Eq,Ord,Show) - data Op = Lt | ELt @@ -46,9 +49,3 @@ data Op = | Div deriving (Eq,Ord,Show) -data Type = - TInt - | TBool - | NoType - deriving (Eq,Ord,Show) -