Examples of BinaryOperation


Examples of dk.brics.string.stringoperations.BinaryOperation

                factory.addStatement(new StringBufferUnaryOp(callee, op));
                return callee;
            }
            // StringBuffer.replace(int start, int end, String replacement)
            else if (methodName.equals("replace") && numArgs == 3) {
                BinaryOperation op = new Replace5();
                Variable rvar = valueOf(expr.getArgBox(2), arguments.get(2), 10, target.getParameterType(2), factory);
                factory.addStatement(new StringBufferBinaryOp(callee, op, rvar));
                return callee;
            }
            // StringBuffer.reverse()
View Full Code Here

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

      return store;
    }
    else
      throw new IllegalArgumentException("Unknown assignment operator \"" + node.getOperator() + "\" in: " + node);

    BinaryOperation binop = new EclipseBinaryAssignOperation(
        node, operator, eclipseVariableQuery);
    TACInstruction store = createStore(
        node,
        node.getLeftHandSide(),
        binop.getTarget(),
        eclipseVariableQuery);
    return new EclipseInstructionSequence(node, new TACInstruction[] { binop, store }, 0, eclipseVariableQuery);
  }
View Full Code Here

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

    Assert.assertTrue(seq.getInstructions()[1] instanceof LoadLiteralInstruction);
    Assert.assertTrue(seq.getInstructions()[2] instanceof BinaryOperation);
    Assert.assertTrue(seq.getInstructions()[3] instanceof StoreFieldInstruction);
    CopyInstruction copy = (CopyInstruction) seq.getInstructions()[0];
    LoadLiteralInstruction one = (LoadLiteralInstruction) seq.getInstructions()[1];
    BinaryOperation add = (BinaryOperation) seq.getInstructions()[2];
    StoreFieldInstruction store = (StoreFieldInstruction) seq.getInstructions()[3];
    Assert.assertEquals(load.getTarget(), add.getOperand1());
    Assert.assertEquals(one.getTarget(), add.getOperand2());
    Assert.assertEquals(add.getTarget(), store.getSourceOperand());
    Assert.assertEquals(copy.getTarget(), seq.getResultVariable());
    Assert.assertFalse(add.getTarget().equals(seq.getResultVariable()));
   
    Assert.assertEquals(load.getTarget(), copy.getOperand());
   
    Assert.assertTrue(load.resolveFieldBinding().equals(store.resolveFieldBinding()));
  }
View Full Code Here

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

    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    InfixExpression infix = (InfixExpression) EclipseTACSimpleTestDriver.getLastStatementReturn(m).getExpression();
    TACInstruction instr = tac.instruction(infix);
    Assert.assertTrue(instr != null);
    Assert.assertTrue(instr instanceof BinaryOperation);
    BinaryOperation binop = (BinaryOperation) instr;
    Assert.assertEquals(tac.variable(infix.getLeftOperand()), binop.getOperand1());
    Assert.assertEquals(tac.variable(infix.getRightOperand()), binop.getOperand2());
  }
View Full Code Here

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

        3, seq.getInstructions().length);
    Assert.assertTrue(seq.getInstructions()[0] instanceof LoadLiteralInstruction);
    Assert.assertTrue(seq.getInstructions()[1] instanceof BinaryOperation);
    Assert.assertTrue(seq.getInstructions()[2] instanceof StoreArrayInstruction);
    LoadLiteralInstruction one = (LoadLiteralInstruction) seq.getInstructions()[0];
    BinaryOperation add = (BinaryOperation) seq.getInstructions()[1];
    StoreArrayInstruction store = (StoreArrayInstruction) seq.getInstructions()[2];
    Assert.assertEquals(load.getTarget(), add.getOperand1());
    Assert.assertEquals(one.getTarget(), add.getOperand2());
    Assert.assertEquals(add.getTarget(), store.getSourceOperand());
    Assert.assertEquals(add.getTarget(), seq.getResultVariable());
    Assert.assertFalse(add.getTarget().equals(load.getTarget()));
  }
View Full Code Here

Examples of org.apache.clerezza.rdf.core.sparql.query.BinaryOperation

  private void appendExpression(StringBuffer s, Expression e) {
    if (e instanceof Variable) {
      appendVariable(s, (Variable) e);
    } else if (e instanceof BinaryOperation) {
      BinaryOperation bo = (BinaryOperation) e;
      s.append("(");
      appendExpression(s, bo.getLhsOperand());
      s.append(") ").append(bo.getOperatorString()).append(" (");
      appendExpression(s, bo.getRhsOperand());
      s.append(")");
    } else if (e instanceof UnaryOperation) {
      UnaryOperation uo = (UnaryOperation) e;
      s.append(uo.getOperatorString()).append(" (");
      appendExpression(s, uo.getOperand());
View Full Code Here

Examples of org.apache.clerezza.rdf.core.sparql.query.BinaryOperation

        new UriRef("http://purl.org/dc/elements/1.1/title"), title));

    SimpleBasicGraphPattern bgp = new SimpleBasicGraphPattern(triplePatterns);
    SimpleGroupGraphPattern queryPattern = new SimpleGroupGraphPattern();
    queryPattern.addGraphPattern(bgp);
    BinaryOperation constraint = new BinaryOperation("<",
        price, new LiteralExpression(LiteralFactory.getInstance().createTypedLiteral(30.5)));
    queryPattern.addConstraint(constraint);
    selectQuery.setQueryPattern(queryPattern);

    Assert.assertTrue(selectQuery.toString()
View Full Code Here

Examples of org.apache.clerezza.rdf.core.sparql.query.BinaryOperation

        new UriRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), myType));

    SimpleBasicGraphPattern bgp = new SimpleBasicGraphPattern(triplePatterns);
    SimpleGroupGraphPattern queryPattern = new SimpleGroupGraphPattern();
    queryPattern.addGraphPattern(bgp);
    BinaryOperation constraint = new BinaryOperation("=",
        resource, new UriRefExpression(new UriRef("http://example.org/ontology#special")));
    queryPattern.addConstraint(constraint);
    selectQuery.setQueryPattern(queryPattern);

    Assert.assertTrue(selectQuery.toString()
View Full Code Here

Examples of org.apache.clerezza.rdf.core.sparql.query.BinaryOperation

            ConstructQuery.class);

        Expression lhsOperand = (Expression) argument1.getClerezzaObject();
        Expression rhsOperand = (Expression) argument2.getClerezzaObject();

        BinaryOperation binaryOperation = new BinaryOperation("+", lhsOperand, rhsOperand);

        return (T) new ClerezzaSparqlObject(binaryOperation);

    }
View Full Code Here

Examples of org.apache.clerezza.rdf.core.sparql.query.BinaryOperation

            ConstructQuery.class);

        Expression lhe = (Expression) clerezzaArgument1.getClerezzaObject();
        Expression rhe = (Expression) clerezzaArgument2.getClerezzaObject();

        return (T) new ClerezzaSparqlObject(new BinaryOperation(">", lhe, rhe));

    }
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.