Safe Haskell | None |
---|---|
Language | Haskell2010 |
Fairly straightforward AST encoding of the .proto grammar
Synopsis
- newtype MessageName = MessageName {}
- newtype FieldName = FieldName {}
- newtype PackageName = PackageName {}
- data DotProtoIdentifier
- data DotProtoImport = DotProtoImport {}
- data DotProtoImportQualifier
- data DotProtoPackageSpec
- data DotProtoOption = DotProtoOption {}
- data DotProtoDefinition
- data DotProtoMeta = DotProtoMeta {}
- data DotProto = DotProto {}
- data DotProtoValue
- data DotProtoPrimType
- data Packing
- newtype Path = Path {
- components :: [String]
- data DotProtoType
- type DotProtoEnumValue = Int
- data DotProtoEnumPart
- data Streaming
- data DotProtoServicePart
- data DotProtoMessagePart
- data DotProtoField
- data DotProtoReservedField
Types
newtype MessageName Source #
The name of a message
Instances
Eq MessageName Source # | |
Defined in Proto3.Suite.DotProto.AST (==) :: MessageName -> MessageName -> Bool # (/=) :: MessageName -> MessageName -> Bool # | |
Ord MessageName Source # | |
Defined in Proto3.Suite.DotProto.AST compare :: MessageName -> MessageName -> Ordering # (<) :: MessageName -> MessageName -> Bool # (<=) :: MessageName -> MessageName -> Bool # (>) :: MessageName -> MessageName -> Bool # (>=) :: MessageName -> MessageName -> Bool # max :: MessageName -> MessageName -> MessageName # min :: MessageName -> MessageName -> MessageName # | |
Show MessageName Source # | |
Defined in Proto3.Suite.DotProto.AST showsPrec :: Int -> MessageName -> ShowS # show :: MessageName -> String # showList :: [MessageName] -> ShowS # | |
IsString MessageName Source # | |
Defined in Proto3.Suite.DotProto.AST fromString :: String -> MessageName # |
The name of some field
newtype PackageName Source #
The name of the package
Instances
Eq PackageName Source # | |
Defined in Proto3.Suite.DotProto.AST (==) :: PackageName -> PackageName -> Bool # (/=) :: PackageName -> PackageName -> Bool # | |
Ord PackageName Source # | |
Defined in Proto3.Suite.DotProto.AST compare :: PackageName -> PackageName -> Ordering # (<) :: PackageName -> PackageName -> Bool # (<=) :: PackageName -> PackageName -> Bool # (>) :: PackageName -> PackageName -> Bool # (>=) :: PackageName -> PackageName -> Bool # max :: PackageName -> PackageName -> PackageName # min :: PackageName -> PackageName -> PackageName # | |
Show PackageName Source # | |
Defined in Proto3.Suite.DotProto.AST showsPrec :: Int -> PackageName -> ShowS # show :: PackageName -> String # showList :: [PackageName] -> ShowS # | |
IsString PackageName Source # | |
Defined in Proto3.Suite.DotProto.AST fromString :: String -> PackageName # |
data DotProtoIdentifier Source #
Instances
data DotProtoImport Source #
Top-level import declaration
Instances
data DotProtoImportQualifier Source #
Instances
data DotProtoPackageSpec Source #
The namespace declaration
Instances
Eq DotProtoPackageSpec Source # | |
Defined in Proto3.Suite.DotProto.AST (==) :: DotProtoPackageSpec -> DotProtoPackageSpec -> Bool # (/=) :: DotProtoPackageSpec -> DotProtoPackageSpec -> Bool # | |
Show DotProtoPackageSpec Source # | |
Defined in Proto3.Suite.DotProto.AST showsPrec :: Int -> DotProtoPackageSpec -> ShowS # show :: DotProtoPackageSpec -> String # showList :: [DotProtoPackageSpec] -> ShowS # | |
Arbitrary DotProtoPackageSpec Source # | |
Defined in Proto3.Suite.DotProto.AST | |
Pretty DotProtoPackageSpec Source # | |
Defined in Proto3.Suite.DotProto.Rendering pPrintPrec :: PrettyLevel -> Rational -> DotProtoPackageSpec -> Doc # pPrint :: DotProtoPackageSpec -> Doc # pPrintList :: PrettyLevel -> [DotProtoPackageSpec] -> Doc # |
data DotProtoOption Source #
An option id/value pair, can be attached to many types of statements
Instances
data DotProtoDefinition Source #
Top-level protocol definitions
DotProtoMessage DotProtoIdentifier [DotProtoMessagePart] | |
DotProtoEnum DotProtoIdentifier [DotProtoEnumPart] | |
DotProtoService DotProtoIdentifier [DotProtoServicePart] |
Instances
Eq DotProtoDefinition Source # | |
Defined in Proto3.Suite.DotProto.AST (==) :: DotProtoDefinition -> DotProtoDefinition -> Bool # (/=) :: DotProtoDefinition -> DotProtoDefinition -> Bool # | |
Show DotProtoDefinition Source # | |
Defined in Proto3.Suite.DotProto.AST showsPrec :: Int -> DotProtoDefinition -> ShowS # show :: DotProtoDefinition -> String # showList :: [DotProtoDefinition] -> ShowS # | |
Arbitrary DotProtoDefinition Source # | |
Defined in Proto3.Suite.DotProto.AST |
data DotProtoMeta Source #
Tracks misc metadata about the AST
DotProtoMeta | |
|
Instances
Eq DotProtoMeta Source # | |
Defined in Proto3.Suite.DotProto.AST (==) :: DotProtoMeta -> DotProtoMeta -> Bool # (/=) :: DotProtoMeta -> DotProtoMeta -> Bool # | |
Show DotProtoMeta Source # | |
Defined in Proto3.Suite.DotProto.AST showsPrec :: Int -> DotProtoMeta -> ShowS # show :: DotProtoMeta -> String # showList :: [DotProtoMeta] -> ShowS # | |
Arbitrary DotProtoMeta Source # | |
Defined in Proto3.Suite.DotProto.AST arbitrary :: Gen DotProtoMeta # shrink :: DotProtoMeta -> [DotProtoMeta] # |
This data structure represents a .proto file The actual source order of protobuf statements isn't meaningful so statements are sorted by type during parsing. A .proto file with more than one package declaration is considered invalid.
data DotProtoValue Source #
Matches the definition of constant
in the proto3 language spec
These are only used as rvalues
Instances
data DotProtoPrimType Source #
Int32 | |
Int64 | |
SInt32 | |
SInt64 | |
UInt32 | |
UInt64 | |
Fixed32 | |
Fixed64 | |
SFixed32 | |
SFixed64 | |
String | |
Bytes | |
Bool | |
Float | |
Double | |
Named DotProtoIdentifier | A named type, referring to another message or enum defined in the same file |
Instances
Eq DotProtoPrimType Source # | |
Defined in Proto3.Suite.DotProto.AST (==) :: DotProtoPrimType -> DotProtoPrimType -> Bool # (/=) :: DotProtoPrimType -> DotProtoPrimType -> Bool # | |
Show DotProtoPrimType Source # | |
Defined in Proto3.Suite.DotProto.AST showsPrec :: Int -> DotProtoPrimType -> ShowS # show :: DotProtoPrimType -> String # showList :: [DotProtoPrimType] -> ShowS # | |
Arbitrary DotProtoPrimType Source # | |
Defined in Proto3.Suite.DotProto.AST arbitrary :: Gen DotProtoPrimType # shrink :: DotProtoPrimType -> [DotProtoPrimType] # | |
Pretty DotProtoPrimType Source # | |
Defined in Proto3.Suite.DotProto.Rendering pPrintPrec :: PrettyLevel -> Rational -> DotProtoPrimType -> Doc # pPrint :: DotProtoPrimType -> Doc # pPrintList :: PrettyLevel -> [DotProtoPrimType] -> Doc # |
data DotProtoType Source #
This type is an almagamation of the modifiers used in types. It corresponds to a syntax role but not a semantic role, not all modifiers are meaningful in every type context.
Prim DotProtoPrimType | |
Optional DotProtoPrimType | |
Repeated DotProtoPrimType | |
NestedRepeated DotProtoPrimType | |
Map DotProtoPrimType DotProtoPrimType |
Instances
Eq DotProtoType Source # | |
Defined in Proto3.Suite.DotProto.AST (==) :: DotProtoType -> DotProtoType -> Bool # (/=) :: DotProtoType -> DotProtoType -> Bool # | |
Show DotProtoType Source # | |
Defined in Proto3.Suite.DotProto.AST showsPrec :: Int -> DotProtoType -> ShowS # show :: DotProtoType -> String # showList :: [DotProtoType] -> ShowS # | |
Arbitrary DotProtoType Source # | |
Defined in Proto3.Suite.DotProto.AST arbitrary :: Gen DotProtoType # shrink :: DotProtoType -> [DotProtoType] # | |
Pretty DotProtoType Source # | |
Defined in Proto3.Suite.DotProto.Rendering pPrintPrec :: PrettyLevel -> Rational -> DotProtoType -> Doc # pPrint :: DotProtoType -> Doc # pPrintList :: PrettyLevel -> [DotProtoType] -> Doc # |
type DotProtoEnumValue = Int Source #
data DotProtoEnumPart Source #
DotProtoEnumField DotProtoIdentifier DotProtoEnumValue [DotProtoOption] | |
DotProtoEnumOption DotProtoOption | |
DotProtoEnumEmpty |
Instances
Eq DotProtoEnumPart Source # | |
Defined in Proto3.Suite.DotProto.AST (==) :: DotProtoEnumPart -> DotProtoEnumPart -> Bool # (/=) :: DotProtoEnumPart -> DotProtoEnumPart -> Bool # | |
Show DotProtoEnumPart Source # | |
Defined in Proto3.Suite.DotProto.AST showsPrec :: Int -> DotProtoEnumPart -> ShowS # show :: DotProtoEnumPart -> String # showList :: [DotProtoEnumPart] -> ShowS # | |
Arbitrary DotProtoEnumPart Source # | |
Defined in Proto3.Suite.DotProto.AST arbitrary :: Gen DotProtoEnumPart # shrink :: DotProtoEnumPart -> [DotProtoEnumPart] # |
data DotProtoServicePart Source #
DotProtoServiceRPC DotProtoIdentifier (DotProtoIdentifier, Streaming) (DotProtoIdentifier, Streaming) [DotProtoOption] | |
DotProtoServiceOption DotProtoOption | |
DotProtoServiceEmpty |
Instances
Eq DotProtoServicePart Source # | |
Defined in Proto3.Suite.DotProto.AST (==) :: DotProtoServicePart -> DotProtoServicePart -> Bool # (/=) :: DotProtoServicePart -> DotProtoServicePart -> Bool # | |
Show DotProtoServicePart Source # | |
Defined in Proto3.Suite.DotProto.AST showsPrec :: Int -> DotProtoServicePart -> ShowS # show :: DotProtoServicePart -> String # showList :: [DotProtoServicePart] -> ShowS # | |
Arbitrary DotProtoServicePart Source # | |
Defined in Proto3.Suite.DotProto.AST | |
Pretty DotProtoServicePart Source # | |
Defined in Proto3.Suite.DotProto.Rendering pPrintPrec :: PrettyLevel -> Rational -> DotProtoServicePart -> Doc # pPrint :: DotProtoServicePart -> Doc # pPrintList :: PrettyLevel -> [DotProtoServicePart] -> Doc # |
data DotProtoMessagePart Source #
DotProtoMessageField DotProtoField | |
DotProtoMessageOneOf | |
DotProtoMessageDefinition DotProtoDefinition | |
DotProtoMessageReserved [DotProtoReservedField] |
Instances
Eq DotProtoMessagePart Source # | |
Defined in Proto3.Suite.DotProto.AST (==) :: DotProtoMessagePart -> DotProtoMessagePart -> Bool # (/=) :: DotProtoMessagePart -> DotProtoMessagePart -> Bool # | |
Show DotProtoMessagePart Source # | |
Defined in Proto3.Suite.DotProto.AST showsPrec :: Int -> DotProtoMessagePart -> ShowS # show :: DotProtoMessagePart -> String # showList :: [DotProtoMessagePart] -> ShowS # | |
Arbitrary DotProtoMessagePart Source # | |
Defined in Proto3.Suite.DotProto.AST |
data DotProtoField Source #
Instances
Eq DotProtoField Source # | |
Defined in Proto3.Suite.DotProto.AST (==) :: DotProtoField -> DotProtoField -> Bool # (/=) :: DotProtoField -> DotProtoField -> Bool # | |
Show DotProtoField Source # | |
Defined in Proto3.Suite.DotProto.AST showsPrec :: Int -> DotProtoField -> ShowS # show :: DotProtoField -> String # showList :: [DotProtoField] -> ShowS # | |
Arbitrary DotProtoField Source # | |
Defined in Proto3.Suite.DotProto.AST arbitrary :: Gen DotProtoField # shrink :: DotProtoField -> [DotProtoField] # |
data DotProtoReservedField Source #
Instances
Eq DotProtoReservedField Source # | |
Defined in Proto3.Suite.DotProto.AST (==) :: DotProtoReservedField -> DotProtoReservedField -> Bool # (/=) :: DotProtoReservedField -> DotProtoReservedField -> Bool # | |
Show DotProtoReservedField Source # | |
Defined in Proto3.Suite.DotProto.AST showsPrec :: Int -> DotProtoReservedField -> ShowS # show :: DotProtoReservedField -> String # showList :: [DotProtoReservedField] -> ShowS # | |
Arbitrary DotProtoReservedField Source # | |
Defined in Proto3.Suite.DotProto.AST | |
Pretty DotProtoReservedField Source # | |
Defined in Proto3.Suite.DotProto.Rendering pPrintPrec :: PrettyLevel -> Rational -> DotProtoReservedField -> Doc # pPrint :: DotProtoReservedField -> Doc # pPrintList :: PrettyLevel -> [DotProtoReservedField] -> Doc # |