Examples of IfNode


Examples of com.google.template.soy.soytree.IfNode

        "  {/if}\n";

    List<StandaloneNode> nodes = parseTemplateBody(templateBody);
    assertEquals(2, nodes.size());

    IfNode in0 = (IfNode) nodes.get(0);
    assertEquals(1, in0.numChildren());
    IfCondNode in0icn0 = (IfCondNode) in0.getChild(0);
    assertEquals("$zoo", in0icn0.getExprText());
    assertEquals(1, in0icn0.numChildren());
    assertEquals("$zoo", ((PrintNode) in0icn0.getChild(0)).getExprText());
    assertTrue(in0icn0.getExprUnion().getExpr().getChild(0) instanceof DataRefNode);

    IfNode in1 = (IfNode) nodes.get(1);
    assertEquals(3, in1.numChildren());
    IfCondNode in1icn0 = (IfCondNode) in1.getChild(0);
    assertEquals("$boo", in1icn0.getExprText());
    assertTrue(in1icn0.getExprUnion().getExpr().getChild(0) instanceof DataRefNode);
    IfCondNode in1icn1 = (IfCondNode) in1.getChild(1);
    assertEquals("$foo.goo > 2", in1icn1.getExprText());
    assertTrue(in1icn1.getExprUnion().getExpr().getChild(0) instanceof GreaterThanOpNode);
    assertEquals("", ((IfElseNode) in1.getChild(2)).getCommandText());
    assertEquals("{if $boo}Blah{elseif $foo.goo > 2}{$moo}{else}Blah {$moo}{/if}",
                 in1.toSourceString());
  }

Examples of com.google.template.soy.soytree.IfNode

    ForeachNonemptyNode fn1fnn0 = (ForeachNonemptyNode) fn1.getChild(0);
    assertEquals("boo", fn1fnn0.getVarName());
    assertEquals("$foo.booze", fn1fnn0.getExprText());
    assertEquals("boo", fn1fnn0.getVarName());
    assertEquals(4, fn1fnn0.numChildren());
    IfNode fn1fnn0in = (IfNode) fn1fnn0.getChild(3);
    assertEquals(1, fn1fnn0in.numChildren());
    assertEquals("not isLast($boo)", ((IfCondNode) fn1fnn0in.getChild(0)).getExprText());

    ForeachIfemptyNode fn1fin1 = (ForeachIfemptyNode) fn1.getChild(1);
    assertEquals(1, fn1fin1.numChildren());
    assertEquals("Sorry, no booze.", ((RawTextNode) fn1fin1.getChild(0)).getRawText());
  }

Examples of com.google.template.soy.soytree.IfNode

    SoyFileSetNode soyTree = SharedTestUtils.parseSoyFiles(testFileContent);

    TemplateNode template = soyTree.getChild(0).getChild(0);
    PrintNode a = (PrintNode) template.getChild(0);
    PrintNode bc = (PrintNode) template.getChild(1);
    IfNode ifNode = (IfNode) template.getChild(2);
    IfCondNode ifCondNode = (IfCondNode) ifNode.getChild(0);
    PrintNode e = (PrintNode) ifCondNode.getChild(0);
    ForeachNode foreachNode = (ForeachNode) ifCondNode.getChild(1);
    ForeachNonemptyNode foreachNonemptyNode = (ForeachNonemptyNode) foreachNode.getChild(0);
    PrintNode f = (PrintNode) foreachNonemptyNode.getChild(0);
    PrintNode gh = (PrintNode) foreachNonemptyNode.getChild(1);

Examples of com.vaadin.sass.internal.tree.controldirective.IfNode

    @Override
    public void ifDirective(String evaluator) {
        if (nodeStack.peek() instanceof IfNode) {
            nodeStack.pop();
        }
        IfNode node = new IfNode(evaluator);
        nodeStack.peek().appendChild(node);
        nodeStack.push(node);
    }

Examples of com.vaadin.sass.internal.tree.controldirective.IfNode

    @Override
    public void ifDirective(String evaluator) {
        if (nodeStack.peek() instanceof IfNode) {
            nodeStack.pop();
        }
        IfNode node = new IfNode(evaluator);
        nodeStack.peek().appendChild(node);
        nodeStack.push(node);
    }

Examples of edu.indiana.extreme.xbaya.graph.system.IfNode

        } else if (GraphSchema.NODE_TYPE_SPLIT.equals(type)) {
            node = new ForEachNode(nodeElement);
        } else if (GraphSchema.NODE_TYPE_MERGE.equals(type)) {
            node = new EndForEachNode(nodeElement);
        } else if (GraphSchema.NODE_TYPE_IF.equals(type)) {
            node = new IfNode(nodeElement);
        } else if (GraphSchema.NODE_TYPE_ENDIF.equals(type)) {
            node = new EndifNode(nodeElement);
        } else if (GraphSchema.NODE_TYPE_MEMO.equals(type)) {
            node = new MemoNode(nodeElement);
        } else if (GraphSchema.NODE_TYPE_RECEIVE.equals(type)) {

Examples of edu.indiana.extreme.xbaya.graph.system.IfNode

    /**
     * @see edu.indiana.extreme.xbaya.component.Component#createNode(edu.indiana.extreme.xbaya.graph.Graph)
     */
    @Override
    public Node createNode(Graph graph) {
        IfNode node = new IfNode(graph);

        node.setName(NAME);
        node.setComponent(this);

        // Creates a unique ID for the node. This has to be after setName().
        node.createID();

        createPorts(node);

        return node;
    }

Examples of edu.indiana.extreme.xbaya.graph.system.IfNode

    }
  }

  private void handleIf(Node node) throws XBayaException {
    IfNode ifNode = (IfNode) node;

    /*
     * Get all input to check condition
     */
    String booleanExpression = ifNode.getXPath();
    if (booleanExpression == null) {
      throw new WorkFlowInterpreterException("XPath for if cannot be null");
    }

    List<DataPort> inputPorts = node.getInputPorts();

Examples of jadx.core.dex.instructions.IfNode

  private IfMakerHelper() {
  }

  static IfInfo makeIfInfo(BlockNode ifBlock) {
    IfNode ifNode = (IfNode) ifBlock.getInstructions().get(0);
    IfCondition condition = IfCondition.fromIfNode(ifNode);
    IfInfo info = new IfInfo(condition, ifNode.getThenBlock(), ifNode.getElseBlock());
    info.setIfBlock(ifBlock);
    info.getMergedBlocks().add(ifBlock);
    return info;
  }

Examples of jadx.core.dex.instructions.IfNode

  public boolean checkPreCondition() {
    List<InsnNode> insns = preCondition.getInstructions();
    if (insns.isEmpty()) {
      return true;
    }
    IfNode ifInsn = getIfInsn();
    int size = insns.size();
    for (int i = 0; i < size; i++) {
      InsnNode insn = insns.get(i);
      if (insn.getResult() == null) {
        return false;
      }
      RegisterArg res = insn.getResult();
      if (res.getSVar().getUseCount() > 1) {
        return false;
      }
      boolean found = false;
      // search result arg in other insns
      for (int j = i + 1; j < size; j++) {
        if (insns.get(i).containsArg(res)) {
          found = true;
        }
      }
      // or in if insn
      if (!found && ifInsn.containsArg(res)) {
        found = true;
      }
      if (!found) {
        return false;
      }
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.