def p_expr_binary(p):
 p[0] = ('BINOP', p[2], p[1], p[3])

def p_expr_binary ( p ) : p [ 0 ] = ( 'BINOP' , p [ 2 ] , p [ 1 ] , p [ 3 ] )
expr : expr plus expr | expr minus expr | expr times expr | expr divide expr | expr power expr .