module Ivory.Language.Syntax.Type where
import Language.Haskell.TH.Lift (deriveLiftMany)
data Type
= TyVoid
| TyInt IntSize
| TyWord WordSize
| TyBool
| TyChar
| TyFloat
| TyDouble
| TyProc Type [Type]
| TyRef Type
| TyConstRef Type
| TyPtr Type
| TyArr Int Type
| TyStruct String
| TyCArray Type
| TyOpaque
deriving (Show, Eq, Ord)
data IntSize
= Int8
| Int16
| Int32
| Int64
deriving (Show,Eq,Ord)
data WordSize
= Word8
| Word16
| Word32
| Word64
deriving (Show,Eq,Ord)
data Typed a = Typed
{ tType :: Type
, tValue :: a
} deriving (Show,Functor,Eq,Ord)
deriveLiftMany [ ''Type, ''IntSize, ''WordSize, ''Typed ]