sema

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const SizeOfInt int = 8
View Source
const SizeOfInterface int = 16
View Source
const SizeOfPtr int = 8
View Source
const SizeOfSlice int = 24
View Source
const SizeOfString int = 16
View Source
const SizeOfUint16 int = 2
View Source
const SizeOfUint8 int = 1
View Source
const ThrowFormat string = "%T"

Variables

View Source
var CurrentPkg *ir.PkgContainer
View Source
var ExportedQualifiedIdents = make(map[string]*ast.Ident)
View Source
var GeneralSliceType *types.Type = &types.Type{}
View Source
var MethodSets = make(map[unsafe.Pointer]*ir.NamedType)

https://golang.org/ref/spec#Method_sets @TODO map key should be a QI ?

Functions

func E2T

func E2T(typeExpr ast.Expr) *types.Type

func EvalInt

func EvalInt(expr ast.Expr) int

func FieldList2Types

func FieldList2Types(fieldList *ast.FieldList) []*types.Type

func GetArrayLen

func GetArrayLen(t *types.Type) int

func GetElementTypeOfCollectionType

func GetElementTypeOfCollectionType(t *types.Type) *types.Type

func GetMethodSymbol

func GetMethodSymbol(method *ir.Method) string

func GetPackageSymbol

func GetPackageSymbol(pkgName string, subsymbol string) string

func GetSizeOfType

func GetSizeOfType(t *types.Type) int

func GetStructFieldOffset

func GetStructFieldOffset(field *ast.Field) int

func GetTupleTypes

func GetTupleTypes(rhsMeta ir.MetaExpr) []*types.Type

func GetTypeOfExpr

func GetTypeOfExpr(meta ir.MetaExpr) *types.Type

Types of an expr in Single value context

func GetUnderlyingStructType

func GetUnderlyingStructType(t *types.Type) *ast.StructType

func GetUnderlyingType

func GetUnderlyingType(t *types.Type) *types.Type

func IsBlankIdentifierMeta

func IsBlankIdentifierMeta(m ir.MetaExpr) bool

func IsInterface

func IsInterface(t *types.Type) bool

func IsNil

func IsNil(meta ir.MetaExpr) bool

func IsOkSyntax

func IsOkSyntax(rhs ir.MetaExpr) bool

func Kind

func Kind(t *types.Type) types.TypeKind

func LinePosition

func LinePosition(pos token.Pos) string

func LookupForeignFunc

func LookupForeignFunc(qi ir.QualifiedIdent) *ir.ForeignFunc

func LookupForeignIdent

func LookupForeignIdent(qi ir.QualifiedIdent) *ast.Ident

func LookupStructField

func LookupStructField(structType *ast.StructType, selName string) *ast.Field

func NewFuncValueFromSymbol

func NewFuncValueFromSymbol(symbol string) *ir.FuncValue

func NewNumberLiteral

func NewNumberLiteral(x int) *ir.MetaBasicLit

func NewQI

func NewQI(pkg string, ident string) ir.QualifiedIdent

func Pos

func Pos(node interface{}) token.Pos

func Selector2QI

func Selector2QI(e *ast.SelectorExpr) ir.QualifiedIdent

func SerializeType

func SerializeType(t *types.Type) string

func SetVariable

func SetVariable(obj *ast.Object, vr *ir.Variable)

func Walk

func Walk(pkg *ir.PkgContainer) *ir.AnalyzedPackage

Purpose of walk: - collect string literals - collect method declarations - collect global variables - collect local variables and set offset - determine struct size and field offset - determine Types of variable declarations - attach type to every expression - transmit ok syntax context - (hope) attach type to untyped constants - (hope) transmit the need of interface conversion

func WalkIdent

func WalkIdent(e *ast.Ident, ctx *ir.EvalContext) *ir.MetaIdent

Types

type AstArg

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

Jump to

Keyboard shortcuts

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