Copyright | (c) Microsoft |
---|---|
License | MIT |
Maintainer | adamsap@microsoft.com |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell98 |
A suite of types describing the abstract syntax tree of the Bond schema definition language.
- data Bond = Bond {
- bondImports :: [Import]
- bondNamespaces :: [Namespace]
- bondDeclarations :: [Declaration]
- type QualifiedName = [String]
- data Import = Import FilePath
- data Namespace = Namespace {}
- data Declaration
- = Struct {
- declNamespaces :: [Namespace]
- declAttributes :: [Attribute]
- declName :: String
- declParams :: [TypeParam]
- structBase :: Maybe Type
- structFields :: [Field]
- | Enum {
- declNamespaces :: [Namespace]
- declAttributes :: [Attribute]
- declName :: String
- enumConstants :: [Constant]
- | Forward {
- declNamespaces :: [Namespace]
- declName :: String
- declParams :: [TypeParam]
- | Alias {
- declNamespaces :: [Namespace]
- declName :: String
- declParams :: [TypeParam]
- aliasType :: Type
- | Service {
- declNamespaces :: [Namespace]
- declAttributes :: [Attribute]
- declName :: String
- declParams :: [TypeParam]
- serviceMethods :: [Method]
- = Struct {
- data Field = Field {}
- data Default
- data Modifier
- data Constant = Constant {}
- data Type
- = BT_Int8
- | BT_Int16
- | BT_Int32
- | BT_Int64
- | BT_UInt8
- | BT_UInt16
- | BT_UInt32
- | BT_UInt64
- | BT_Float
- | BT_Double
- | BT_Bool
- | BT_String
- | BT_WString
- | BT_MetaName
- | BT_MetaFullName
- | BT_Blob
- | BT_Maybe Type
- | BT_List Type
- | BT_Vector Type
- | BT_Nullable Type
- | BT_Set Type
- | BT_Map Type Type
- | BT_Bonded Type
- | BT_IntTypeArg Int
- | BT_TypeParam TypeParam
- | BT_UserDefined Declaration [Type]
- data TypeParam = TypeParam {}
- data Constraint = Value
- data Method
- data Attribute = Attribute {}
- data Language
Schema definition file
The top level type representing the Bond schema definition abstract syntax tree.
Bond | |
|
type QualifiedName = [String] Source #
Represents fully qualified name
Namespace declaration.
Declarations
data Declaration Source #
Bond schema declaration
Struct | |
| |
Enum | |
| |
Forward | |
| |
Alias | |
| |
Service | |
|
Definition of a Struct
field.
Field | |
|
Default value of a field.
DefaultBool Bool | |
DefaultInteger Integer | |
DefaultFloat Double | |
DefaultString String | |
DefaultEnum String | name of an enum |
DefaultNothing | explicitly specified default value of |
Specifies whether a field is required or optional.
Optional | field is optional and may be omitted during serialization |
Required | field is required, deserialization will fail if it is missing |
RequiredOptional | deserialization will not fail if the field is missing but it can't be omitted during serialization |
Definition of an Enum
constant.
Types
Type in the Bond type system
BT_Int8 | |
BT_Int16 | |
BT_Int32 | |
BT_Int64 | |
BT_UInt8 | |
BT_UInt16 | |
BT_UInt32 | |
BT_UInt64 | |
BT_Float | |
BT_Double | |
BT_Bool | |
BT_String | |
BT_WString | |
BT_MetaName | |
BT_MetaFullName | |
BT_Blob | |
BT_Maybe Type | type for fields with the default value of |
BT_List Type | |
BT_Vector Type | |
BT_Nullable Type | |
BT_Set Type | |
BT_Map Type Type | |
BT_Bonded Type | |
BT_IntTypeArg Int | an integer argument in an instance of a generic type |
BT_TypeParam TypeParam | |
BT_UserDefined Declaration [Type] | user defined type or an instance of a generic type with the specified type arguments |
Comm
Method of a service
Function | |
| |
Event | |
|
Metadata
Attribute for attaching user defined metadata to a Declaration
or a Field