Examples of BinaryExpression


Examples of org.codehaus.groovy.ast.expr.BinaryExpression

    private static void addFieldInit(Parameter p, FieldNode fn, BlockStatement block) {
        VariableExpression ve = new VariableExpression(p);
        FieldExpression fe = new FieldExpression(fn);
        block.addStatement(new ExpressionStatement(
                new BinaryExpression(
                        fe,
                        Token.newSymbol(Types.ASSIGN, -1, -1),
                        ve
                )
        ));
View Full Code Here

Examples of org.codehaus.groovy.ast.expr.BinaryExpression

        ClassNode cNode = fNode.getDeclaringClass();
        BlockStatement body = new BlockStatement();
        Parameter[] params = new Parameter[1];
        params[0] = new Parameter(ClassHelper.int_TYPE, "index");
        body.addStatement(new ExpressionStatement(
                new BinaryExpression(
                        new VariableExpression(fNode.getName()),
                        INDEX,
                        new VariableExpression(params[0]))
        ));
        cNode.addMethod(makeName(fNode, "get"), getModifiers(fNode), componentType, params, null, body);
View Full Code Here

Examples of org.codehaus.groovy.ast.expr.BinaryExpression

        BlockStatement body = new BlockStatement();
        Parameter[] params = new Parameter[2];
        params[0] = new Parameter(ClassHelper.int_TYPE, "index");
        params[1] = new Parameter(componentType, "value");
        body.addStatement(new ExpressionStatement(
                new BinaryExpression(
                        new BinaryExpression(
                                new VariableExpression(fNode.getName()),
                                INDEX,
                                new VariableExpression(params[0])),
                        ASSIGN,
                        new VariableExpression(params[1])
View Full Code Here

Examples of org.codehaus.groovy.ast.expr.BinaryExpression

        final Expression oin = new VariableExpression("oin", OBJECTINPUT_TYPE);
        for (FieldNode fNode : list) {
            if (excludes.contains(fNode.getName())) continue;
            if ((fNode.getModifiers() & ACC_TRANSIENT) != 0) continue;
            Expression readObject = new MethodCallExpression(oin, "read" + suffixForField(fNode), MethodCallExpression.NO_ARGUMENTS);
            body.addStatement(new ExpressionStatement(new BinaryExpression(new VariableExpression(fNode), ASSIGN, readObject)));
        }
        cNode.addMethod("readExternal", ACC_PUBLIC, ClassHelper.VOID_TYPE, new Parameter[]{new Parameter(OBJECTINPUT_TYPE, "oin")}, ClassNode.EMPTY_ARRAY, body);
    }
View Full Code Here

Examples of org.codehaus.jparsec.examples.sql.ast.BinaryExpression

            null, null, null));
    assertParser(parser, "select 1 from t where x > 1",
        new Select(false,
            Arrays.asList(new Projection(number(1), null)),
            Arrays.asList(table("t")),
            new BinaryExpression(ExpressionParserTest.name("x"), Op.GT, number(1)), null, null));
    assertParser(parser, "select 1 from t where exists (select * from t2)",
        new Select(false,
            Arrays.asList(new Projection(number(1), null)),
            Arrays.asList(table("t")),
            new UnaryRelationalExpression(
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.ast.BinaryExpression

}
public void generateAssignment(BlockScope currentScope, CodeStream codeStream, Assignment assignment, boolean valueRequired) {
  // optimizing assignment like: i = i + 1 or i = 1 + i
  if (assignment.expression.isCompactableOperation()) {
    BinaryExpression operation = (BinaryExpression) assignment.expression;
    int operator = (operation.bits & OperatorMASK) >> OperatorSHIFT;
    SingleNameReference variableReference;
    if ((operation.left instanceof SingleNameReference) && ((variableReference = (SingleNameReference) operation.left).binding == this.binding)) {
      // i = i + value, then use the variable on the right hand side, since it has the correct implicit conversion
      variableReference.generateCompoundAssignment(currentScope, codeStream, this.syntheticAccessors == null ? null : this.syntheticAccessors[WRITE], operation.right, operator, operation.implicitConversion, valueRequired);
View Full Code Here

Examples of org.jinq.jpa.jpqlquery.BinaryExpression

            // Create the new query, merging in the analysis of the method
            SelectFromWhere<U> toReturn = (SelectFromWhere<U>)sfw.shallowCopy();
            if (sfw.where == null)
               toReturn.where = methodExpr;
            else
               toReturn.where = new BinaryExpression("AND", sfw.where, methodExpr);
            return toReturn;
         }
         else if (query.isSelectFromWhereGroupHaving())
         {
            GroupedSelectFromWhere<V, ?> sfw = (GroupedSelectFromWhere<V, ?>)query;
            Expression methodExpr = computeWhereReturnExpr(where, sfw, parentArgumentScope);
           
            // Create the new query, merging in the analysis of the method
            GroupedSelectFromWhere<U, ?> toReturn = (GroupedSelectFromWhere<U, ?>)sfw.shallowCopy();
            if (sfw.having == null)
               toReturn.having = methodExpr;
            else
               toReturn.having = new BinaryExpression("AND", sfw.having, methodExpr);
            return toReturn;
         }
         throw new QueryTransformException("Existing query cannot be transformed further");
      }
      catch (TypedValueVisitorException e)
View Full Code Here

Examples of org.lilystudio.javascript.expression.BinaryExpression

        Node valueNode = childNode.getFirstChild();
        IdentifierExpression id = (IdentifierExpression) addExpression(
            childNode, root, scope);
        if (valueNode != null) {
          IExpression value = addExpression(valueNode, root, scope);
          BinaryExpression assignment = new BinaryExpression(node.getLineno(),
              Token.ASSIGN, id, value);
          assignment.setParent(this);
          if (value instanceof NumericLiteral
              && ((NumericLiteral) value).getValue() == 0
              && id.getName().getString().length() == 1) {
            params.add(i++, assignment);
            id.getName().inc(10000000 - i * 10000);
 
View Full Code Here

Examples of org.lilystudio.javascript.expression.BinaryExpression

   *          变量名
   * @param value
   *          变量值
   */
  public void addParam(int lineno, String name, String value) {
    BinaryExpression assignment = new BinaryExpression(lineno, Token.ASSIGN,
        new IdentifierExpression(lineno, name), new IdentifierExpression(
            lineno, value));
    assignment.setParent(this);
    params.add(0, assignment);
  }
View Full Code Here

Examples of org.lilystudio.javascript.expression.BinaryExpression

  public void write(Writer writer, Environment env) throws IOException {
    if (env.getMode() == JSCompressor.FOR_GZIP) {
      for (int i = params.size() - 1; i >= 0; i--) {
        IExpression param = params.get(i);
        if (param instanceof BinaryExpression) {
          BinaryExpression binary = (BinaryExpression) param;
          Identifier id = ((IdentifierExpression) binary.getLeftExpression())
              .getName();
          if (id.getName().startsWith("__gzip_direct__")) {
            Writer s = new StringWriter();
            binary.getRightExpression().write(s, env);
            id.setString(s.toString());
            params.remove(i);
          }
        }
      }
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.