ast_go

package
v1.9.11 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFunctionDecl

func AddFunctionDecl(x *ast.FuncDecl, currentFile *core_domain.CodeContainer) (*core_domain.CodeFunction, string)

func AddNestedFunction

func AddNestedFunction(currentFunc *core_domain.CodeFunction, x *ast.FuncType)

func AddStructType

func AddStructType(currentNodeName string, x *ast.StructType, currentFile *core_domain.CodeContainer, dsMap map[string]*core_domain.CodeDataStruct)

func BuildCallFromExpr

func BuildCallFromExpr(expr *ast.CallExpr, codeFunc *CodeFunction, fields []CodeField, imports []CodeImport, currentPackage string, localVars []CodeProperty) CodeCall

func BuildExpr

func BuildExpr(expr ast.Expr) (string, string, string)

func BuildFieldToProperty

func BuildFieldToProperty(fieldList []*ast.Field) []CodeProperty

func BuildFunction

func BuildFunction(x *ast.FuncDecl, file *CodeContainer) *CodeFunction

func BuildImport

func BuildImport(x *ast.ImportSpec, fileName string, manager core_domain.CodePackageInfo) *core_domain.CodeImport

func BuildImportName

func BuildImportName(fileName string) string

func BuildLocalVars

func BuildLocalVars(it *ast.AssignStmt, codeFunc *CodeFunction, imports []CodeImport) []CodeProperty

func BuildMethodCall

func BuildMethodCall(codeFunc *CodeFunction, item ast.Stmt, fields []CodeField, localVars []CodeProperty, imports []CodeImport, packageName string) ([]CodeProperty, CodeCall)

func BuildMethodCallExprStmt

func BuildMethodCallExprStmt(it *ast.ExprStmt, codeFunc *CodeFunction, fields []CodeField, imports []CodeImport, currentPackage string, localVars []CodeProperty)

func BuildPropertyField

func BuildPropertyField(name string, field *ast.Field) *CodeProperty

func BuildReceiver

func BuildReceiver(x *ast.FuncDecl, recv string) string

func BuildValSpec

func BuildValSpec(expr ast.Expr) (string, string, string)

func ParseTarget

func ParseTarget(selector string, fields []CodeField, localVars []CodeProperty, codeFunc *CodeFunction) string

func SortInterface

func SortInterface(slice []core_domain.CodeDataStruct)

Types

type CocagoParser

type CocagoParser struct {
	CodeMembers    []core_domain.CodeMember
	PackageManager core_domain.CodePackageInfo
}

func NewCocagoParser

func NewCocagoParser() *CocagoParser

func (*CocagoParser) IdentAnalysis

func (n *CocagoParser) IdentAnalysis(code string, fileName string) *core_domain.CodeContainer

func (*CocagoParser) ProcessFile

func (n *CocagoParser) ProcessFile(fileName string) core_domain.CodeContainer

func (*CocagoParser) ProcessString

func (n *CocagoParser) ProcessString(code string, fileName string, codeMembers []core_domain.CodeMember) *core_domain.CodeContainer

func (*CocagoParser) SetOutput

func (n *CocagoParser) SetOutput(out io.Writer) io.Writer

func (*CocagoParser) SetPackageManager

func (n *CocagoParser) SetPackageManager(manager core_domain.CodePackageInfo)

func (*CocagoParser) Visitor

func (n *CocagoParser) Visitor(f *ast.File, fset *token.FileSet, fileName string) *core_domain.CodeContainer

Jump to

Keyboard shortcuts

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