public ExpressionTree assignmentExpression(ExpressionTree expression, Optional<List<OperatorAndOperand>> operatorAndOperands) { if (!operatorAndOperands.isPresent()) { return expression; } ExpressionTree result = null; InternalSyntaxToken lastOperator = null; for (OperatorAndOperand operatorAndOperand : Lists.reverse(operatorAndOperands.get())) { if (lastOperator == null) { result = operatorAndOperand.operand(); } else { result = new AssignmentExpressionTreeImpl( kindMaps.getAssignmentOperator((JavaPunctuator) lastOperator.getGrammarRuleKey()), operatorAndOperand.operand(), lastOperator, result); } lastOperator = operatorAndOperand.operator(); } result = new AssignmentExpressionTreeImpl( kindMaps.getAssignmentOperator((JavaPunctuator) lastOperator.getGrammarRuleKey()), expression, lastOperator, result); return result; }
public ExpressionTree assignmentExpression(ExpressionTree expression, Optional<List<OperatorAndOperand>> operatorAndOperands) { if (!operatorAndOperands.isPresent()) { return expression; } ExpressionTree result = null; InternalSyntaxToken lastOperator = null; for (OperatorAndOperand operatorAndOperand : Lists.reverse(operatorAndOperands.get())) { if (lastOperator == null) { result = operatorAndOperand.operand(); } else { result = new AssignmentExpressionTreeImpl( kindMaps.getAssignmentOperator((JavaPunctuator) lastOperator.getType()), operatorAndOperand.operand(), lastOperator, result); } lastOperator = operatorAndOperand.operator(); } result = new AssignmentExpressionTreeImpl( kindMaps.getAssignmentOperator((JavaPunctuator) lastOperator.getType()), expression, lastOperator, result); return result; }
public ExpressionTree assignmentExpression(ExpressionTree expression, Optional<List<OperatorAndOperand>> operatorAndOperands) { if (!operatorAndOperands.isPresent()) { return expression; } ExpressionTree result = null; InternalSyntaxToken lastOperator = null; for (OperatorAndOperand operatorAndOperand : Lists.reverse(operatorAndOperands.get())) { if (lastOperator == null) { result = operatorAndOperand.operand(); } else { result = new AssignmentExpressionTreeImpl( kindMaps.getAssignmentOperator((JavaPunctuator) lastOperator.getGrammarRuleKey()), operatorAndOperand.operand(), lastOperator, result); } lastOperator = operatorAndOperand.operator(); } result = new AssignmentExpressionTreeImpl( kindMaps.getAssignmentOperator((JavaPunctuator) lastOperator.getGrammarRuleKey()), expression, lastOperator, result); return result; }
public ExpressionTree assignmentExpression(ExpressionTree expression, Optional<List<OperatorAndOperand>> operatorAndOperands) { if (!operatorAndOperands.isPresent()) { return expression; } ExpressionTree result = null; InternalSyntaxToken lastOperator = null; for (OperatorAndOperand operatorAndOperand : Lists.reverse(operatorAndOperands.get())) { if (lastOperator == null) { result = operatorAndOperand.operand(); } else { result = new AssignmentExpressionTreeImpl( kindMaps.getAssignmentOperator((JavaPunctuator) lastOperator.getGrammarRuleKey()), operatorAndOperand.operand(), lastOperator, result); } lastOperator = operatorAndOperand.operator(); } result = new AssignmentExpressionTreeImpl( kindMaps.getAssignmentOperator((JavaPunctuator) lastOperator.getGrammarRuleKey()), expression, lastOperator, result); return result; }
private OperatorAndOperand newOperatorAndOperand(InternalSyntaxToken operator, ExpressionTree operand) { return new OperatorAndOperand(operator, operand); }
private static OperatorAndOperand newOperatorAndOperand(InternalSyntaxToken operator, ExpressionTree operand) { return new OperatorAndOperand(operator, operand); }
private ExpressionTree binaryExpression(ExpressionTree expression, Optional<List<OperatorAndOperand>> operatorAndOperands) { if (!operatorAndOperands.isPresent()) { return expression; } ExpressionTree result = expression; for (OperatorAndOperand operatorAndOperand : operatorAndOperands.get()) { result = new BinaryExpressionTreeImpl( kindMaps.getBinaryOperator((JavaPunctuator) operatorAndOperand.operator().getGrammarRuleKey()), result, operatorAndOperand.operator(), operatorAndOperand.operand()); } return result; }
private ExpressionTree binaryExpression(ExpressionTree expression, Optional<List<OperatorAndOperand>> operatorAndOperands) { if (!operatorAndOperands.isPresent()) { return expression; } ExpressionTree result = expression; for (OperatorAndOperand operatorAndOperand : operatorAndOperands.get()) { result = new BinaryExpressionTreeImpl( kindMaps.getBinaryOperator((JavaPunctuator) operatorAndOperand.operator().getType()), result, operatorAndOperand.operator(), operatorAndOperand.operand()); } return result; }
private ExpressionTree binaryExpression(ExpressionTree expression, Optional<List<OperatorAndOperand>> operatorAndOperands) { if (!operatorAndOperands.isPresent()) { return expression; } ExpressionTree result = expression; for (OperatorAndOperand operatorAndOperand : operatorAndOperands.get()) { result = new BinaryExpressionTreeImpl( kindMaps.getBinaryOperator((JavaPunctuator) operatorAndOperand.operator().getGrammarRuleKey()), result, operatorAndOperand.operator(), operatorAndOperand.operand()); } return result; }
private static OperatorAndOperand newOperatorAndOperand(InternalSyntaxToken operator, ExpressionTree operand) { return new OperatorAndOperand(operator, operand); }
private ExpressionTree binaryExpression(ExpressionTree expression, Optional<List<OperatorAndOperand>> operatorAndOperands) { if (!operatorAndOperands.isPresent()) { return expression; } ExpressionTree result = expression; for (OperatorAndOperand operatorAndOperand : operatorAndOperands.get()) { result = new BinaryExpressionTreeImpl( kindMaps.getBinaryOperator((JavaPunctuator) operatorAndOperand.operator().getGrammarRuleKey()), result, operatorAndOperand.operator(), operatorAndOperand.operand()); } return result; }
private OperatorAndOperand newOperatorAndOperand(AstNode operator, ExpressionTree operand) { return new OperatorAndOperand(InternalSyntaxToken.create(operator), operand); }