Documentation ¶
Overview ¶
Package starcgenx is a Static Analysis Type Assertion shim and Registration Code Generator which provides an extractor to extract types from a package, in order to generate approprate shimsr a package so code can be generated for it.
It's written for use by the starcgen tool, but separate to permit alternative "go/importer" Importers for accessing types from imported packages.
Index ¶
- type Extractor
- func (e *Extractor) Bytes() []byte
- func (e *Extractor) FromAsts(imp types.Importer, fset *token.FileSet, files []*ast.File) error
- func (e *Extractor) Generate(filename string) []byte
- func (e *Extractor) NameType(t types.Type) string
- func (e *Extractor) Print(s string)
- func (e *Extractor) Printf(f string, args ...any)
- func (e *Extractor) Summary()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Extractor ¶
type Extractor struct { Package string // Debug enables printing out the analysis information to the output. Debug bool // LegacyIdentifiers disables parts of the code generator analysis // requiring a list of identifiers to be passed in. Notably this // disables RegisterDoFn support. LegacyIdentifiers bool // Ids is an optional slice of package local identifiers Ids []string // contains filtered or unexported fields }
Extractor contains and uniquifies the cache of types and things that need to be generated.
func NewExtractor ¶
NewExtractor returns an extractor for the given package.
func (*Extractor) Generate ¶
Generate produces an additional file for the Go package that was extracted, to be included in a subsequent compilation.
func (*Extractor) NameType ¶
NameType turns a reflect.Type into a string based on it's name. It prefixes Emit or Iter if the function satisfies the constrains of those types.