Portability | portable |
---|---|
Stability | provisional |
Maintainer | Antoine Latter <aslatter@gmail.com> |
Defines types inteneded to be equivalent to the schema used by the XCB project in their XML protocol description.
- data XHeader = XHeader {}
- data XDecl
- data StructElem
- = Pad Int
- | List Name Type (Maybe Expression)
- | SField Name Type
- | ExprField Name Type Expression
- | ValueParam Type MaskName (Maybe MaskPadding) ListName
- type Name = String
- type XReply = [StructElem]
- type Ref = String
- type MaskName = Name
- type ListName = Name
- type MaskPadding = Int
- data Type
- = UnQualType Name
- | QualType Name Name
- data XidUnionElem = XidUnionElem Type
- data EnumElem = EnumElem Name (Maybe Expression)
- data Expression
- = Value Int
- | Bit Int
- | FieldRef String
- | Op Binop Expression Expression
- data Binop
Documentation
This is what a single XML file maps to. It contains some meta-data then declarations.
XHeader | |
|
The different types of declarations which can be made in one of the XML files.
XStruct Name [StructElem] | |
XTypeDef Name Type | |
XEvent Name Int [StructElem] (Maybe Bool) | The boolean indicates if the event includes a sequence number. |
XRequest Name Int [StructElem] (Maybe XReply) | |
XidType Name | |
XidUnion Name [XidUnionElem] | |
XEnum Name [EnumElem] | |
XUnion Name [StructElem] | |
XImport Name | |
XError Name Int [StructElem] |
data StructElem Source
type XReply = [StructElem]Source
type MaskPadding = IntSource
Types may include a reference to the containing module.
data Expression Source
Declarations may contain expressions from this small language
Value Int | A literal value |
Bit Int | A log-base-2 literal value |
FieldRef String | A reference to a field in the same declaration |
Op Binop Expression Expression | A binary opeation |