Examples of JsBinaryOperation


Examples of com.google.gwt.dev.js.ast.JsBinaryOperation

      String packageName = getPackageName(x.getName());
      JsExpression rhs;
      if (packageName != null) {
        // use "com.example.foo." + "Foo"
        JsName name = (JsName) packageNames.get(packageName);
        rhs = new JsBinaryOperation(JsBinaryOperator.ADD, name.makeRef(),
            jsProgram.getStringLiteral(className));
      } else {
        // no package name could be split, just use the full name
        rhs = jsProgram.getStringLiteral(x.getName());
      }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsBinaryOperation

          && x.getLhs().getType() instanceof JReferenceType
          && x.getRhs().getType() instanceof JReferenceType) {
        myOp = JsBinaryOperator.REF_NEQ;
      }

      push(new JsBinaryOperation(myOp, lhs, rhs));
    }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsBinaryOperation

      }

      JsExpression initializer = (JsExpression) pop(); // initializer
      JsNameRef localRef = (JsNameRef) pop(); // localRef

      JsBinaryOperation binOp = new JsBinaryOperation(JsBinaryOperator.ASG,
          localRef, initializer);

      push(binOp.makeStmt());
    }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsBinaryOperation

      push(jsSwitch);
      return false;
    }

    private JsExpression createAssignment(JsExpression lhs, JsExpression rhs) {
      return new JsBinaryOperation(JsBinaryOperator.ASG, lhs, rhs);
    }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsBinaryOperation

        builder.append(((JsStringLiteral) expression).getValue());
        return true;
      }

      if (expression instanceof JsBinaryOperation) {
        JsBinaryOperation operation = (JsBinaryOperation) expression;
        if (operation.getOperator() != JsBinaryOperator.ADD) {
          return false;
        }
        return expressionToString(operation.getArg1(), builder)
            && expressionToString(operation.getArg2(), builder);
      }

      return false;
    }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsBinaryOperation

      if (expression instanceof JsStringLiteral) {
        return ((JsStringLiteral) expression).getValue().length();
      }

      if (expression instanceof JsBinaryOperation) {
        JsBinaryOperation operation = (JsBinaryOperation) expression;
        if (operation.getOperator() != JsBinaryOperator.ADD) {
          return -1;
        }

        int arg1Length = getStringLength(operation.getArg1());
        int arg2Length = getStringLength(operation.getArg2());

        return (arg1Length >= 0 && arg2Length >= 0) ? (arg1Length + arg2Length) : -1;
      }

      return -1;
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsBinaryOperation

      } else if (myOp == JsBinaryOperator.NEQ && x.getLhs().getType() instanceof JReferenceType
          && x.getRhs().getType() instanceof JReferenceType) {
        myOp = JsBinaryOperator.REF_NEQ;
      }

      push(new JsBinaryOperation(x.getSourceInfo(), myOp, lhs, rhs));
    }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsBinaryOperation

        // Will initialize at top scope; no need to double-initialize.
        push(null);
        return;
      }

      JsBinaryOperation binOp =
          new JsBinaryOperation(x.getSourceInfo(), JsBinaryOperator.ASG, localRef, initializer);

      push(binOp.makeStmt());
    }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsBinaryOperation

        methodSignatures = Sets.add(methodSignatures, sig);
      }
    }

    private JsExpression createAssignment(JsExpression lhs, JsExpression rhs) {
      return new JsBinaryOperation(lhs.getSourceInfo(), JsBinaryOperator.ASG, lhs, rhs);
    }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsBinaryOperation

      if (lhs == null) {
        return rhs;
      } else if (rhs == null) {
        return lhs;
      }
      return new JsBinaryOperation(lhs.getSourceInfo(), JsBinaryOperator.COMMA, lhs, rhs);
    }
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.