definition module parse from Data.Either import :: Either from Data.Maybe import :: Maybe import lex :: ParserOutput :== Either String AST :: AST = AST [VarDecl] [FunDecl] :: VarDecl = VarDecl String Type Expr :: Type = TupleType Type Type | ListType Type | IdType String | IntType | BoolType | CharType | VarType :: Expr = VarExpr String (Maybe FieldSelector) | Op2Expr Expr Op2 Expr //TODO, iets met associativiteit wat niet weet hoe | Op1Expr Op1 Expr | IntExpr Int | CharExpr Char | BoolExpr Bool | EmptyListExpr | TupleExpr Expr Expr :: FieldSelector = FieldHd | FieldTl | FieldFst | FieldSnd :: Op1 = UnNegation | UnMinus :: Op2 = BiPlus | BiMinus | BiTimes | BiDivide | BiMod | BiEquals | BiLesser | BiGreater | BiLesserEq | BiGreaterEq | BiUnEqual | BiAnd | BiOr | BiCons //TODO :: FunDecl = Stub parse :: LexerOutput -> ParserOutput