Package info.bliki.wiki.template.expr.operator

Examples of info.bliki.wiki.template.expr.operator.Operator


   * Determine the current PrefixOperator
   *
   * @return <code>null</code> if no prefix operator could be determined
   */
  private PrefixOperator determinePrefixOperator() {
    Operator oper = null;
    for (int i = 0; i < fOperList.size(); i++) {
      oper = (Operator) fOperList.get(i);
      if (oper instanceof PrefixOperator) {
        return (PrefixOperator) oper;
      }
View Full Code Here


   * Determine the current PostfixOperator
   *
   * @return <code>null</code> if no postfix operator could be determined
   */
  private PostfixOperator determinePostfixOperator() {
    Operator oper = null;
    for (int i = 0; i < fOperList.size(); i++) {
      oper = (Operator) fOperList.get(i);
      if (oper instanceof PostfixOperator) {
        return (PostfixOperator) oper;
      }
View Full Code Here

   * Determine the current BinaryOperator
   *
   * @return <code>null</code> if no binary operator could be determined
   */
  private InfixOperator determineBinaryOperator() {
    Operator oper = null;
    for (int i = 0; i < fOperList.size(); i++) {
      oper = (Operator) fOperList.get(i);
      if (oper instanceof InfixOperator) {
        return (InfixOperator) oper;
      }
View Full Code Here

    return null;
  }

  private ASTNode parsePrimary() {
    if (fToken == TT_OPERATOR) {
      final Operator oper = determinePrefixOperator();

      if (oper instanceof PrefixOperator) {
        getNextToken();
        final ASTNode temp = parseLookaheadOperator(oper.getPrecedence());
        if (oper.getFunctionName().equals("PreMinus")) {
          // special cases for negative numbers
          if (temp instanceof NumberNode) {
            ((NumberNode) temp).toggleSign();
            return temp;
          }
View Full Code Here

    return getFactor();
  }

  private ASTNode parseLookaheadOperator(final int min_precedence) {
    ASTNode rhs = parsePrimary();
    Operator operLookahead;
    InfixOperator binOper;
    while (true) {
      final int lookahead = fToken;
      if (lookahead != TT_OPERATOR) {
        break;
      }
      operLookahead = determineBinaryOperator();
      if (operLookahead instanceof InfixOperator) {
        binOper = (InfixOperator) operLookahead;
        if (binOper.getPrecedence() > min_precedence) {
          rhs = parseOperators(rhs, operLookahead.getPrecedence());
          continue;
        } else if ((binOper.getPrecedence() == min_precedence) && (binOper.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE)) {
          rhs = parseOperators(rhs, operLookahead.getPrecedence());
          continue;
        }
      } else {
        operLookahead = determinePostfixOperator();

        if (operLookahead instanceof PostfixOperator) {
          if (operLookahead.getPrecedence() > min_precedence) {
            getNextToken();
            rhs = ((PostfixOperator) operLookahead).createFunction(fFactory, rhs);
            continue;
          }
        }
View Full Code Here

   * @param min_precedence
   * @return
   */
  private ASTNode parseOperators(ASTNode lhs, final int min_precedence) {
    ASTNode rhs = null;
    Operator oper;
    while (true) {
      if (fToken != TT_OPERATOR) {
        break;
      }
      oper = determineBinaryOperator();

      if (oper instanceof InfixOperator) {
        if (oper.getPrecedence() >= min_precedence) {
          getNextToken();
          rhs = parseLookaheadOperator(oper.getPrecedence());
          lhs = ((InfixOperator) oper).createFunction(fFactory, lhs, rhs);
          // lhs = parseArguments(lhs);
          continue;
        }
      } else {
View Full Code Here

   * Determine the current PrefixOperator
   *
   * @return <code>null</code> if no prefix operator could be determined
   */
  private PrefixOperator determinePrefixOperator() {
    Operator oper = null;
    for (int i = 0; i < fOperList.size(); i++) {
      oper = (Operator) fOperList.get(i);
      if (oper instanceof PrefixOperator) {
        return (PrefixOperator) oper;
      }
View Full Code Here

   * Determine the current PostfixOperator
   *
   * @return <code>null</code> if no postfix operator could be determined
   */
  private PostfixOperator determinePostfixOperator() {
    Operator oper = null;
    for (int i = 0; i < fOperList.size(); i++) {
      oper = (Operator) fOperList.get(i);
      if (oper instanceof PostfixOperator) {
        return (PostfixOperator) oper;
      }
View Full Code Here

   * Determine the current BinaryOperator
   *
   * @return <code>null</code> if no binary operator could be determined
   */
  private InfixOperator determineBinaryOperator() {
    Operator oper = null;
    for (int i = 0; i < fOperList.size(); i++) {
      oper = (Operator) fOperList.get(i);
      if (oper instanceof InfixOperator) {
        return (InfixOperator) oper;
      }
View Full Code Here

    return null;
  }

  private ASTNode parsePrimary() {
    if (fToken == TT_OPERATOR) {
      final Operator oper = determinePrefixOperator();

      if (oper instanceof PrefixOperator) {
        getNextToken();
        final ASTNode temp = parseLookaheadOperator(oper.getPrecedence());
        if (oper.getFunctionName().equals("PreMinus")) {
          // special cases for negative numbers
          if (temp instanceof NumberNode) {
            ((NumberNode) temp).toggleSign();
            return temp;
          }
View Full Code Here

TOP

Related Classes of info.bliki.wiki.template.expr.operator.Operator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.