codegen

package
v0.0.0-...-bbc9ce3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2021 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotated

type Annotated interface {
	LookupAttribute(fidlgen.Identifier) (fidlgen.Attribute, bool)
}

TODO(pascallouis): rethink how we depend on the fidlgen package.

type Bits

type Bits struct {
	fidlgen.Bits

	Name       string
	Members    []BitsMember
	TypeSymbol string
	TypeExpr   string
	Mask       uint64
	Documented
}

Bits represents a bits declaration.

type BitsMember

type BitsMember struct {
	Name  string
	Value string
	Documented
}

BitsMember represents a member of a bits declaration.

type Const

type Const struct {
	Type  Type
	Name  string
	Value string
	Documented
}

Const represents a constant declaration.

type Documented

type Documented struct {
	Doc []string
}

Documented is embedded in structs for declarations that may hold documentation.

type Enum

type Enum struct {
	fidlgen.Enum

	Name       string
	Members    []EnumMember
	TypeSymbol string
	TypeExpr   string
	Documented
}

Enum represents an enum declaration.

type EnumMember

type EnumMember struct {
	fidlgen.EnumMember

	Name  string
	Value string
	Documented
}

EnumMember represents a member of an enum declaration.

type FidlGenerator

type FidlGenerator struct{ *fidlgen.Generator }

func NewFidlGenerator

func NewFidlGenerator(dart string) FidlGenerator

func (FidlGenerator) GenerateAsyncFile

func (gen FidlGenerator) GenerateAsyncFile(tree Root, path string) error

func (FidlGenerator) GenerateTestFile

func (gen FidlGenerator) GenerateTestFile(tree Root, path string) error

type Import

type Import struct {
	URL       string
	LocalName string
	AsyncURL  string
}

Import describes another FIDL library that will be imported.

type Method

type Method struct {
	Ordinal     uint64
	OrdinalName string
	Name        string
	HasRequest  bool
	Request     []StructMember
	HasResponse bool
	Response    MethodResponse
	// AsyncResponseClass is a named tuple that wraps the MethodParameters of
	// a response, and is only generated when there is more than one parameter
	AsyncResponseClass string
	AsyncResponseType  string
	CallbackType       string
	TypeSymbol         string
	TypeExpr           string
	Transitional       bool
	Documented
}

Method represents a method declaration within an protocol declaration.

type MethodResponse

type MethodResponse struct {
	// WireParameters represent the parameters of the top level response struct
	// that is sent on the wire
	WireParameters []StructMember
	// MethodParameters represent the parameters that the user interacts with
	// when using generated methods. When HasError is false, this is the same as
	// WireParameters. When HasError is true, MethodParameters corresponds to the
	// fields of a successful response.
	MethodParameters  []StructMember
	HasError          bool
	ResultTypeName    string
	ResultTypeTagName string
	ValueType         Type
	ErrorType         Type
}

type Protocol

type Protocol struct {
	fidlgen.Attributes
	Name        string
	ServiceName string
	ServiceData string
	ProxyName   string
	BindingName string
	EventsName  string
	Methods     []Method
	HasEvents   bool
	Documented
}

Protocol represents an protocol declaration.

type Root

type Root struct {
	LibraryName string
	Imports     []Import
	Consts      []Const
	Enums       []Enum
	Bits        []Bits
	Protocols   []Protocol
	Structs     []Struct
	Tables      []Table
	Unions      []Union
}

Root holds all of the declarations for a FIDL library.

func Compile

func Compile(r fidlgen.Root) Root

Compile the language independent type definition into the Dart-specific representation.

type Struct

type Struct struct {
	Identifier       fidlgen.EncodedCompoundIdentifier
	Name             string
	Members          []StructMember
	Paddings         []StructPadding
	TypeSymbol       string
	TypeExpr         string
	HasNullableField bool
	Documented
	// contains filtered or unexported fields
}

Struct represents a struct declaration.

type StructMember

type StructMember struct {
	Type         Type
	TypeSymbol   string
	Name         string
	DefaultValue string
	OffsetV1     int
	OffsetV2     int

	Documented
	// contains filtered or unexported fields
}

StructMember represents a member of a struct declaration.

type StructPadding

type StructPadding struct {
	OffsetV1, OffsetV2   int
	PaddingV1, PaddingV2 int
}

type Table

type Table struct {
	fidlgen.Table
	Name       string
	Members    []TableMember
	TypeSymbol string
	TypeExpr   string
	Documented
}

Table represents a table declaration.

type TableMember

type TableMember struct {
	Ordinal      int
	Index        int
	Type         Type
	Name         string
	DefaultValue string

	Documented
	// contains filtered or unexported fields
}

TableMember represents a member of a table declaration.

type Type

type Type struct {
	Decl         string // type in traditional bindings
	SyncDecl     string // type in async bindings when referring to traditional bindings
	AsyncDecl    string // type in async bindings when referring to async bindings
	OptionalDecl string // type when the value is optional
	Nullable     bool
	// contains filtered or unexported fields
}

Type represents a FIDL datatype.

type Union

type Union struct {
	fidlgen.Union
	Name          string
	TagName       string
	Members       []UnionMember
	TypeSymbol    string
	TypeExpr      string
	OptTypeSymbol string
	OptTypeExpr   string
	Documented
}

Union represents a union declaration.

type UnionMember

type UnionMember struct {
	Ordinal  uint64
	Type     Type
	Name     string
	CtorName string
	Tag      string
	Documented
}

UnionMember represents a member of a Union declaration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL