ast

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2015 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// END cause whole parsing end
	END = errors.Err("parsing end")

	// TYPE_END cause single type's parsing end
	TYPE_END = errors.Err("type parsing end")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Attrs

type Attrs struct {
	// Package name
	Package string

	// helpful for access single type, if don't know, don't use it
	Accessed bool

	// Common
	TypeName string

	// Document
	TypeDoc []string

	// Struct
	S struct {
		Doc         []string
		Field, Type string // if type is empty, means anonymous field
		Tag         reflect.StructTag
		Anonymous   bool
	}

	// Const
	C struct {
		Doc         []string
		Name, Value string
	}

	// Var
	V struct {
		Doc        []string
		Name, Type string
	}

	// Interface
	I struct {
		Doc    []string
		Method string
	}

	// Func
	F struct {
		Name    string
		PtrRecv bool // whether a method's reciever is pointer, only valid for method
	}
}

type Parser

type Parser struct {
	Const     func(*Attrs) error
	Var       func(*Attrs) error
	Interface func(*Attrs) error
	Struct    func(*Attrs) error
	Func      func(*Attrs) error

	ParseDoc bool
}

func (Parser) Parse

func (p Parser) Parse(file *ast.File) (err error)

func (Parser) ParseFile

func (p Parser) ParseFile(fname string) error

Jump to

Keyboard shortcuts

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