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 ...interface{})
- 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 // 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) Bytes ¶
Bytes forwards to fmt.Fprint to the extractor buffer.
func (*Extractor) FromAsts ¶
FromAsts analyses the contents of a 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.
func (*Extractor) Print ¶
Print forwards to fmt.Fprint to the extractor buffer.
func (*Extractor) Printf ¶
Printf forwards to fmt.Printf to the extractor buffer.