public Node createSwitchStatement(Node condition, Node body) { return posify(new Switch().rawCondition(condition).rawBody(body)); }
public Node createSwitchStatement(Node condition, Node body) { return posify(new Switch().rawCondition(condition).rawBody(body)); }
public Node createSwitchStatement(Node condition, Node body) { return posify(new Switch().rawCondition(condition).rawBody(body)); }
@Override public void visitSwitch(JCSwitch node) { Switch s = new Switch(); JCExpression cond = node.getExpression(); setConversionPositionInfo(s, "()", getPosition(cond)); s.rawCondition(toTree(removeParens(cond))); Block b = new Block(); s.astBody(b); for (JCCase c : node.getCases()) { JCExpression rawExpr = c.getExpression(); if (rawExpr == null) b.rawContents().addToEnd(setPos(c, new Default())); else b.rawContents().addToEnd(setPos(c, new Case().rawCondition(toTree(rawExpr)))); fillList(c.getStatements(), b.rawContents()); } set(node, s); }
@Override public void visitSwitch(JCSwitch node) { Switch s = new Switch(); JCExpression cond = node.getExpression(); setConversionPositionInfo(s, "()", getPosition(cond)); s.rawCondition(toTree(removeParens(cond))); Block b = new Block(); s.astBody(b); for (JCCase c : node.getCases()) { JCExpression rawExpr = c.getExpression(); if (rawExpr == null) b.rawContents().addToEnd(setPos(c, new Default())); else b.rawContents().addToEnd(setPos(c, new Case().rawCondition(toTree(rawExpr)))); fillList(c.getStatements(), b.rawContents()); } set(node, s); }
@Override public void visitSwitch(JCSwitch node) { Switch s = new Switch(); JCExpression cond = node.getExpression(); setConversionPositionInfo(s, "()", getPosition(cond)); s.rawCondition(toTree(removeParens(cond))); Block b = new Block(); s.astBody(b); for (JCCase c : node.getCases()) { JCExpression rawExpr = c.getExpression(); if (rawExpr == null) b.rawContents().addToEnd(setPos(c, new Default())); else b.rawContents().addToEnd(setPos(c, new Case().rawCondition(toTree(rawExpr)))); fillList(c.getStatements(), b.rawContents()); } set(node, s); }
formatter.append("("); formatter.nameNextElement("operand"); visit(node.rawCondition()); formatter.append(")"); formatter.space();
formatter.append("("); formatter.nameNextElement("operand"); visit(node.rawCondition()); formatter.append(")"); formatter.space();
formatter.append("("); formatter.nameNextElement("operand"); visit(node.rawCondition()); formatter.append(")"); formatter.space();