SHS/pkg/shsh/symbol_table.go

33 lines
649 B
Go
Raw Normal View History

2019-11-21 20:32:00 -08:00
package shsh
import (
"strings"
)
type operation func(*Token) *Token
type symbol_tag int
const (
SYM_OPERATOR symbol_tag = iota,
SYM_VARIABLE symbol_tag = iota
)
type bucket struct {
symbol string
tag symbol_tag
_inner interface{}
}
2019-11-21 21:10:22 -08:00
type sym_table []bucket
const initial_table_length 10
var (
global_sym_table sym_table
)
func extend_table() {}
// TODO: take in a table as a target, so that inner scopes can be appended to outer scopes
func set_variable(key string, val string) {}
func get_variable(arg string) string {}
func set_operator(key string, val operation) {}
func get_operator(arg string) operation {}