Пример #1
0
  /**
   * Parses the given String to a Reverish Polish Notation Queue according to the Shunting-Yard
   * algorithm.
   *
   * @param expression The String to parse.
   * @return The Reverse Polish Notation Queue.
   */
  public Queue<Expression> parse(String expression) {
    expressions = new Converter().convert(expression);

    for (Expression e : expressions) {
      e.parse(operators, output);
    }

    popAll(operators, output);

    return output;
  }