use of org.sonar.java.model.statement.ExpressionStatementTreeImpl in project sonar-java by SonarSource.
the class TreeFactory method newStatementExpressions.
public StatementExpressionListTreeImpl newStatementExpressions(ExpressionTree expression, Optional<List<Tuple<InternalSyntaxToken, ExpressionTree>>> rests) {
ImmutableList.Builder<StatementTree> statements = ImmutableList.builder();
statements.add(new ExpressionStatementTreeImpl(expression, null));
ImmutableList.Builder<SyntaxToken> separators = ImmutableList.builder();
if (rests.isPresent()) {
for (Tuple<InternalSyntaxToken, ExpressionTree> rest : rests.get()) {
separators.add(rest.first());
statements.add(new ExpressionStatementTreeImpl(rest.second(), null));
}
}
return new StatementExpressionListTreeImpl(statements.build(), separators.build());
}
Aggregations