26 //a := &AST{Op: imm, N: 5}
27 //b := &AST{Op: plus, A: a, B: &AST{Op: arg, N: 0}}
28 input := "[ a b ] a*a + b*b"
29 value := []rune(input)
30 for index, char := range value {
31 //make a stack and start pusing the [] to identify the start of a function and its end
32 //also check on a *-+/ for starting new operations with the last value and the next
33 //or can be a ( which pushes last value to a stack and picks up a new "first value" for this operation and ) indicating that order of operation is finish and
34 //you should pull again the last value that you pushed
36 //found [ start registering args to a map
37 // variable inside [] add to map of variables
38 // found ] stop registering new variables for the map
39 // found variable put to stack
40 // found inmmediate number put to stack
41 // found operation activate operation mode and upon next variable or inmediate add to the structure
42 // found ( can push another variable to stack and increment the indent counter
43 // found ) if no operation mode (that would be an error) then add the operations to the structure and decrement the indnet counter