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

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


  }

  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();
View Full Code Here


  }

  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();
View Full Code Here

  }

  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();
View Full Code Here

      System.out.println("public static final Operator[] OPERATORS = {");
      while (i3.hasNext()) {
        final String headStr = i3.next();
        final Operator oper = operatorMap.get(headStr);
        if (oper instanceof DivideOperator) {
          final InfixOperator iOper = (DivideOperator) oper;
          String grouping = null;
          if (iOper.getGrouping() == InfixOperator.NONE) {
            grouping = "InfixOperator.NONE";
          } else if (iOper.getGrouping() == InfixOperator.LEFT_ASSOCIATIVE) {
            grouping = "InfixOperator.LEFT_ASSOCIATIVE";
          } else if (iOper.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE) {
            grouping = "InfixOperator.RIGHT_ASSOCIATIVE";
          }
          System.out.println("    new DivideOperator(\"" + iOper.getOperatorString() + "\", \"" + iOper.getFunctionName() + "\", "
              + iOper.getPrecedence() + ", " + grouping + "),");
        } else if (oper instanceof SubtractOperator) {
          final InfixOperator iOper = (SubtractOperator) oper;
          String grouping = null;
          if (iOper.getGrouping() == InfixOperator.NONE) {
            grouping = "InfixOperator.NONE";
          } else if (iOper.getGrouping() == InfixOperator.LEFT_ASSOCIATIVE) {
            grouping = "InfixOperator.LEFT_ASSOCIATIVE";
          } else if (iOper.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE) {
            grouping = "InfixOperator.RIGHT_ASSOCIATIVE";
          }
          System.out.println("    new SubtractOperator(\"" + iOper.getOperatorString() + "\", \"" + iOper.getFunctionName()
              + "\", " + iOper.getPrecedence() + ", " + grouping + "),");
        } else if (oper instanceof InfixOperator) {
          final InfixOperator iOper = (InfixOperator) oper;
          String grouping = null;
          if (iOper.getGrouping() == InfixOperator.NONE) {
            grouping = "InfixOperator.NONE";
          } else if (iOper.getGrouping() == InfixOperator.LEFT_ASSOCIATIVE) {
            grouping = "InfixOperator.LEFT_ASSOCIATIVE";
          } else if (iOper.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE) {
            grouping = "InfixOperator.RIGHT_ASSOCIATIVE";
          }
          System.out.println("    new InfixOperator(\"" + iOper.getOperatorString() + "\", \"" + iOper.getFunctionName() + "\", "
              + iOper.getPrecedence() + ", " + grouping + "),");
        } else if (oper instanceof PostfixOperator) {
          System.out.println("    new PostfixOperator(\"" + oper.getOperatorString() + "\", \"" + oper.getFunctionName() + "\", "
              + oper.getPrecedence() + "),");
        } else if (oper instanceof PreMinusOperator) {
          System.out.println("    new PreMinusOperator(\"" + oper.getOperatorString() + "\", \"" + oper.getFunctionName() + "\", "
View Full Code Here

            } else if (groupingStr.equalsIgnoreCase("right")) {
              grouping = InfixOperator.RIGHT_ASSOCIATIVE;
            }
            oper = ASTNodeFactory.createInfixOperator(operatorStr, headStr, precedence, grouping);
          } catch (final NoSuchElementException nsee) {
            oper = new InfixOperator(operatorStr, headStr, precedence, InfixOperator.NONE);
          }
          // if (operatorStr.equals("*")) {
          // TIMES_OPERATOR = (InfixOperator) oper;
          // } else if (operatorStr.equals("+")) {
          // PLUS_OPERATOR = (InfixOperator) oper;
View Full Code Here

            System.out.println("public static final Operator[] OPERATORS = {");
            while (i3.hasNext()) {
                final String headStr = i3.next();
                final Operator oper = operatorMap.get(headStr);
                if (oper instanceof DivideOperator) {
                    final InfixOperator iOper = (DivideOperator) oper;
                    String grouping = null;
                    if (iOper.getGrouping() == InfixOperator.NONE) {
                        grouping = "InfixOperator.NONE";
                    } else if (iOper.getGrouping() == InfixOperator.LEFT_ASSOCIATIVE) {
                        grouping = "InfixOperator.LEFT_ASSOCIATIVE";
                    } else if (iOper.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE) {
                        grouping = "InfixOperator.RIGHT_ASSOCIATIVE";
                    }
                    System.out.println("    new DivideOperator(\"" + iOper.getOperatorString() + "\", \"" + iOper.getFunctionName() + "\", "
                            + iOper.getPrecedence() + ", " + grouping + "),");
                } else if (oper instanceof SubtractOperator) {
                    final InfixOperator iOper = (SubtractOperator) oper;
                    String grouping = null;
                    if (iOper.getGrouping() == InfixOperator.NONE) {
                        grouping = "InfixOperator.NONE";
                    } else if (iOper.getGrouping() == InfixOperator.LEFT_ASSOCIATIVE) {
                        grouping = "InfixOperator.LEFT_ASSOCIATIVE";
                    } else if (iOper.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE) {
                        grouping = "InfixOperator.RIGHT_ASSOCIATIVE";
                    }
                    System.out.println("    new SubtractOperator(\"" + iOper.getOperatorString() + "\", \"" + iOper.getFunctionName()
                            + "\", " + iOper.getPrecedence() + ", " + grouping + "),");
                } else if (oper instanceof InfixOperator) {
                    final InfixOperator iOper = (InfixOperator) oper;
                    String grouping = null;
                    if (iOper.getGrouping() == InfixOperator.NONE) {
                        grouping = "InfixOperator.NONE";
                    } else if (iOper.getGrouping() == InfixOperator.LEFT_ASSOCIATIVE) {
                        grouping = "InfixOperator.LEFT_ASSOCIATIVE";
                    } else if (iOper.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE) {
                        grouping = "InfixOperator.RIGHT_ASSOCIATIVE";
                    }
                    System.out.println("    new InfixOperator(\"" + iOper.getOperatorString() + "\", \"" + iOper.getFunctionName() + "\", "
                            + iOper.getPrecedence() + ", " + grouping + "),");
                } else if (oper instanceof PostfixOperator) {
                    System.out.println("    new PostfixOperator(\"" + oper.getOperatorString() + "\", \"" + oper.getFunctionName() + "\", "
                            + oper.getPrecedence() + "),");
                } else if (oper instanceof PreMinusOperator) {
                    System.out.println("    new PreMinusOperator(\"" + oper.getOperatorString() + "\", \"" + oper.getFunctionName() + "\", "
View Full Code Here

    }

    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();
View Full Code Here

                        } else if (groupingStr.equalsIgnoreCase("right")) {
                            grouping = InfixOperator.RIGHT_ASSOCIATIVE;
                        }
                        oper = ASTNodeFactory.createInfixOperator(operatorStr, headStr, precedence, grouping);
                    } catch (final NoSuchElementException nsee) {
                        oper = new InfixOperator(operatorStr, headStr, precedence, InfixOperator.NONE);
                    }
                    // if (operatorStr.equals("*")) {
                    // TIMES_OPERATOR = (InfixOperator) oper;
                    // } else if (operatorStr.equals("+")) {
                    // PLUS_OPERATOR = (InfixOperator) oper;
View Full Code Here

  }

  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();
View Full Code Here

      System.out.println("public static final Operator[] OPERATORS = {");
      while (i3.hasNext()) {
        final String headStr = (String) i3.next();
        final Operator oper = (Operator) operatorMap.get(headStr);
        if (oper instanceof DivideOperator) {
          final InfixOperator iOper = (DivideOperator) oper;
          String grouping = null;
          if (iOper.getGrouping() == InfixOperator.NONE) {
            grouping = "InfixOperator.NONE";
          } else if (iOper.getGrouping() == InfixOperator.LEFT_ASSOCIATIVE) {
            grouping = "InfixOperator.LEFT_ASSOCIATIVE";
          } else if (iOper.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE) {
            grouping = "InfixOperator.RIGHT_ASSOCIATIVE";
          }
          System.out.println("    new DivideOperator(\"" + iOper.getOperatorString() + "\", \"" + iOper.getFunctionName() + "\", "
              + iOper.getPrecedence() + ", " + grouping + "),");
        } else if (oper instanceof SubtractOperator) {
          final InfixOperator iOper = (SubtractOperator) oper;
          String grouping = null;
          if (iOper.getGrouping() == InfixOperator.NONE) {
            grouping = "InfixOperator.NONE";
          } else if (iOper.getGrouping() == InfixOperator.LEFT_ASSOCIATIVE) {
            grouping = "InfixOperator.LEFT_ASSOCIATIVE";
          } else if (iOper.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE) {
            grouping = "InfixOperator.RIGHT_ASSOCIATIVE";
          }
          System.out.println("    new SubtractOperator(\"" + iOper.getOperatorString() + "\", \"" + iOper.getFunctionName()
              + "\", " + iOper.getPrecedence() + ", " + grouping + "),");
        } else if (oper instanceof InfixOperator) {
          final InfixOperator iOper = (InfixOperator) oper;
          String grouping = null;
          if (iOper.getGrouping() == InfixOperator.NONE) {
            grouping = "InfixOperator.NONE";
          } else if (iOper.getGrouping() == InfixOperator.LEFT_ASSOCIATIVE) {
            grouping = "InfixOperator.LEFT_ASSOCIATIVE";
          } else if (iOper.getGrouping() == InfixOperator.RIGHT_ASSOCIATIVE) {
            grouping = "InfixOperator.RIGHT_ASSOCIATIVE";
          }
          System.out.println("    new InfixOperator(\"" + iOper.getOperatorString() + "\", \"" + iOper.getFunctionName() + "\", "
              + iOper.getPrecedence() + ", " + grouping + "),");
        } else if (oper instanceof PostfixOperator) {
          System.out.println("    new PostfixOperator(\"" + oper.getOperatorString() + "\", \"" + oper.getFunctionName() + "\", "
              + oper.getPrecedence() + "),");
        } else if (oper instanceof PreMinusOperator) {
          System.out.println("    new PreMinusOperator(\"" + oper.getOperatorString() + "\", \"" + oper.getFunctionName() + "\", "
View Full Code Here

TOP

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

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.