List of usage examples for org.eclipse.jdt.core.dom ParenthesizedExpression ParenthesizedExpression
ParenthesizedExpression(AST ast)
From source file:org.eclipse.jdt.core.dom.ASTConverter.java
License:Open Source License
public ParenthesizedExpression convertToParenthesizedExpression( org.eclipse.jdt.internal.compiler.ast.Expression expression) { final ParenthesizedExpression parenthesizedExpression = new ParenthesizedExpression(this.ast); if (this.resolveBindings) { recordNodes(parenthesizedExpression, expression); }//from w w w .j a v a 2 s . c om parenthesizedExpression.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); adjustSourcePositionsForParent(expression); trimWhiteSpacesAndComments(expression); // decrement the number of parenthesis int numberOfParenthesis = (expression.bits & org.eclipse.jdt.internal.compiler.ast.ASTNode.ParenthesizedMASK) >> org.eclipse.jdt.internal.compiler.ast.ASTNode.ParenthesizedSHIFT; expression.bits &= ~org.eclipse.jdt.internal.compiler.ast.ASTNode.ParenthesizedMASK; expression.bits |= (numberOfParenthesis - 1) << org.eclipse.jdt.internal.compiler.ast.ASTNode.ParenthesizedSHIFT; parenthesizedExpression.setExpression(convert(expression)); return parenthesizedExpression; }