diff --git a/pkg/shsh/token.go b/pkg/shsh/token.go index ed13203..3438006 100644 --- a/pkg/shsh/token.go +++ b/pkg/shsh/token.go @@ -7,6 +7,17 @@ import ( type operation func(Token) Token +/* + * LIST: a list of elements + * OPERAND: an element which is + */ +type parse_tag enum { + LIST_T iota + OPERAND_T iota + OPERATOR_T iota + OPERATION_T iota +} + type Token struct { Token *next interface{} *_inner @@ -42,9 +53,13 @@ func lex(string input) string { } func parse(Token *arg) { - + // if operand determine if operator + // determine operator precense in symbol table + // Determine if a list is an operation or a list } func eval(Token *tree) Token* { - + // Find operations + // Simplify operations deepest first + // return tree of final Tokens }