go/src/cmd/cgo/ast.go

func parse(name string, src []byte, flags parser.Mode) *ast.File {}

func sourceLine(n ast.Node) int {}

// ParseGo populates f with information learned from the Go source code
// which was read from the named file. It gathers the C preamble
// attached to the import "C" comment, a list of references to C.xxx,
// a list of exported functions, and the actual AST, to be rewritten and
// printed.
func (f *File) ParseGo(abspath string, src []byte) {}

// Like ast.CommentGroup's Text method but preserves
// leading blank lines, so that line numbers line up.
func commentText(g *ast.CommentGroup) string {}

func (f *File) validateIdents(x interface{}

// Save various references we are going to need later.
func (f *File) saveExprs(x interface{}

// Save references to C.xxx for later processing.
func (f *File) saveRef(n *ast.Expr, context astContext) {}

// Save calls to C.xxx for later processing.
func (f *File) saveCall(call *ast.CallExpr, context astContext) {}

// If a function should be exported add it to ExpFunc.
func (f *File) saveExport(x interface{}

// Make f.ExpFunc[i] point at the Func from this AST instead of the other one.
func (f *File) saveExport2(x interface{}

type astContext

const ctxProg

const ctxEmbedType

const ctxType

const ctxStmt

const ctxExpr

const ctxField

const ctxParam

const ctxAssign2

const ctxSwitch

const ctxTypeSwitch

const ctxFile

const ctxDecl

const ctxSpec

const ctxDefer

const ctxCall

const ctxCall2

const ctxSelector

// walk walks the AST x, calling visit(f, x, context) for each node.
func (f *File) walk(x interface{}

// If x is of the form (T), unparen returns unparen(T), otherwise it returns x.
func unparen(x ast.Expr) ast.Expr {}