protected Expression findExpression(String source){
  if (source != null && source.length() > 0) {
    source=source.trim();
    if (source.length() == 0) {
      return null;
    }
    String leftSide=source;
    String rightSide=null;
    Connector op=findOp(leftSide);
    if (op != null) {
      rightSide=op.getRightSide(leftSide);
      leftSide=leftSide.substring(0,op.sourceLoc);
      Expression leftExpression=findExpression(leftSide);
      Expression rightExpression=findExpression(rightSide);
      if (leftExpression != null) {
        op.addExpr(leftExpression);
      }
      if (rightExpression != null) {
        op.addExpr(rightExpression);
      }
      return op;
    }
    op=findMiniOp(leftSide);
    if (op != null) {
      rightSide=op.getRightSide(leftSide);
      leftSide=leftSide.substring(0,op.sourceLoc);
      Expression leftExpression=findExpression(leftSide);
      Expression rightExpression=findExpression(rightSide);
      if (leftExpression != null) {
        op.addExpr(leftExpression);
      }
      if (rightExpression != null) {
        op.addExpr(rightExpression);
      }
      return op;
    }
    if (logger.isLoggable(Level.FINER)) {
      logger.finer("need to break up: " + source);
    }
    return findMathOp(source);
  }
  return null;
}

protected Expression findExpression ( String source ) { if ( source != null && source . length ( ) > 0 ) { source = source . trim ( ) ; if ( source . length ( ) == 0 ) { return null ; } String leftSide = source ; String rightSide = null ; Connector op = findOp ( leftSide ) ; if ( op != null ) { rightSide = op . getRightSide ( leftSide ) ; leftSide = leftSide . substring ( 0 , op . sourceLoc ) ; Expression leftExpression = findExpression ( leftSide ) ; Expression rightExpression = findExpression ( rightSide ) ; if ( leftExpression != null ) { op . addExpr ( leftExpression ) ; } if ( rightExpression != null ) { op . addExpr ( rightExpression ) ; } return op ; } op = findMiniOp ( leftSide ) ; if ( op != null ) { rightSide = op . getRightSide ( leftSide ) ; leftSide = leftSide . substring ( 0 , op . sourceLoc ) ; Expression leftExpression = findExpression ( leftSide ) ; Expression rightExpression = findExpression ( rightSide ) ; if ( leftExpression != null ) { op . addExpr ( leftExpression ) ; } if ( rightExpression != null ) { op . addExpr ( rightExpression ) ; } return op ; } if ( logger . isLoggable ( Level . FINER ) ) { logger . finer ( "need to break up: " + source ) ; } return findMathOp ( source ) ; } return null ; }
recursive parsing statement . keys on connectors ( and , or ) and builds expressions based on those . then looks for mini connectors ( and , or ) and builds on those . of course , there might just be one expression here , one that is separated by an operator .
