| Copyright | (c) Microsoft |
|---|---|
| License | MIT |
| Maintainer | adamsap@microsoft.com |
| Stability | provisional |
| Portability | portable |
| Safe Haskell | Safe |
| Language | Haskell98 |
Language.Bond.Syntax.Types
Description
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.
Constructors
| Bond | |
Fields
| |
type QualifiedName = [String] Source #
Represents fully qualified name
Import declaration.
Declarations
data Declaration Source #
Bond schema declaration
Constructors
| Struct | |
Fields
| |
| Enum | |
Fields
| |
| Forward | |
Fields
| |
| Alias | |
Fields
| |
| Service | |
Fields
| |
Instances
Definition of a Struct field.
Constructors
| Field | |
Fields
| |
Default value of a field.
Constructors
| 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.
Constructors
| 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.
Constructors
| Constant | |
Fields
| |
Types
Type in the Bond type system
Constructors
| 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 |
Constructors
| TypeParam | |
Fields | |
data Constraint Source #
Constraint on a TypeParam.
Constructors
| Value | the type parameter allows only value types |
Instances
Comm
Method of a service
Constructors
| Function | |
Fields
| |
| Event | |
Fields
| |
Metadata
Attribute for attaching user defined metadata to a Declaration or a Field
Constructors
| Attribute | |
Fields
| |