implemented data types for symbol table
This commit is contained in:
parent
f3c0f366d2
commit
2b5e43a322
1 changed files with 19 additions and 4 deletions
|
|
@ -4,7 +4,22 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
// TODO: Enum{Operator, Variable}
|
||||
// TODO build hashmap bucket
|
||||
// TODO define type for function signature operation
|
||||
// TODO functions for get_symbol, add_symbol
|
||||
// TODO: Maybe I should just have two tables
|
||||
|
||||
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{}
|
||||
}
|
||||
|
||||
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 {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue