From 7b4a6c812c5093f352a1faac869488c8ef826320 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Sun, 5 Apr 2009 22:31:26 +0000 Subject: [PATCH] Removed monadic and dyadic operators from the AST This is the first part of a change, suggested in #64, to remove operators in favour of functions (which will also allow user-defined operators). The ticket suggested removed operators after the parser, but the way it's working out, it is fine to just never represent as anything other than function calls. All the knock-on changes will be recorded in later patches. --- data/AST.hs | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/data/AST.hs b/data/AST.hs index 78a3707..8c81f4d 100644 --- a/data/AST.hs +++ b/data/AST.hs @@ -257,12 +257,8 @@ data Variable = -- | An expression. data Expression = - -- | A monadic (unary) operator. - Monadic Meta MonadicOp Expression - -- | A dyadic (binary) operator. - | Dyadic Meta DyadicOp Expression Expression -- | The most positive value of a given type. - | MostPos Meta Type + MostPos Meta Type -- | The most negative value of a given type. | MostNeg Meta Type -- | The size of the outermost dimension of an array type (see 'SizeExpr'). @@ -304,27 +300,6 @@ data ExpressionList = | AllocChannelBundle Meta Name deriving (Show, Eq, Typeable, Data) --- | A monadic (unary) operator. --- Nothing to do with Haskell monads. -data MonadicOp = - MonadicSubtr - | MonadicMinus - | MonadicBitNot - | MonadicNot - deriving (Show, Eq, Typeable, Data) - --- | A dyadic (binary) operator. -data DyadicOp = - Add | Subtr | Mul | Div | Rem - | Plus | Minus | Times - | BitAnd | BitOr | BitXor - | LeftShift | RightShift - | And | Or - | Eq | NotEq | Less | More | LessEq | MoreEq - | After - | Concat - deriving (Show, Eq, Typeable, Data) - -- | An item in an input. data InputItem = -- | A counted input.