@Test public void testIfElseBlock() throws IOException { String qlForm = "form taxOfficeExample { if (hasSoldHouse) { \"q1?\" val1: boolean } else { \"q2?\" val2: boolean } }"; Form form = ASTGenerator.getForm(qlForm); List<Item> questions = form.getQuestions(); IfThenElse ifThenElse = (IfThenElse) questions.get(0); assertEquals(1, ifThenElse.getThenStatements().size()); assertEquals(1, ifThenElse.getElseStatements().size()); }
public List<Item> getElseStatements() { return elseStatements; }
IfThenElse extends IfThen { public List<Item> getElseStatements() { return elseStatements; } }
IfThenElse extends IfThen { public List<Item> getElseStatements() { return elseStatements; } IfThenElse(int lineNumber, Expression condition, List<Item> thenStatements, List<Item> elseStatements); }
IfThenElse extends IfThen { public List<Item> getElseStatements() { return elseStatements; } IfThenElse(int lineNumber, Expression condition, List<Item> thenStatements, List<Item> elseStatements); List<Item> getElseStatements(); @Override T accept(ItemVisitor<T> visitor); }
IfThenElse extends IfThen { public List<Item> getElseStatements() { return elseStatements; } IfThenElse(int lineNumber, Expression condition, List<Item> thenStatements, List<Item> elseStatements); List<Item> getElseStatements(); @Override T accept(ItemVisitor<T> visitor);  }