Example usage for org.eclipse.jdt.core.dom PostfixExpression PostfixExpression

List of usage examples for org.eclipse.jdt.core.dom PostfixExpression PostfixExpression

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom PostfixExpression PostfixExpression.

Prototype

PostfixExpression(AST ast) 

Source Link

Document

Creates a new AST node for an postfix expression owned by the given AST.

Usage

From source file:org.eclipse.jdt.core.dom.ASTConverter.java

License:Open Source License

public PostfixExpression convert(org.eclipse.jdt.internal.compiler.ast.PostfixExpression expression) {
    final PostfixExpression postfixExpression = new PostfixExpression(this.ast);
    if (this.resolveBindings) {
        recordNodes(postfixExpression, expression);
    }//www  .  ja va  2 s.co m
    postfixExpression.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1);
    postfixExpression.setOperand(convert(expression.lhs));
    switch (expression.operator) {
    case org.eclipse.jdt.internal.compiler.ast.OperatorIds.PLUS:
        postfixExpression.setOperator(PostfixExpression.Operator.INCREMENT);
        break;
    case org.eclipse.jdt.internal.compiler.ast.OperatorIds.MINUS:
        postfixExpression.setOperator(PostfixExpression.Operator.DECREMENT);
        break;
    }
    return postfixExpression;
}