hprotoc-2.4.11: Parse Google Protocol Buffer specifications

Safe HaskellNone
LanguageHaskell98

Text.ProtocolBuffers.ProtoCompile.Resolve

Description

This huge module handles the loading and name resolution. The loadProto command recursively gets all the imported proto files. The makeNameMaps command makes the translator from proto name to Haskell name. Many possible errors in the proto data are caught and reported by these operations.

hprotoc will actually resolve more unqualified imported names than Google's protoc which requires more qualified names. I do not have the obsessive nature to fix this.

Synopsis

Documentation

loadProto :: [LocalFP] -> LocalFP -> IO (Env, [FileDescriptorProto]) #

Given a list of paths to search, loads proto files by looking for them in the file system.

loadCodeGenRequest :: CodeGeneratorRequest -> LocalFP -> (Env, [FileDescriptorProto]) #

data Env #

By construction Env is 0 or more Local Entity namespaces followed by 1 or more Global TopLevel namespaces (self and imported files). Entities in first Global TopLevel namespace can refer to each other and to Entities in the list of directly imported TopLevel namespaces only.

Constructors

Local [IName String] EMap Env 
Global TopLevel [TopLevel] 
Instances
Show Env # 
Instance details

Defined in Text.ProtocolBuffers.ProtoCompile.Resolve

Methods

showsPrec :: Int -> Env -> ShowS #

show :: Env -> String #

showList :: [Env] -> ShowS #

data TopLevel #

TopLevel corresponds to all items defined in a .proto file. This includes the FileOptions since this will be consulted when generating the Haskell module names, and the imported files are only known through their TopLevel data.

Instances
Show TopLevel # 
Instance details

Defined in Text.ProtocolBuffers.ProtoCompile.Resolve

data NameMap #

Instances
Show NameMap # 
Instance details

Defined in Text.ProtocolBuffers.ProtoCompile.Resolve

data PackageID a #

Constructors

PackageID 

Fields

NoPackageID 

Fields

Instances
Functor PackageID # 
Instance details

Defined in Text.ProtocolBuffers.ProtoCompile.Resolve

Methods

fmap :: (a -> b) -> PackageID a -> PackageID b #

(<$) :: a -> PackageID b -> PackageID a #

Show a => Show (PackageID a) # 
Instance details

Defined in Text.ProtocolBuffers.ProtoCompile.Resolve