@Override public Expression clone(boolean resolved) { return new ArithmeticExpression(left.clone(resolved), right.clone(resolved), op); }
@Override public Expression clone(boolean resolved) { return new ArithmeticExpression(left.clone(resolved), right.clone(resolved), op); }
@Override public Expression visitArithmeticExpressionPlusMinus(JPQLSelectExpressionParser.ArithmeticExpressionPlusMinusContext ctx) { ArithmeticOperator op = ArithmeticOperator.fromSymbol(ctx.op.getText()); if (op == null) { throw new IllegalStateException("Unexpected arithmetic operator symbol [" + ctx.op.getText() + "]"); } return new ArithmeticExpression( ctx.arithmetic_expression().accept(this), ctx.arithmetic_term().accept(this), op); }
@Override public Expression visitArithmeticMultDiv(JPQLSelectExpressionParser.ArithmeticMultDivContext ctx) { ArithmeticOperator op = ArithmeticOperator.fromSymbol(ctx.op.getText()); if (op == null) { throw new IllegalStateException("Unexpected arithmetic operator symbol [" + ctx.op.getText() + "]"); } return new ArithmeticExpression( ctx.arithmetic_term().accept(this), ctx.arithmetic_factor().accept(this), op); }
@Override public Expression visitArithmeticMultDiv(JPQLSelectExpressionParser.ArithmeticMultDivContext ctx) { ArithmeticOperator op = ArithmeticOperator.fromSymbol(ctx.op.getText()); if (op == null) { throw new IllegalStateException("Unexpected arithmetic operator symbol [" + ctx.op.getText() + "]"); } return new ArithmeticExpression( ctx.arithmetic_term().accept(this), ctx.arithmetic_factor().accept(this), op); }
@Override public Expression visitArithmeticExpressionPlusMinus(JPQLSelectExpressionParser.ArithmeticExpressionPlusMinusContext ctx) { ArithmeticOperator op = ArithmeticOperator.fromSymbol(ctx.op.getText()); if (op == null) { throw new IllegalStateException("Unexpected arithmetic operator symbol [" + ctx.op.getText() + "]"); } return new ArithmeticExpression( ctx.arithmetic_expression().accept(this), ctx.arithmetic_term().accept(this), op); }
@Override public Expression visit(ArithmeticExpression expression) { Expression newLeft = expression.getLeft().accept(this); Expression newRight = expression.getRight().accept(this); if (newLeft != expression.getLeft() || newRight != expression.getRight()) { return new ArithmeticExpression(newLeft, newRight, expression.getOp()); } return expression; }
@Override public Expression visit(ArithmeticExpression expression) { Expression newLeft = expression.getLeft().accept(this); Expression newRight = expression.getRight().accept(this); if (newLeft != expression.getLeft() || newRight != expression.getRight()) { return new ArithmeticExpression(newLeft, newRight, expression.getOp()); } return expression; }