Search in sources :

Example 1 with InternalPostfixUnaryExpression

use of org.sonar.java.model.expression.InternalPostfixUnaryExpression in project sonar-java by SonarSource.

the class TreeFactory method newPostfixExpression.

public ExpressionTree newPostfixExpression(ExpressionTree expression, Optional<InternalSyntaxToken> postfixOperator) {
    ExpressionTree result = expression;
    if (postfixOperator.isPresent()) {
        InternalSyntaxToken postfixOperatorToken = postfixOperator.get();
        result = new InternalPostfixUnaryExpression(kindMaps.getPostfixOperator((JavaPunctuator) postfixOperator.get().getGrammarRuleKey()), result, postfixOperatorToken);
    }
    return result;
}
Also used : InternalPostfixUnaryExpression(org.sonar.java.model.expression.InternalPostfixUnaryExpression) ExpressionTree(org.sonar.plugins.java.api.tree.ExpressionTree) InternalSyntaxToken(org.sonar.java.model.InternalSyntaxToken)

Aggregations

InternalSyntaxToken (org.sonar.java.model.InternalSyntaxToken)1 InternalPostfixUnaryExpression (org.sonar.java.model.expression.InternalPostfixUnaryExpression)1 ExpressionTree (org.sonar.plugins.java.api.tree.ExpressionTree)1