Examples of Conditional


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

    for (int i = children.size() - 1; i >= 3; i -= 2) {
      if (children.get(i).getClass() != commonType) { return null; }
    }
    List<ParseTreeNode> allChildren = Lists.newArrayList(children);
    allChildren.add(follower);
    return new Conditional(
        FilePosition.span(cond.getFilePosition(), follower.getFilePosition()),
        null, allChildren);
  }
View Full Code Here

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

      if (newChildren.size() < 2) {
        out.node = newChildren.isEmpty()
            ? new Noop(UNK) : (Statement) newChildren.get(0);
        out.digest = optNodeDigest(out.node);
      } else {
        out.node = new Conditional(UNK, null, newChildren);
        out.digest = sb != null ? sb.toString() : null;
      }
    } else {
      out.node = c;
      out.digest = sb != null ? sb.toString() : null;
View Full Code Here

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

        nodes.set(i, returnLast(nodes.get(i)));
      }
      if ((lasti & 1) == 0) {  // else clause
        nodes.set(lasti, returnLast(nodes.get(lasti)));
      }
      result = new Conditional(node.getFilePosition(), null, nodes);
    } else if (node instanceof TryStmt) {
      TryStmt tryer = (TryStmt) node;
      result = new TryStmt(
          node.getFilePosition(),
          (Block) returnLast(tryer.getBody()),
View Full Code Here

Examples of com.google.gxp.compiler.base.Conditional

        sgmlDoctype = new ExceptionExpression(
            element.getSourcePosition(), elementSchema,
            ExceptionExpression.Kind.NOT_SUPPORTED_IN_SGML_MODE,
            exceptionMessage);
      }
      return new Conditional(element, elementSchema,
                             new IsXmlExpression(element, elementSchema),
                             xmlDoctype, sgmlDoctype);
    }
View Full Code Here

Examples of com.google.gxp.compiler.base.Conditional

      }
      concatList.add(new StringConstant(element, elementSchema, "=\""));
      concatList.add(new StringConstant(element, elementSchema,
          CharEscapers.xmlEscaper().escape(xmlns)));
      concatList.add(new StringConstant(element, elementSchema, "\""));
      return new Conditional(
          element, elementSchema,
          new IsXmlExpression(element, elementSchema),
          Concatenation.create(element.getSourcePosition(), elementSchema,
                               concatList),
          new StringConstant(element, elementSchema, ""));
View Full Code Here

Examples of com.google.gxp.compiler.base.Conditional

          } else {
            if (attrValue instanceof ConvertibleToContent) {
              ConvertibleToContent ctc = (ConvertibleToContent)attrValue;
              attrValue = ctc.getSubexpression();
            }
            values.add(new Conditional(element, elementSchema,
                                       attrValue,
                                       buildBooleanAttrExpression(attr, element),
                                       empty));
          }
        } else {
          Expression condition = attr.getCondition();
          if (condition != null) {
            values.add(new Conditional(element, elementSchema, condition,
                                       buildAttrExpression(attr, element), empty));
          } else {
            values.add(buildAttrExpression(attr, element));
          }
        }
      }

      for (String attrBundle : element.getAttrBundles()) {
        values.add(new EscapeExpression(elementSchema,
                                        new AttrBundleReference(element, attrBundle)));
      }

      if (elementValidator.isFlagSet(ElementValidator.Flag.NOENDTAG)) {
        values.add(new Conditional(
            element, elementSchema,
            new IsXmlExpression(element, elementSchema),
            new StringConstant(element, elementSchema, " /"),
            new StringConstant(element, elementSchema, "")));
      }
View Full Code Here

Examples of com.google.gxp.compiler.base.Conditional

    private Expression buildBooleanAttrExpression(Attribute attr, OutputElement element) {
      Schema elementSchema = element.getSchema();
      List<Expression> values = Lists.newArrayList();

      values.add(new StringConstant(attr, elementSchema," " + attr.getName()));
      values.add(new Conditional(
                     attr, elementSchema,
                     new IsXmlExpression(attr, elementSchema),
                     new StringConstant(attr, elementSchema,
                                        "=\"" + attr.getName() + "\""),
                     new StringConstant(attr, elementSchema, "")));
View Full Code Here

Examples of com.google.gxp.compiler.base.Conditional

      if (clauses.isEmpty()) {
        if (elseExpression == null) {
          alertSink.add(new NoClausesInCondError(node));
        }
      } else {
        output.accumulate(new Conditional(node, null, clauses,
                                          elseExpression));
      }

      return null;
    }
View Full Code Here

Examples of com.google.gxp.compiler.base.Conditional

      if (clauses.isEmpty()) {
        if (elseExpression == null) {
          alertSink.add(new NoClausesInCondError(node));
        }
      } else {
        output.accumulate(new Conditional(node, null, clauses,
                                          elseExpression));
      }

      return null;
    }
View Full Code Here

Examples of com.sk89q.worldedit.internal.expression.runtime.Conditional

                        falsePart = parseStatements(true);
                    } else {
                        falsePart = null;
                    }

                    statements.add(new Conditional(current.getPosition(), condition, truePart, falsePart));
                    break;
                }

                case 'w': { // while
                    ++position;
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.