Documentation ¶
Index ¶
- Variables
- func GenerateIDL(writer io.Writer, packageName string, objs map[string]object.MetaObject) error
- func NewRefType(name string, scope Scope) signature.Type
- func ParseIDL(reader io.Reader) ([]object.MetaObject, error)
- type Context
- type InterfaceType
- func (s *InterfaceType) Marshal(id string, writer string) *jen.Statement
- func (s *InterfaceType) MetaObject() object.MetaObject
- func (s *InterfaceType) Reader() signature.TypeReader
- func (s *InterfaceType) RegisterTo(set *signature.TypeSet)
- func (s *InterfaceType) Signature() string
- func (s *InterfaceType) SignatureIDL() string
- func (s *InterfaceType) Type() reflect.Type
- func (s *InterfaceType) TypeDeclaration(f *jen.File)
- func (s *InterfaceType) TypeName() *jen.Statement
- func (s *InterfaceType) Unmarshal(reader string) *jen.Statement
- type Method
- type Namespace
- type PackageDeclaration
- type Parameter
- type Property
- type RefType
- func (r *RefType) Marshal(id string, writer string) *signature.Statement
- func (r *RefType) Reader() signature.TypeReader
- func (r *RefType) RegisterTo(set *signature.TypeSet)
- func (r *RefType) Signature() string
- func (r *RefType) SignatureIDL() string
- func (r *RefType) Type() reflect.Type
- func (r *RefType) TypeDeclaration(file *jen.File)
- func (r *RefType) TypeName() *signature.Statement
- func (r *RefType) Unmarshal(reader string) *signature.Statement
- type Scope
- type Signal
- type Statement
Constants ¶
This section is empty.
Variables ¶
var InterfaceTypeForStub = false
InterfaceTypeForStub is a global flags which informs the InterfaceType instances if they are used in the context of the generation of a stub.
Functions ¶
func GenerateIDL ¶
GenerateIDL writes the IDL definition for the meta object in objs. a MetaObject into a writer. This IDL definition can be used to re-create the MetaObject with the method ParseIDL.
func NewRefType ¶
NewRefType is a contructor for the representation of a type reference to be resolved with a TypeSet.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context catures the current state of the parser.
type InterfaceType ¶
type InterfaceType struct { Name string PackageName string Methods map[uint32]Method Signals map[uint32]Signal Properties map[uint32]Property Scope Scope Namespace Namespace ForStub bool }
InterfaceType represents a parsed IDL interface. It implements signature.Type.
func (*InterfaceType) Marshal ¶
func (s *InterfaceType) Marshal(id string, writer string) *jen.Statement
Marshal returns a statement which represent the code needed to put the variable "id" into the io.Writer "writer" while returning an error.
func (*InterfaceType) MetaObject ¶
func (s *InterfaceType) MetaObject() object.MetaObject
MetaObject returs the MetaObject describing the interface.
func (*InterfaceType) Reader ¶
func (s *InterfaceType) Reader() signature.TypeReader
Reader returns a TypeReader for object references
func (*InterfaceType) RegisterTo ¶
func (s *InterfaceType) RegisterTo(set *signature.TypeSet)
RegisterTo adds the type to the type set.
func (*InterfaceType) SignatureIDL ¶
func (s *InterfaceType) SignatureIDL() string
SignatureIDL returns "obj".
func (*InterfaceType) Type ¶
func (s *InterfaceType) Type() reflect.Type
func (*InterfaceType) TypeDeclaration ¶
func (s *InterfaceType) TypeDeclaration(f *jen.File)
TypeDeclaration writes the type declaration into file. It generates the proxy for the interface.
func (*InterfaceType) TypeName ¶
func (s *InterfaceType) TypeName() *jen.Statement
TypeName returns a statement to be inserted when the type is to be declared.
type Method ¶
Method represents the signature of a method describe in an IDL file.
func (Method) Meta ¶
func (m Method) Meta(id uint32) object.MetaMethod
Meta translate the method signature into a MetaMethod use in a MetaObject. There is not a one-to-one mapping between the two structures: Method capture the reference to other interface (object) while MetaMethod treats all object with a generic reference.
type Namespace ¶
Namespace represents a set of packages extracted from IDL files. Each package is given a name and a set of types.
type PackageDeclaration ¶
PackageDeclaration is the result of the parsing of an IDL file. It represents a package declaration containing a package name and a list of declared types.
func ParsePackage ¶
func ParsePackage(input []byte) (*PackageDeclaration, error)
ParsePackage takes an IDL file as input, parse it and returns a PackageDeclaration.
type Property ¶
Property represents a property
func (Property) Meta ¶
func (p Property) Meta(id uint32) object.MetaProperty
Meta converts a property to a MetaProperty.
type RefType ¶
RefType represents a reference to an IDL interface. It implements signature.Type.
func (*RefType) Marshal ¶
Marshal returns a statement which represent the code needed to put the variable "id" into the io.Writer "writer" while returning an error.
func (*RefType) Reader ¶
func (r *RefType) Reader() signature.TypeReader
Reader returns a TypeReader of the referenced type.
func (*RefType) RegisterTo ¶
RegisterTo adds the type to the type set. Does nothing on RefType.
func (*RefType) Signature ¶
Signature returns the signature of the referenced type. If the reference can not be resolved, it returns an invalid struct type with a name describing the error.
func (*RefType) SignatureIDL ¶
SignatureIDL returns the IDL signature of the referenced type. If the reference can not be resolved, it returns an invalid name describing the error.
func (*RefType) TypeDeclaration ¶
TypeDeclaration writes the type declaration into file.
type Scope ¶
type Scope interface { Add(name string, typ signature.Type) error Search(name string) (signature.Type, error) Extend(namespace string, other Scope) error }
Scope represents the scope of a type in which type declarations are resolved.