astcatalog

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

type Catalog struct {
	Structs    map[NodeStructType]*NodeStructDef
	Interfaces map[NodeInterfaceType]*NodeInterfaceDef
	Consts     map[ConstType]*ConstDef
}

Catalog is a catalog of AST types.

func Load

func Load(astFilename, astConstFilename string) (*Catalog, error)

Load loads a catalog from the given AST files.

type ConstDef

type ConstDef struct {
	SourcePos token.Pos
	Name      string
	Values    []*ConstValueDef
}

ConstDef is a definition of const types in ast/ast_const.go

type ConstType

type ConstType string

ConstType is a type name of const types defined in ast/ast_const.go.

type ConstValueDef

type ConstValueDef struct {
	Name  string
	Value string
}

ConstValueDef is a value definition of const types in ast/ast_const.go.

type FieldDef

type FieldDef struct {
	Name    string
	Type    Type
	Comment string
}

FieldDef is a field definition of node structs in ast/ast.go.

type NodeInterfaceDef

type NodeInterfaceDef struct {
	SourcePos   token.Pos
	Name        string
	Implemented []NodeStructType
}

NodeInterfaceDef is a definition of node interfaces in ast/ast.go.

type NodeInterfaceType

type NodeInterfaceType string

NodeInterfaceType is a type name of node interfaces defined in ast/ast.go.

type NodeStructDef

type NodeStructDef struct {
	SourcePos  token.Pos
	Name       string
	Doc        string
	Tmpl       string
	Pos, End   string
	Fields     []*FieldDef
	Implements []NodeInterfaceType
}

NodeStructDef is a definition of node structs in ast/ast.go.

type NodeStructType

type NodeStructType string

NodeStructType is a type name of node structs defined in ast/ast.go.

type PointerType

type PointerType struct {
	Type Type
}

PointerType is a pointer type.

type PrimitiveType

type PrimitiveType string

PrimitiveType is a type name which is neither a node pointer, a node interface, nor a const types.

const (
	BoolType       PrimitiveType = "bool"
	ByteType       PrimitiveType = "byte"
	IntType        PrimitiveType = "int"
	StringType     PrimitiveType = "string"
	TokenPosType   PrimitiveType = "token.Pos"
	TokenTokenType PrimitiveType = "token.Token"
)

PrimitiveType values.

type SliceType

type SliceType struct {
	Type Type
}

SliceType is a slice type.

type Type

type Type interface {
	// contains filtered or unexported methods
}

Type represents types used in Catalog.

Jump to

Keyboard shortcuts

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