3 from Data.Maybe import :: Maybe
4 from StdOverloaded import class toString
6 :: Pos = {line :: Int, col :: Int}
7 :: AST = AST [VarDecl] [FunDecl]
8 :: VarDecl = VarDecl Pos Type String Expr
10 = TupleType (Type, Type)
19 | Op2Expr Pos Expr Op2 Expr
20 | Op1Expr Pos Op1 Expr
26 | TupleExpr Pos (Expr, Expr)
27 :: VarDef = VarDef String [FieldSelector]
28 :: FieldSelector = FieldHd | FieldTl | FieldFst | FieldSnd
29 :: Op1 = UnNegation | UnMinus
30 :: Op2 = BiPlus | BiMinus | BiTimes | BiDivide | BiMod | BiEquals | BiLesser |
31 BiGreater | BiLesserEq | BiGreaterEq | BiUnEqual | BiAnd | BiOr | BiCons
32 :: FunDecl = FunDecl Pos String [String] (Maybe FunType) [VarDecl] [Stmt]
33 :: FunType = FunType [Type] (Maybe Type)
34 :: FunCall = FunCall String [Expr]
36 = IfStmt Expr [Stmt] [Stmt]
37 | WhileStmt Expr [Stmt]
40 | ReturnStmt (Maybe Expr)