symbol

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FunctionSymbol = "Function"
	StructSymbol   = "Struct"
	VariableSymbol = "Variable"
	LiteralSymbol  = "Literal"
	ImportSymbol   = "Import"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func NewManager

func NewManager(rootPath string) *Manager

func (*Manager) AddFile

func (m *Manager) AddFile(filePath string, table *Table)

func (*Manager) GetFile

func (m *Manager) GetFile(filePath string) (*Table, bool)

func (*Manager) GetSymbol

func (m *Manager) GetSymbol(filePath, symbolName string) (Symbol, bool)

type ModuleNode added in v0.2.2

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

type Symbol

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

func NewAlias

func NewAlias(alias string, sym Symbol) Symbol

func NewSymbol

func NewSymbol(name string, stype Type, declarationNode ast.Node, valueType types.ValueType) Symbol

func (Symbol) Alias

func (s Symbol) Alias() string

func (Symbol) AsImportedFrom

func (s Symbol) AsImportedFrom(importName string) Symbol

func (Symbol) DeclarationNode

func (s Symbol) DeclarationNode() ast.Node

func (Symbol) Name

func (s Symbol) Name() string

func (Symbol) Type

func (s Symbol) Type() Type

func (Symbol) ValueType

func (s Symbol) ValueType() types.ValueType

type Table

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

func NewTable

func NewTable(parent *Table, scopeName string, originFile string) *Table

func (*Table) AddChild

func (s *Table) AddChild(table *Table)

func (*Table) Define

func (s *Table) Define(symbol Symbol) error

func (*Table) GetChild

func (s *Table) GetChild(scope string) (*Table, bool)

func (*Table) GetImportedSymbols added in v0.2.2

func (s *Table) GetImportedSymbols() map[string]Symbol

func (*Table) GetParent

func (s *Table) GetParent() *Table

func (*Table) GetSymbols added in v0.2.2

func (s *Table) GetSymbols() map[string]Symbol

func (*Table) ImportSymbol added in v0.2.2

func (s *Table) ImportSymbol(sym Symbol) error

func (*Table) ImportTable

func (s *Table) ImportTable(table *Table) error

func (*Table) Lookup

func (s *Table) Lookup(name string) (Symbol, bool)

func (*Table) OriginFile

func (s *Table) OriginFile() string

func (*Table) ScopeName

func (s *Table) ScopeName() string

type Type

type Type string

Jump to

Keyboard shortcuts

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