private Expression concat ( Expression left , char operator , Expression right ) { if ( left == null ) { return right ; } Operation op ; if ( left . getClass ( ) == Operation . class && ( ( Operation ) left ) . getOperator ( ) == operator ) { op = ( Operation ) left ; } else if ( right != null && right . getClass ( ) == Operation . class && ( ( Operation ) right ) . getOperator ( ) == operator ) { op = ( Operation ) right ; op . addLeftOperand ( left ) ; return op ; } else { op = new Operation ( reader , left , operator ) ; } if ( right != null ) { op . addOperand ( right ) ; } return op ; }
Concatenate 2 expressions to one expression .