Documentation
¶
Overview ¶
Code generated by cmd/genstdlib/main.go; DO NOT EDIT.
Index ¶
- func LoadPackage(absolutePath string, optionalConfig *packages.Config) (*packages.Package, error)
- func Map[T, U any](ts []T, f func(T) U) []U
- func RunPackageFunction(pkg *Package, functionName string, optionalVM *VM) error
- func WalkPackageFunction(pkg *Package, functionName string, optionalVM *VM) error
- type ArrayType
- type AssignStmt
- type BasicLit
- type BinaryExpr
- type BinaryExprValue
- func (b BinaryExprValue) BoolEval(left bool) reflect.Value
- func (b BinaryExprValue) ComplexOpComplex(left, right complex128) reflect.Value
- func (b BinaryExprValue) Eval() reflect.Value
- func (b BinaryExprValue) FloatEval(left float64) reflect.Value
- func (b BinaryExprValue) FloatOpFloat(left float64, right float64) reflect.Value
- func (b BinaryExprValue) IntEval(left int64) reflect.Value
- func (b BinaryExprValue) IntOpInt(left int64, right int64) reflect.Value
- func (b BinaryExprValue) IsValid() bool
- func (b BinaryExprValue) StringEval(left string) reflect.Value
- func (b BinaryExprValue) UIntEval(left uint64) reflect.Value
- func (b BinaryExprValue) UIntOpUInt(left uint64, right uint64) reflect.Value
- type BlockStmt
- type BranchStmt
- type CallExpr
- type CanAssign
- type CanCompose
- type CanDeclare
- type CanInstantiate
- type CaseClause
- type CompositeLit
- type ConstOrVar
- type Decl
- type DeclStmt
- type DeferStmt
- type Ellipsis
- type Env
- type Environment
- type Evaluable
- type Expr
- type ExprStmt
- type Field
- type FieldList
- type FieldSelectable
- type Flowable
- type ForStmt
- type FuncDecl
- type FuncLit
- type FuncType
- type HasZeroValue
- type Ident
- type IfStmt
- type ImportSpec
- type IncDecStmt
- type IndexExpr
- type Instance
- type KeyValue
- type KeyValueExpr
- type LabeledStmt
- type MapType
- type Package
- type PkgEnvironment
- type RangeStmt
- type ReflectLenExpr
- type ReturnStmt
- type SelectorExpr
- type StandardPackage
- type StarExpr
- type Step
- type StepTaker
- type Stmt
- type StructType
- type SwitchStmt
- type Traverseable
- type TypeSpec
- type UnaryExpr
- type VM
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadPackage ¶
func RunPackageFunction ¶
Types ¶
type ArrayType ¶
func (ArrayType) LiteralCompose ¶
composite is (a reflect on) a Go array or slice
type AssignStmt ¶
type AssignStmt struct {
*ast.AssignStmt
Lhs []Expr
Rhs []Expr
}
func (AssignStmt) Eval ¶
func (a AssignStmt) Eval(vm *VM)
func (AssignStmt) Flow ¶
func (a AssignStmt) Flow(g *graphBuilder) (head Step)
func (AssignStmt) String ¶
func (a AssignStmt) String() string
type BinaryExpr ¶
type BinaryExpr struct {
*ast.BinaryExpr
X Expr // left
Y Expr // right
}
func (BinaryExpr) Eval ¶
func (s BinaryExpr) Eval(vm *VM)
func (BinaryExpr) Flow ¶
func (s BinaryExpr) Flow(g *graphBuilder) (head Step)
func (BinaryExpr) String ¶
func (s BinaryExpr) String() string
type BinaryExprValue ¶
type BinaryExprValue struct {
// contains filtered or unexported fields
}
func (BinaryExprValue) ComplexOpComplex ¶
func (b BinaryExprValue) ComplexOpComplex(left, right complex128) reflect.Value
func (BinaryExprValue) Eval ¶
func (b BinaryExprValue) Eval() reflect.Value
func (BinaryExprValue) FloatOpFloat ¶
func (b BinaryExprValue) FloatOpFloat(left float64, right float64) reflect.Value
func (BinaryExprValue) IntOpInt ¶
func (b BinaryExprValue) IntOpInt(left int64, right int64) reflect.Value
func (BinaryExprValue) IsValid ¶
func (b BinaryExprValue) IsValid() bool
func (BinaryExprValue) StringEval ¶
func (b BinaryExprValue) StringEval(left string) reflect.Value
func (BinaryExprValue) UIntOpUInt ¶
func (b BinaryExprValue) UIntOpUInt(left uint64, right uint64) reflect.Value
type BranchStmt ¶
type BranchStmt struct {
*ast.BranchStmt
Label *Ident
}
BranchStmt represents a break, continue, goto, or fallthrough statement.
func (BranchStmt) Eval ¶
func (s BranchStmt) Eval(vm *VM)
func (BranchStmt) Flow ¶
func (s BranchStmt) Flow(g *graphBuilder) (head Step)
func (BranchStmt) String ¶
func (s BranchStmt) String() string
type CanCompose ¶
type CanDeclare ¶
type CanInstantiate ¶
type CaseClause ¶
type CaseClause struct {
*ast.CaseClause
List []Expr // list of expressions; nil means default case
Body []Stmt
}
A CaseClause represents a case of an expression or type switch statement.
func (CaseClause) Eval ¶
func (c CaseClause) Eval(vm *VM)
func (CaseClause) Flow ¶
func (c CaseClause) Flow(g *graphBuilder) (head Step)
func (CaseClause) String ¶
func (c CaseClause) String() string
type CompositeLit ¶
type CompositeLit struct {
*ast.CompositeLit
Type Expr
Elts []Expr
}
func (CompositeLit) Eval ¶
func (s CompositeLit) Eval(vm *VM)
func (CompositeLit) Flow ¶
func (s CompositeLit) Flow(g *graphBuilder) (head Step)
func (CompositeLit) String ¶
func (s CompositeLit) String() string
type ConstOrVar ¶
type ConstOrVar struct {
*ast.ValueSpec
// for each Name in ValueSpec there is a ConstOrVar
Name *Ident
Type Expr
Value Expr
}
func (ConstOrVar) Declare ¶
func (v ConstOrVar) Declare(vm *VM) bool
func (ConstOrVar) Eval ¶
func (v ConstOrVar) Eval(vm *VM)
func (ConstOrVar) Flow ¶
func (v ConstOrVar) Flow(g *graphBuilder) (head Step)
func (ConstOrVar) String ¶
func (v ConstOrVar) String() string
type Ellipsis ¶
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
func (*Environment) String ¶
func (e *Environment) String() string
type FieldSelectable ¶
type Flowable ¶
type Flowable interface {
// Flow builds the control flow graph using the provided grapher.
// Head is the entry point to that call flow graph.
Flow(g *graphBuilder) (head Step)
}
type FuncDecl ¶
type FuncLit ¶
type HasZeroValue ¶
type ImportSpec ¶
type ImportSpec struct {
*ast.ImportSpec
}
type IncDecStmt ¶
type IncDecStmt struct {
*ast.IncDecStmt
X Expr
}
func (IncDecStmt) Eval ¶
func (i IncDecStmt) Eval(vm *VM)
func (IncDecStmt) Flow ¶
func (i IncDecStmt) Flow(g *graphBuilder) (head Step)
func (IncDecStmt) String ¶
func (i IncDecStmt) String() string
type Instance ¶
type Instance struct {
Type StructType
// contains filtered or unexported fields
}
first for struct
func NewInstance ¶
func NewInstance(vm *VM, t StructType) Instance
func (Instance) LiteralCompose ¶
composite is (a reflect on) an Instance
type KeyValueExpr ¶
type KeyValueExpr struct {
*ast.KeyValueExpr
Key Expr
Value Expr
}
func (KeyValueExpr) Eval ¶
func (e KeyValueExpr) Eval(vm *VM)
func (KeyValueExpr) Flow ¶
func (e KeyValueExpr) Flow(g *graphBuilder) (head Step)
func (KeyValueExpr) String ¶
func (e KeyValueExpr) String() string
type LabeledStmt ¶
type LabeledStmt struct {
*ast.LabeledStmt
Label *Ident
Stmt Stmt
}
LabeledStmt represents a labeled statement. https://go.dev/ref/spec#Labeled_statements https://go.dev/ref/spec#Label_scopes
func (LabeledStmt) Eval ¶
func (s LabeledStmt) Eval(vm *VM)
func (LabeledStmt) String ¶
func (s LabeledStmt) String() string
type MapType ¶
func (MapType) LiteralCompose ¶
type Package ¶
type Package struct {
*packages.Package
Env *PkgEnvironment
Initialized bool
}
func BuildPackageFromAST ¶
func ParseSource ¶
func (*Package) Initialize ¶
type PkgEnvironment ¶
type PkgEnvironment struct {
Env
// contains filtered or unexported fields
}
func (*PkgEnvironment) String ¶
func (p *PkgEnvironment) String() string
type RangeStmt ¶
type ReflectLenExpr ¶
type ReflectLenExpr struct {
// TODO position info
X Expr
}
func (ReflectLenExpr) Eval ¶
func (r ReflectLenExpr) Eval(vm *VM)
func (ReflectLenExpr) Flow ¶
func (r ReflectLenExpr) Flow(g *graphBuilder) (head Step)
func (ReflectLenExpr) String ¶
func (r ReflectLenExpr) String() string
type ReturnStmt ¶
type ReturnStmt struct {
*ast.ReturnStmt
Results []Expr
}
func (ReturnStmt) Eval ¶
func (r ReturnStmt) Eval(vm *VM)
func (ReturnStmt) Flow ¶
func (r ReturnStmt) Flow(g *graphBuilder) (head Step)
func (ReturnStmt) String ¶
func (r ReturnStmt) String() string
type SelectorExpr ¶
type SelectorExpr struct {
*ast.SelectorExpr
X Expr
}
func (SelectorExpr) Eval ¶
func (s SelectorExpr) Eval(vm *VM)
func (SelectorExpr) Flow ¶
func (s SelectorExpr) Flow(g *graphBuilder) (head Step)
func (SelectorExpr) String ¶
func (s SelectorExpr) String() string
type StandardPackage ¶
type StandardPackage struct {
Name string
PkgPath string
// contains filtered or unexported fields
}
func (StandardPackage) String ¶
func (p StandardPackage) String() string
type Stmt ¶
type Stmt interface {
Flowable
// contains filtered or unexported methods
}
All statement nodes implement the Stmt interface.
type StructType ¶
type StructType struct {
*ast.StructType
Fields *FieldList
Methods map[string]FuncDecl
}
func (StructType) Eval ¶
func (s StructType) Eval(vm *VM)
func (StructType) Flow ¶
func (s StructType) Flow(g *graphBuilder) (head Step)
func (StructType) Instantiate ¶
func (s StructType) Instantiate(vm *VM) reflect.Value
func (StructType) LiteralCompose ¶
func (StructType) String ¶
func (s StructType) String() string
type SwitchStmt ¶
type SwitchStmt struct {
*ast.SwitchStmt
Init Stmt // initialization statement; or nil
Tag Expr // tag expression; or nil
Body BlockStmt
}
A SwitchStmt represents an expression switch statement.
func (SwitchStmt) Eval ¶
func (s SwitchStmt) Eval(vm *VM)
func (SwitchStmt) Flow ¶
func (s SwitchStmt) Flow(g *graphBuilder) (head Step)
func (SwitchStmt) String ¶
func (s SwitchStmt) String() string
type Traverseable ¶
type TypeSpec ¶
func (TypeSpec) LiteralCompose ¶
Source Files
¶
- array.go
- assign.go
- binaryexpr.go
- block.go
- call.go
- call_builtin.go
- env.go
- field.go
- for.go
- func.go
- graph_builder.go
- ident.go
- if.go
- import.go
- incdec.go
- index.go
- instance.go
- interfaces.go
- keyvalue.go
- literal.go
- package.go
- range.go
- return.go
- selector.go
- stack.go
- stacks.go
- star.go
- stdlib_builtins.go
- stdlib_generated.go
- stdlib_types.go
- step.go
- step_builder.go
- stmt.go
- type.go
- unary.go
- utils.go
- var.go
- vm.go
Click to show internal directories.
Click to hide internal directories.