예제 #1
0
  /**
   * Transfomiert die mathematischen Operatoren Mal und Durch (*,/). <br>
   * EBNF:<br>
   * <code>expoOp {("*"|"/") spaces expoOp};</code>
   *
   * @return CFXD Element
   * @throws PageException
   */
  private Ref divMultiOp() throws PageException {
    Ref ref = expoOp();

    while (!cfml.isLast()) {
      // Multiply Operation
      if (cfml.forwardIfCurrent('*')) {
        ref = _multi(ref);
        // cfml.removeSpace();
        // ref=new Multi(ref,expoOp());
      }
      // Divide Operation
      else if (cfml.isCurrent('/') && (!cfml.isCurrent("/>"))) {
        cfml.next();
        ref = _div(ref);
        // cfml.removeSpace();
        // ref=new Div(ref,expoOp());
      }
      // Divide Operation
      else if (cfml.isCurrent('\\')) {
        cfml.next();
        ref = _intdiv(ref);
        // cfml.removeSpace();
        // ref=new IntDiv(ref,expoOp());
      } else {
        break;
      }
    }
    return ref;
  }
예제 #2
0
  /**
   * Transfomiert die mathematischen Operatoren Plus und Minus (1,-). <br>
   * EBNF:<br>
   * <code>modOp [("-"|"+") spaces plusMinusOp];</code>
   *
   * @return CFXD Element
   * @throws PageException
   */
  private Ref plusMinusOp() throws PageException {
    Ref ref = modOp();

    while (!cfml.isLast()) {
      // Plus Operation
      if (cfml.forwardIfCurrent('+')) {
        ref = _plus(ref);
        // cfml.removeSpace();
        // ref=new Plus(ref,modOp());
      }
      // Minus Operation
      else if (cfml.forwardIfCurrent('-')) {
        ref = _minus(ref);
        // cfml.removeSpace();
        // ref=new Minus(ref,modOp());
      } else break;
    }
    return ref;
  }