1 definition module parse
3 from Data.Either import :: Either
4 from Data.Maybe import :: Maybe
8 :: ParserOutput :== Either String AST
10 :: AST = AST [VarDecl] [FunDecl]
11 :: VarDecl = VarDecl String Type Expr
22 = VarExpr String (Maybe FieldSelector)
23 | Op2Expr Expr Op2 Expr //TODO, iets met associativiteit wat niet weet hoe
28 | FunExpr String [Expr]
32 :: FieldSelector = FieldHd | FieldTl | FieldFst | FieldSnd
33 :: Op1 = UnNegation | UnMinus
34 :: Op2 = BiPlus | BiMinus | BiTimes | BiDivide | BiMod | BiEquals | BiLesser |
35 BiGreater | BiLesserEq | BiGreaterEq | BiUnEqual | BiAnd | BiOr | BiCons
43 parser :: LexerOutput -> ParserOutput