parser

package
v0.0.0-...-d69f115 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: BSD-3-Clause Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GOARCH = map[string]struct{}{
	"386":      {},
	"amd64":    {},
	"amd64p32": {},
	"arm64":    {},
	"arm":      {},
	"mips64":   {},
	"mips64le": {},
	"ppc64":    {},
	"ppc64le":  {},
	"s390x":    {},
}
View Source
var GOOS = map[string]struct{}{
	"android":   {},
	"darwin":    {},
	"dragonfly": {},
	"freebsd":   {},
	"linux":     {},
	"nacl":      {},
	"netbsd":    {},
	"openbsd":   {},
	"plan9":     {},
	"solaris":   {},
	"windows":   {},
}

Functions

This section is empty.

Types

type FileContext

type FileContext struct {
	// package's underlying filename
	Filename string
	// AST of a file (so the AST is not constructed again once all file's dependencies are processed)
	FileAST *ast.File
	// If set, there are still some symbols that needs processing
	ImportsProcessed bool

	DataTypes []*ast.TypeSpec
	Variables []*ast.ValueSpec
	Constants []types.ConstSpec
	Functions []*ast.FuncDecl

	AllocatedSymbolsTable *alloctable.Table
}

FileContext storing context for a file

type PackageContext

type PackageContext struct {
	// fully qualified package name
	PackagePath string
	PackageQID  string

	// files attached to a package
	PackageDir string
	FileIndex  int
	Files      []*FileContext

	Config *types.Config

	// package name
	PackageName string
	// per package symbol table
	SymbolTable *stack.Stack

	// symbol definitions postponed (only variable/constants and function bodies definitions affected)
	DataTypes []*ast.TypeSpec
	Variables []*ast.ValueSpec
	Functions []*ast.FuncDecl
}

PackageContext storing context for a package

type ProjectParser

type ProjectParser struct {
	// contains filtered or unexported fields
}

func New

func New(symbolTableDir, cgoSymbolsPath, goVersion string, snapshot snapshots.Snapshot) (*ProjectParser, error)

func (*ProjectParser) GlobalAllocTable

func (pp *ProjectParser) GlobalAllocTable() *allocglobal.Table

func (*ProjectParser) GlobalContractsTable

func (pp *ProjectParser) GlobalContractsTable() *contractglobal.Table

func (*ProjectParser) GlobalSymbolTable

func (pp *ProjectParser) GlobalSymbolTable() *global.Table

func (*ProjectParser) Parse

func (pp *ProjectParser) Parse(packagePath string, allocated bool) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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