module Ivory.BitData.AST where
data BitTy = TyCon String
| TyNat Integer
| TyApp BitTy BitTy
deriving Show
data BitLiteral =
BitLitKnown { bitLitLen :: Int , bitLitVal :: Int }
| BitLitUnknown { bitLitVal :: Int }
deriving Show
data LayoutItem = LayoutConst BitLiteral
| LayoutField String
deriving Show
type Layout = [LayoutItem]
data Def = Def
{ defName :: String
, defType :: BitTy
, defConstrs :: [Constr]
}
data Constr = Constr
{ constrName :: String
, constrFields :: [Field]
, constrLayout :: Layout
}
data Field = Field
{ fieldName :: String
, fieldType :: BitTy
}