X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=src%2Fparse.dcl;h=55d8a95c35005ac3126ee472c9489bfb18d789ba;hb=3d1c57710eb0b86f13df392f03131157aec22c21;hp=abfb8b4443f327806a0cc795c40bc56e5d111994;hpb=1e30f02a706b29dae471b6526e7fd0e4bf5bf483;p=cc1516.git diff --git a/src/parse.dcl b/src/parse.dcl index abfb8b4..55d8a95 100644 --- a/src/parse.dcl +++ b/src/parse.dcl @@ -10,7 +10,7 @@ import lex :: AST = AST [VarDecl] [FunDecl] :: VarDecl = VarDecl Type String Expr :: Type - = TupleType Type Type + = TupleType (Type, Type) | ListType Type | IdType String | IntType @@ -26,13 +26,13 @@ import lex | BoolExpr Bool | FunExpr FunCall | EmptyListExpr - | TupleExpr Expr Expr + | TupleExpr (Expr, Expr) :: VarDef = VarDef String [FieldSelector] :: FieldSelector = FieldHd | FieldTl | FieldFst | FieldSnd :: Op1 = UnNegation | UnMinus :: Op2 = BiPlus | BiMinus | BiTimes | BiDivide | BiMod | BiEquals | BiLesser | BiGreater | BiLesserEq | BiGreaterEq | BiUnEqual | BiAnd | BiOr | BiCons -:: FunDecl = FunDecl String [String] FunType [VarDecl] [Stmt] +:: FunDecl = FunDecl String [String] (Maybe FunType) [VarDecl] [Stmt] :: FunType = FunType [Type] (Maybe Type) :: FunCall = FunCall String [Expr] :: Stmt