ssa2ast

package module
v0.0.0-...-86598ce Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2023 License: BSD-3-Clause Imports: 13 Imported by: 0

README

go-ssa2ast

An experimental implementation of converting from go/ssa back to go/ast

Known problems:

  • Convert breaks "lazy" for range for map to go because there is no publicly available iterator for map
  • Generics not tested

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UnsupportedErr = errors.New("unsupported")

Functions

func Convert

func Convert(ssaFunc *ssa.Function, cfg *ConverterConfig) (*ast.FuncDecl, error)

Types

type AstBlock

type AstBlock struct {
	Index   int
	HasRefs bool
	Body    []ast.Stmt
	Phi     []ast.Stmt
	Exit    ast.Stmt
}

type AstFunc

type AstFunc struct {
	Vars   map[string]types.Type
	Blocks []*AstBlock
}

type ConverterConfig

type ConverterConfig struct {
	ImportNameResolver ImportNameResolver
	NamePrefix         string
}

func DefaultConfig

func DefaultConfig() *ConverterConfig

type ImportNameResolver

type ImportNameResolver func(pkg *types.Package) *ast.Ident

type NameType

type NameType int

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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