Documentation ¶
Index ¶
- type Stack
- func (s *Stack) AddDataType(sym *symbols.SymbolDef) error
- func (s *Stack) AddFunction(sym *symbols.SymbolDef) error
- func (s *Stack) AddImport(sym *symbols.SymbolDef) error
- func (s *Stack) AddVariable(sym *symbols.SymbolDef) error
- func (s *Stack) AddVirtualDataType(sym *symbols.SymbolDef) error
- func (s *Stack) CurrentLevel() int
- func (s *Stack) Exists(name string) bool
- func (s *Stack) Json()
- func (s *Stack) Lookup(name string) (*symbols.SymbolDef, symbols.SymbolType, error)
- func (s *Stack) LookupAllMethods(datatype string) (map[string]*symbols.SymbolDef, error)
- func (s *Stack) LookupDataType(name string) (*symbols.SymbolDef, error)
- func (s *Stack) LookupFromBlock(name string, idx int) (*symbols.SymbolDef, symbols.SymbolType, error)
- func (s *Stack) LookupFunction(name string) (*symbols.SymbolDef, error)
- func (s *Stack) LookupMethod(datatype, methodName string) (*symbols.SymbolDef, error)
- func (s *Stack) LookupVariable(name string) (*symbols.SymbolDef, error)
- func (s *Stack) LookupVariableLikeSymbol(name string) (*symbols.SymbolDef, symbols.SymbolType, error)
- func (s *Stack) Pop()
- func (s *Stack) Print()
- func (s *Stack) PrintTop()
- func (s *Stack) Push()
- func (s *Stack) Reset() error
- func (s *Stack) Table(level int) (*tables.Table, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Stack ¶
type Stack struct { Tables []*tables.Table `json:"tables"` Size int `json:"size"` Imports map[string]*symbols.SymbolDef `json:"imports"` }
Stack is a multi-level symbol table for parsing blocks of code
func (*Stack) CurrentLevel ¶
func (*Stack) LookupAllMethods ¶
func (*Stack) LookupDataType ¶
func (*Stack) LookupFromBlock ¶
func (s *Stack) LookupFromBlock(name string, idx int) (*symbols.SymbolDef, symbols.SymbolType, error)
Lookup looks for the first occurrence of a symbol with the given name starting from a block idx
func (*Stack) LookupFunction ¶
func (*Stack) LookupMethod ¶
func (*Stack) LookupVariable ¶
func (*Stack) LookupVariableLikeSymbol ¶
Click to show internal directories.
Click to hide internal directories.