@Override public boolean visit(Assignment node) { int rightSideIndex = this.tm.firstIndexIn(node.getRightHandSide(), -1); if (this.tm.get(rightSideIndex).getLineBreaksBefore() > 0) return true; // must be an array initializer in new line because of brace_position_for_array_initializer int operatorIndex = this.tm.firstIndexBefore(node.getRightHandSide(), -1); while (this.tm.get(operatorIndex).isComment()) operatorIndex--; assert node.getOperator().toString().equals(this.tm.toString(operatorIndex)); this.wrapIndexes.add(this.options.wrap_before_assignment_operator ? operatorIndex : rightSideIndex); this.secondaryWrapIndexes.add(this.options.wrap_before_assignment_operator ? rightSideIndex : operatorIndex); this.wrapParentIndex = operatorIndex - 1; this.wrapGroupEnd = this.tm.lastIndexIn(node.getRightHandSide(), -1); handleWrap(this.options.alignment_for_assignment); return true; }
public boolean visit(Assignment node) { Expression lhs = node.getLeftHandSide(); Expression rhs = node.getRightHandSide(); ITypeBinding lhsType = lhs.resolveTypeBinding(); ITypeBinding saved = pushExpectedType (lhsType); if (node.getOperator() == Assignment.Operator.RIGHT_SHIFT_UNSIGNED_ASSIGN) { String type = lhsType.getQualifiedName(); if (type == "byte") { pushExpression(new CSInfixExpression(">>", mapExpression(lhs), mapExpression(lhs .resolveTypeBinding(), rhs))); } else { CSExpression mappedLhs = mapExpression(lhs); CSExpression cast = new CSCastExpression (new CSTypeReference ("u" + type), mappedLhs); cast = new CSParenthesizedExpression (cast); CSExpression shiftResult = new CSInfixExpression(">>", cast, mapExpression(rhs)); shiftResult = new CSParenthesizedExpression (shiftResult); shiftResult = new CSCastExpression (new CSTypeReference (type), shiftResult); pushExpression(new CSInfixExpression("=", mappedLhs, shiftResult)); } } else { pushExpression(new CSInfixExpression(node.getOperator().toString(), mapExpression(lhs), mapExpression(lhs .resolveTypeBinding(), rhs))); } popExpectedType(saved); return false; }
protected String getLabel(ASTNode n) { if (n instanceof Name) return ((Name) n).getFullyQualifiedName(); if (n instanceof Type) return n.toString(); if (n instanceof Modifier) return n.toString(); if (n instanceof StringLiteral) return ((StringLiteral) n).getEscapedValue(); if (n instanceof NumberLiteral) return ((NumberLiteral) n).getToken(); if (n instanceof CharacterLiteral) return ((CharacterLiteral) n).getEscapedValue(); if (n instanceof BooleanLiteral) return ((BooleanLiteral) n).toString(); if (n instanceof InfixExpression) return ((InfixExpression) n).getOperator().toString(); if (n instanceof PrefixExpression) return ((PrefixExpression) n).getOperator().toString(); if (n instanceof PostfixExpression) return ((PostfixExpression) n).getOperator().toString(); if (n instanceof Assignment) return ((Assignment) n).getOperator().toString(); if (n instanceof TextElement) return n.toString(); if (n instanceof TagElement) return ((TagElement) n).getTagName(); if (n instanceof TypeDeclaration) return ((TypeDeclaration) n).isInterface() ? "interface" : "class"; return ""; }
@Override public boolean visit(Assignment node) { int rightSideIndex = this.tm.firstIndexIn(node.getRightHandSide(), -1); if (this.tm.get(rightSideIndex).getLineBreaksBefore() > 0) return true; // must be an array initializer in new line because of brace_position_for_array_initializer int operatorIndex = this.tm.firstIndexBefore(node.getRightHandSide(), -1); while (this.tm.get(operatorIndex).isComment()) operatorIndex--; assert node.getOperator().toString().equals(this.tm.toString(operatorIndex)); this.wrapIndexes.add(this.options.wrap_before_assignment_operator ? operatorIndex : rightSideIndex); this.secondaryWrapIndexes.add(this.options.wrap_before_assignment_operator ? rightSideIndex : operatorIndex); this.wrapParentIndex = operatorIndex - 1; this.wrapGroupEnd = this.tm.lastIndexIn(node.getRightHandSide(), -1); handleWrap(this.options.alignment_for_assignment); return true; }
protected String getLabel(ASTNode n) { if (n instanceof Name) return ((Name) n).getFullyQualifiedName(); if (n instanceof Type) return n.toString(); if (n instanceof Modifier) return n.toString(); if (n instanceof StringLiteral) return ((StringLiteral) n).getEscapedValue(); if (n instanceof NumberLiteral) return ((NumberLiteral) n).getToken(); if (n instanceof CharacterLiteral) return ((CharacterLiteral) n).getEscapedValue(); if (n instanceof BooleanLiteral) return ((BooleanLiteral) n).toString(); if (n instanceof InfixExpression) return ((InfixExpression) n).getOperator().toString(); if (n instanceof PrefixExpression) return ((PrefixExpression) n).getOperator().toString(); if (n instanceof PostfixExpression) return ((PostfixExpression) n).getOperator().toString(); if (n instanceof Assignment) return ((Assignment) n).getOperator().toString(); if (n instanceof TextElement) return n.toString(); if (n instanceof TagElement) return ((TagElement) n).getTagName(); return ""; }
@Override public boolean visit(Assignment node) { int rightSideIndex = this.tm.firstIndexIn(node.getRightHandSide(), -1); if (this.tm.get(rightSideIndex).getLineBreaksBefore() > 0) return true; // must be an array initializer in new line because of brace_position_for_array_initializer int operatorIndex = this.tm.firstIndexBefore(node.getRightHandSide(), -1); while (this.tm.get(operatorIndex).isComment()) operatorIndex--; assert node.getOperator().toString().equals(this.tm.toString(operatorIndex)); this.wrapIndexes.add(this.options.wrap_before_assignment_operator ? operatorIndex : rightSideIndex); this.secondaryWrapIndexes.add(this.options.wrap_before_assignment_operator ? rightSideIndex : operatorIndex); this.wrapParentIndex = operatorIndex - 1; this.wrapGroupEnd = this.tm.lastIndexIn(node.getRightHandSide(), -1); handleWrap(this.options.alignment_for_assignment); return true; }
@Override public boolean visit(Assignment node) { int rightSideIndex = this.tm.firstIndexIn(node.getRightHandSide(), -1); if (this.tm.get(rightSideIndex).getLineBreaksBefore() > 0) return true; // must be an array initializer in new line because of brace_position_for_array_initializer int operatorIndex = this.tm.firstIndexBefore(node.getRightHandSide(), -1); while (this.tm.get(operatorIndex).isComment()) operatorIndex--; assert node.getOperator().toString().equals(this.tm.toString(operatorIndex)); this.wrapIndexes.add(this.options.wrap_before_assignment_operator ? operatorIndex : rightSideIndex); this.secondaryWrapIndexes.add(this.options.wrap_before_assignment_operator ? rightSideIndex : operatorIndex); this.wrapParentIndex = operatorIndex - 1; this.wrapGroupEnd = this.tm.lastIndexIn(node.getRightHandSide(), -1); handleWrap(this.options.alignment_for_assignment); return true; }
public boolean visit(Assignment node) { node.getLeftHandSide().accept(this); this.buffer.append(node.getOperator().toString()); node.getRightHandSide().accept(this); return false; }
@Override public boolean visit(Assignment node) { handleOperator(node.getOperator().toString(), node.getRightHandSide(), this.options.insert_space_before_assignment_operator, this.options.insert_space_after_assignment_operator); return true; }
public boolean visit(Assignment node) { node.getLeftHandSide().accept(this); this.buffer.append(node.getOperator().toString()); node.getRightHandSide().accept(this); return false; }
public boolean visit(Assignment node) { node.getLeftHandSide().accept(this); this.buffer.append(node.getOperator().toString()); node.getRightHandSide().accept(this); return false; }
@Override public boolean visit(Assignment node) { node.getLeftHandSide().accept(this); this.fBuffer.append(node.getOperator().toString()); node.getRightHandSide().accept(this); return false; }
public boolean visit(Assignment node) { node.getLeftHandSide().accept(this); this.buffer.append(node.getOperator().toString()); node.getRightHandSide().accept(this); return false; }
public boolean visit(Assignment node) { node.getLeftHandSide().accept(this); this.buffer.append(node.getOperator().toString()); node.getRightHandSide().accept(this); return false; }
public boolean visit(Assignment node) { node.getLeftHandSide().accept(this); this.fBuffer.append(node.getOperator().toString()); node.getRightHandSide().accept(this); return false; }
public void handleAssignment(final Assignment node, final ASTNode leftSide, final Type type) { leftSide.accept(this); this.appendToBuffer(node.getOperator().toString()); this.handleRightHandSide(node, type); }
@Override public boolean visit(Assignment node) { handleOperator(node.getOperator().toString(), node.getRightHandSide(), this.options.insert_space_before_assignment_operator, this.options.insert_space_after_assignment_operator); return true; }
@Override public boolean visit(Assignment node) { node.getLeftHandSide().accept(this); this.buffer.append(node.getOperator().toString()); node.getRightHandSide().accept(this); return false; }
@Override public boolean visit(Assignment node) { handleOperator(node.getOperator().toString(), node.getRightHandSide(), this.options.insert_space_before_assignment_operator, this.options.insert_space_after_assignment_operator); return true; }
@Override public boolean visit(Assignment node) { node.getLeftHandSide().accept(this); this.fBuffer.append(node.getOperator().toString()); node.getRightHandSide().accept(this); return false; }