use of org.wso2.ballerinalang.compiler.tree.statements.BLangStatement.BLangStatementLink in project ballerina by ballerina-lang.
the class Desugar method rewrite.
@SuppressWarnings("unchecked")
private <E extends BLangStatement> E rewrite(E statement, SymbolEnv env) {
if (statement == null) {
return null;
}
BLangStatementLink link = new BLangStatementLink();
link.parent = currentLink;
currentLink = link;
BLangStatement stmt = (BLangStatement) rewrite((BLangNode) statement, env);
// Link Statements.
link.statement = stmt;
stmt.statementLink = link;
currentLink = link.parent;
return (E) stmt;
}
Aggregations