use of com.sun.source.tree.StatementTree in project j2objc by google.
the class TreeConverter method convertSwitch.
private TreeNode convertSwitch(SwitchTree node, TreePath parent) {
TreePath path = getTreePath(parent, node);
SwitchStatement newNode = new SwitchStatement().setExpression(convertWithoutParens(node.getExpression(), path));
for (CaseTree switchCase : node.getCases()) {
newNode.addStatement((SwitchCase) convert(switchCase, path));
TreePath switchCasePath = getTreePath(path, switchCase);
for (StatementTree s : switchCase.getStatements()) {
newNode.addStatement((Statement) convert(s, switchCasePath));
}
}
return newNode;
}
use of com.sun.source.tree.StatementTree in project j2objc by google.
the class TreeConverter method convertBlock.
private TreeNode convertBlock(BlockTree node, TreePath parent) {
TreePath path = getTreePath(parent, node);
Block newNode = new Block();
for (StatementTree stmt : node.getStatements()) {
TreeNode tree = convert(stmt, path);
if (tree instanceof AbstractTypeDeclaration) {
tree = new TypeDeclarationStatement().setDeclaration((AbstractTypeDeclaration) tree);
}
newNode.addStatement((Statement) tree);
}
return newNode;
}
Aggregations