Copyright | (c) Harvard University 2006-2011 (c) Geoffrey Mainland 2011-2013 (c) Manuel M T Chakravarty 2013 : (c) Drexel University 2013 |
---|---|
License | BSD-style |
Maintainer | mainland@cs.drexel.edu |
Safe Haskell | None |
Language | Haskell98 |
- data Extensions
- data Id
- data Storage
- data TypeQual
- = Tconst !SrcLoc
- | Tvolatile !SrcLoc
- | Tinline !SrcLoc
- | Trestrict !SrcLoc
- | TCUDAdevice !SrcLoc
- | TCUDAglobal !SrcLoc
- | TCUDAhost !SrcLoc
- | TCUDAconstant !SrcLoc
- | TCUDAshared !SrcLoc
- | TCUDArestrict !SrcLoc
- | TCUDAnoinline !SrcLoc
- | TCLprivate !SrcLoc
- | TCLlocal !SrcLoc
- | TCLglobal !SrcLoc
- | TCLconstant !SrcLoc
- | TCLreadonly !SrcLoc
- | TCLwriteonly !SrcLoc
- | TCLkernel !SrcLoc
- data Sign
- data TypeSpec
- = Tvoid !SrcLoc
- | Tchar (Maybe Sign) !SrcLoc
- | Tshort (Maybe Sign) !SrcLoc
- | Tint (Maybe Sign) !SrcLoc
- | Tlong (Maybe Sign) !SrcLoc
- | Tlong_long (Maybe Sign) !SrcLoc
- | Tfloat !SrcLoc
- | Tdouble !SrcLoc
- | Tlong_double !SrcLoc
- | Tstruct (Maybe Id) (Maybe [FieldGroup]) [Attr] !SrcLoc
- | Tunion (Maybe Id) (Maybe [FieldGroup]) [Attr] !SrcLoc
- | Tenum (Maybe Id) [CEnum] [Attr] !SrcLoc
- | Tnamed Id [Id] !SrcLoc
- | TtypeofExp Exp !SrcLoc
- | TtypeofType Type !SrcLoc
- | Tva_list !SrcLoc
- data DeclSpec
- data ArraySize
- data Decl
- data Type
- data Designator
- data Designation = Designation [Designator] !SrcLoc
- data Initializer
- type AsmLabel = String
- data Init = Init Id Decl (Maybe AsmLabel) (Maybe Initializer) [Attr] !SrcLoc
- data Typedef = Typedef Id Decl [Attr] !SrcLoc
- data InitGroup
- data Field = Field (Maybe Id) (Maybe Decl) (Maybe Exp) !SrcLoc
- data FieldGroup
- = FieldGroup DeclSpec [Field] !SrcLoc
- | AntiSdecl String !SrcLoc
- | AntiSdecls String !SrcLoc
- data CEnum
- data Attr = Attr Id [Exp] !SrcLoc
- data Param
- data Params = Params [Param] Bool !SrcLoc
- data Func
- data Definition
- = FuncDef Func !SrcLoc
- | DecDef InitGroup !SrcLoc
- | EscDef String !SrcLoc
- | ObjCClassDec [Id] !SrcLoc
- | ObjCClassIface Id (Maybe Id) [Id] [ObjCIvarDecl] [ObjCIfaceDecl] [Attr] !SrcLoc
- | ObjCCatIface Id (Maybe Id) [Id] [ObjCIvarDecl] [ObjCIfaceDecl] !SrcLoc
- | ObjCProtDec [Id] !SrcLoc
- | ObjCProtDef Id [Id] [ObjCIfaceDecl] !SrcLoc
- | ObjCClassImpl Id (Maybe Id) [ObjCIvarDecl] [Definition] !SrcLoc
- | ObjCCatImpl Id Id [Definition] !SrcLoc
- | ObjCSynDef [(Id, Maybe Id)] !SrcLoc
- | ObjCDynDef [Id] !SrcLoc
- | ObjCMethDef ObjCMethodProto [BlockItem] !SrcLoc
- | ObjCCompAlias Id Id !SrcLoc
- | AntiFunc String !SrcLoc
- | AntiEsc String !SrcLoc
- | AntiEdecl String !SrcLoc
- | AntiEdecls String !SrcLoc
- data ObjCIvarDecl
- data ObjCVisibilitySpec
- data ObjCIfaceDecl
- data ObjCPropAttr
- data ObjCMethodReq
- data ObjCParam = ObjCParam (Maybe Id) (Maybe Type) [Attr] (Maybe Id) !SrcLoc
- data ObjCMethodProto = ObjCMethodProto Bool (Maybe Type) [Attr] [ObjCParam] Bool [Attr] !SrcLoc
- data Stm
- = Label Id Stm !SrcLoc
- | Case Exp Stm !SrcLoc
- | Default Stm !SrcLoc
- | Exp (Maybe Exp) !SrcLoc
- | Block [BlockItem] !SrcLoc
- | If Exp Stm (Maybe Stm) !SrcLoc
- | Switch Exp Stm !SrcLoc
- | While Exp Stm !SrcLoc
- | DoWhile Stm Exp !SrcLoc
- | For (Either InitGroup (Maybe Exp)) (Maybe Exp) (Maybe Exp) Stm !SrcLoc
- | Goto Id !SrcLoc
- | Continue !SrcLoc
- | Break !SrcLoc
- | Return (Maybe Exp) !SrcLoc
- | Pragma String !SrcLoc
- | Asm Bool [Attr] [String] [(String, Exp)] [(String, Exp)] [String] !SrcLoc
- | ObjCTry [BlockItem] [ObjCCatch] (Maybe [BlockItem]) !SrcLoc
- | ObjCThrow (Maybe Exp) !SrcLoc
- | ObjCSynchronized Exp [BlockItem] !SrcLoc
- | ObjCAutoreleasepool [BlockItem] !SrcLoc
- | AntiPragma String !SrcLoc
- | AntiStm String !SrcLoc
- | AntiStms String !SrcLoc
- data BlockItem
- data ObjCCatch = ObjCCatch (Maybe Param) [BlockItem] !SrcLoc
- funcProto :: Func -> InitGroup
- isPtr :: Type -> Bool
- data Signed
- data Const
- = IntConst String Signed Integer !SrcLoc
- | LongIntConst String Signed Integer !SrcLoc
- | LongLongIntConst String Signed Integer !SrcLoc
- | FloatConst String Rational !SrcLoc
- | DoubleConst String Rational !SrcLoc
- | LongDoubleConst String Rational !SrcLoc
- | CharConst String Char !SrcLoc
- | StringConst [String] String !SrcLoc
- | AntiConst String !SrcLoc
- | AntiInt String !SrcLoc
- | AntiUInt String !SrcLoc
- | AntiLInt String !SrcLoc
- | AntiULInt String !SrcLoc
- | AntiLLInt String !SrcLoc
- | AntiULLInt String !SrcLoc
- | AntiFloat String !SrcLoc
- | AntiDouble String !SrcLoc
- | AntiLongDouble String !SrcLoc
- | AntiChar String !SrcLoc
- | AntiString String !SrcLoc
- data ExeConfig = ExeConfig {
- exeGridDim :: Exp
- exeBlockDim :: Exp
- exeSharedSize :: Maybe Exp
- exeStream :: Maybe Exp
- exeLoc :: !SrcLoc
- data Exp
- = Var Id !SrcLoc
- | Const Const !SrcLoc
- | BinOp BinOp Exp Exp !SrcLoc
- | Assign Exp AssignOp Exp !SrcLoc
- | PreInc Exp !SrcLoc
- | PostInc Exp !SrcLoc
- | PreDec Exp !SrcLoc
- | PostDec Exp !SrcLoc
- | UnOp UnOp Exp !SrcLoc
- | SizeofExp Exp !SrcLoc
- | SizeofType Type !SrcLoc
- | Cast Type Exp !SrcLoc
- | Cond Exp Exp Exp !SrcLoc
- | Member Exp Id !SrcLoc
- | PtrMember Exp Id !SrcLoc
- | Index Exp Exp !SrcLoc
- | FnCall Exp [Exp] !SrcLoc
- | CudaCall Exp ExeConfig [Exp] !SrcLoc
- | Seq Exp Exp !SrcLoc
- | CompoundLit Type [(Maybe Designation, Initializer)] !SrcLoc
- | StmExpr [BlockItem] !SrcLoc
- | BuiltinVaArg Exp Type !SrcLoc
- | BlockLit BlockType [Attr] [BlockItem] !SrcLoc
- | ObjCMsg ObjCRecv [ObjCArg] [Exp] !SrcLoc
- | ObjCLitConst (Maybe UnOp) Const !SrcLoc
- | ObjCLitString [Const] !SrcLoc
- | ObjCLitBool Bool !SrcLoc
- | ObjCLitArray [Exp] !SrcLoc
- | ObjCLitDict [(Exp, Exp)] !SrcLoc
- | ObjCLitBoxed Exp !SrcLoc
- | ObjCEncode Type !SrcLoc
- | ObjCProtocol Id !SrcLoc
- | ObjCSelector String !SrcLoc
- | AntiExp String !SrcLoc
- | AntiArgs String !SrcLoc
- data BinOp
- data AssignOp
- data UnOp
- data BlockType
- data ObjCRecv
- data ObjCArg = ObjCArg (Maybe Id) (Maybe Exp) !SrcLoc
- ctypedef :: Id -> Decl -> [Attr] -> Typedef
- cdeclSpec :: [Storage] -> [TypeQual] -> TypeSpec -> DeclSpec
- cinitGroup :: DeclSpec -> [Attr] -> [Init] -> InitGroup
- ctypedefGroup :: DeclSpec -> [Attr] -> [Typedef] -> InitGroup
Documentation
data Extensions
data Id
data Storage
data TypeQual
data TypeSpec
Tvoid !SrcLoc | |
Tchar (Maybe Sign) !SrcLoc | |
Tshort (Maybe Sign) !SrcLoc | |
Tint (Maybe Sign) !SrcLoc | |
Tlong (Maybe Sign) !SrcLoc | |
Tlong_long (Maybe Sign) !SrcLoc | |
Tfloat !SrcLoc | |
Tdouble !SrcLoc | |
Tlong_double !SrcLoc | |
Tstruct (Maybe Id) (Maybe [FieldGroup]) [Attr] !SrcLoc | |
Tunion (Maybe Id) (Maybe [FieldGroup]) [Attr] !SrcLoc | |
Tenum (Maybe Id) [CEnum] [Attr] !SrcLoc | |
Tnamed Id [Id] !SrcLoc | |
TtypeofExp Exp !SrcLoc | |
TtypeofType Type !SrcLoc | |
Tva_list !SrcLoc |
data DeclSpec
data ArraySize
There are two types of declarators in C, regular declarators and abstract
declarators. The former is for declaring variables, function parameters,
typedefs, etc. and the latter for abstract types---typedef int
({*}foo)(void)
vs. tt int ({*})(void)
. The difference between the two is
just whether or not an identifier is attached to the declarator. We therefore
only define one Decl
type and use it for both cases.
data Decl
data Type
data Designator
data Designation
data Initializer
data Init
data Typedef
data InitGroup
data Field
data FieldGroup
data CEnum
data Param
data Func
data Definition
FuncDef Func !SrcLoc | |
DecDef InitGroup !SrcLoc | |
EscDef String !SrcLoc | |
ObjCClassDec [Id] !SrcLoc | |
ObjCClassIface Id (Maybe Id) [Id] [ObjCIvarDecl] [ObjCIfaceDecl] [Attr] !SrcLoc | |
ObjCCatIface Id (Maybe Id) [Id] [ObjCIvarDecl] [ObjCIfaceDecl] !SrcLoc | |
ObjCProtDec [Id] !SrcLoc | |
ObjCProtDef Id [Id] [ObjCIfaceDecl] !SrcLoc | |
ObjCClassImpl Id (Maybe Id) [ObjCIvarDecl] [Definition] !SrcLoc | |
ObjCCatImpl Id Id [Definition] !SrcLoc | |
ObjCSynDef [(Id, Maybe Id)] !SrcLoc | |
ObjCDynDef [Id] !SrcLoc | |
ObjCMethDef ObjCMethodProto [BlockItem] !SrcLoc | |
ObjCCompAlias Id Id !SrcLoc | |
AntiFunc String !SrcLoc | |
AntiEsc String !SrcLoc | |
AntiEdecl String !SrcLoc | |
AntiEdecls String !SrcLoc |
data ObjCIvarDecl
data ObjCVisibilitySpec
data ObjCIfaceDecl
data ObjCPropAttr
data ObjCMethodReq
data ObjCParam
data ObjCMethodProto
data Stm
Label Id Stm !SrcLoc | |
Case Exp Stm !SrcLoc | |
Default Stm !SrcLoc | |
Exp (Maybe Exp) !SrcLoc | |
Block [BlockItem] !SrcLoc | |
If Exp Stm (Maybe Stm) !SrcLoc | |
Switch Exp Stm !SrcLoc | |
While Exp Stm !SrcLoc | |
DoWhile Stm Exp !SrcLoc | |
For (Either InitGroup (Maybe Exp)) (Maybe Exp) (Maybe Exp) Stm !SrcLoc | |
Goto Id !SrcLoc | |
Continue !SrcLoc | |
Break !SrcLoc | |
Return (Maybe Exp) !SrcLoc | |
Pragma String !SrcLoc | |
Asm Bool [Attr] [String] [(String, Exp)] [(String, Exp)] [String] !SrcLoc | |
ObjCTry [BlockItem] [ObjCCatch] (Maybe [BlockItem]) !SrcLoc | Invariant: There is either at least one |
ObjCThrow (Maybe Exp) !SrcLoc | |
ObjCSynchronized Exp [BlockItem] !SrcLoc | |
ObjCAutoreleasepool [BlockItem] !SrcLoc | |
AntiPragma String !SrcLoc | |
AntiStm String !SrcLoc | |
AntiStms String !SrcLoc |
data BlockItem
data ObjCCatch
data Const
data ExeConfig
ExeConfig | |
|
data Exp
data BinOp
data AssignOp
data BlockType
data ObjCRecv
data ObjCArg
cinitGroup :: DeclSpec -> [Attr] -> [Init] -> InitGroup
ctypedefGroup :: DeclSpec -> [Attr] -> [Typedef] -> InitGroup