✨ Moved code out of handout directory
This commit is contained in:
26
a1/src/APL/AST.hs
Normal file
26
a1/src/APL/AST.hs
Normal file
@ -0,0 +1,26 @@
|
||||
module APL.AST
|
||||
( VName,
|
||||
Exp (..),
|
||||
printExp,
|
||||
)
|
||||
where
|
||||
|
||||
type VName = String
|
||||
|
||||
data Exp
|
||||
= CstInt Integer
|
||||
| CstBool Bool
|
||||
| Add Exp Exp
|
||||
| Sub Exp Exp
|
||||
| Mul Exp Exp
|
||||
| Div Exp Exp
|
||||
| Pow Exp Exp
|
||||
| Eql Exp Exp
|
||||
| If Exp Exp Exp
|
||||
| Var VName
|
||||
| Let VName Exp Exp
|
||||
-- TODO: add cases
|
||||
deriving (Eq, Show)
|
||||
|
||||
printExp :: Exp -> String
|
||||
printExp = undefined -- TODO
|
Reference in New Issue
Block a user