Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- type FnSym = String
- type Var = String
- type RefVar = String
- type IxVar = String
- type TypeVar = String
- type FieldNm = String
- type MacroVar = String
- data GlobalSym
- data AreaDef = AreaDef {}
- data AreaImportDef = AreaImportDef {}
- data IncludeDef = IncludeDef {
- inclModule :: String
- inclDefLoc :: SrcLoc
- data Extern = Extern {
- externSym :: String
- externFile :: String
- externType :: Type
- externLoc :: SrcLoc
- data ConstDef = ConstDef {}
- data TypeDef = TypeDef {}
- data ProcDef = ProcDef {}
- data IncludeProc = IncludeProc {
- procInclTy :: Type
- procInclSym :: FnSym
- procInclArgs :: [(Type, Var)]
- procIncl :: (String, FnSym)
- procInclLoc :: SrcLoc
- data PrePost
- type SzType = Either String Integer
- data Type
- tyArray :: Type -> SzType -> [SzType] -> Type
- data Scope
- data IntSize
- data WordSize
- data Literal
- data Exp
- data ExpOp
- = EqOp
- | NeqOp
- | CondOp
- | GtOp Bool
- | LtOp Bool
- | NotOp
- | AndOp
- | OrOp
- | MulOp
- | AddOp
- | SubOp
- | NegateOp
- | AbsOp
- | SignumOp
- | DivOp
- | EucDivOp
- | ModOp
- | FExpOp
- | FSqrtOp
- | FLogOp
- | FPowOp
- | FSinOp
- | FTanOp
- | FCosOp
- | FAsinOp
- | FAtanOp
- | FAtan2Op
- | FAcosOp
- | FSinhOp
- | FTanhOp
- | FCoshOp
- | FAsinhOp
- | FAtanhOp
- | FAcoshOp
- | IsNanOp
- | IsInfOp
- | RoundFOp
- | CeilFOp
- | FloorFOp
- | BitAndOp
- | BitOrOp
- | BitXorOp
- | BitComplementOp
- | BitShiftLOp
- | BitShiftROp
- | ConstRefOp
- | SafeCast
- | BitCast
- | CastWith
- | TwosCompCast
- | TwosCompRep
- | ToIx
- | FromIx
- | IxSize
- | ArrayLen
- | SizeOf
- | NullPtr
- | RefToPtr
- | ToCArray
- data StructInit
- data AllocRef
- = AllocBase RefVar (Maybe Exp)
- | AllocArr RefVar [Exp]
- | AllocStruct RefVar StructInit
- allocRefVar :: AllocRef -> RefVar
- data Stmt
- = IfTE Exp [Stmt] [Stmt]
- | Assert Exp
- | Assume Exp
- | Return Exp
- | ReturnVoid
- | Store Exp Exp
- | Assign Var Exp (Maybe Type)
- | NoBindCall Var [Exp]
- | RefCopy Exp Exp
- | AllocRef AllocRef
- | MapArr IxVar [Stmt]
- | UpTo Exp IxVar [Stmt]
- | UpFromTo Exp Exp IxVar [Stmt]
- | DownFrom Exp IxVar [Stmt]
- | DownFromTo Exp Exp IxVar [Stmt]
- | Forever [Stmt]
- | IvoryMacroStmt (Maybe Var) (String, [Exp])
- | Break
- | LocStmt (Located Stmt)
- data StructDef
- structSym :: StructDef -> String
- ivoryStringStructName :: String -> String
- data Field = Field {}
- data BitDataDef = BitDataDef {}
- data BitTy
- data Constr = Constr {
- constrName :: String
- constrFields :: [BitField]
- constrLayout :: [LayoutItem]
- constrLoc :: SrcLoc
- data LayoutItem
- data BitLiteral
- = BitLitKnown { }
- | BitLitUnknown { }
- data BitField = BitField {}
Documentation
data AreaImportDef Source #
Instances
data IncludeDef Source #
Instances
Extern | |
|
data IncludeProc Source #
We distinguish the name used from the name imported so the same symbol can
be used twice at different types. (E.g., printf
).
IncludeProc | |
|
Instances
TyVoid | Unit type |
TyInt IntSize | Signed ints |
TyWord WordSize | Unsigned ints |
TyBool | Booleans |
TyChar | Characters |
TyFloat | Floats |
TyDouble | Doubles XXX | TyPtr Type -- ^ Pointers |
TyIx Integer | Index type |
TyString | Static strings |
TyStored Type | References |
TyStruct String | Structures |
TyArray Type SzType | Arrays of fixed length (can be a macro or integer) |
TyRef Scope Type | References |
TyConstRef Scope Type | Constant References |
TySynonym String | Type synonym |
LocTy (Located Type) |
Stack (Maybe TypeVar) | Stack allocated. If no type variable is provided, a fresh one is constructed. |
Global | Globally allocated |
PolyMem (Maybe TypeVar) | Either allocation. If no type variable is provided, a fresh one is constructed. |
ExpLit Literal | |
ExpVar Var | |
ExpRet | |
ExpOp ExpOp [Exp] | |
IvoryMacroExp (String, [Exp]) | |
ExpDeref Exp | |
ExpArray Exp Exp | |
ExpStruct Exp Exp | |
ExpCall FnSym [Exp] | |
ExpAddrOf Var | |
LocExp (Located Exp) |
data StructInit Source #
Instances
allocRefVar :: AllocRef -> RefVar Source #
AST for parsing C-like statements.
IfTE Exp [Stmt] [Stmt] | |
Assert Exp | |
Assume Exp | |
Return Exp | |
ReturnVoid | |
Store Exp Exp | |
Assign Var Exp (Maybe Type) | |
NoBindCall Var [Exp] | |
RefCopy Exp Exp | |
AllocRef AllocRef | |
MapArr IxVar [Stmt] | |
UpTo Exp IxVar [Stmt] | |
UpFromTo Exp Exp IxVar [Stmt] | |
DownFrom Exp IxVar [Stmt] | |
DownFromTo Exp Exp IxVar [Stmt] | |
Forever [Stmt] | |
IvoryMacroStmt (Maybe Var) (String, [Exp]) | |
Break | |
LocStmt (Located Stmt) |
ivoryStringStructName :: String -> String Source #
data BitDataDef Source #
A "bitdata" definition.
Instances
Basic type representation allowed in bit definitions.
A constructor definition within a "bitdata".
Constr | |
|
data LayoutItem Source #
One element of a bit data constructor layout.
Instances
Eq LayoutItem Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST (==) :: LayoutItem -> LayoutItem -> Bool # (/=) :: LayoutItem -> LayoutItem -> Bool # | |
Ord LayoutItem Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST compare :: LayoutItem -> LayoutItem -> Ordering # (<) :: LayoutItem -> LayoutItem -> Bool # (<=) :: LayoutItem -> LayoutItem -> Bool # (>) :: LayoutItem -> LayoutItem -> Bool # (>=) :: LayoutItem -> LayoutItem -> Bool # max :: LayoutItem -> LayoutItem -> LayoutItem # min :: LayoutItem -> LayoutItem -> LayoutItem # | |
Read LayoutItem Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST readsPrec :: Int -> ReadS LayoutItem # readList :: ReadS [LayoutItem] # readPrec :: ReadPrec LayoutItem # readListPrec :: ReadPrec [LayoutItem] # | |
Show LayoutItem Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST showsPrec :: Int -> LayoutItem -> ShowS # show :: LayoutItem -> String # showList :: [LayoutItem] -> ShowS # |
data BitLiteral Source #
A bit integer literal with a known or unknown size.
Instances
Eq BitLiteral Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST (==) :: BitLiteral -> BitLiteral -> Bool # (/=) :: BitLiteral -> BitLiteral -> Bool # | |
Ord BitLiteral Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST compare :: BitLiteral -> BitLiteral -> Ordering # (<) :: BitLiteral -> BitLiteral -> Bool # (<=) :: BitLiteral -> BitLiteral -> Bool # (>) :: BitLiteral -> BitLiteral -> Bool # (>=) :: BitLiteral -> BitLiteral -> Bool # max :: BitLiteral -> BitLiteral -> BitLiteral # min :: BitLiteral -> BitLiteral -> BitLiteral # | |
Read BitLiteral Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST readsPrec :: Int -> ReadS BitLiteral # readList :: ReadS [BitLiteral] # readPrec :: ReadPrec BitLiteral # readListPrec :: ReadPrec [BitLiteral] # | |
Show BitLiteral Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST showsPrec :: Int -> BitLiteral -> ShowS # show :: BitLiteral -> String # showList :: [BitLiteral] -> ShowS # |