many notes to self
This commit is contained in:
parent
123301881e
commit
6e57fe7e09
1 changed files with 17 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue