term method

double term()

Implementation

double term() {
  double x = factor();
  while (true) {
    if (match('*')) {
      x *= factor();
    } else if (match('/')) {
      x /= factor();
    } else {
      break;
    }
  }
  return x;
}