--- 1+2+3 (arith_expr.Binary op: '+' left: (arith_expr.Binary op:'+' left:(arith_expr.Const i:1) right:(arith_expr.Const i:2)) right: (arith_expr.Const i:3) ) (B '+' (B '+' (1) (2)) (3)) --- 1+2*3 (arith_expr.Binary op: '+' left: (arith_expr.Const i:1) right: (arith_expr.Binary op:'*' left:(arith_expr.Const i:2) right:(arith_expr.Const i:3)) ) (B '+' (1) (B '*' (2) (3))) --- 4*(2+3) (arith_expr.Binary op: '*' left: (arith_expr.Const i:4) right: (arith_expr.Binary op:'+' left:(arith_expr.Const i:2) right:(arith_expr.Const i:3)) ) (B '*' (4) (B '+' (2) (3))) --- (2+3)*4 (arith_expr.Binary op: '*' left: (arith_expr.Binary op:'+' left:(arith_expr.Const i:2) right:(arith_expr.Const i:3)) right: (arith_expr.Const i:4) ) (B '*' (B '+' (2) (3)) (4)) --- 1<2 (arith_expr.Binary op:'<' left:(arith_expr.Const i:1) right:(arith_expr.Const i:2)) (B '<' (1) (2)) --- x=3 (arith_expr.Binary op:'=' left:(arith_expr.Var name:x) right:(arith_expr.Const i:3) spids:[42 43]) (arith_expr.Binary op:'=' left:($ x) right:(3)) --- x = 2*3 (arith_expr.Binary op: '=' left: (arith_expr.Var name:x) right: (arith_expr.Binary op:'*' left:(arith_expr.Const i:2) right:(arith_expr.Const i:3)) spids: [42 43] ) (arith_expr.Binary op:'=' left:($ x) right:(B '*' (2) (3))) --- x = y (arith_expr.Binary op:'=' left:(arith_expr.Var name:x) right:(arith_expr.Var name:y) spids:[42 43]) (arith_expr.Binary op:'=' left:($ x) right:($ y)) --- x*y - y*z (arith_expr.Binary op: - left: (arith_expr.Binary op:'*' left:(arith_expr.Var name:x) right:(arith_expr.Var name:y)) right: (arith_expr.Binary op:'*' left:(arith_expr.Var name:y) right:(arith_expr.Var name:z)) ) (B - (B '*' ($ x) ($ y)) (B '*' ($ y) ($ z))) --- x/y - y%z (arith_expr.Binary op: - left: (arith_expr.Binary op:'/' left:(arith_expr.Var name:x) right:(arith_expr.Var name:y)) right: (arith_expr.Binary op:'%' left:(arith_expr.Var name:y) right:(arith_expr.Var name:z)) ) (B - (B '/' ($ x) ($ y)) (B '%' ($ y) ($ z))) --- x = y (arith_expr.Binary op:'=' left:(arith_expr.Var name:x) right:(arith_expr.Var name:y) spids:[42 43]) (arith_expr.Binary op:'=' left:($ x) right:($ y)) --- 2 ** 3 ** 2 (arith_expr.Binary op: '**' left: (arith_expr.Const i:2) right: (arith_expr.Binary op:'**' left:(arith_expr.Const i:3) right:(arith_expr.Const i:2)) ) (B '**' (2) (B '**' (3) (2))) --- a = b = 10 (arith_expr.Binary op: '=' left: (arith_expr.Var name:a) right: (arith_expr.Binary op: '=' left: (arith_expr.Var name:b) right: (arith_expr.Const i:10) spids: [42 43] ) spids: [42 43] ) (arith_expr.Binary op:'=' left:($ a) right:(arith_expr.Binary op:'=' left:($ b) right:(10))) --- x = ((y*4)-2) (arith_expr.Binary op: '=' left: (arith_expr.Var name:x) right: (arith_expr.Binary op: - left: (arith_expr.Binary op:'*' left:(arith_expr.Var name:y) right:(arith_expr.Const i:4)) right: (arith_expr.Const i:2) ) spids: [42 43] ) (arith_expr.Binary op:'=' left:($ x) right:(B - (B '*' ($ y) (4)) (2))) --- x - -y (arith_expr.Binary op: - left: (arith_expr.Var name:x) right: (arith_expr.Unary op:- a:(arith_expr.Var name:y)) ) (B - ($ x) (U - ($ y))) --- -1 * -2 (arith_expr.Binary op: '*' left: (arith_expr.Unary op:- a:(arith_expr.Const i:1)) right: (arith_expr.Unary op:- a:(arith_expr.Const i:2)) ) (B '*' (U - (1)) (U - (2))) --- -x * -y (arith_expr.Binary op: '*' left: (arith_expr.Unary op:- a:(arith_expr.Var name:x)) right: (arith_expr.Unary op:- a:(arith_expr.Var name:y)) ) (B '*' (U - ($ x)) (U - ($ y))) --- x - -234 (arith_expr.Binary op: - left: (arith_expr.Var name:x) right: (arith_expr.Unary op:- a:(arith_expr.Const i:234)) ) (B - ($ x) (U - (234))) --- x += y += 3 (arith_expr.Binary op: '+=' left: (arith_expr.Var name:x) right: (arith_expr.Binary op: '+=' left: (arith_expr.Var name:y) right: (arith_expr.Const i:3) spids: [42 43] ) spids: [42 43] ) (B '+=' ($ x) (B '+=' ($ y) (3))) --- x[1,2] (arith_expr.Index a: (arith_expr.Var name:x) index: (arith_expr.Binary op:',' left:(arith_expr.Const i:1) right:(arith_expr.Const i:2)) ) (arith_expr.Index a:($ x) index:(B ',' (1) (2))) --- +1 - +2 (arith_expr.Binary op: - left: (arith_expr.Unary op:'+' a:(arith_expr.Const i:1)) right: (arith_expr.Unary op:'+' a:(arith_expr.Const i:2)) ) (B - (U '+' (1)) (U '+' (2))) --- f[x] += 1 (arith_expr.Binary op: '+=' left: (arith_expr.Index a:(arith_expr.Var name:f) index:(arith_expr.Var name:x)) right: (arith_expr.Const i:1) spids: [42 43] ) (B '+=' (arith_expr.Index a:($ f) index:($ x)) (1)) --- ~1 | ~2 (arith_expr.Binary op: '|' left: (arith_expr.Unary op:'~' a:(arith_expr.Const i:1)) right: (arith_expr.Unary op:'~' a:(arith_expr.Const i:2)) ) (B '|' (U '~' (1)) (U '~' (2))) --- x & y | a & b (arith_expr.Binary op: '|' left: (arith_expr.Binary op:'&' left:(arith_expr.Var name:x) right:(arith_expr.Var name:y)) right: (arith_expr.Binary op:'&' left:(arith_expr.Var name:a) right:(arith_expr.Var name:b)) ) (B '|' (B '&' ($ x) ($ y)) (B '&' ($ a) ($ b))) --- ~x ^ y (arith_expr.Binary op: '^' left: (arith_expr.Unary op:'~' a:(arith_expr.Var name:x)) right: (arith_expr.Var name:y) ) (B '^' (U '~' ($ x)) ($ y)) --- x << y | y << z (arith_expr.Binary op: '|' left: (arith_expr.Binary op:'<<' left:(arith_expr.Var name:x) right:(arith_expr.Var name:y)) right: (arith_expr.Binary op:'<<' left:(arith_expr.Var name:y) right:(arith_expr.Var name:z)) ) (B '|' (B '<<' ($ x) ($ y)) (B '<<' ($ y) ($ z))) --- a ^= b-1 (arith_expr.Binary op: '^=' left: (arith_expr.Var name:a) right: (arith_expr.Binary op:- left:(arith_expr.Var name:b) right:(arith_expr.Const i:1)) spids: [42 43] ) (B '^=' ($ a) (B - ($ b) (1))) --- a && b || c && d (arith_expr.Binary op: '||' left: (arith_expr.Binary op:'&&' left:(arith_expr.Var name:a) right:(arith_expr.Var name:b)) right: (arith_expr.Binary op:'&&' left:(arith_expr.Var name:c) right:(arith_expr.Var name:d)) ) (B '||' (B '&&' ($ a) ($ b)) (B '&&' ($ c) ($ d))) --- !a && !b (arith_expr.Binary op: '&&' left: (arith_expr.Unary op:'!' a:(arith_expr.Var name:a)) right: (arith_expr.Unary op:'!' a:(arith_expr.Var name:b)) ) (B '&&' (U '!' ($ a)) (U '!' ($ b))) --- a != b && c == d (arith_expr.Binary op: '&&' left: (arith_expr.Binary op:'!=' left:(arith_expr.Var name:a) right:(arith_expr.Var name:b)) right: (arith_expr.Binary op:'==' left:(arith_expr.Var name:c) right:(arith_expr.Var name:d)) ) (B '&&' (B '!=' ($ a) ($ b)) (B '==' ($ c) ($ d))) --- a > b ? 0 : 1 (arith_expr.Ternary cond: (arith_expr.Binary op:'>' left:(arith_expr.Var name:a) right:(arith_expr.Var name:b)) true_expr: (arith_expr.Const i:0) false_expr: (arith_expr.Const i:1) ) (arith_expr.Ternary cond:(B '>' ($ a) ($ b)) true_expr:(0) false_expr:(1)) --- a > b ? x+1 : y+1 (arith_expr.Ternary cond: (arith_expr.Binary op:'>' left:(arith_expr.Var name:a) right:(arith_expr.Var name:b)) true_expr: (arith_expr.Binary op:'+' left:(arith_expr.Var name:x) right:(arith_expr.Const i:1)) false_expr: (arith_expr.Binary op:'+' left:(arith_expr.Var name:y) right:(arith_expr.Const i:1)) ) (arith_expr.Ternary cond:(B '>' ($ a) ($ b)) true_expr:(B '+' ($ x) (1)) false_expr:(B '+' ($ y) (1))) --- 1 ? true1 : 2 ? true2 : false (arith_expr.Ternary cond: (arith_expr.Const i:1) true_expr: (arith_expr.Var name:true1) false_expr: (arith_expr.Ternary cond: (arith_expr.Const i:2) true_expr: (arith_expr.Var name:true2) false_expr: (arith_expr.Var name:false) ) ) (arith_expr.Ternary cond: (1) true_expr: ($ true1) false_expr: (arith_expr.Ternary cond:(2) true_expr:($ true2) false_expr:($ false)) ) --- 1 ? true1 : (2 ? true2 : false) (arith_expr.Ternary cond: (arith_expr.Const i:1) true_expr: (arith_expr.Var name:true1) false_expr: (arith_expr.Ternary cond: (arith_expr.Const i:2) true_expr: (arith_expr.Var name:true2) false_expr: (arith_expr.Var name:false) ) ) (arith_expr.Ternary cond: (1) true_expr: ($ true1) false_expr: (arith_expr.Ternary cond:(2) true_expr:($ true2) false_expr:($ false)) ) --- 1 ? (2 ? true : false1) : false2 (arith_expr.Ternary cond: (arith_expr.Const i:1) true_expr: (arith_expr.Ternary cond: (arith_expr.Const i:2) true_expr: (arith_expr.Var name:true) false_expr: (arith_expr.Var name:false1) ) false_expr: (arith_expr.Var name:false2) ) (arith_expr.Ternary cond: (1) true_expr: (arith_expr.Ternary cond:(2) true_expr:($ true) false_expr:($ false1)) false_expr: ($ false2) ) --- 1 ? 2 ? true : false1 : false2 (arith_expr.Ternary cond: (arith_expr.Const i:1) true_expr: (arith_expr.Ternary cond: (arith_expr.Const i:2) true_expr: (arith_expr.Var name:true) false_expr: (arith_expr.Var name:false1) ) false_expr: (arith_expr.Var name:false2) ) (arith_expr.Ternary cond: (1) true_expr: (arith_expr.Ternary cond:(2) true_expr:($ true) false_expr:($ false1)) false_expr: ($ false2) ) --- x ? 1 : 2, y ? 3 : 4 (arith_expr.Binary op: ',' left: (arith_expr.Ternary cond: (arith_expr.Var name:x) true_expr: (arith_expr.Const i:1) false_expr: (arith_expr.Const i:2) ) right: (arith_expr.Ternary cond: (arith_expr.Var name:y) true_expr: (arith_expr.Const i:3) false_expr: (arith_expr.Const i:4) ) ) (B ',' (arith_expr.Ternary cond:($ x) true_expr:(1) false_expr:(2)) (arith_expr.Ternary cond:($ y) true_expr:(3) false_expr:(4)) ) --- !x (arith_expr.Unary op:'!' a:(arith_expr.Var name:x)) (U '!' ($ x)) --- x-- (arith_expr.Unary op:-- a:(arith_expr.Var name:x)) (U -- ($ x)) --- x[1]-- (arith_expr.Unary op:-- a:(arith_expr.Index a:(arith_expr.Var name:x) index:(arith_expr.Const i:1))) (U -- (arith_expr.Index a:($ x) index:(1))) --- --x (arith_expr.Unary op:-- a:(arith_expr.Var name:x)) (U -- ($ x)) --- ++x[1] (arith_expr.Unary op:'++' a:(arith_expr.Index a:(arith_expr.Var name:x) index:(arith_expr.Const i:1))) (U '++' (arith_expr.Index a:($ x) index:(1))) --- !x-- (arith_expr.Unary op:'!' a:(arith_expr.Unary op:-- a:(arith_expr.Var name:x))) (U '!' (U -- ($ x))) --- ~x++ (arith_expr.Unary op:'~' a:(arith_expr.Unary op:'++' a:(arith_expr.Var name:x))) (U '~' (U '++' ($ x))) --- x++ - y++ (arith_expr.Binary op: - left: (arith_expr.Unary op:'++' a:(arith_expr.Var name:x)) right: (arith_expr.Unary op:'++' a:(arith_expr.Var name:y)) ) (B - (U '++' ($ x)) (U '++' ($ y))) --- ++x - ++y (arith_expr.Binary op: - left: (arith_expr.Unary op:'++' a:(arith_expr.Var name:x)) right: (arith_expr.Unary op:'++' a:(arith_expr.Var name:y)) ) (B - (U '++' ($ x)) (U '++' ($ y))) --- x[1] (arith_expr.Index a:(arith_expr.Var name:x) index:(arith_expr.Const i:1)) (arith_expr.Index a:($ x) index:(1)) --- x[a+b] (arith_expr.Index a: (arith_expr.Var name:x) index: (arith_expr.Binary op:'+' left:(arith_expr.Var name:a) right:(arith_expr.Var name:b)) ) (arith_expr.Index a:($ x) index:(B '+' ($ a) ($ b))) --- x[1:2] (arith_expr.Slice a:(arith_expr.Var name:x) begin:(arith_expr.Const i:1) end:(arith_expr.Const i:2)) (arith_expr.Slice a:($ x) begin:(1) end:(2)) --- x = y(2)*3 + y(4)*5 (arith_expr.Binary op: '=' left: (arith_expr.Var name:x) right: (arith_expr.Binary op: '+' left: (arith_expr.Binary op: '*' left: (arith_expr.FuncCall name:y args:[(arith_expr.Const i:2)]) right: (arith_expr.Const i:3) ) right: (arith_expr.Binary op: '*' left: (arith_expr.FuncCall name:y args:[(arith_expr.Const i:4)]) right: (arith_expr.Const i:5) ) ) spids: [42 43] ) (arith_expr.Binary op: '=' left: ($ x) right: (B '+' (B '*' (arith_expr.FuncCall name:y args:[(2)]) (3)) (B '*' (arith_expr.FuncCall name:y args:[(4)]) (5)) ) ) --- x(1,2)+y(3,4) (arith_expr.Binary op: '+' left: (arith_expr.FuncCall name:x args:[(arith_expr.Const i:1) (arith_expr.Const i:2)]) right: (arith_expr.FuncCall name:y args:[(arith_expr.Const i:3) (arith_expr.Const i:4)]) ) (B '+' (arith_expr.FuncCall name:x args:[(1) (2)]) (arith_expr.FuncCall name:y args:[(3) (4)])) --- x(a,b,c[d]) (arith_expr.FuncCall name: x args: [ (arith_expr.Var name:a) (arith_expr.Var name:b) (arith_expr.Index a:(arith_expr.Var name:c) index:(arith_expr.Var name:d)) ] ) (arith_expr.FuncCall name:x args:[($ a) ($ b) (arith_expr.Index a:($ c) index:($ d))]) --- x(1,2)*j+y(3,4)*k+z(5,6)*l (arith_expr.Binary op: '+' left: (arith_expr.Binary op: '+' left: (arith_expr.Binary op: '*' left: (arith_expr.FuncCall name:x args:[(arith_expr.Const i:1) (arith_expr.Const i:2)]) right: (arith_expr.Var name:j) ) right: (arith_expr.Binary op: '*' left: (arith_expr.FuncCall name:y args:[(arith_expr.Const i:3) (arith_expr.Const i:4)]) right: (arith_expr.Var name:k) ) ) right: (arith_expr.Binary op: '*' left: (arith_expr.FuncCall name:z args:[(arith_expr.Const i:5) (arith_expr.Const i:6)]) right: (arith_expr.Var name:l) ) ) (B '+' (B '+' (B '*' (arith_expr.FuncCall name:x args:[(1) (2)]) ($ j)) (B '*' (arith_expr.FuncCall name:y args:[(3) (4)]) ($ k)) ) (B '*' (arith_expr.FuncCall name:z args:[(5) (6)]) ($ l)) ) --- print(test(2,3)) (arith_expr.FuncCall name: print args: [(arith_expr.FuncCall name:test args:[(arith_expr.Const i:2) (arith_expr.Const i:3)])] ) (arith_expr.FuncCall name:print args:[(arith_expr.FuncCall name:test args:[(2) (3)])]) --- print("x") (arith_expr.FuncCall name:print args:[(arith_expr.Var name:x)]) (arith_expr.FuncCall name:print args:[($ x)]) --- min(255,n*2) (arith_expr.FuncCall name: min args: [ (arith_expr.Const i:255) (arith_expr.Binary op:'*' left:(arith_expr.Var name:n) right:(arith_expr.Const i:2)) ] ) (arith_expr.FuncCall name:min args:[(255) (B '*' ($ n) (2))]) --- c = pal[i*8] (arith_expr.Binary op: '=' left: (arith_expr.Var name:c) right: (arith_expr.Index a: (arith_expr.Var name:pal) index: (arith_expr.Binary op:'*' left:(arith_expr.Var name:i) right:(arith_expr.Const i:8)) ) spids: [42 43] ) (arith_expr.Binary op:'=' left:($ c) right:(arith_expr.Index a:($ pal) index:(B '*' ($ i) (8)))) --- x=1,y=2,z=3 (arith_expr.Binary op: ',' left: (arith_expr.Binary op: ',' left: (arith_expr.Binary op: '=' left: (arith_expr.Var name:x) right: (arith_expr.Const i:1) spids: [42 43] ) right: (arith_expr.Binary op: '=' left: (arith_expr.Var name:y) right: (arith_expr.Const i:2) spids: [42 43] ) ) right: (arith_expr.Binary op: '=' left: (arith_expr.Var name:z) right: (arith_expr.Const i:3) spids: [42 43] ) ) (B ',' (B ',' (arith_expr.Binary op:'=' left:($ x) right:(1)) (arith_expr.Binary op:'=' left:($ y) right:(2))) (arith_expr.Binary op:'=' left:($ z) right:(3)) )got expected error for }: Unexpected end of input got expected error for ]: can't be used in prefix position got expected error for {: Unexpected end of input got expected error for x+1 = y: Can't assign to (arith_expr.Binary op:'+' left:(arith_expr.Var name:x) right:(arith_expr.Const i:1)) got expected error for (x+1)++: Can't assign to (arith_expr.Binary op:'+' left:(arith_expr.Var name:x) right:(arith_expr.Const i:1)) got expected error for foo ? 1 :: Unexpected end of input got expected error for foo ? 1 : expected :, got got expected error for %: can't be used in prefix position got expected error for }: Unexpected end of input got expected error for {: Unexpected end of input got expected error for ]: can't be used in prefix position got expected error for 1 ( 2: (arith_expr.Const i:1) can't be called got expected error for (x+1) ( 2 ): (arith_expr.Binary op:'+' left:(arith_expr.Var name:x) right:(arith_expr.Const i:1)) can't be called got expected error for 1 [ 2 ]: (arith_expr.Const i:1) can't be indexed