goast

package
v0.0.0-...-72fbe86 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PopulateSymbolTable

func PopulateSymbolTable(file *ast.File, symbols *SymbolTable) error

PopulateSymbolTable ...

func ReadFile

func ReadFile(filePath, fileName string) (*ast.File, error)

ReadFile ...

Types

type Annotations

type Annotations struct {
	Field   string
	Ignore  bool
	OnKinds []string
}

Annotations contains any annotations that are relevant to a section of Go code being processed.

type Const

type Const struct {
	Name  string
	Field string
}

Const represents the information we need from the Go AST for constants. TODO: This isn't really a "Const", it's more specifically a "Kind", isn't it? This looks more like some template data.

func (Const) SelfName

func (c Const) SelfName() string

SelfName ...

type Struct

type Struct struct {
	FieldNames []string
	Fields     map[string]Type
}

Struct represents the information we need from the Go AST for structs.

func NewStruct

func NewStruct() Struct

NewStruct returns a new Struct value with the map on it initialised.

type SymbolTable

type SymbolTable struct {
	Package string
	Consts  map[string][]Const
	Structs map[string]Struct
}

SymbolTable takes the information we need from the Go AST, and represents it in an easy to access structure for the walker generator.

func NewSymbolTable

func NewSymbolTable() SymbolTable

NewSymbolTable returns a new SymbolTable value with the maps on it initialised.

type Type

type Type struct {
	TypeName  string
	OnKinds   []string
	IsArray   bool
	IsPointer bool
}

Type represents the information we need from the Go AST for types.

Jump to

Keyboard shortcuts

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