29 lines
420 B
Haskell
29 lines
420 B
Haskell
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
|
|
| Lambda VName Exp
|
|
| Apply Exp Exp
|
|
| TryCatch Exp Exp
|
|
deriving (Eq, Show)
|
|
|
|
printExp :: Exp -> String
|
|
printExp = undefined -- TODO
|