Examples of BooleanLiteral


Examples of au.csiro.ontology.model.BooleanLiteral

        return new RoleInclusion(lhs, rhs);
    }
   
    @Deprecated
    public static Literal createBooleanLiteral(boolean value) {
        return new BooleanLiteral(value);
    }
View Full Code Here

Examples of com.dragome.compiler.ast.BooleanLiteral

  void rollOut_(Block block)
  {
    WhileStatement loopStmt= new WhileStatement();
    Block loopBody= new Block();
    loopStmt.setBlock(loopBody);
    loopStmt.setExpression(new BooleanLiteral(true));

    block.appendChild(loopStmt);

    Iterator iter= selfEdges.iterator();
    while (iter.hasNext())
View Full Code Here

Examples of com.facebook.presto.sql.tree.BooleanLiteral

                return new StringLiteral((String) object);
            }
        }

        if (type.equals(BOOLEAN)) {
            return new BooleanLiteral(object.toString());
        }

        Signature signature = FunctionRegistry.getMagicLiteralFunctionSignature(type);
        Expression rawLiteral = toExpression(object, FunctionRegistry.type(type.getJavaType()));
        return new FunctionCall(new QualifiedName(signature.getName()), ImmutableList.of(rawLiteral));
View Full Code Here

Examples of com.facebook.presto.sql.tree.BooleanLiteral

        if (object instanceof Slice) {
            return new StringLiteral(((Slice) object).toString(UTF_8));
        }

        if (object instanceof Boolean) {
            return new BooleanLiteral(object.toString());
        }

        if (object == null) {
            return new NullLiteral();
        }
View Full Code Here

Examples of com.facebook.presto.sql.tree.BooleanLiteral

                return new StringLiteral((String) object);
            }
        }

        if (type.equals(BOOLEAN)) {
            return new BooleanLiteral(object.toString());
        }

        Signature signature = FunctionRegistry.getMagicLiteralFunctionSignature(type);
        Expression rawLiteral = toExpression(object, FunctionRegistry.type(type.getJavaType()));
        return new FunctionCall(new QualifiedName(signature.getName()), ImmutableList.of(rawLiteral));
View Full Code Here

Examples of com.facebook.presto.sql.tree.BooleanLiteral

                return new StringLiteral((String) object);
            }
        }

        if (type.equals(BOOLEAN)) {
            return new BooleanLiteral(object.toString());
        }

        Signature signature = FunctionRegistry.getMagicLiteralFunctionSignature(type);
        Expression rawLiteral = toExpression(object, FunctionRegistry.type(type.getJavaType()));
        return new FunctionCall(new QualifiedName(signature.getName()), ImmutableList.of(rawLiteral));
View Full Code Here

Examples of com.google.caja.parser.js.BooleanLiteral

        + "  }"
        + "  return schema;"
        + "})();",
        "poolDecls", poolDecls,
        "cssSchema", cssSchema,
        "hasAliases", new BooleanLiteral(unk, hasAliases));
    TokenConsumer tc = js.makeRenderer(out, null);
    js.render(new RenderContext(tc));
    tc.noMoreTokens();
    out.append(";\n");
  }
View Full Code Here

Examples of com.google.caja.parser.js.BooleanLiteral

      Expression clause = expressionChildOf(condParts.get(--pos));
      Expression cond = (Expression) condParts.get(--pos);
      FilePosition fpos = FilePosition.span(
          cond.getFilePosition(), e.getFilePosition());
      if (clause instanceof BooleanLiteral && e instanceof BooleanLiteral) {
        BooleanLiteral a = (BooleanLiteral) clause,
            b = (BooleanLiteral) e;
        if (a.getValue() == b.getValue()) {
          e = commaOp(cond, a).fold(false);
        } else {
          // cond ? true : false -> !!cond
          int nNotsNeeded = a.getValue() ? 2 : 1;
          if (nNotsNeeded == 2 && "boolean".equals(cond.typeOf())) {
            nNotsNeeded = 0;
          }
          e = cond;
          while (--nNotsNeeded >= 0) {
View Full Code Here

Examples of com.google.dart.engine.ast.BooleanLiteral

    // binary expression.
    // TODO(jwren) Do we want to take constant expressions into account, evaluate if(false) {}
    // differently than if(<condition>), when <condition> evaluates to a constant false value?
    if (operatorType == TokenType.BAR_BAR) {
      if (lhsExpression instanceof BooleanLiteral) {
        BooleanLiteral booleanLiteral = (BooleanLiteral) lhsExpression;
        if (!booleanLiteral.getValue()) {
          return false;
        }
      }
    }
    // If the operator is && and the left hand side is true literal, don't consider the RHS of the
    // binary expression.
    if (operatorType == TokenType.AMPERSAND_AMPERSAND) {
      if (lhsExpression instanceof BooleanLiteral) {
        BooleanLiteral booleanLiteral = (BooleanLiteral) lhsExpression;
        if (booleanLiteral.getValue()) {
          return false;
        }
      }
    }
    Expression rhsExpression = node.getRightOperand();
View Full Code Here

Examples of com.google.dart.engine.ast.BooleanLiteral

      if (nodeExits(conditionExpression)) {
        return true;
      }
      // TODO(jwren) Do we want to take all constant expressions into account?
      if (conditionExpression instanceof BooleanLiteral) {
        BooleanLiteral booleanLiteral = (BooleanLiteral) conditionExpression;
        // If do {} while (true), and the body doesn't return or the body doesn't have a break, then
        // return true.
        boolean blockReturns = nodeExits(node.getBody());
        if (booleanLiteral.getValue() && (blockReturns || !enclosingBlockContainsBreak)) {
          return true;
        }
      }
      return false;
    } finally {
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.