tok_val a tok_val b tok_val c -- 1+2 => Other -- 1+2*3 => Other -- 1*2+3 => Other -- (1+2)*3 => Other -- a+b+c+d => Other -- a*b*3*4 => Other -- 1 => Const 1 -- a => Var a -- ( => Parse error: Unexpected token -- ) => Parse error: Expected ( -- (a+b => Parse error: Expected ) -- => Parse error: Unexpected token -- $$ => Parse error: Unexpected token c.i -1 v.name '' b.op '' ([33mexpr.Binary[0;0m op:[1m"+"[0;0m left:([33mexpr.Const[0;0m i:[32m1[0;0m) right:([33mexpr.Const[0;0m i:[32m2[0;0m)) ([33mexpr.Binary[0;0m op: [1m"+"[0;0m left: ([33mexpr.Const[0;0m i:[32m1[0;0m) right: ([33mexpr.Binary[0;0m op:[1m"*"[0;0m left:([33mexpr.Const[0;0m i:[32m2[0;0m) right:([33mexpr.Const[0;0m i:[32m3[0;0m)) ) ([33mexpr.Binary[0;0m op: [1m"+"[0;0m left: ([33mexpr.Binary[0;0m op:[1m"*"[0;0m left:([33mexpr.Const[0;0m i:[32m1[0;0m) right:([33mexpr.Const[0;0m i:[32m2[0;0m)) right: ([33mexpr.Const[0;0m i:[32m3[0;0m) ) ([33mexpr.Binary[0;0m op: [1m"*"[0;0m left: ([33mexpr.Binary[0;0m op:[1m"+"[0;0m left:([33mexpr.Const[0;0m i:[32m1[0;0m) right:([33mexpr.Const[0;0m i:[32m2[0;0m)) right: ([33mexpr.Const[0;0m i:[32m3[0;0m) ) ([33mexpr.Binary[0;0m op: [1m"+"[0;0m left: ([33mexpr.Binary[0;0m op: [1m"+"[0;0m left: ([33mexpr.Binary[0;0m op:[1m"+"[0;0m left:([33mexpr.Var[0;0m name:[1ma[0;0m) right:([33mexpr.Var[0;0m name:[1mb[0;0m)) right: ([33mexpr.Var[0;0m name:[1mc[0;0m) ) right: ([33mexpr.Var[0;0m name:[1md[0;0m) ) ([33mexpr.Binary[0;0m op: [1m"*"[0;0m left: ([33mexpr.Binary[0;0m op: [1m"*"[0;0m left: ([33mexpr.Binary[0;0m op:[1m"*"[0;0m left:([33mexpr.Var[0;0m name:[1ma[0;0m) right:([33mexpr.Var[0;0m name:[1mb[0;0m)) right: ([33mexpr.Const[0;0m i:[32m3[0;0m) ) right: ([33mexpr.Const[0;0m i:[32m4[0;0m) ) ([33mexpr.Const[0;0m i:[32m1[0;0m) ([33mexpr.Var[0;0m name:[1ma[0;0m) ([33mexpr.Binary[0;0m op:[1m"+"[0;0m left:([33mexpr.Const[0;0m i:[32m-1[0;0m) right:([33mexpr.Var[0;0m name:[1m""[0;0m))