@Test public void testNestedIfBlock() throws IOException { String qlForm = "form taxOfficeExample { if (hasSoldHouse) { if (bool) { \"q2?\" val2: boolean } } }"; Form form = ASTGenerator.getForm(qlForm); List<Item> questions = form.getQuestions(); IfThen c1 = (IfThen) questions.get(0); assertEquals(1, questions.size()); assertEquals(1, c1.getThenStatements().size()); assertThat(c1.getThenStatements().get(0), instanceOf(IfThen.class)); }
public List<Item> getThenStatements() { return thenStatements; }
IfThen extends Item { public List<Item> getThenStatements() { return thenStatements; } }
IfThen extends Item { public List<Item> getThenStatements() { return thenStatements; } IfThen(int lineNumber, Expression condition, List<Item> thenStatements); }
IfThen extends Item { public List<Item> getThenStatements() { return thenStatements; } IfThen(int lineNumber, Expression condition, List<Item> thenStatements); Expression getCondition(); List<Item> getThenStatements(); @Override T accept(ItemVisitor<T> visitor); }
IfThen extends Item { public List<Item> getThenStatements() { return thenStatements; } IfThen(int lineNumber, Expression condition, List<Item> thenStatements); Expression getCondition(); List<Item> getThenStatements(); @Override T accept(ItemVisitor<T> visitor);  }