accessors

package
v0.0.0-...-d69f115 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accessor

type Accessor struct {
	// contains filtered or unexported fields
}

func NewAccessor

func NewAccessor(globalSymbolTable *global.Table) *Accessor

func (*Accessor) CToGoUnderlyingType

func (a *Accessor) CToGoUnderlyingType(cIdent *gotypes.Identifier) (*gotypes.Identifier, error)

func (*Accessor) CurrentTable

func (a *Accessor) CurrentTable() (string, symbols.SymbolLookable)

func (*Accessor) FindFirstNonIdSymbol

func (a *Accessor) FindFirstNonIdSymbol(typeDef gotypes.DataType) (gotypes.DataType, error)

func (*Accessor) FindFirstNonidDataType

func (a *Accessor) FindFirstNonidDataType(typeDef gotypes.DataType) (gotypes.DataType, error)

func (*Accessor) FindFirstNonidVariable

func (a *Accessor) FindFirstNonidVariable(typeDef gotypes.DataType) (gotypes.DataType, error)

func (*Accessor) FindLastIdDataType

func (a *Accessor) FindLastIdDataType(typeDef gotypes.DataType) (gotypes.DataType, error)

func (*Accessor) GetBuiltin

func (a *Accessor) GetBuiltin(name string) (*symbols.SymbolDef, symbols.SymbolType, error)

func (*Accessor) GetBuiltinDataType

func (a *Accessor) GetBuiltinDataType(name string) (*symbols.SymbolDef, symbols.SymbolLookable, error)

func (*Accessor) IsBuiltin

func (a *Accessor) IsBuiltin(name string) bool

func (*Accessor) IsBuiltinConstantType

func (a *Accessor) IsBuiltinConstantType(name string) bool

func (*Accessor) IsCIntegral

func (a *Accessor) IsCIntegral(name string) bool

func (*Accessor) IsComplex

func (a *Accessor) IsComplex(name string) bool

func (*Accessor) IsDataTypeInterface

func (a *Accessor) IsDataTypeInterface(typeDef gotypes.DataType) (bool, error)

func (*Accessor) IsFloating

func (a *Accessor) IsFloating(name string) bool

func (*Accessor) IsIntegral

func (a *Accessor) IsIntegral(name string) bool

func (*Accessor) IsPointerType

func (a *Accessor) IsPointerType(def gotypes.DataType) bool

func (*Accessor) IsUintegral

func (a *Accessor) IsUintegral(name string) bool

func (*Accessor) Lookup

Lookup retrieves a definition of identifier ident

func (*Accessor) LookupAllMethods

func (a *Accessor) LookupAllMethods(ident *gotypes.Identifier) (map[string]*symbols.SymbolDef, error)

func (*Accessor) LookupDataType

func (a *Accessor) LookupDataType(ident *gotypes.Identifier) (*symbols.SymbolDef, symbols.SymbolLookable, error)

func (*Accessor) LookupMethod

func (a *Accessor) LookupMethod(ident *gotypes.Identifier, method string) (*symbols.SymbolDef, error)

func (*Accessor) LookupPackage

func (a *Accessor) LookupPackage(packageName string) (symbols.SymbolLookable, error)

func (*Accessor) LookupVariableLike

func (a *Accessor) LookupVariableLike(ident *gotypes.Identifier) (*symbols.SymbolDef, symbols.SymbolLookable, error)

func (*Accessor) ResolveToUnderlyingType

func (a *Accessor) ResolveToUnderlyingType(typeDef gotypes.DataType) (*UnderlyingType, error)

func (*Accessor) RetrieveDataTypeField

func (a *Accessor) RetrieveDataTypeField(accessor *FieldAccessor) (*FieldAttribute, error)

Get a struct's field. Given a struct can embedded another struct from a different package, the method must be able to access symbol tables of other packages. Thus recursively process struct's definition up to all its embedded fields. TODO(jchaloup): return symbol table of the returned data type

func (*Accessor) RetrieveInterfaceMethod

func (a *Accessor) RetrieveInterfaceMethod(pkgsymboltable symbols.SymbolLookable, interfaceDefsymbol *symbols.SymbolDef, method string) (*FieldAttribute, error)

TODO(jchaloup): return symbol table of the returned data type

func (*Accessor) RetrieveQid

func (*Accessor) RetrieveQidDataType

func (a *Accessor) RetrieveQidDataType(qidprefix gotypes.DataType, item *ast.Ident) (symbols.SymbolLookable, *symbols.SymbolDef, error)

func (*Accessor) RetrieveStructFieldAtIndex

func (a *Accessor) RetrieveStructFieldAtIndex(structDef *gotypes.Struct, idx int) (gotypes.DataType, error)

func (*Accessor) SetCurrentTable

func (a *Accessor) SetCurrentTable(packageName string, symbolTable symbols.SymbolLookable) *Accessor

func (*Accessor) TypeToSimpleBuiltin

func (a *Accessor) TypeToSimpleBuiltin(typeDef gotypes.DataType) (*gotypes.Identifier, error)

type FieldAccessor

type FieldAccessor struct {
	// contains filtered or unexported fields
}

func NewFieldAccessor

func NewFieldAccessor(symbolTable symbols.SymbolLookable, dataTypeDef *symbols.SymbolDef, field *ast.Ident) *FieldAccessor

func (*FieldAccessor) SetDropFieldsOnly

func (f *FieldAccessor) SetDropFieldsOnly() *FieldAccessor

func (*FieldAccessor) SetFieldsOnly

func (f *FieldAccessor) SetFieldsOnly() *FieldAccessor

func (*FieldAccessor) SetMethodsOnly

func (f *FieldAccessor) SetMethodsOnly() *FieldAccessor

type FieldAttribute

type FieldAttribute struct {
	// field definition
	gotypes.DataType
	// field's origin
	SymbolTable symbols.SymbolLookable
	// origin of the field
	Origin []*symbols.SymbolDef
	// is the field a method?
	IsMethod bool
}

type UnderlyingType

type UnderlyingType struct {
	Def        gotypes.DataType
	SymbolType string
	Id         string
	Package    string
}

Jump to

Keyboard shortcuts

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