Examples of BinaryOperator


Examples of org.eclipse.jst.jsf.validation.internal.el.operators.BinaryOperator

            final ValueType secondType =
                getValueTypeForBinaryOperation(tracker.getType(), (SimpleNode) node.jjtGetChild(child));

            if (curType != null && secondType != null)
            {
                final BinaryOperator operator =
                    BinaryOperator.getBinaryOperator((Token)node.getOperatorTokens().get(child-1), _diagnosticFactory, _context);

                final Diagnostic diagnostic = operator.validate(curType, secondType);

                if (diagnostic.getSeverity() != Diagnostic.OK)
                {
                    final Token firstToken = node.getFirstToken();
                    final int offset = _context.getDocumentPosition() + firstToken.beginColumn - 1;
                    final int length = node.getLastToken().endColumn - firstToken.beginColumn+1;
                    _reporter.report(diagnostic, offset, length);
                }

                curType = operator.performOperation(curType, secondType);
            }
        }

        tracker.setType(curType);
    }
View Full Code Here

Examples of org.stjs.generator.javascript.BinaryOperator

public class BinaryWriter<JS> implements WriterContributor<BinaryTree, JS> {
  @Override
  public JS visit(WriterVisitor<JS> visitor, BinaryTree tree, GenerationContext<JS> context) {
    JS left = visitor.scan(tree.getLeftOperand(), context);
    JS right = visitor.scan(tree.getRightOperand(), context);
    BinaryOperator op = BinaryOperator.valueOf(tree.getKind());
    assert op != null : "Unknow operator:" + tree.getKind();

    @SuppressWarnings("unchecked")
    JS expr = context.js().binary(op, Arrays.asList(left, right));
View Full Code Here

Examples of org.stjs.generator.javascript.BinaryOperator

  protected JS doVisit(WriterVisitor<JS> visitor, UnaryTree tree, GenerationContext<JS> context, boolean global) {
    UnaryOperator op = UnaryOperator.valueOf(tree.getKind());
    assert op != null : "Unknow operator:" + tree.getKind();

    BinaryOperator binaryOp = getBinaryOperator(op);

    if (binaryOp == null) {
      return super.visit(visitor, tree, context);
    }
View Full Code Here

Examples of org.stjs.generator.javascript.BinaryOperator

public class ReplaceBinaryWriter<JS> implements WriterContributor<BinaryTree, JS> {
  @Override
  public JS visit(WriterVisitor<JS> visitor, BinaryTree tree, GenerationContext<JS> context) {
    JS left = visitor.scan(tree.getLeftOperand(), context);
    // JS right = visitor.scan(tree.getRightOperand(), context);
    BinaryOperator op = BinaryOperator.valueOf(tree.getKind());
    assert op != null : "Unknow operator:" + tree.getKind();

    @SuppressWarnings("unchecked")
    // replaces on purpose the second operand at 2
    JS expr = context.js().binary(op, Arrays.asList(left, context.js().number(2)));
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.