Examples of InfixExpression


Examples of com.bacoder.parser.java.api.InfixExpression

          && isTerminalNode(context, 3, JavaParser.GT)) {
        operator = InfixExpression.Operator.UNSIGNED_RIGHT_SHIFT;
      }

      if (operator != null) {
        InfixExpression infixExpression = createNode(context, InfixExpression.class);
        infixExpression.setLeftHandSide(
            getAdapter(ExpressionAdapter.class).adapt((ExpressionContext) context.getChild(0)));
        infixExpression.setOperator(operator);
        infixExpression.setRightHandSide(
            getAdapter(ExpressionAdapter.class).adapt(
                (ExpressionContext) context.getChild(context.getChildCount() - 1)));
        return infixExpression;
      }
    }
View Full Code Here

Examples of com.dragome.compiler.ast.InfixExpression

    aToB.redirect(bToD.target);
    removeEdge(bToC);
    removeEdge(bToD);
    removeNode(b);

    InfixExpression infix= new InfixExpression(isOR ? InfixExpression.Operator.CONDITIONAL_OR : InfixExpression.Operator.CONDITIONAL_AND);

    infix.setOperands(aToC.getBooleanExpression().getExpression(), bToC.getBooleanExpression().getExpression());

    BooleanExpression be= new BooleanExpression(infix);
    aToC.setBooleanExpression(be);
    aToB.setBooleanExpression(be);
View Full Code Here

Examples of com.dragome.compiler.ast.InfixExpression

    return methodDecl.createVariableBinding(VariableDeclaration.getLocalVariableName(method, slot, bytes.getIndex()), type, isWrite);
  }

  private InfixExpression createInfixRightLeft(InfixExpression.Operator op, Expression right, Expression left, Type type)
  {
    InfixExpression binOp= new InfixExpression(op);
    binOp.setTypeBinding(type);
    binOp.setOperands(left, right);
    return binOp;
  }
View Full Code Here

Examples of com.dragome.compiler.ast.InfixExpression

  }

  ConditionalBranch createConditional(int currentIndex, InfixExpression.Operator operator) throws IOException
  {
    ConditionalBranch c= new ConditionalBranch(currentIndex + bytes.readShort());
    InfixExpression be= new InfixExpression(operator);
    Expression rightOperand= stack.pop();
    be.setOperands(stack.pop(), rightOperand);
    c.setExpression(be);
    return c;
  }
View Full Code Here

Examples of com.dragome.compiler.ast.InfixExpression

        c.setExpression(leftOperand);
      }
    }
    else
    {
      InfixExpression be= new InfixExpression(operator);
      be.setOperands(leftOperand, rightOperand);
      c.setExpression(be);
    }

    return c;
  }
View Full Code Here

Examples of com.dragome.compiler.ast.InfixExpression

      return simplifyBooleanExpression((Expression) pe.getOperand(), !negate);
    }

    if (expr instanceof InfixExpression && expr.getTypeBinding() == Type.BOOLEAN)
    {
      InfixExpression in= (InfixExpression) expr;
      InfixExpression.Operator op= in.getOperator();
      if (negate)
      {
        op= op.getComplement();
        if (op != InfixExpression.Operator.CONDITIONAL_AND && op != InfixExpression.Operator.CONDITIONAL_OR)
          negate= false;
      }
      InfixExpression out= new InfixExpression(op);
      out.widen(in);
      out.setOperands(simplifyBooleanExpression(in.getLeftOperand(), negate), simplifyBooleanExpression(in.getRightOperand(), negate));
      return out;
    }

    if (negate)
    {
View Full Code Here

Examples of com.dragome.compiler.ast.InfixExpression

    VariableBinding vb2= null;

    Assignable fa1= null;
    Assignable fa2= null;

    InfixExpression sum= null;

    Iterator iter= decl.vbs.iterator();

    while (iter.hasNext())
    {
      VariableBinding vb= (VariableBinding) iter.next();

      if (vb.getParentNode() instanceof Assignment)
      {
        Assignment a= (Assignment) vb.getParentNode();
        if (a.getLeftHandSide() == vb && a.getRightHandSide() instanceof Assignable)
        {
          vb1= vb;
          a1= a;
          fa1= (Assignable) a.getRightHandSide();
          continue;
        }
      }

      if (vb.getParentNode() instanceof InfixExpression)
      {
        InfixExpression infix= (InfixExpression) vb.getParentNode();
        if (infix.getParentNode() instanceof Assignment)
        {
          Assignment a= (Assignment) infix.getParentNode();
          if (a.getLeftHandSide() instanceof Assignable)
          {
            vb2= vb;
            fa2= (Assignable) a.getLeftHandSide();
            a2= a;
View Full Code Here

Examples of com.dragome.compiler.ast.InfixExpression

    VariableBinding vb2= null;

    Assignable fa1= null;
    Assignable fa2= null;

    InfixExpression infixExpr= null;

    Iterator iter= decl.vbs.iterator();

    while (iter.hasNext())
    {
      VariableBinding vb= (VariableBinding) iter.next();

      if (!(vb.getParentNode() instanceof Assignment))
        continue;

      Assignment a= (Assignment) vb.getParentNode();
      if (a.getRightHandSide() == vb && a.getLeftHandSide() instanceof Assignable)
      {
        vb2= vb;
        a2= a;
        fa2= (Assignable) a.getLeftHandSide();
        continue;
      }

      if (a.getLeftHandSide() == vb && a.getRightHandSide() instanceof InfixExpression)
      {
        InfixExpression infix= (InfixExpression) a.getRightHandSide();
        if (!(infix.getLeftOperand() instanceof Assignable))
          continue;
        vb1= vb;
        a1= a;
        fa1= (Assignable) infix.getLeftOperand();
        infixExpr= infix;
        continue;
      }
    }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.InfixExpression

     *
     * @param text literal text
     * @return string concatenation expression
     */
    public InfixExpressionBuilder buildStringConcatenation(String text) {
        InfixExpression expr = getAST().newInfixExpression();
        StringLiteral strlit = getAST().newStringLiteral();
        strlit.setLiteralValue(text);
        expr.setOperator(Operator.PLUS);
        return new InfixExpressionBuilder(this, expr, strlit);
    }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.InfixExpression

     *
     * @param op operator
     * @return expression
     */
    public InfixExpressionBuilder buildInfix(Operator op) {
        InfixExpression infixex = getAST().newInfixExpression();
        infixex.setOperator(op);
        return new InfixExpressionBuilder(this, infixex);
    }
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.