private void print(SwitchStatement node) throws IOException { writer.append("switch").ws().append('('); print(node.getExpression()); writer.append(')').ws().append('{').indent().softNewLine(); for (SwitchCase sc : node.getCases()) { if (sc.getExpression() == null) { writer.append("default:"); } else { writer.append("case "); print(sc.getExpression()); writer.append(':'); } writer.indent().softNewLine(); if (sc.getStatements() != null) { for (AstNode stmt : sc.getStatements()) { print(stmt); writer.softNewLine(); } } writer.outdent(); } writer.outdent().append('}'); }
private void print(SwitchStatement node) throws IOException { writer.append("switch").ws().append('('); print(node.getExpression()); writer.append(')').ws().append('{').indent().softNewLine(); for (SwitchCase sc : node.getCases()) { if (sc.getExpression() == null) { writer.append("default:"); } else { writer.append("case "); print(sc.getExpression()); writer.append(':'); } writer.indent().softNewLine(); if (sc.getStatements() != null) { for (AstNode stmt : sc.getStatements()) { print(stmt); writer.softNewLine(); } } writer.outdent(); } writer.append('}'); }
context.cfg().add(node, label, CAstControlFlowMap.SWITCH_DEFAULT); } else { CAstNode labelCAst = visit(sc.getExpression(), context); context.cfg().add(node, label, labelCAst);
AstNode expr = sc.getExpression(); Node caseExpr = null;
AstNode expr = sc.getExpression(); Node caseExpr = null;
AstNode expr = sc.getExpression(); Node caseExpr = null;
AstNode expr = sc.getExpression(); Node caseExpr = null;