implemented data types for symbol table

This commit is contained in:
Aidan 2019-11-21 20:59:14 -08:00
parent f3c0f366d2
commit 2b5e43a322
No known key found for this signature in database
GPG key ID: 327711E983899316

View file

@ -4,7 +4,22 @@ import (
"strings" "strings"
) )
// TODO: Enum{Operator, Variable} // TODO: Maybe I should just have two tables
// TODO build hashmap bucket
// TODO define type for function signature operation type operation func(*Token) *Token
// TODO functions for get_symbol, add_symbol 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{}
}
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 {}