Documentation ¶
Index ¶
- Variables
- func AddSrcGoTypes()
- func AnalyzeIllegalCode(file *ast.File)
- func Arrayify(typ ast.Expr, len ast.Expr) *ast.ArrayType
- func ChangeRecvrNames(file *ast.File)
- func ExpandFuncPtrCalls(x *ast.CallExpr, retvals []ast.Expr, retTypes []types.Type) []ast.Stmt
- func FindExpr(a []ast.Expr, x ast.Expr) int
- func FindParam(fn *ast.FuncDecl, name string) (*ast.Field, int)
- func FindStmt(a []ast.Stmt, x ast.Stmt) int
- func GetFuncName(expr ast.Expr) string
- func GetTypeBase(t types.Type) types.Type
- func InsertDecl(a []ast.Decl, index int, value ast.Decl) []ast.Decl
- func InsertExpr(a []ast.Expr, index int, value ast.Expr) []ast.Expr
- func InsertStmt(a []ast.Stmt, index int, value ast.Stmt) []ast.Stmt
- func IsFuncPtr(expr ast.Expr) bool
- func IsMapType(expr ast.Expr) bool
- func MakeAssign(create bool) *ast.AssignStmt
- func MakeBasicLit(tok token.Token, value string) *ast.BasicLit
- func MakeBitNotExpr(e ast.Expr) *ast.UnaryExpr
- func MakeEnumType(name string, names []string, values []int64)
- func MakeFunc(name string, recv *types.Var, params, results *types.Tuple, variadic bool)
- func MakeFuncPtrArgCall(arg ast.Expr, by_ref bool, pretyp types.Type) *ast.ExprStmt
- func MakeIndex(index, x ast.Expr) *ast.IndexExpr
- func MakeIntConst(name string, num int64)
- func MakeIntVar(name string)
- func MakeNamedType(name string, typ types.Type, methods []*types.Func)
- func MakeParams(param_names []string, param_types []types.Type) *types.Tuple
- func MakeParenExpr(e ast.Expr) *ast.ParenExpr
- func MakeReference(x ast.Expr) *ast.UnaryExpr
- func MakeRet(param_types []types.Type) *types.Tuple
- func MakeTypeAlias(name string, typ types.Type, strong bool)
- func MakeVarDecl(names []*ast.Ident, val ast.Expr, typ types.Type) *ast.DeclStmt
- func MergeRetVals(file *ast.File)
- func MutateAndNotExpr(file *ast.File)
- func MutateAssignDefStmts(owner_list *[]ast.Stmt, index int, s ast.Stmt, bm BlockMutator)
- func MutateAssignDefs(file *ast.File)
- func MutateAssignStmts(owner_list *[]ast.Stmt, index int, s ast.Stmt, bm BlockMutator)
- func MutateAssigns(file *ast.File)
- func MutateBlock(b *ast.BlockStmt, mutator StmtMutator)
- func MutateFuncLit(owner_list *[]ast.Stmt, index int, s ast.Stmt, bm BlockMutator)
- func MutateFuncLitExprs(e *ast.Expr)
- func MutateNoRetCallStmts(owner_list *[]ast.Stmt, index int, s ast.Stmt, bm BlockMutator)
- func MutateNoRetCalls(file *ast.File)
- func MutateRangeStmts(owner_list *[]ast.Stmt, index int, s ast.Stmt, bm BlockMutator)
- func MutateRanges(file *ast.File)
- func MutateRetStmts(owner_list *[]ast.Stmt, index int, s ast.Stmt, bm BlockMutator)
- func MutateRetTypes(retvals **ast.FieldList, curr_params *ast.FieldList, obj_name string) []*ast.Field
- func MutateRets(file *ast.File)
- func NameAnonFuncs(file *ast.File)
- func PrettyPrintAST(n ast.Node) string
- func PrintAST(n ast.Node) string
- func PrintSrcGoErr(p token.Pos, msg string)
- func PtrizeExpr(x ast.Expr) *ast.StarExpr
- func SetUpSrcGo(fset *token.FileSet, info *types.Info, err_fn func(err error))
- func TypeToASTExpr(typ types.Type) ast.Expr
- func ValueToTypeExpr(val ast.Expr) ast.Expr
- type BlockMutator
- type StmtMutator
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AddSrcGoTypes ¶
func AddSrcGoTypes()
func AnalyzeIllegalCode ¶
func ChangeRecvrNames ¶
func ExpandFuncPtrCalls ¶
func GetFuncName ¶
func MakeAssign ¶
func MakeAssign(create bool) *ast.AssignStmt
func MakeEnumType ¶
func MakeFuncPtrArgCall ¶
func MakeIntConst ¶
func MakeIntVar ¶
func MakeIntVar(name string)
func MergeRetVals ¶
func MutateAndNotExpr ¶
/ a &^ b ==> a & ^(b) ==> a & ~(b) in sp.
func MutateAssignDefStmts ¶
func MutateAssignDefs ¶
func MutateAssignStmts ¶
func MutateAssigns ¶
func MutateBlock ¶
func MutateBlock(b *ast.BlockStmt, mutator StmtMutator)
func MutateFuncLit ¶
/ func(params){code}(args) => func _srcgo_func#(params){code} ... _srcgo_func#(args)
func MutateFuncLitExprs ¶
func MutateNoRetCallStmts ¶
func MutateNoRetCalls ¶
func MutateRangeStmts ¶
func MutateRanges ¶
func MutateRetStmts ¶
func MutateRetTypes ¶
func MutateRetTypes(retvals **ast.FieldList, curr_params *ast.FieldList, obj_name string) []*ast.Field
*
- Modifies the return values of a function by mutating them into references and moving them to the parameters.
- Example Go code: func f() (int, float) {}
- Result Go code: func f(f_param1 *float) int {}
func MutateRets ¶
func NameAnonFuncs ¶
func PrettyPrintAST ¶
func PrintSrcGoErr ¶
Types ¶
type BlockMutator ¶
type BlockMutator func(b *ast.BlockStmt, mutator StmtMutator)
type StmtMutator ¶
Click to show internal directories.
Click to hide internal directories.