def p_expression_binop(p):
 if (p[2] == '+'):
  p[0] = (p[1] + p[3])
 elif (p[2] == '-'):
  p[0] = (p[1] - p[3])
 elif (p[2] == '*'):
  p[0] = (p[1] * p[3])
 elif (p[2] == '/'):
  p[0] = (p[1] / p[3])

def p_expression_binop ( p ) : if ( p [ 2 ] == '+' ) : p [ 0 ] = ( p [ 1 ] + p [ 3 ] ) elif ( p [ 2 ] == '-' ) : p [ 0 ] = ( p [ 1 ] - p [ 3 ] ) elif ( p [ 2 ] == '*' ) : p [ 0 ] = ( p [ 1 ] * p [ 3 ] ) elif ( p [ 2 ] == '/' ) : p [ 0 ] = ( p [ 1 ] / p [ 3 ] )
expression : expression plus expression | expression minus expression | expression times expression | expression divide expression .