resolve

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Name     string
	Type     Type
	Optional bool
}

type Resolver

type Resolver struct {
	Symbols         []*Symbol
	ResolvedStructs []*Symbol
}

func New

func New() *Resolver

func (*Resolver) AddSymbol

func (resolver *Resolver) AddSymbol(sym *Symbol)

func (*Resolver) AddSymbolDecl

func (resolver *Resolver) AddSymbolDecl(decl ast.Decl)

func (*Resolver) AddType

func (resolver *Resolver) AddType(name string, ty Type)

func (*Resolver) GetSymbol

func (resolver *Resolver) GetSymbol(name string) (*Symbol, bool)

func (*Resolver) Resolve

func (resolver *Resolver) Resolve(name string) (Type, error)

func (*Resolver) ResolveAll

func (resolver *Resolver) ResolveAll() error

func (*Resolver) ResolveField

func (resolver *Resolver) ResolveField(field *ast.Field) (Field, error)

func (*Resolver) ResolveTypespec

func (resolver *Resolver) ResolveTypespec(typespec ast.Typespec) (Type, error)

type Symbol

type Symbol struct {
	State SymbolState
	Name  string
	Decl  ast.Decl
	Type  Type
}

type SymbolState

type SymbolState int
const (
	SymbolUnresolved SymbolState = iota
	SymbolResolving
	SymbolResolved
)

type Type

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

type TypeArray

type TypeArray struct {
	ElementType Type
}

type TypeBoolean

type TypeBoolean struct{}

type TypeInt

type TypeInt struct{}

TODO(patrik): Rename to number, or have bit size

type TypePtr

type TypePtr struct {
	BaseType Type
}

type TypeSameStruct

type TypeSameStruct struct {
	Type *TypeStruct
}

type TypeString

type TypeString struct{}

type TypeStruct

type TypeStruct struct {
	Name   string
	Fields []Field
}

Jump to

Keyboard shortcuts

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