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