Examples of BinaryOperator


Examples of com.icona.tree.nodes.Operator.BinaryOperator

    Expression rhs=null;
    BinaryOperator operator=null;
   
    public BinaryExpression(Node parent, int line_no,BinarySymbol operator) {
      super(parent, line_no);
      this.operator=new BinaryOperator(operator);
      
    }
View Full Code Here

Examples of edu.cmu.cs.crystal.tac.model.BinaryOperator

  }

  public TACInstruction create(
      Assignment node,
      IEclipseVariableQuery eclipseVariableQuery) {
    BinaryOperator operator = null// null indicates "normal" assignment
    if(Assignment.Operator.BIT_AND_ASSIGN.equals(node.getOperator()))
      operator = BinaryOperator.BITWISE_AND;
    else if(Assignment.Operator.BIT_OR_ASSIGN.equals(node.getOperator()))
      operator = BinaryOperator.BITWISE_OR;
    else if(Assignment.Operator.BIT_XOR_ASSIGN.equals(node.getOperator()))
View Full Code Here

Examples of edu.cmu.cs.crystal.tac.model.BinaryOperator

  }

  public TACInstruction create(
      InfixExpression node,
      IEclipseVariableQuery eclipseVariableQuery) {
    BinaryOperator operator = null;
    if(InfixExpression.Operator.AND.equals(node.getOperator()))
      operator = BinaryOperator.BITWISE_AND;
    else if(InfixExpression.Operator.CONDITIONAL_AND.equals(node.getOperator()))
      return new EclipseMergeHelper(node, eclipseVariableQuery);
    else if(InfixExpression.Operator.CONDITIONAL_OR.equals(node.getOperator()))
View Full Code Here

Examples of edu.cmu.cs.crystal.tac.model.BinaryOperator

    return new LoadLiteralInstructionImpl(node, node.getToken(), eclipseVariableQuery);
  }

  public TACInstruction create(PostfixExpression node,
      IEclipseVariableQuery eclipseVariableQuery) {
    BinaryOperator operator;
    if(PostfixExpression.Operator.DECREMENT.equals(node.getOperator()))
      operator = BinaryOperator.ARIT_SUBTRACT;
    else if(PostfixExpression.Operator.INCREMENT.equals(node.getOperator()))
      operator = BinaryOperator.ARIT_ADD;
    else
View Full Code Here

Examples of httl.ast.BinaryOperator

  }

  private BinaryOperator createBinaryOperator(String operator, int priority, int offset) {
    String name = BINARY_OPERATOR_NAMES.get(operator);
    if (StringUtils.isNotEmpty(name)) {
      return new BinaryOperator(name, priority, offset);
    } else if (StringUtils.isFunction(operator)) {
      return new BinaryOperator(operator.substring(1), priority, offset);
    } else {
      throw new UnsupportedOperationException("Unsupported binary operator " + operator);
    }
  }
View Full Code Here

Examples of httl.ast.BinaryOperator

          operatorStack.push(operator);
        } else {
          if (! StringUtils.isFunction(msg) && ! BINARY_OPERATORS.contains(msg)) {
            throw new ParseException("Unsupported binary operator " + msg, getTokenOffset(token) );
          }
          BinaryOperator operator = createBinaryOperator(msg, getPriority(msg, false), getTokenOffset(token));
          operatorTokens.put(operator, token);
          while (! operatorStack.isEmpty() && ! (operatorStack.peek() instanceof Bracket)
              && operatorStack.peek().getPriority() >= operator.getPriority()) {
            popOperator(parameterStack, operatorStack, operatorTokens, offset);
          }
          operatorStack.push(operator);
        }
        if ("[".equals(msg)) {
View Full Code Here

Examples of httl.ast.BinaryOperator

    if (operatorStack.isEmpty())
      throw new ParseException("Miss left parenthesis", offset);
    Operator operator = operatorStack.pop(); // 将优先级高于及等于当前操作符的弹出
    if (operator instanceof BinaryOperator) {
      Token token = operatorTokens.get(operator);
      BinaryOperator binaryOperator = (BinaryOperator) operator;
      if (parameterStack.isEmpty())
        throw new ParseException("Binary operator " + binaryOperator.getName() + " miss parameter", token == null ? offset : getTokenOffset(token));
      binaryOperator.setRightParameter(parameterStack.pop()); // right first
      if (parameterStack.isEmpty())
        throw new ParseException("Binary operator " + binaryOperator.getName() + " miss parameter", token == null ? offset : getTokenOffset(token));
      binaryOperator.setLeftParameter(parameterStack.pop());
      parameterStack.push(operator);
    } else if (operator instanceof UnaryOperator) {
      Token token = operatorTokens.get(operator);
      UnaryOperator unaryOperator = (UnaryOperator) operator;
      if (parameterStack.isEmpty())
View Full Code Here

Examples of nexj.core.persistence.operator.BinaryOperator

         if (args.getTail() == null)
         {
            return create(args.getHead(), query, key, nOutput);
         }

         BinaryOperator op = create(query);

         if (!op.setLeft(query.createOperator(key, args.getHead(), nOutput)))
         {
            return null;
         }

         args = (Pair)args.getTail();

         for (;;)
         {
            if (!op.setRight(query.createOperator(key, args.getHead(), nOutput)))
            {
               return null;
            }

            if (args.getTail() == null)
            {
               break;
            }

            BinaryOperator right = create(query);

            right.setLeft(op);
            op = right;
            args = args.getNext();
         }

         return op;
View Full Code Here

Examples of nexj.core.persistence.operator.BinaryOperator

      /**
       * @see nexj.core.persistence.sql.SQLGenerator.OperatorAppender#appendOperator(java.lang.StringBuffer, nexj.core.persistence.Operator, nexj.core.persistence.sql.SQLGenerator)
       */
      public void appendOperator(StringBuffer buf, Operator op, SQLGenerator gen)
      {
         BinaryOperator binOp = (BinaryOperator)op;

         gen.appendOperator(buf, binOp.getLeft());
         buf.append(m_sOperator);
         gen.appendOperator(buf, binOp.getRight());
      }
View Full Code Here

Examples of nexj.core.persistence.operator.BinaryOperator

      /**
       * @see nexj.core.persistence.sql.SQLGenerator.OperatorAppender#appendOperator(java.lang.StringBuffer, nexj.core.persistence.Operator, nexj.core.persistence.sql.SQLGenerator)
       */
      public void appendOperator(StringBuffer buf, Operator op, SQLGenerator gen)
      {
         BinaryOperator binOp = (BinaryOperator)op;

         gen.appendComparisonOperand(buf, binOp.getLeft());
         buf.append(m_sOperator);
         gen.appendComparisonOperand(buf, binOp.getRight());
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.