generate

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatCode

func FormatCode(dir string)

func RemoveGeneratedCode

func RemoveGeneratedCode(dir string)

Types

type Generator

type Generator struct {
	*SymbolCache
	Platform  string
	Version   int
	Framework string
	// contains filtered or unexported fields
}

func (*Generator) AllowedEnumAlias

func (db *Generator) AllowedEnumAlias(s Symbol) bool

func (*Generator) EnumValues

func (db *Generator) EnumValues(framework string) (symbols []Symbol)

func (*Generator) Generate

func (db *Generator) Generate(platform string, version int, rootDir string, framework string, ignoreTypes set.Set[string])

func (*Generator) Members

func (db *Generator) Members(fw string, sym Symbol, covariantTypes []string) (properties []*codegen.Property, methods []*codegen.Method)

func (*Generator) ParseType

func (db *Generator) ParseType(ti declparse.TypeInfo) (typ typing.Type)

func (*Generator) ResolveTypeAlias

func (db *Generator) ResolveTypeAlias(typeName string) (declparse.TypeInfo, bool)

func (*Generator) ToClassGen

func (db *Generator) ToClassGen(sym Symbol) *codegen.Class

func (*Generator) ToEnumInfo

func (db *Generator) ToEnumInfo(fw string, sym Symbol) *codegen.AliasInfo

func (*Generator) ToProtocolGen

func (db *Generator) ToProtocolGen(fw string, sym Symbol) *codegen.Protocol

func (*Generator) TypeFromSymbol

func (db *Generator) TypeFromSymbol(sym Symbol) typing.Type

func (*Generator) TypeFromSymbolName

func (db *Generator) TypeFromSymbolName(name string) typing.Type

type Parameter

type Parameter struct {
	Name        string
	Description string
}

type Platform

type Platform struct {
	Name         string
	IntroducedAt string
	Current      string
	Beta         bool
	Deprecated   bool
	DeprecatedAt string
}

type Symbol

type Symbol struct {
	Name string
	Path string
	Kind string // Class, Constant, Enum, Framework, Function, Macro, Method, Property, Protocol, Struct, Type

	Description   string
	Type          string
	Parent        string
	Modules       []string
	Platforms     []Platform
	Declaration   string
	Declarations  map[string]string
	Parameters    []Parameter
	Return        string
	Deprecated    bool
	InheritedFrom string
}

func (Symbol) DocURL

func (s Symbol) DocURL() string

func (Symbol) HasFramework

func (s Symbol) HasFramework(name string) bool

func (Symbol) HasPlatform

func (s Symbol) HasPlatform(name string, version int, deprecated bool) bool

func (Symbol) MainModule

func (s Symbol) MainModule() *modules.Module

func (Symbol) Parse

func (s Symbol) Parse(platform string) (*declparse.Statement, error)

type SymbolCache

type SymbolCache struct {
	*zip.ReadCloser
	// contains filtered or unexported fields
}

func OpenSymbols

func OpenSymbols(filename string) (*SymbolCache, error)

func (*SymbolCache) AllSymbols

func (db *SymbolCache) AllSymbols() (symbols []Symbol)

func (*SymbolCache) FindTypeSymbol

func (db *SymbolCache) FindTypeSymbol(name string) *Symbol

func (*SymbolCache) ModuleSymbol

func (db *SymbolCache) ModuleSymbol(m modules.Module) *Symbol

func (*SymbolCache) ModuleSymbols

func (db *SymbolCache) ModuleSymbols(module string) (symbols []Symbol)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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