Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Ivory.Language.Syntax.Concrete.ParseAST
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
Constructors
Instances
Eq GlobalSym Source # | |
Ord GlobalSym Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST | |
Read GlobalSym Source # | |
Show GlobalSym Source # | |
HasLocation GlobalSym Source # | |
Constructors
AreaDef | |
data AreaImportDef Source #
Constructors
AreaImportDef | |
Instances
data IncludeDef Source #
Constructors
IncludeDef | |
Fields
|
Instances
Eq IncludeDef Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST | |
Ord IncludeDef Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST Methods compare :: IncludeDef -> IncludeDef -> Ordering # (<) :: IncludeDef -> IncludeDef -> Bool # (<=) :: IncludeDef -> IncludeDef -> Bool # (>) :: IncludeDef -> IncludeDef -> Bool # (>=) :: IncludeDef -> IncludeDef -> Bool # max :: IncludeDef -> IncludeDef -> IncludeDef # min :: IncludeDef -> IncludeDef -> IncludeDef # | |
Read IncludeDef Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST Methods readsPrec :: Int -> ReadS IncludeDef # readList :: ReadS [IncludeDef] # readPrec :: ReadPrec IncludeDef # readListPrec :: ReadPrec [IncludeDef] # | |
Show IncludeDef Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST Methods showsPrec :: Int -> IncludeDef -> ShowS # show :: IncludeDef -> String # showList :: [IncludeDef] -> ShowS # | |
HasLocation IncludeDef Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST |
Constructors
Extern | |
Fields
|
Constructors
ConstDef | |
Constructors
ProcDef | |
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
).
Constructors
IncludeProc | |
Fields
|
Instances
Eq IncludeProc Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST | |
Ord IncludeProc Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST Methods compare :: IncludeProc -> IncludeProc -> Ordering # (<) :: IncludeProc -> IncludeProc -> Bool # (<=) :: IncludeProc -> IncludeProc -> Bool # (>) :: IncludeProc -> IncludeProc -> Bool # (>=) :: IncludeProc -> IncludeProc -> Bool # max :: IncludeProc -> IncludeProc -> IncludeProc # min :: IncludeProc -> IncludeProc -> IncludeProc # | |
Read IncludeProc Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST Methods readsPrec :: Int -> ReadS IncludeProc # readList :: ReadS [IncludeProc] # readPrec :: ReadPrec IncludeProc # readListPrec :: ReadPrec [IncludeProc] # | |
Show IncludeProc Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST Methods showsPrec :: Int -> IncludeProc -> ShowS # show :: IncludeProc -> String # showList :: [IncludeProc] -> ShowS # | |
HasLocation IncludeProc Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST |
Constructors
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) |
Constructors
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. |
Constructors
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) |
Constructors
data StructInit Source #
Instances
Eq StructInit Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST | |
Ord StructInit Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST Methods compare :: StructInit -> StructInit -> Ordering # (<) :: StructInit -> StructInit -> Bool # (<=) :: StructInit -> StructInit -> Bool # (>) :: StructInit -> StructInit -> Bool # (>=) :: StructInit -> StructInit -> Bool # max :: StructInit -> StructInit -> StructInit # min :: StructInit -> StructInit -> StructInit # | |
Read StructInit Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST Methods readsPrec :: Int -> ReadS StructInit # readList :: ReadS [StructInit] # readPrec :: ReadPrec StructInit # readListPrec :: ReadPrec [StructInit] # | |
Show StructInit Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST Methods showsPrec :: Int -> StructInit -> ShowS # show :: StructInit -> String # showList :: [StructInit] -> ShowS # | |
HasLocation StructInit Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST |
Constructors
AllocBase RefVar (Maybe Exp) | |
AllocArr RefVar [Exp] | |
AllocStruct RefVar StructInit |
allocRefVar :: AllocRef -> RefVar Source #
AST for parsing C-like statements.
Constructors
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) |
Constructors
StructDef String [Field] SrcLoc | |
AbstractDef String FilePath SrcLoc | |
StringDef String Integer SrcLoc |
Instances
Eq StructDef Source # | |
Ord StructDef Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST | |
Read StructDef Source # | |
Show StructDef Source # | |
HasLocation StructDef Source # | |
ivoryStringStructName :: String -> String Source #
data BitDataDef Source #
A "bitdata" definition.
Constructors
BitDataDef | |
Instances
Eq BitDataDef Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST | |
Ord BitDataDef Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST Methods compare :: BitDataDef -> BitDataDef -> Ordering # (<) :: BitDataDef -> BitDataDef -> Bool # (<=) :: BitDataDef -> BitDataDef -> Bool # (>) :: BitDataDef -> BitDataDef -> Bool # (>=) :: BitDataDef -> BitDataDef -> Bool # max :: BitDataDef -> BitDataDef -> BitDataDef # min :: BitDataDef -> BitDataDef -> BitDataDef # | |
Read BitDataDef Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST Methods readsPrec :: Int -> ReadS BitDataDef # readList :: ReadS [BitDataDef] # readPrec :: ReadPrec BitDataDef # readListPrec :: ReadPrec [BitDataDef] # | |
Show BitDataDef Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST Methods showsPrec :: Int -> BitDataDef -> ShowS # show :: BitDataDef -> String # showList :: [BitDataDef] -> ShowS # | |
HasLocation BitDataDef Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST |
Basic type representation allowed in bit definitions.
A constructor definition within a "bitdata".
Constructors
Constr | |
Fields
|
data LayoutItem Source #
One element of a bit data constructor layout.
Constructors
LayoutConst BitLiteral | |
LayoutField String |
Instances
Eq LayoutItem Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST | |
Ord LayoutItem Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST Methods 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 Methods readsPrec :: Int -> ReadS LayoutItem # readList :: ReadS [LayoutItem] # readPrec :: ReadPrec LayoutItem # readListPrec :: ReadPrec [LayoutItem] # | |
Show LayoutItem Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST Methods showsPrec :: Int -> LayoutItem -> ShowS # show :: LayoutItem -> String # showList :: [LayoutItem] -> ShowS # |
data BitLiteral Source #
A bit integer literal with a known or unknown size.
Constructors
BitLitKnown | |
BitLitUnknown | |
Instances
Eq BitLiteral Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST | |
Ord BitLiteral Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST Methods 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 Methods readsPrec :: Int -> ReadS BitLiteral # readList :: ReadS [BitLiteral] # readPrec :: ReadPrec BitLiteral # readListPrec :: ReadPrec [BitLiteral] # | |
Show BitLiteral Source # | |
Defined in Ivory.Language.Syntax.Concrete.ParseAST Methods showsPrec :: Int -> BitLiteral -> ShowS # show :: BitLiteral -> String # showList :: [BitLiteral] -> ShowS # |
A record-like field defined within a "bitdata" constructor. If the name is
an underscore, we name it with Nothing
.
Constructors
BitField | |
Fields
|